bundle.js 967 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203
  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 = true;
  851. HttpMgr._instance = this;
  852. }
  853. static getInstance() {
  854. if (!this._instance) {
  855. this._instance = new HttpMgr();
  856. }
  857. return this._instance;
  858. }
  859. sendPost(url, data, call) {
  860. let httpObj = new Laya.HttpRequest();
  861. httpObj.http.timeout = 5000;
  862. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  863. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  864. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  865. function errorHandler(error) {
  866. console.log("errorHandler:" + error);
  867. alert("Please check your network connection.");
  868. }
  869. function completeHandler(data) {
  870. if (data && data.length > 0) {
  871. let jsonData = JSON.parse(data);
  872. if (call)
  873. call(jsonData);
  874. }
  875. }
  876. }
  877. getReqData() {
  878. let reqData = JSON.stringify({
  879. gameName: "TQ",
  880. gameUserName: "zhangSan",
  881. isDev: this.isDev
  882. });
  883. return reqData;
  884. }
  885. sendPost2025(reqUrl, data, call) {
  886. let isDev = this.isDev;
  887. let urlTop = "https://api.kessongame.site/";
  888. let urlMid = urlTop + "prod-api/api/";
  889. if (isDev) {
  890. urlTop = "http://192.168.1.13:8090/";
  891. urlMid = urlTop + "api/";
  892. }
  893. let url = urlMid + reqUrl;
  894. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  895. if (isDev) {
  896. url = urlTop + reqUrl;
  897. }
  898. else {
  899. url = urlTop + "prod-api/" + reqUrl;
  900. }
  901. }
  902. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  903. if (reqUrl.indexOf("/api/game/") >= 0) {
  904. }
  905. const keyForLoginInfo = "userInfo";
  906. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  907. if (userInfoData != null) {
  908. try {
  909. let bb = JSON.parse(userInfoData);
  910. if (bb) {
  911. let token = bb.token;
  912. headers.push("Authorization");
  913. headers.push(`Bearer ${token}`);
  914. }
  915. }
  916. catch (e) {
  917. }
  918. }
  919. let httpObj = new Laya.HttpRequest();
  920. httpObj.http.timeout = 5000;
  921. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  922. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  923. httpObj.send(url, data, 'post', 'text', headers);
  924. console.log('zh: http url = ' + url);
  925. function errorHandler(error) {
  926. if (call) {
  927. call("{'msg':'Network exception','code':500}");
  928. }
  929. else {
  930. alert("Tip:Please check your network connection.");
  931. }
  932. }
  933. function completeHandler(data) {
  934. if (data && data.length > 0) {
  935. let jsonData = JSON.parse(data);
  936. if (call)
  937. call(jsonData);
  938. }
  939. }
  940. }
  941. sendGet(url, call) {
  942. let httpObj = new Laya.HttpRequest();
  943. httpObj.http.timeout = 5000;
  944. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  945. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  946. httpObj.send(url, '', 'get');
  947. function errorHandler(error) {
  948. console.log("errorHandler:" + error);
  949. }
  950. function completeHandler(data) {
  951. if (data && data.length > 0) {
  952. if (call)
  953. call(data);
  954. }
  955. }
  956. }
  957. }
  958. HttpMgr._instance = null;
  959. class LightShader extends Laya.Sprite {
  960. constructor() {
  961. super();
  962. this._time = 0;
  963. this._sin = 0;
  964. this.initShader();
  965. }
  966. initShader() {
  967. var vs = `
  968. #define FSHIGHPRECISION
  969. attribute vec4 posuv;
  970. uniform vec2 size;
  971. varying vec4 v_texcoord;
  972. void main() {
  973. vec4 pos = vec4(posuv.xy,0.,1.);
  974. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  975. gl_Position=pos1;
  976. v_texcoord.xy = posuv.xy;
  977. }
  978. `;
  979. var ps = `
  980. #define FSHIGHPRECISION
  981. precision highp float;
  982. varying vec4 v_texcoord;
  983. uniform vec2 size;
  984. uniform sampler2D texture;
  985. uniform float u_Time;
  986. void main() {
  987. vec4 color= texture2D(texture, v_texcoord.xy);
  988. float width = 0.2;
  989. float start = u_Time;
  990. float offset = 1.0;
  991. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  992. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  993. {
  994. color.r=1.1;
  995. color.g=1.1;
  996. color.b=1.1;
  997. gl_FragColor = color;
  998. } else {
  999. gl_FragColor = color;
  1000. }
  1001. }
  1002. `;
  1003. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  1004. this.customRenderEnable = true;
  1005. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1006. }
  1007. customRender(context, x, y) {
  1008. this.onUpdate();
  1009. if (!this.texture)
  1010. return;
  1011. let xx = x - this.pivotX;
  1012. let yy = y - this.pivotY;
  1013. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1014. }
  1015. onUpdate() {
  1016. this._time += 2 * Laya.timer.delta * 0.001;
  1017. this._sin = Math.sin(this._time);
  1018. if (this._sin > 0.99) {
  1019. this._sin = 0;
  1020. this._time = 0;
  1021. }
  1022. this.shaderValue['u_Time'] = this._sin;
  1023. }
  1024. }
  1025. LightShader.DissolveSurfaceSaveName = 9997;
  1026. class UIBase extends fairygui.Window {
  1027. constructor() {
  1028. super();
  1029. this.isEject = true;
  1030. this.isHide = true;
  1031. this.showbanner = true;
  1032. this.className = "";
  1033. this.isMuti = false;
  1034. this.showbanner = false;
  1035. this.onConstructor();
  1036. }
  1037. checkActive(show) {
  1038. }
  1039. getUIName() {
  1040. return UIBase.uiName;
  1041. }
  1042. onConstructor() {
  1043. }
  1044. onInit() {
  1045. if (!!this.contentPane) {
  1046. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1047. }
  1048. this.setPivot(0.5, 0.5, false);
  1049. }
  1050. doShowAnimation() {
  1051. if (!this.isEject)
  1052. return;
  1053. super.doShowAnimation();
  1054. Laya.Tween.clearTween(this);
  1055. this.scaleX = this.scaleY = 0.8;
  1056. let tweenFunc1 = (func) => {
  1057. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1058. };
  1059. let tweenFunc2 = (func) => {
  1060. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1061. };
  1062. tweenFunc1(tweenFunc2);
  1063. }
  1064. show(...args) {
  1065. super.show();
  1066. this._openParam = args;
  1067. this.isHide = false;
  1068. xGame.uiMgr.checkUIState();
  1069. }
  1070. moveBannerButton() {
  1071. }
  1072. showBannerButton() {
  1073. this.bannerButton.visible = true;
  1074. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1075. this.bannerButton.touchable = true;
  1076. }));
  1077. }
  1078. hide() {
  1079. super.hide();
  1080. this.isHide = true;
  1081. xGame.uiMgr.checkUIState();
  1082. }
  1083. Dispose() {
  1084. super.dispose();
  1085. }
  1086. myUpdate(delay) {
  1087. }
  1088. refresh() { }
  1089. addUIClick(obj, func, arr = null) {
  1090. obj.onClick(this, func, arr);
  1091. obj.onClick(this, this.playBtnSound);
  1092. }
  1093. offUIClick(obj, func) {
  1094. obj.offClick(this, func);
  1095. }
  1096. playBtnSound() {
  1097. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1098. }
  1099. }
  1100. UIBase.lastShowBanner = 0;
  1101. UIBase.showBannerNum = 0;
  1102. UIBase.uiName = "";
  1103. class ui_UIDraw extends fgui.GComponent {
  1104. static createInstance() {
  1105. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1106. }
  1107. onConstruct() {
  1108. this.n_bj = (this.getChild("n_bj"));
  1109. this.n1 = (this.getChild("n1"));
  1110. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  1111. this.myNode = (this.getChild("myNode"));
  1112. this.extraNode = (this.getChild("extraNode"));
  1113. this.closeNode = (this.getChild("closeNode"));
  1114. this.moneyNode = (this.getChild("moneyNode"));
  1115. this.n38 = (this.getChild("n38"));
  1116. this.talkNode = (this.getChild("talkNode"));
  1117. this.secretary = (this.getChild("secretary"));
  1118. this.drawBtn = (this.getChild("drawBtn"));
  1119. this.t0 = this.getTransition("t0");
  1120. }
  1121. }
  1122. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1123. class ui_UIBox extends fgui.GComponent {
  1124. static createInstance() {
  1125. return (fgui.UIPackage.createObject("game", "UIBox"));
  1126. }
  1127. onConstruct() {
  1128. this.n0 = (this.getChild("n0"));
  1129. this.n12 = (this.getChild("n12"));
  1130. this.n1 = (this.getChild("n1"));
  1131. this.n2 = (this.getChild("n2"));
  1132. this.bar = (this.getChild("bar"));
  1133. this.closeBtn = (this.getChild("closeBtn"));
  1134. this.openBtn = (this.getChild("openBtn"));
  1135. this.t0 = this.getTransition("t0");
  1136. this.t1 = this.getTransition("t1");
  1137. }
  1138. }
  1139. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1140. class LocalStorageManager {
  1141. test1() {
  1142. LocalStorageManager.setItem("playerName", "Tom");
  1143. LocalStorageManager.setItem("playerLevel", 5);
  1144. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  1145. const name = LocalStorageManager.getItem("playerName");
  1146. const level = LocalStorageManager.getItem("playerLevel");
  1147. const data = LocalStorageManager.getItem("playerData");
  1148. console.log(name);
  1149. console.log(level);
  1150. console.log(data);
  1151. LocalStorageManager.removeItem("playerLevel");
  1152. }
  1153. static setItem(key, value) {
  1154. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  1155. }
  1156. static getItem(key) {
  1157. const data = Laya.LocalStorage.getItem(key);
  1158. if (data === null)
  1159. return null;
  1160. try {
  1161. return JSON.parse(data);
  1162. }
  1163. catch (e) {
  1164. return data;
  1165. }
  1166. }
  1167. static removeItem(key) {
  1168. Laya.LocalStorage.removeItem(key);
  1169. }
  1170. static clear() {
  1171. Laya.LocalStorage.clear();
  1172. }
  1173. static hasJosnKey(key) {
  1174. var value = Laya.LocalStorage.getJSON(key);
  1175. if (value != null) {
  1176. return true;
  1177. }
  1178. else {
  1179. return false;
  1180. }
  1181. }
  1182. static hasKey(key) {
  1183. return Laya.LocalStorage.getItem(key) !== null;
  1184. }
  1185. }
  1186. class GlobalManager {
  1187. constructor() {
  1188. }
  1189. registerMethod(name, method) {
  1190. console.log('zh: 注册全局方法', name);
  1191. this[name] = method;
  1192. }
  1193. callMethod(name, ...args) {
  1194. console.log('zh: 调用全局方法', name);
  1195. if (this[name]) {
  1196. return this[name](...args);
  1197. }
  1198. else {
  1199. console.error(`zh: 全局方法 Method ${name} not found`);
  1200. }
  1201. }
  1202. }
  1203. GlobalManager.instance = new GlobalManager();
  1204. class JSBridgeUtils {
  1205. constructor() { }
  1206. static get instance() {
  1207. if (!this._instance) {
  1208. this._instance = new JSBridgeUtils();
  1209. }
  1210. return this._instance;
  1211. }
  1212. initBridge() {
  1213. if (!Laya.Browser.onAndroid) {
  1214. console.log('zh:非android dev');
  1215. return;
  1216. }
  1217. let cfg = window['conchConfig'];
  1218. if (cfg) {
  1219. var os = cfg.getOS();
  1220. if (os == "Conch-android") {
  1221. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1222. if (this.bridge) {
  1223. return true;
  1224. }
  1225. else {
  1226. return false;
  1227. }
  1228. }
  1229. else {
  1230. return false;
  1231. }
  1232. }
  1233. else {
  1234. return false;
  1235. }
  1236. }
  1237. testAd1() {
  1238. if (!Laya.Browser.onAndroid) {
  1239. console.log('zh:非android dev');
  1240. return;
  1241. }
  1242. if (!this.initBridge()) {
  1243. return;
  1244. }
  1245. let rs = this.bridge.call("testString", "hello");
  1246. console.log('zh:testString rs=' + rs);
  1247. }
  1248. testAdCallBack() {
  1249. if (!this.initBridge()) {
  1250. return;
  1251. }
  1252. console.log("zh:testAdCallBack start");
  1253. const defaultObj = { code: 200, msg: "req update Ui" };
  1254. const reqObj = { code: 300, msg: "hello java ui" };
  1255. this.bridge.callWithBack((rsStr) => {
  1256. const rsObj = JSON.parse(rsStr);
  1257. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1258. }, "testAsyncCallback", JSON.stringify(reqObj));
  1259. }
  1260. showInternAd(mark) {
  1261. let boo1 = this.checkAdForUserOrderForSpid17(1);
  1262. if (boo1) {
  1263. console.log('zh: VIP SPID = 1,免除插页AD');
  1264. return false;
  1265. }
  1266. console.log('zh:showInternAd start');
  1267. if (!Laya.Browser.onAndroid) {
  1268. console.log('zh:showInternAd 非android dev');
  1269. return false;
  1270. }
  1271. if (!this.initBridge()) {
  1272. return false;
  1273. }
  1274. let rs = this.bridge.call("showInternAd", mark);
  1275. try {
  1276. const result = JSON.parse(rs);
  1277. if (result.code === 200) {
  1278. console.log("zh:showInternAd OK");
  1279. return true;
  1280. }
  1281. else {
  1282. console.warn("zh:showInternAd FAILL:", result.msg);
  1283. return false;
  1284. }
  1285. }
  1286. catch (e) {
  1287. console.error("zh:解析桥接返回值失败:", e);
  1288. return false;
  1289. }
  1290. }
  1291. exitAndCloseGame() {
  1292. if (!Laya.Browser.onAndroid) {
  1293. return;
  1294. }
  1295. if (!this.initBridge()) {
  1296. return;
  1297. }
  1298. console.log('zh:开始关闭游戏-');
  1299. this.bridge.call("exitAndCloseGame");
  1300. }
  1301. checkAdForUserOrderForSpid17(spid) {
  1302. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  1303. if (userInfo != null) {
  1304. if (!userInfo.buySpids) {
  1305. userInfo.buySpids = { 1: false, 7: false };
  1306. }
  1307. else {
  1308. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  1309. }
  1310. let boo = userInfo.buySpids[spid];
  1311. console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
  1312. return boo;
  1313. }
  1314. return false;
  1315. }
  1316. showRewardAd(mark) {
  1317. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1318. if (boo7) {
  1319. console.log('zh: VIP SPID = 7,无任何AD');
  1320. return false;
  1321. }
  1322. if (!Laya.Browser.onAndroid) {
  1323. return false;
  1324. }
  1325. if (!this.initBridge()) {
  1326. return false;
  1327. }
  1328. let rs = this.bridge.call("showRewardAd", mark);
  1329. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1330. try {
  1331. const result = JSON.parse(rs);
  1332. if (result.code === 200) {
  1333. console.log("zh:广告显示成功");
  1334. return true;
  1335. }
  1336. else {
  1337. console.warn("zh:广告显示失败:", result.msg);
  1338. return false;
  1339. }
  1340. }
  1341. catch (e) {
  1342. console.error("zh:解析桥接返回值失败:", e);
  1343. return false;
  1344. }
  1345. }
  1346. logEventForAdNoParams(eventName) {
  1347. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1348. if (!Laya.Browser.onAndroid) {
  1349. return;
  1350. }
  1351. if (!this.initBridge()) {
  1352. return;
  1353. }
  1354. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1355. this.bridge.call("logEventForAdNoParams", eventName);
  1356. }
  1357. logEventForAdHaveParams(eventName, jsonStr) {
  1358. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1359. if (!Laya.Browser.onAndroid) {
  1360. return;
  1361. }
  1362. if (!this.initBridge()) {
  1363. return;
  1364. }
  1365. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1366. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1367. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1368. }
  1369. logEventForFirebase(eventName, jsonStr) {
  1370. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1371. if (!Laya.Browser.onAndroid) {
  1372. return;
  1373. }
  1374. if (!this.initBridge()) {
  1375. return;
  1376. }
  1377. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1378. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1379. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1380. }
  1381. testNetTip() {
  1382. if (Laya.Browser.onAndroid) {
  1383. let boo = this.getNetworkAvailable();
  1384. this.showToast2("Network error, reward unavailable");
  1385. return;
  1386. }
  1387. }
  1388. getNetworkAvailable() {
  1389. if (!Laya.Browser.onAndroid) {
  1390. return;
  1391. }
  1392. if (!this.initBridge()) {
  1393. return;
  1394. }
  1395. let boo = this.bridge.call("getNetworkAvailable");
  1396. console.log("zh:getNetworkAvailable boo=" + boo);
  1397. return boo;
  1398. }
  1399. showToast2(msg) {
  1400. if (!Laya.Browser.onAndroid) {
  1401. return;
  1402. }
  1403. if (!this.initBridge()) {
  1404. return;
  1405. }
  1406. this.bridge.call("showToast2", msg);
  1407. }
  1408. loginOutForApp() {
  1409. if (!Laya.Browser.onAndroid) {
  1410. return;
  1411. }
  1412. if (!this.initBridge()) {
  1413. return;
  1414. }
  1415. this.bridge.call("loginOutForApp");
  1416. }
  1417. startGgPay(token, ggSpid, spid) {
  1418. if (!Laya.Browser.onAndroid) {
  1419. return;
  1420. }
  1421. if (!this.initBridge()) {
  1422. return;
  1423. }
  1424. let jsonObj = {
  1425. token: token,
  1426. ggSpid: ggSpid,
  1427. spid: spid,
  1428. spsl: 1
  1429. };
  1430. let reqData = JSON.stringify(jsonObj);
  1431. console.log("zh:startGgPay ts reqData=" + reqData);
  1432. this.bridge.call("startGgPay", reqData);
  1433. }
  1434. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1435. if (!Laya.Browser.onAndroid) {
  1436. return;
  1437. }
  1438. if (!this.initBridge()) {
  1439. return;
  1440. }
  1441. let jsonObj = {
  1442. token: token,
  1443. ggSpid: ggSpid,
  1444. spid: spid,
  1445. spsl: 1
  1446. };
  1447. let reqData = JSON.stringify(jsonObj);
  1448. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1449. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1450. }
  1451. nativeCallJs(msg) {
  1452. console.log("zh:nativeCallJs received data: 1111", msg);
  1453. if (msg === 'Ad1') {
  1454. GlobalManager.instance.callMethod('Ad1');
  1455. console.log("zh: Ad1 奖励发送成功");
  1456. }
  1457. else if (msg === 'Ad2') {
  1458. GlobalManager.instance.callMethod('Ad2');
  1459. console.log("zh: Ad2 奖励发送成功");
  1460. }
  1461. else if (msg === 'Ad3') {
  1462. GlobalManager.instance.callMethod('Ad3');
  1463. console.log("zh: Ad3 奖励发送成功");
  1464. }
  1465. else if (msg === 'Ad4') {
  1466. GlobalManager.instance.callMethod('Ad4');
  1467. console.log("zh: Ad4 奖励发送成功");
  1468. }
  1469. else if (msg === 'Ad5') {
  1470. console.log("zh: Ad5 奖励发送成功");
  1471. GlobalManager.instance.callMethod('Ad5');
  1472. }
  1473. }
  1474. }
  1475. class UIBox extends UIBase {
  1476. constructor() {
  1477. super();
  1478. this.boxNum = 0;
  1479. this.boxMax = 10;
  1480. this.inAd = false;
  1481. this.isClose = false;
  1482. }
  1483. onConstructor() {
  1484. this.ui = ui_UIBox.createInstance();
  1485. this.contentPane = this.ui;
  1486. this.isEject = false;
  1487. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1488. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1489. Laya.timer.loop(1000, this, this.update);
  1490. }
  1491. update() {
  1492. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1493. this.boxNum -= 1;
  1494. this.upBar();
  1495. }
  1496. }
  1497. upBar() {
  1498. if (this.boxNum > this.boxMax)
  1499. this.boxNum = this.boxMax;
  1500. this.ui.bar.value = this.boxNum * 10;
  1501. }
  1502. show() {
  1503. super.show();
  1504. this.isClose = false;
  1505. this.boxNum = 0;
  1506. this.inAd = false;
  1507. this.upBar();
  1508. this.ui.t0.play();
  1509. this.ui.closeBtn.visible = false;
  1510. Laya.timer.once(3000, this, () => {
  1511. this.ui.closeBtn.visible = true;
  1512. this.ui.bar.alpha = 1;
  1513. });
  1514. Laya.timer.once(500, this, () => {
  1515. this.ui.t1.play();
  1516. });
  1517. }
  1518. hide() {
  1519. Laya.timer.clearAll(this);
  1520. Moyu.showBannerAd(false);
  1521. super.hide();
  1522. }
  1523. onOpenBox() {
  1524. this.boxNum++;
  1525. if (this.boxNum < this.boxMax) {
  1526. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1527. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1528. }
  1529. }
  1530. else if (this.boxNum == this.boxMax) {
  1531. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1532. this.ui.openBtn.c1.selectedIndex = 13;
  1533. this.inAd = true;
  1534. }
  1535. else
  1536. this.getAward();
  1537. }
  1538. else if (this.inAd) {
  1539. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1540. if (Laya.Browser.onAndroid) {
  1541. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1542. if (!boo) {
  1543. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1544. return;
  1545. }
  1546. }
  1547. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1548. }
  1549. else {
  1550. console.log('zh:AD 失败,直接发放奖励');
  1551. this.qjff_AD_for_UIBOX_onOpenBox();
  1552. }
  1553. }
  1554. this.upBar();
  1555. }
  1556. qjff_AD_for_UIBOX_onOpenBox() {
  1557. this.getAward();
  1558. }
  1559. onCloseBox() {
  1560. if (this.isClose)
  1561. this.hide();
  1562. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1563. this.isClose = true;
  1564. PlatMgr.showBanner(true, 0, 3000);
  1565. }
  1566. else
  1567. this.hide();
  1568. }
  1569. getAward() {
  1570. let str = "";
  1571. if (Math.random() < 0.5) {
  1572. let max = Moyu.isLegal ? 500 : 2500;
  1573. let num = xGame.tools.random(max, 500 + max);
  1574. DataMgr.setCoin(num);
  1575. str = "金币x" + num;
  1576. }
  1577. else {
  1578. let max = Moyu.isLegal ? 10 : 30;
  1579. let num = xGame.tools.random(max, 30 + max);
  1580. DataMgr.setDiamond(num);
  1581. str = "钻石x" + num;
  1582. }
  1583. xGame.showTip("恭喜获得-" + str);
  1584. this.hide();
  1585. }
  1586. }
  1587. UIBox.uiName = "UIBox";
  1588. class ui_UITry extends fgui.GComponent {
  1589. static createInstance() {
  1590. return (fgui.UIPackage.createObject("game", "UITry"));
  1591. }
  1592. onConstruct() {
  1593. this.n11 = (this.getChild("n11"));
  1594. this.myNode = (this.getChild("myNode"));
  1595. this.t0 = this.getTransition("t0");
  1596. }
  1597. }
  1598. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1599. class UITry extends UIBase {
  1600. constructor() {
  1601. super();
  1602. this.closeTime = 0;
  1603. this.closeNum = 0;
  1604. this.skillUrl = xGame.common.skillIconList;
  1605. }
  1606. onConstructor() {
  1607. this.ui = ui_UITry.createInstance();
  1608. this.contentPane = this.ui;
  1609. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1610. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1611. }
  1612. show() {
  1613. super.show();
  1614. this.closeNum = 0;
  1615. this.closeTime = 15;
  1616. this.ui.t0.play();
  1617. PlatMgr.showRateBanner();
  1618. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1619. Laya.timer.loop(1000, this, this.updateTime);
  1620. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1621. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1622. xGame.common.gameMgr.gamePause = true;
  1623. }
  1624. updateTime() {
  1625. if (this.closeTime > 1) {
  1626. this.closeTime--;
  1627. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1628. }
  1629. else
  1630. this.hide();
  1631. }
  1632. hide() {
  1633. Laya.timer.clearAll(this);
  1634. Moyu.showBannerAd(false);
  1635. super.hide();
  1636. xGame.common.gameMgr.gamePause = false;
  1637. }
  1638. onTry() {
  1639. console.log('zh:qjff_AD_for_uitry');
  1640. if (Laya.Browser.onAndroid) {
  1641. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1642. if (!boo) {
  1643. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1644. return;
  1645. }
  1646. }
  1647. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1648. }
  1649. else {
  1650. console.log('zh:AD 失败,直接发放奖励');
  1651. this.qjff_AD_for_uitry();
  1652. }
  1653. }
  1654. qjff_AD_for_uitry() {
  1655. let select = xGame.common.curPlayerSkillType;
  1656. DataMgr.gameData.trySkill = select;
  1657. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1658. DataMgr.saveGameData();
  1659. DataMgr.setBigSkill(select, 1);
  1660. xGame.showTip("Trial Successful");
  1661. this.hide();
  1662. }
  1663. onCancel() {
  1664. if (this.closeNum > 0) {
  1665. this.closeNum--;
  1666. if (this.closeNum < 2)
  1667. this.hide();
  1668. return;
  1669. }
  1670. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1671. this.onTry();
  1672. }
  1673. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1674. this.closeNum = 3;
  1675. }
  1676. else
  1677. this.hide();
  1678. }
  1679. }
  1680. UITry.uiName = "UITry";
  1681. class PlatMgr {
  1682. static initConfig() {
  1683. this.lastVt = 0;
  1684. if (!Moyu.platConfig)
  1685. return;
  1686. for (let k in Moyu.platConfig) {
  1687. let pd = this[k];
  1688. let pc = Moyu.platConfig[k];
  1689. if (pd != undefined && pc != undefined)
  1690. this[k] = pc;
  1691. }
  1692. Moyu.setBannerPos(0.5, 1);
  1693. }
  1694. static rand100(num) {
  1695. return xGame.tools.random(0, 100) < num;
  1696. }
  1697. static isMisVideo() {
  1698. let dt = Laya.timer.currTimer - this.lastVt;
  1699. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1700. this.lastVt = Laya.timer.currTimer;
  1701. return true;
  1702. }
  1703. else {
  1704. if (this.rand100(this.fullVideoRate)) {
  1705. console.log('zh:插屏 ad start');
  1706. JSBridgeUtils.instance.showInternAd('platMgr');
  1707. }
  1708. return false;
  1709. }
  1710. }
  1711. static showVideo(call, type) {
  1712. Moyu.showVideoAd(() => {
  1713. this.lastVt = Laya.timer.currTimer;
  1714. call && call();
  1715. }, type);
  1716. }
  1717. static showInsert(delay = false) {
  1718. if (this.getRand() < this.insertRate) {
  1719. let dt = delay ? this.insertDelay : 0;
  1720. console.log('zh:插屏 ad start');
  1721. JSBridgeUtils.instance.showInternAd('gameInsert');
  1722. }
  1723. }
  1724. static gameInsert() {
  1725. let t = this.getRand();
  1726. let r = this.gameInsertRate;
  1727. if (t < r) {
  1728. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1729. }
  1730. }
  1731. static showRateBanner() {
  1732. if (this.getRand() < this.bannerRate)
  1733. this.showBanner(true, this.bannerDelay, 3000);
  1734. }
  1735. static showBanner(show, delay = 0, hide = 0) {
  1736. if (2 > 1) {
  1737. console.log('zh:显示showBanner广告 直接返回');
  1738. return;
  1739. }
  1740. if (!show)
  1741. Moyu.showBannerAd(false);
  1742. else {
  1743. Laya.timer.clear(this, this.bannerShow);
  1744. if (delay > 0)
  1745. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1746. else
  1747. this.bannerShow(true);
  1748. if (hide > 0)
  1749. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1750. }
  1751. }
  1752. static bannerShow(show) {
  1753. if (2 > 1) {
  1754. console.log('zh:显示showBanner广告 直接返回');
  1755. return;
  1756. }
  1757. Moyu.showBannerAd(show);
  1758. console.log("showBanner" + show);
  1759. }
  1760. static getRand() {
  1761. return xGame.tools.random(0, 100);
  1762. }
  1763. static openBox() {
  1764. if (this.getRand() < this.boxRate)
  1765. xGame.uiMgr.Show(UIBox);
  1766. }
  1767. static openTry() {
  1768. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1769. return;
  1770. if (this.getRand() < this.tryRate)
  1771. xGame.uiMgr.Show(UITry);
  1772. else if (DataMgr.gameData.gameCount == 1)
  1773. xGame.uiMgr.Show(UITry);
  1774. }
  1775. }
  1776. PlatMgr.forceShare = 0;
  1777. PlatMgr.signAdRate = 0;
  1778. PlatMgr.forceVideoRate = 0;
  1779. PlatMgr.forceVideoGap = 0;
  1780. PlatMgr.fullVideoRate = 0;
  1781. PlatMgr.gameInsertRate = 0;
  1782. PlatMgr.insertGap = 0;
  1783. PlatMgr.insertDelay = 0;
  1784. PlatMgr.insertRate = 0;
  1785. PlatMgr.boxRate = 0;
  1786. PlatMgr.boxVideoRate = 0;
  1787. PlatMgr.boxInsertRate = 0;
  1788. PlatMgr.boxBannerRate = 0;
  1789. PlatMgr.tryRate = 0;
  1790. PlatMgr.tryClose3Rate = 0;
  1791. PlatMgr.tryVideoRate = 0;
  1792. PlatMgr.bannerRate = 0;
  1793. PlatMgr.lastVt = 0;
  1794. class ui_UIAddProp extends fgui.GComponent {
  1795. static createInstance() {
  1796. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1797. }
  1798. onConstruct() {
  1799. this.n11 = (this.getChild("n11"));
  1800. this.myNode = (this.getChild("myNode"));
  1801. this.closeBtn = (this.getChild("closeBtn"));
  1802. this.t0 = this.getTransition("t0");
  1803. }
  1804. }
  1805. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1806. class SpineMgr {
  1807. constructor(name, loadCb = null) {
  1808. this.loaded = false;
  1809. this.spineName = '';
  1810. this.loadedCallback = loadCb;
  1811. this.templet = new Laya.Templet();
  1812. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1813. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1814. if (name === 'mishu') {
  1815. this.templet.loadAni('spine/nvmishu.sk');
  1816. }
  1817. else {
  1818. this.templet.loadAni(`spine/${name}.sk`);
  1819. }
  1820. this.templet.lock = true;
  1821. this.spineName = name;
  1822. }
  1823. onError() {
  1824. console.log("zh:spine加载出错");
  1825. }
  1826. parseComplete() {
  1827. this.loaded = true;
  1828. this.loadedCallback && this.loadedCallback();
  1829. }
  1830. dispose() {
  1831. if (this.templet && !this.templet.destroyed) {
  1832. this.templet.destroy();
  1833. }
  1834. this.templet = null;
  1835. }
  1836. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1837. if (!this.loaded) {
  1838. return;
  1839. }
  1840. let spine;
  1841. if (mySpine) {
  1842. spine = mySpine;
  1843. }
  1844. else {
  1845. spine = this.createSpine(data, parent);
  1846. }
  1847. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1848. if (!isLoop) {
  1849. spine.on(Laya.Event.STOPPED, this, () => {
  1850. spine.offAll(Laya.Event.STOPPED);
  1851. callback && callback(spine);
  1852. });
  1853. }
  1854. return spine;
  1855. }
  1856. createSpine(data, parent, type = 1) {
  1857. let spine;
  1858. spine = this.templet.buildArmature(type);
  1859. spine.showSkinByIndex(0);
  1860. parent.addChild(spine);
  1861. spine.pos(data.x, data.y);
  1862. spine.scale(data.scaleX, data.scaleY, true);
  1863. return spine;
  1864. }
  1865. }
  1866. var AIState;
  1867. (function (AIState) {
  1868. AIState[AIState["none"] = 0] = "none";
  1869. AIState[AIState["idle"] = 1] = "idle";
  1870. AIState[AIState["reset"] = 2] = "reset";
  1871. AIState[AIState["move"] = 3] = "move";
  1872. AIState[AIState["wait"] = 4] = "wait";
  1873. AIState[AIState["select"] = 5] = "select";
  1874. AIState[AIState["turn"] = 6] = "turn";
  1875. AIState[AIState["shoot"] = 7] = "shoot";
  1876. AIState[AIState["leave"] = 8] = "leave";
  1877. })(AIState || (AIState = {}));
  1878. class AIPlayer {
  1879. constructor() {
  1880. this.dtime = 30;
  1881. this.awayTime = 0;
  1882. this.awayNum = 0;
  1883. this.hideTime = 0;
  1884. this.rootMoveTime = 0;
  1885. this.isGuide = false;
  1886. this.state = AIState.none;
  1887. this.waitTime = 0;
  1888. this.forceNum = 0;
  1889. this.forceMax = 0;
  1890. this.ballSize = 33;
  1891. this.selectNum = 0;
  1892. this.destRot = 0;
  1893. this.aiLv = 10;
  1894. this.kickBall = [];
  1895. this.lineBall = [];
  1896. this.scoreBall = [];
  1897. this.holeBall = [];
  1898. this.turnNum = 0;
  1899. this.setNum = 0;
  1900. this.setMax = 0;
  1901. this.setRate = 0;
  1902. this.rectL = 0;
  1903. this.rectR = 0;
  1904. this.rectT = 0;
  1905. this.rectB = 0;
  1906. this.rootPos = { x: 0, y: 0 };
  1907. this.bestForce = 0;
  1908. this.bestAngle = 180;
  1909. this.bestPos = { x: 0, y: 0 };
  1910. this.bestKick = { x: 0, y: 0 };
  1911. this.posList = [];
  1912. this.posIdx = 0;
  1913. this.chatTime = 3000;
  1914. this.tempDir1 = new Laya.Vector2();
  1915. this.tempDir2 = new Laya.Vector2();
  1916. this.tempDir3 = new Laya.Vector2();
  1917. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1918. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1919. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1920. this.gameSrc = xGame.common.gameUI;
  1921. this.hideTime = Laya.timer.currTimer;
  1922. Moyu.setOnTipCall((id) => {
  1923. if (id == 20012)
  1924. this.hideTime = Laya.timer.currTimer;
  1925. else
  1926. (id == 20011);
  1927. {
  1928. let dt = Laya.timer.currTimer - this.hideTime;
  1929. console.log("onshow" + dt);
  1930. if (dt > 30000 && this.state > AIState.none)
  1931. xGame.common.gameMgr.aiGameEnd(false);
  1932. }
  1933. }, this);
  1934. }
  1935. init() {
  1936. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1937. this.awayTime = xGame.tools.random(5000, 10000);
  1938. this.awayNum = 0;
  1939. this.hideTime = Laya.timer.currTimer;
  1940. let rect = xGame.common.d2World.borderRect;
  1941. this.rectL = Math.ceil(rect.x) + 17;
  1942. this.rectT = Math.ceil(rect.y) + 17;
  1943. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1944. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1945. this.wBall = xGame.common.d2World.rootBall;
  1946. this.ballSize = this.wBall.gameObj.width - 1;
  1947. if (this.posList.length < 1) {
  1948. let dp = 40;
  1949. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1950. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1951. let dx = i < this.rectR ? i : this.rectR;
  1952. let dy = j < this.rectB ? j : this.rectB;
  1953. let order = xGame.tools.random(0, 1000);
  1954. this.posList.push({ x: dx, y: dy, order: order });
  1955. }
  1956. }
  1957. this.posList.sort(function (a, b) {
  1958. return a.order - b.order;
  1959. });
  1960. this.setMax = this.posList.length;
  1961. }
  1962. this.state = AIState.idle;
  1963. }
  1964. setAiLevel(num) {
  1965. this.aiLv = num;
  1966. }
  1967. initBall() {
  1968. this.rootPos.x = this.wBall.gameObj.x;
  1969. this.rootPos.y = this.wBall.gameObj.y;
  1970. this.initHoleBall();
  1971. }
  1972. initHoleBall() {
  1973. this.kickBall = [];
  1974. this.lineBall = [];
  1975. this.scoreBall = [];
  1976. this.holeBall = [];
  1977. this.selectNum = 0;
  1978. this.forceNum = 0;
  1979. this.forceMax = 0;
  1980. this.turnNum = 0;
  1981. let list = xGame.common.d2World.ballArr;
  1982. if (list.length < 20 && !this.isGuide) {
  1983. let holes = xGame.common.gameMgr.holePosList;
  1984. for (let i = 0; i < list.length; i++) {
  1985. let obj = list[i];
  1986. if (!obj)
  1987. continue;
  1988. obj.kickPos.x = 0;
  1989. obj.kickPos.y = 0;
  1990. obj.poleAngle = 0;
  1991. obj.hard = 0;
  1992. obj.borderDis = 0;
  1993. obj.kickAngle = 180;
  1994. if (obj.number == 0)
  1995. continue;
  1996. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1997. continue;
  1998. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1999. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  2000. continue;
  2001. }
  2002. let b = obj.gameObj;
  2003. let wbp = this.rootPos;
  2004. let bx = wbp.x - b.x;
  2005. let by = wbp.y - b.y;
  2006. obj.borderDis = xGame.tools.random(0, 100);
  2007. this.kickBall.push(obj);
  2008. if (!this.isLine(wbp, obj))
  2009. continue;
  2010. obj.kickAngle = xGame.tools.random(90, 180);
  2011. obj.kickPos.x = b.x;
  2012. obj.kickPos.y = b.y;
  2013. this.lineBall.push(obj);
  2014. let minDis = 999999;
  2015. let hole = false;
  2016. for (let j = 0; j < holes.length; j++) {
  2017. let hp = holes[j];
  2018. if (bx >= 0 && hp.x > b.x + 100)
  2019. continue;
  2020. if (bx <= 0 && hp.x < b.x - 100)
  2021. continue;
  2022. if (by < -10 && hp.y < wbp.y)
  2023. continue;
  2024. if (by > 10 && hp.y > wbp.y)
  2025. continue;
  2026. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2027. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2028. if (dis < minDis) {
  2029. let dx = b.x - this.tempDir1.x * this.ballSize;
  2030. let dy = b.y - this.tempDir1.y * this.ballSize;
  2031. this.tempDir3.x = this.tempDir1.x;
  2032. this.tempDir3.y = this.tempDir1.y;
  2033. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2034. obj.kickPos.x = dx;
  2035. obj.kickPos.y = dy;
  2036. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2037. if (num > 1)
  2038. num = 1;
  2039. obj.kickAngle = Math.acos(num) * 57.3;
  2040. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2041. dis = dis * 2;
  2042. if (Math.abs(hp.x - 600) < 100)
  2043. dis += 50;
  2044. obj.hard = dis + obj.kickAngle * 3;
  2045. hole = true;
  2046. }
  2047. }
  2048. }
  2049. }
  2050. if (hole) {
  2051. this.scoreBall.push(obj);
  2052. this.holeBall.push(obj);
  2053. }
  2054. }
  2055. this.scoreBall.sort(function (a, b) {
  2056. return a.hard - b.hard;
  2057. });
  2058. this.holeBall.sort(function (a, b) {
  2059. return a.kickAngle - b.kickAngle;
  2060. });
  2061. this.kickBall.sort(function (a, b) {
  2062. return a.borderDis - b.borderDis;
  2063. });
  2064. }
  2065. else {
  2066. let max = list.length - 1;
  2067. let i = xGame.tools.random(0, max);
  2068. for (i; i <= max; i++) {
  2069. let idx = i >= max ? i -= max : i;
  2070. let obj = list[idx];
  2071. if (obj && obj.number != 0) {
  2072. obj.kickAngle = xGame.tools.random(90, 180);
  2073. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2074. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2075. this.lineBall.push(obj);
  2076. break;
  2077. }
  2078. }
  2079. }
  2080. }
  2081. selectBall() {
  2082. let ball = null;
  2083. this.destRot = 0;
  2084. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2085. let ai = 110 - this.aiLv * 10;
  2086. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2087. let score = false;
  2088. if (this.scoreBall.length < 1) {
  2089. if (this.lineBall.length < 1) {
  2090. for (let i = 0; i < this.kickBall.length; i++) {
  2091. let list = [];
  2092. let bo = this.kickBall[i];
  2093. let bobj = bo.gameObj;
  2094. let rect = xGame.common.d2World.borderRect;
  2095. let mobj = this.wBall.gameObj;
  2096. let minb = bobj.y - rect.y - 20;
  2097. let minw = mobj.y - rect.y - 50;
  2098. if (minb > 0 && minw > 0) {
  2099. let dlenx = 0;
  2100. let dleny = mobj.y - rect.y;
  2101. let spx = mobj.x;
  2102. let spy = rect.y - dleny;
  2103. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2104. }
  2105. minb = rect.y + rect.height - bobj.y - 20;
  2106. minw = rect.y + rect.height - mobj.y - 50;
  2107. if (minb > 0 && minw > 0) {
  2108. let dlenx = 0;
  2109. let dleny = rect.y + rect.height - mobj.y;
  2110. let spx = mobj.x;
  2111. let spy = rect.y + rect.height + dleny;
  2112. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2113. }
  2114. minb = bobj.x - rect.x - 20;
  2115. minw = mobj.x - rect.x - 50;
  2116. if (minb > 0 && minw > 0) {
  2117. let dlenx = mobj.x - rect.x;
  2118. let dleny = 0;
  2119. let spx = rect.x - dlenx;
  2120. let spy = mobj.y;
  2121. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2122. }
  2123. minb = rect.x + rect.width - bobj.x - 20;
  2124. minw = rect.x + rect.width - mobj.x - 50;
  2125. if (minb > 0 && minw > 0) {
  2126. let dlenx = rect.x + rect.width - mobj.x;
  2127. let dleny = 0;
  2128. let spx = rect.x + rect.width + dlenx;
  2129. let spy = mobj.y;
  2130. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2131. }
  2132. list.sort(function (a, b) {
  2133. return a.order - b.order;
  2134. });
  2135. for (let i = 0; i < list.length; i++) {
  2136. let data = list[i];
  2137. let mx = mobj.x - bobj.x;
  2138. let my = mobj.y - bobj.y;
  2139. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2140. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2141. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2142. if (num > 1)
  2143. num = 1;
  2144. let cos = Math.acos(num);
  2145. if (cos > 1.57)
  2146. cos = 1.57;
  2147. else if (cos < 0.01)
  2148. cos = 0.01;
  2149. let tan = Math.tan(cos);
  2150. let dx = tan * data.dleny;
  2151. let dy = tan * data.dlenx;
  2152. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2153. if (Math.abs(bx - 667) < 40)
  2154. continue;
  2155. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2156. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2157. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2158. this.forceMax = dis * 0.08;
  2159. this.destRot += mis * 0.1;
  2160. this.setKick(bx, by);
  2161. return true;
  2162. }
  2163. }
  2164. }
  2165. }
  2166. else {
  2167. ball = xGame.common.getRandArrEle(this.lineBall);
  2168. }
  2169. }
  2170. else {
  2171. for (let i = 0; i < this.scoreBall.length; i++) {
  2172. if (i < this.scoreBall.length - 1) {
  2173. let rand = 70 + this.aiLv * 10 + i * 10;
  2174. if (xGame.tools.random(0, 100) < rand) {
  2175. ball = this.scoreBall[i];
  2176. break;
  2177. }
  2178. }
  2179. else {
  2180. ball = this.scoreBall[i];
  2181. break;
  2182. }
  2183. }
  2184. score = true;
  2185. this.selectNum++;
  2186. }
  2187. if (!ball)
  2188. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2189. if (this.selectNum >= max) {
  2190. let dx = ball.gameObj.x;
  2191. let dy = ball.gameObj.y;
  2192. let kickAngle = 0;
  2193. if (score) {
  2194. dx = ball.kickPos.x;
  2195. dy = ball.kickPos.y;
  2196. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2197. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2198. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2199. if (adot > 1)
  2200. adot = 1;
  2201. kickAngle = Math.acos(adot) * 57.3;
  2202. if (kickAngle > 45) {
  2203. let kdx = ball.kickPos.x - ball.gameObj.x;
  2204. let kdy = ball.kickPos.y - ball.gameObj.y;
  2205. dx = ball.kickPos.x - kdx * mis * 0.3;
  2206. dy = ball.kickPos.y - kdy * mis * 0.3;
  2207. }
  2208. else
  2209. this.destRot += mis;
  2210. }
  2211. else if (ball.poleAngle != 0) {
  2212. this.destRot += ball.poleAngle;
  2213. }
  2214. if (xGame.common.gameMode == 0) {
  2215. let af = kickAngle * 0.08;
  2216. this.forceMax = ball.hard * 0.1 + af * af;
  2217. }
  2218. this.setKick(dx, dy);
  2219. }
  2220. else {
  2221. let rand = this.aiLv * 5 + 40;
  2222. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2223. ball = xGame.common.getRandArrEle(this.scoreBall);
  2224. else
  2225. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2226. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2227. if (xGame.tools.random(0, 100) > rand) {
  2228. this.selectNum = max;
  2229. }
  2230. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2231. this.selectNum++;
  2232. }
  2233. ball.onClick(0, true);
  2234. }
  2235. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2236. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2237. let balls = xGame.common.d2World.ballArr;
  2238. let max = xGame.tools.getDis(hx, hy, bx, by);
  2239. for (let index = 0; index < balls.length; index++) {
  2240. let obj = balls[index];
  2241. if (obj.number == 0)
  2242. continue;
  2243. if (obj.number == bn || obj.number == dn)
  2244. continue;
  2245. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2246. if (dis * dis > max)
  2247. continue;
  2248. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2249. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2250. if (num > 1)
  2251. num = 1;
  2252. if (num < 0)
  2253. continue;
  2254. let gap = Math.sin(Math.acos(num)) * dis;
  2255. if (gap < this.ballSize)
  2256. return true;
  2257. }
  2258. return false;
  2259. }
  2260. isLine(xy, ball) {
  2261. let bx = xy.x;
  2262. let by = xy.y;
  2263. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2264. let dis = ball.getDestDis(xy);
  2265. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2266. let sin = Math.sin(angle);
  2267. let cos = Math.cos(angle);
  2268. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2269. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2270. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2271. let dx = bx + this.tempDir2.x * dis;
  2272. let dy = by + this.tempDir2.y * dis;
  2273. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2274. sin = Math.sin(-angle);
  2275. cos = Math.cos(-angle);
  2276. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2277. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2278. dx = bx + this.tempDir2.x * dis;
  2279. dy = by + this.tempDir2.y * dis;
  2280. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2281. if (isr && isl)
  2282. return false;
  2283. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2284. }
  2285. return true;
  2286. }
  2287. turnPole() {
  2288. this.turnNum++;
  2289. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2290. let dr = rot - this.destRot;
  2291. let abs = Math.abs(dr) % 360;
  2292. if (abs > 180) {
  2293. if (rot > 180)
  2294. rot -= 360;
  2295. if (this.destRot > 180)
  2296. this.destRot -= 360;
  2297. }
  2298. let max = this.turnNum * 5 + this.aiLv * 5;
  2299. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2300. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2301. let at = xGame.tools.random(1000, 2000);
  2302. if (!this.onAway(3))
  2303. at += xGame.tools.random(10000, 15000);
  2304. this.setState(AIState.shoot, at);
  2305. }
  2306. else {
  2307. let mr = 0;
  2308. if (abs > 3)
  2309. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2310. else if (Math.random() > 0.6)
  2311. mr = xGame.tools.random(1, 10) * 0.1;
  2312. mr = dr > 0 ? -mr : mr;
  2313. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2314. }
  2315. }
  2316. setKick(dx, dy) {
  2317. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2318. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2319. this.tempDir1.x = 0;
  2320. this.tempDir1.y = 1;
  2321. this.tempDir2.y = -this.tempDir2.y;
  2322. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2323. if (num > 1)
  2324. num = 1;
  2325. let rot = Math.acos(num) * 57.3;
  2326. if (this.tempDir2.x < 0)
  2327. rot = 360 - rot;
  2328. this.destRot += rot;
  2329. if (!xGame.common.gameMgr.finishOneShoot) {
  2330. this.forceMax += xGame.tools.random(10, 50);
  2331. this.forceMax -= this.aiLv * 2;
  2332. if (this.forceMax < 20)
  2333. this.forceMax = 20;
  2334. }
  2335. if (this.forceMax > 100)
  2336. this.forceMax = 101;
  2337. else if (this.forceMax < 10)
  2338. this.forceMax += xGame.tools.random(0, 10);
  2339. if (xGame.common.gameMode == 1)
  2340. this.forceMax = xGame.tools.random(80, 100);
  2341. else
  2342. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2343. let max = 2000 - this.aiLv * 100;
  2344. if (Math.random() > 0.8)
  2345. max += xGame.tools.random(100, 2000);
  2346. this.setState(AIState.turn, xGame.tools.random(500, max));
  2347. }
  2348. shoot() {
  2349. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2350. if (Math.random() > 0.8) {
  2351. this.gameSrc.aiForce(1);
  2352. this.setState(AIState.wait);
  2353. }
  2354. }
  2355. else {
  2356. let df = xGame.tools.random(3, 8);
  2357. if (this.forceNum < this.forceMax)
  2358. this.forceNum += df;
  2359. else
  2360. this.forceNum -= df;
  2361. let startY = this.gameSrc.ui.powerNode.y;
  2362. let height = this.gameSrc.ui.powerNode.height;
  2363. let force = startY + height * this.forceNum * 0.01;
  2364. this.gameSrc.aiForce(2, force);
  2365. }
  2366. }
  2367. reset() {
  2368. for (let i = 0; i < 4; i++) {
  2369. this.setRate--;
  2370. this.setNum++;
  2371. let pos = this.posList[this.posIdx];
  2372. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2373. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2374. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2375. this.rootPos.x = 387;
  2376. if (this.rootPos.x < this.rectL)
  2377. this.rootPos.x = this.rectL;
  2378. else if (this.rootPos.x > this.rectR)
  2379. this.rootPos.x = this.rectR;
  2380. if (this.rootPos.y < this.rectT)
  2381. this.rootPos.y = this.rectT;
  2382. else if (this.rootPos.y > this.rectB)
  2383. this.rootPos.y = this.rectB;
  2384. this.posIdx++;
  2385. let max = this.posList.length;
  2386. if (this.posIdx >= max)
  2387. this.posIdx -= max;
  2388. this.initHoleBall();
  2389. let ball = null;
  2390. if (this.scoreBall.length > 0)
  2391. ball = this.scoreBall[0];
  2392. else if (this.lineBall.length > 0)
  2393. ball = xGame.common.getRandArrEle(this.lineBall);
  2394. if (ball && ball.kickAngle < this.bestAngle) {
  2395. this.bestAngle = ball.kickAngle;
  2396. this.bestKick.x = ball.kickPos.x;
  2397. this.bestKick.y = ball.kickPos.y;
  2398. this.bestPos.x = this.rootPos.x;
  2399. this.bestPos.y = this.rootPos.y;
  2400. this.bestForce = ball.hard * 0.08;
  2401. }
  2402. }
  2403. if (this.setNum >= this.setMax)
  2404. this.setMax = 0;
  2405. if (this.setRate < 1) {
  2406. this.setState(AIState.move, 0);
  2407. this.rootMoveTime = Laya.timer.currTimer;
  2408. this.gameSrc.aiRootMove(true);
  2409. }
  2410. }
  2411. delayLine() {
  2412. this.gameSrc.aiRootMove(false);
  2413. }
  2414. move() {
  2415. if (this.bestPos.x < 1)
  2416. this.bestPos = this.rootPos;
  2417. let wObj = this.wBall.gameObj;
  2418. let destx = wObj.x;
  2419. let desty = wObj.y;
  2420. let dx = Math.abs(destx - this.bestPos.x);
  2421. let dy = Math.abs(desty - this.bestPos.y);
  2422. let mx = 3 + dx * 0.03;
  2423. let my = 3 + dy * 0.03;
  2424. if (dx < 4 && dy < 4) {
  2425. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2426. dt = dt < 1000 ? 1000 - dt : 0;
  2427. if (this.setMax > 0) {
  2428. let min = this.setMax * 0.3 + this.aiLv * 5;
  2429. this.setRate = xGame.tools.random(min, this.setMax);
  2430. this.setState(AIState.reset, 0);
  2431. }
  2432. else {
  2433. this.destRot = 0;
  2434. this.forceMax = this.bestForce;
  2435. this.setKick(this.bestKick.x, this.bestKick.y);
  2436. }
  2437. if (dt > 100) {
  2438. Laya.timer.clear(this, this.delayLine);
  2439. Laya.timer.once(dt, this, this.delayLine);
  2440. }
  2441. else
  2442. this.gameSrc.aiRootMove(false);
  2443. }
  2444. else {
  2445. if (dx > 4)
  2446. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2447. if (dy > 4)
  2448. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2449. this.gameSrc.onRootMove({ x: destx, y: desty });
  2450. }
  2451. }
  2452. resetRoot() {
  2453. this.bestAngle = 180;
  2454. this.bestForce = 0;
  2455. this.setMax = this.posList.length;
  2456. this.posIdx = xGame.tools.random(0, this.setMax);
  2457. let min = this.setMax * 0.3 + this.aiLv * 5;
  2458. this.setRate = xGame.tools.random(min, this.setMax);
  2459. let max = 2000 - this.aiLv * 100;
  2460. if (Math.random() > 0.8)
  2461. max += xGame.tools.random(100, 1000);
  2462. if (this.isGuide)
  2463. this.setState(AIState.select, 500);
  2464. else if (this.onAway(2))
  2465. this.setState(AIState.reset, xGame.tools.random(400, max));
  2466. else
  2467. this.setState(AIState.none);
  2468. if (xGame.common.gameMgr.finishOneShoot)
  2469. this.chat();
  2470. }
  2471. runAI() {
  2472. if (this.state > AIState.idle)
  2473. return;
  2474. this.initBall();
  2475. this.onGame(2500);
  2476. if (Math.random() > 0.6)
  2477. this.chat();
  2478. }
  2479. stopRun() {
  2480. this.setState(AIState.idle);
  2481. }
  2482. onGame(base) {
  2483. let max = base - this.aiLv * 100;
  2484. if (Math.random() > 0.8)
  2485. max += xGame.tools.random(100, 1000);
  2486. if (this.onAway(2))
  2487. this.setState(AIState.select, xGame.tools.random(500, max));
  2488. else
  2489. this.setState(AIState.none);
  2490. }
  2491. setState(sta, wt = 0) {
  2492. if (this.state == AIState.none)
  2493. return;
  2494. this.state = sta;
  2495. this.waitTime = wt;
  2496. }
  2497. onUpdate() {
  2498. if (this.state == AIState.none)
  2499. return;
  2500. this.awayTime -= this.dtime;
  2501. if (this.awayTime < 1) {
  2502. this.awayTime = xGame.tools.random(6000, 10000);
  2503. this.awayNum += (11 - this.aiLv);
  2504. this.onAway(1);
  2505. }
  2506. if (this.waitTime >= 0) {
  2507. this.waitTime -= this.dtime;
  2508. return;
  2509. }
  2510. switch (this.state) {
  2511. case AIState.idle:
  2512. this.chat();
  2513. break;
  2514. case AIState.reset:
  2515. this.reset();
  2516. break;
  2517. case AIState.move:
  2518. this.move();
  2519. break;
  2520. case AIState.leave:
  2521. this.state = AIState.none;
  2522. xGame.common.gameMgr.aiGameEnd(true);
  2523. break;
  2524. case AIState.select:
  2525. this.selectBall();
  2526. break;
  2527. case AIState.turn:
  2528. this.turnPole();
  2529. break;
  2530. case AIState.shoot:
  2531. this.shoot();
  2532. break;
  2533. }
  2534. }
  2535. onAway(type) {
  2536. if (type == 1) {
  2537. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2538. let num = this.awayNum + db * 20;
  2539. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2540. xGame.common.gameMgr.aiLeave();
  2541. this.setState(AIState.leave, 6666);
  2542. }
  2543. }
  2544. else if (type == 2) {
  2545. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2546. let num = this.awayNum + db * 30;
  2547. if (xGame.tools.random(0, 10000) < num)
  2548. return false;
  2549. }
  2550. else if (type == 3) {
  2551. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2552. let num = this.awayNum + db * 10;
  2553. if (xGame.tools.random(0, 4000) < num)
  2554. return false;
  2555. }
  2556. return true;
  2557. }
  2558. chat() {
  2559. if (this.chatTime > 0) {
  2560. this.chatTime -= this.dtime;
  2561. return;
  2562. }
  2563. this.chatTime = xGame.tools.random(2000, 10000);
  2564. let rand = xGame.tools.random(0, 100);
  2565. if (rand < 15)
  2566. this.talk();
  2567. else if (rand < 35)
  2568. this.emotion();
  2569. }
  2570. talk() {
  2571. xGame.common.talkMgr.showAITalk(0);
  2572. }
  2573. emotion() {
  2574. xGame.common.talkMgr.showAIEmotion(0);
  2575. }
  2576. resetAI() {
  2577. this.stopRun();
  2578. this.state = AIState.none;
  2579. }
  2580. }
  2581. class Partical extends Laya.Script3D {
  2582. constructor() {
  2583. super();
  2584. this.duration = 2000;
  2585. }
  2586. ;
  2587. onAwake() {
  2588. this.gameObj = this.owner;
  2589. }
  2590. onEnable() {
  2591. this.openTimer();
  2592. }
  2593. openTimer() {
  2594. Laya.timer.once(this.duration, this, this.disappear);
  2595. }
  2596. setCallback(obj, callback) {
  2597. this.obj = obj;
  2598. this.callback = callback;
  2599. Laya.timer.clearAll(this);
  2600. Laya.timer.once(this.duration, this, this.disappear);
  2601. }
  2602. disappear() {
  2603. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2604. this.callback && this.callback(this.obj);
  2605. }
  2606. }
  2607. class Ball extends Laya.Script3D {
  2608. constructor() {
  2609. super();
  2610. this.posV3 = new Laya.Vector3();
  2611. this.rotRate = 2.1;
  2612. this.rotSpeed = new Laya.Vector3();
  2613. this.myIndex = 0;
  2614. }
  2615. onAwake() {
  2616. this.gameObj = this.owner;
  2617. this.transform = this.gameObj.transform;
  2618. this.ballNode = this.gameObj.getChildByName("Ball");
  2619. this.shadowNode = this.gameObj.getChildByName("shadow");
  2620. }
  2621. initSelf(index, x, y, owner) {
  2622. this.d2BallSrc = owner;
  2623. this.myIndex = index;
  2624. this.setAlbedoTexture();
  2625. this.setTransPos(x, y);
  2626. this.setScale();
  2627. this.ballNode.transform.localRotationEulerX = 90;
  2628. if (index == 0) {
  2629. }
  2630. }
  2631. setAlbedoTexture(isIce = false) {
  2632. let url;
  2633. if (isIce) {
  2634. url = `res/d3Res/ballTexture/ice.jpg`;
  2635. }
  2636. else {
  2637. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2638. }
  2639. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2640. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2641. }));
  2642. }
  2643. runFireworks(obj, delay, callback) {
  2644. Laya.timer.clearAll(this);
  2645. Laya.timer.once(delay + 1, this, () => {
  2646. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2647. fire.transform.localPositionX = this.transform.localPositionX;
  2648. fire.transform.localPositionY = this.transform.localPositionY;
  2649. fire.transform.localPositionZ = this.transform.localPositionZ;
  2650. let src = fire.getComponent(Partical);
  2651. src.duration = 1000;
  2652. src.setCallback(obj, callback);
  2653. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2654. eft.transform.localPositionX = this.transform.localPositionX;
  2655. eft.transform.localPositionY = this.transform.localPositionY;
  2656. eft.transform.localPositionZ = this.transform.localPositionZ;
  2657. });
  2658. }
  2659. setTransPos(x, y) {
  2660. this.setRotation();
  2661. xGame.common.pos2to3Convert(x, y, this.posV3);
  2662. this.transform.localPositionX = this.posV3.x;
  2663. this.transform.localPositionY = 0;
  2664. this.transform.localPositionZ = this.posV3.z;
  2665. this.transform.localRotationEulerX = 0;
  2666. this.transform.localRotationEulerY = 0;
  2667. this.transform.localRotationEulerZ = 0;
  2668. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2669. this.shadowNode.transform.localPositionY = 0.1;
  2670. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2671. }
  2672. setRotation() {
  2673. if (this.d2BallSrc.canRot) {
  2674. let speed = this.d2BallSrc.rigy.linearVelocity;
  2675. this.rotSpeed.x = speed.x * this.rotRate;
  2676. this.rotSpeed.z = speed.y * this.rotRate;
  2677. this.rotSpeed.y = this.d2BallSrc.rotY;
  2678. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2679. }
  2680. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2681. this.rotSpeed.x = this.rotSpeed.y = 0;
  2682. this.rotSpeed.y = this.d2BallSrc.rotY;
  2683. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2684. }
  2685. }
  2686. setScale() {
  2687. let radius = xGame.common.d2World.rootBall.ui.width;
  2688. let scale = xGame.common.scale2to3Convert(radius);
  2689. this.transform.localScaleX = scale;
  2690. this.transform.localScaleY = scale;
  2691. this.transform.localScaleZ = scale;
  2692. }
  2693. playInHoleEft() {
  2694. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2695. eft.transform.position = this.transform.position;
  2696. }
  2697. playIceEft() {
  2698. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2699. eft.transform.position = this.transform.position;
  2700. }
  2701. get scaleXYZ() {
  2702. return this.transform.localScaleX;
  2703. }
  2704. set scaleXYZ(val) {
  2705. this.transform.localScaleX = val;
  2706. this.transform.localScaleY = val;
  2707. this.transform.localScaleZ = val;
  2708. }
  2709. get posX() {
  2710. return this.transform.localPositionX;
  2711. }
  2712. set posX(val) {
  2713. this.transform.localPositionX = val;
  2714. }
  2715. get posY() {
  2716. return this.transform.localPositionY;
  2717. }
  2718. set posY(val) {
  2719. this.transform.localPositionY = val;
  2720. }
  2721. get posZ() {
  2722. return this.transform.localPositionZ;
  2723. }
  2724. set posZ(val) {
  2725. this.transform.localPositionZ = val;
  2726. }
  2727. destroySelf() {
  2728. this.posV3 = null;
  2729. this.rotSpeed = null;
  2730. this.d2BallSrc = null;
  2731. this.ballNode = null;
  2732. this.gameObj.destroy(true);
  2733. this.transform = null;
  2734. this.destroy();
  2735. }
  2736. }
  2737. class ui_D2Ball extends fgui.GComponent {
  2738. static createInstance() {
  2739. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2740. }
  2741. onConstruct() {
  2742. this.myIcon = (this.getChild("myIcon"));
  2743. this.inner = (this.getChild("inner"));
  2744. this.n8 = (this.getChild("n8"));
  2745. this.n4 = (this.getChild("n4"));
  2746. this.wrongTips = (this.getChild("wrongTips"));
  2747. this.rightTips = (this.getChild("rightTips"));
  2748. this.breathAni = this.getTransition("breathAni");
  2749. }
  2750. }
  2751. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2752. class D2BallSrc extends Laya.Script {
  2753. constructor() {
  2754. super();
  2755. this.number = 0;
  2756. this.startX = 0;
  2757. this.startY = 0;
  2758. this.angleV2 = new Laya.Vector2();
  2759. this.isRootBall = false;
  2760. this.isBlackBall = false;
  2761. this.ballType = "";
  2762. this.canRot = true;
  2763. this.rotY = 0;
  2764. this.poleAngle = 0;
  2765. this.kickPos = { x: 0, y: 0 };
  2766. this.hard = 0;
  2767. this.kickAngle = 0;
  2768. this.borderDis = 0;
  2769. this.speedP10 = 5.6;
  2770. this.lastSpeed = { x: 0, y: 0 };
  2771. this.stillSpeed = 0.12;
  2772. this.ballFunc = "normal";
  2773. this.isRunSkillAni = false;
  2774. this.isInHole = false;
  2775. this.iceOwner = "";
  2776. this.forceRun = false;
  2777. this.myUNID = "";
  2778. this.rectL = 0;
  2779. this.rectR = 0;
  2780. this.rectT = 0;
  2781. this.rectB = 0;
  2782. this.forceVec = new Laya.Vector2();
  2783. this.lastDis = 0;
  2784. this.helpOut = { type: "", x: 0, y: 0 };
  2785. }
  2786. initSelf(number, x, y, d3Ball) {
  2787. if (!this.gameObj)
  2788. this.gameObj = this.owner;
  2789. this.number = number;
  2790. this.startX = x;
  2791. this.startY = y;
  2792. this.d3Ball = d3Ball;
  2793. this.isRootBall = false;
  2794. this.isBlackBall = false;
  2795. this.ballType = "";
  2796. if (number == 0) {
  2797. this.isRootBall = true;
  2798. }
  2799. else if (number == 8) {
  2800. this.isBlackBall = true;
  2801. }
  2802. else {
  2803. if (number <= 7) {
  2804. this.ballType = ballCamp.full;
  2805. }
  2806. else {
  2807. this.ballType = ballCamp.flower;
  2808. }
  2809. }
  2810. this.setInfo();
  2811. this.setD3Ball();
  2812. this.owner["mySrc"] = this;
  2813. this.rigy.linearDamping = 1;
  2814. D2BallSrc._unid++;
  2815. this.myUNID = "d2ball" + D2BallSrc._unid;
  2816. let rect = xGame.common.d2World.borderRect;
  2817. this.rectL = Math.ceil(rect.x) + 20;
  2818. this.rectT = Math.ceil(rect.y) + 20;
  2819. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2820. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2821. }
  2822. setInfo() {
  2823. this.gameObj.x = this.startX;
  2824. this.gameObj.y = this.startY;
  2825. let radius = this.ui.width / 2;
  2826. this.gameObj.width = radius * 2;
  2827. this.gameObj.height = radius * 2;
  2828. if (xGame.common.showDebug) {
  2829. this.ui.myIcon.alpha = 1;
  2830. this.ui.inner.alpha = 1;
  2831. }
  2832. else {
  2833. this.ui.myIcon.alpha = 0;
  2834. this.ui.inner.alpha = 0;
  2835. }
  2836. }
  2837. setD3Ball() {
  2838. this.d3Ball = this.d3Ball;
  2839. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2840. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2841. }
  2842. onUpdate() {
  2843. if (xGame.common.gameMgr.gamePause)
  2844. return;
  2845. if (this.isInHole)
  2846. return;
  2847. if (!xGame.common.d2World.openCheckStill)
  2848. return;
  2849. this.runBall();
  2850. }
  2851. runBall() {
  2852. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2853. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2854. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2855. this.judgeBorder();
  2856. }
  2857. getDestDis(dest) {
  2858. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2859. }
  2860. setmyXY(x, y) {
  2861. this.d3BallSrc.setTransPos(x, y);
  2862. }
  2863. getSpeed() {
  2864. let speed = this.rigy.linearVelocity;
  2865. return speed.x * speed.x + speed.y * speed.y;
  2866. }
  2867. onTriggerEnter(collider) {
  2868. if (!collider || !collider.owner)
  2869. return;
  2870. let coll = "collide";
  2871. let speed = this.getSpeed();
  2872. let sv2 = this.speedP10 * this.speedP10;
  2873. if (collider.label == "ball") {
  2874. if (speed < 9 && this.number != 0)
  2875. coll = "";
  2876. else if (speed < sv2)
  2877. coll = "collide_4";
  2878. else if (speed < sv2 * 6.2)
  2879. coll = "collide_3";
  2880. else if (speed < sv2 * 25)
  2881. coll = "collide_2";
  2882. else if (speed < sv2 * 56)
  2883. coll = "collide_1";
  2884. xGame.soundMgr.playSound(coll);
  2885. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2886. if (collider.owner) {
  2887. let rig = collider.owner.getComponent(D2BallSrc);
  2888. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2889. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2890. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2891. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2892. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2893. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2894. let rx = 0;
  2895. let ry = 0;
  2896. if (this.gameObj.x < this.rectL)
  2897. rx = vx;
  2898. else if (this.gameObj.x > this.rectR)
  2899. rx = -vx;
  2900. else if (this.gameObj.y < this.rectT)
  2901. ry = vy;
  2902. else if (this.gameObj.y > this.rectB)
  2903. ry = -vy;
  2904. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2905. }
  2906. }
  2907. if (this.number != 0) {
  2908. return;
  2909. }
  2910. else {
  2911. if (this.forceRun) {
  2912. console.log("randon force");
  2913. this.applyForce(collider);
  2914. }
  2915. }
  2916. if (xGame.common.d2World.isOnSameLine) {
  2917. xGame.common.d2World.isOnSameLine = false;
  2918. this.rigy.linearVelocity = { x: 0, y: 0 };
  2919. }
  2920. if (xGame.common.gameMgr.firstColliObj == null) {
  2921. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2922. xGame.common.gameMgr.isTouchedBall = true;
  2923. }
  2924. }
  2925. else {
  2926. xGame.common.recoverCameraView();
  2927. let wallStr = "";
  2928. if (speed < 9) { }
  2929. else if (speed < sv2) { }
  2930. else if (speed < sv2 * 6.2)
  2931. wallStr = "wall_30";
  2932. else if (speed < sv2 * 25)
  2933. wallStr = "wall_50";
  2934. else if (speed < sv2 * 56)
  2935. wallStr = "wall_80";
  2936. xGame.soundMgr.playSound(wallStr);
  2937. }
  2938. }
  2939. applyForce(collider) {
  2940. let src = collider.owner.mySrc;
  2941. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2942. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2943. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2944. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2945. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2946. }
  2947. checkWrongBall(playEft = true) {
  2948. if (this.isInHole)
  2949. return;
  2950. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2951. if (this.number != 0 && playEft)
  2952. this.d3BallSrc.playInHoleEft();
  2953. let coll = "inpocket_1";
  2954. let speed = this.getSpeed();
  2955. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2956. if (speed < 9 && this.number != 0)
  2957. coll = "";
  2958. else if (speed < sv2 * 6.2)
  2959. coll = "inpocket_4";
  2960. else if (speed < sv2 * 25)
  2961. coll = "collide_3";
  2962. else if (speed < sv2 * 56)
  2963. coll = "collide_2";
  2964. xGame.soundMgr.playSound(coll);
  2965. this.isInHole = true;
  2966. if (this.number == 0) {
  2967. console.log("白球进了。。");
  2968. this.reset();
  2969. this.rigy.linearVelocity = { x: 0, y: 0 };
  2970. this.hideSelf();
  2971. xGame.common.gameUI.ui.whiteAni.visible = true;
  2972. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2973. xGame.common.gameUI.ui.whiteAni.visible = false;
  2974. }));
  2975. }
  2976. else {
  2977. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2978. xGame.common.d2World.removeOneBall(this);
  2979. this.destroySelf();
  2980. xGame.common.playHappySound(this.number);
  2981. this.runFlyEft();
  2982. }
  2983. }
  2984. runFlyEft() {
  2985. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2986. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2987. }
  2988. }
  2989. hideSelf() {
  2990. if (this.d3Ball)
  2991. this.d3Ball.active = false;
  2992. }
  2993. showSelf() {
  2994. this.isInHole = false;
  2995. if (this.d3Ball && !this.d3Ball.active)
  2996. this.d3Ball.active = true;
  2997. }
  2998. isStill() {
  2999. let speed = this.rigy.linearVelocity;
  3000. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  3001. this.rigy.linearVelocity = { x: 0, y: 0 };
  3002. return true;
  3003. }
  3004. return false;
  3005. }
  3006. reset() {
  3007. }
  3008. destroySelf() {
  3009. this.d3BallSrc.destroySelf();
  3010. if (!this.ui.isDisposed) {
  3011. this.ui.removeFromParent();
  3012. this.ui.dispose();
  3013. this.ui = null;
  3014. }
  3015. this.outColli = null;
  3016. this.innerColli = null;
  3017. this.rigy = null;
  3018. this.d3Ball = null;
  3019. this.d3BallSrc = null;
  3020. this.angleV2 = null;
  3021. this.gameObj.destroy(true);
  3022. this.destroy();
  3023. }
  3024. judgeBorder() {
  3025. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3026. return;
  3027. }
  3028. if (this.destroyed)
  3029. return;
  3030. if (xGame.common.gameMode == GameMode.classic)
  3031. return;
  3032. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3033. if (isOver) {
  3034. this.checkWrongBall();
  3035. }
  3036. }
  3037. onClick(e, force = false) {
  3038. if (this.number == 0)
  3039. return;
  3040. if (force) {
  3041. }
  3042. else {
  3043. if (xGame.common.d2World.openCheckStill)
  3044. return;
  3045. if (!xGame.common.gameMgr.selfTurn) {
  3046. return;
  3047. }
  3048. }
  3049. if (!xGame.common.gameMgr.finishOneShoot)
  3050. return;
  3051. let root = xGame.common.d2World.rootBall.gameObj;
  3052. let x = this.gameObj.x - root.x;
  3053. let y = this.gameObj.y - root.y;
  3054. let angle = xGame.common.getfguiRotation(x, y);
  3055. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3056. xGame.common.d2World.getHelpLine();
  3057. xGame.common.clickedBall = true;
  3058. this.checkGuide();
  3059. }
  3060. checkGuide() {
  3061. let guide = DataMgr.getSkillGuide();
  3062. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3063. xGame.common.guideStep++;
  3064. xGame.common.gameUI.ui.guide1.visible = false;
  3065. xGame.common.gameUI.ui.guide2.visible = true;
  3066. }
  3067. }
  3068. checkDistance(disX, disY, angle) {
  3069. let diameter = this.gameObj.width - 1;
  3070. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3071. if (!this.lastDis)
  3072. this.lastDis = dis;
  3073. else {
  3074. if (dis > this.lastDis) {
  3075. this.helpOut.type = "remove";
  3076. return this.helpOut;
  3077. }
  3078. }
  3079. if (dis <= Math.pow(diameter, 2)) {
  3080. let del = 0.01;
  3081. let offest = 0;
  3082. let realX = disX - this.gameObj.x;
  3083. let realY = disY - this.gameObj.y;
  3084. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3085. offest += del;
  3086. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3087. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3088. }
  3089. this.helpOut.type = "ok";
  3090. this.helpOut.x = realX + this.gameObj.x;
  3091. this.helpOut.y = realY + this.gameObj.y;
  3092. return this.helpOut;
  3093. }
  3094. else {
  3095. this.helpOut.type = "no";
  3096. return this.helpOut;
  3097. }
  3098. }
  3099. clearBallEft() {
  3100. this.clearBallRightEft();
  3101. this.clearBallWrongEft();
  3102. }
  3103. clearBallRightEft() {
  3104. this.ui.breathAni.stop();
  3105. this.ui.rightTips.visible = false;
  3106. }
  3107. clearBallWrongEft() {
  3108. this.ui.wrongTips.visible = false;
  3109. }
  3110. showWrongEft() {
  3111. if (!xGame.common.gameMgr.selfTurn)
  3112. return;
  3113. this.ui.wrongTips.visible = true;
  3114. }
  3115. showRightEft() {
  3116. if (!xGame.common.gameMgr.selfTurn)
  3117. return;
  3118. this.ui.rightTips.visible = true;
  3119. this.ui.rightTips.scaleX = 1;
  3120. this.ui.rightTips.scaleY = 1;
  3121. this.ui.breathAni.play();
  3122. }
  3123. setBallFunc(type, owner) {
  3124. if (type == "ice") {
  3125. this.ballFunc = type;
  3126. this.d3BallSrc.setAlbedoTexture(true);
  3127. this.rigy.type = "static";
  3128. this.iceOwner = owner;
  3129. }
  3130. else {
  3131. if (owner == this.iceOwner) {
  3132. this.ballFunc = type;
  3133. this.d3BallSrc.setAlbedoTexture(false);
  3134. this.rigy.type = "dynamic";
  3135. }
  3136. }
  3137. }
  3138. }
  3139. D2BallSrc._unid = 0;
  3140. class D2RootBallSrc extends D2BallSrc {
  3141. constructor() {
  3142. super();
  3143. this.maxSpeed = 0;
  3144. this.classicMaxSpeed = 2.2;
  3145. this.bigSkillMaxSpeed = 4;
  3146. this.angle = 0;
  3147. this.allPercent = 0;
  3148. this.linearPercent = 0;
  3149. this.anglePercent = 0;
  3150. this.maxAngleRate = 0.6;
  3151. this.baseRot = 7;
  3152. this.angleMax = 0;
  3153. this.speed = new Laya.Vector2();
  3154. this.rotSpeed = new Laya.Vector2();
  3155. }
  3156. isStill() {
  3157. let speed = this.rigy.linearVelocity;
  3158. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3159. if (this.anglePercent <= 0.1) {
  3160. this.rigy.linearVelocity = { x: 0, y: 0 };
  3161. return true;
  3162. }
  3163. }
  3164. return false;
  3165. }
  3166. reset() {
  3167. this.linearPercent = 0;
  3168. this.anglePercent = 0;
  3169. }
  3170. setSpeed(percent, angle) {
  3171. this.allPercent = percent;
  3172. this.angle = angle;
  3173. this.setAngleSpeed();
  3174. this.setLinearSpeed();
  3175. let hit = "hit";
  3176. if (percent < 25)
  3177. hit = "hit03";
  3178. else if (percent < 50)
  3179. hit = "hit02";
  3180. else if (percent < 75)
  3181. hit = "hit01";
  3182. xGame.soundMgr.playSound(hit);
  3183. }
  3184. setAngleSpeed() {
  3185. let offest = xGame.common.rodOffest;
  3186. let radius = 82;
  3187. let rate = Math.abs(offest.y / radius) * 0.5;
  3188. if (offest.y > 0)
  3189. this.angleMax = -this.baseRot * 2;
  3190. else
  3191. this.angleMax = this.baseRot;
  3192. this.rotY = -offest.x / radius * 100;
  3193. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3194. this.linearPercent = this.allPercent - this.anglePercent;
  3195. }
  3196. setLinearSpeed() {
  3197. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3198. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3199. if (!xGame.common.longHelpLine) {
  3200. let offset = -150 + xGame.common.randomNum(0, 300);
  3201. offset /= 100;
  3202. this.angle += offset;
  3203. }
  3204. }
  3205. }
  3206. let sin = Math.sin(this.angle * Math.PI / 180);
  3207. let cos = Math.cos(this.angle * Math.PI / 180);
  3208. switch (xGame.common.gameMode) {
  3209. case GameMode.classic:
  3210. this.maxSpeed = this.classicMaxSpeed;
  3211. break;
  3212. case GameMode.bigMove:
  3213. this.maxSpeed = this.bigSkillMaxSpeed;
  3214. break;
  3215. case GameMode.placeBall:
  3216. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3217. if (data.type == 1) {
  3218. this.maxSpeed = this.bigSkillMaxSpeed;
  3219. }
  3220. else {
  3221. this.maxSpeed = this.classicMaxSpeed;
  3222. }
  3223. break;
  3224. default:
  3225. break;
  3226. }
  3227. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3228. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3229. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3230. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3231. this.rigy.applyLinearImpulseToCenter(this.speed);
  3232. }
  3233. onUpdate() {
  3234. if (this.anglePercent > 0.1) {
  3235. this.anglePercent *= 0.97;
  3236. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3237. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3238. this.rigy.applyForceToCenter(this.rotSpeed);
  3239. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3240. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3241. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3242. if (num > 0.9)
  3243. this.canRot = true;
  3244. }
  3245. else
  3246. this.canRot = true;
  3247. if (Math.abs(this.rotY) > 0.1)
  3248. this.rotY *= 0.98;
  3249. super.onUpdate();
  3250. }
  3251. destroySelf() {
  3252. super.destroySelf();
  3253. this.speed = null;
  3254. }
  3255. }
  3256. class D2Ball extends Laya.Sprite {
  3257. constructor(isRootBall = false) {
  3258. super();
  3259. this.ui = ui_D2Ball.createInstance();
  3260. this.pivotX = this.ui.width / 2;
  3261. this.pivotY = this.ui.width / 2;
  3262. this.x = 0;
  3263. this.y = 0;
  3264. this.addChild(this.ui.displayObject);
  3265. this.ui.displayObject.x += this.ui.width / 2;
  3266. this.ui.displayObject.y += this.ui.width / 2;
  3267. if (isRootBall) {
  3268. this.d2Src = this.addComponent(D2RootBallSrc);
  3269. }
  3270. else {
  3271. this.d2Src = this.addComponent(D2BallSrc);
  3272. }
  3273. this.d2Src.ui = this.ui;
  3274. this.addCircleCollider();
  3275. this.addInnerCircleCollider();
  3276. this.addRigyBody();
  3277. }
  3278. addCircleCollider() {
  3279. let colli = xGame.common.getCollider("circle");
  3280. colli.radius = this.ui.width / 2;
  3281. this.addComponentIntance(colli);
  3282. this.d2Src.outColli = colli;
  3283. colli.label = "ball";
  3284. }
  3285. addInnerCircleCollider() {
  3286. let colli = xGame.common.getCollider("circle");
  3287. colli.radius = this.ui.inner.width / 2;
  3288. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3289. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3290. this.addComponentIntance(colli);
  3291. this.d2Src.innerColli = colli;
  3292. colli.label = "inner";
  3293. }
  3294. addRigyBody() {
  3295. let rigy = xGame.common.getRigbody();
  3296. rigy.type = "dynamic";
  3297. this.addComponentIntance(rigy);
  3298. this.d2Src.rigy = rigy;
  3299. }
  3300. disposeSelf() {
  3301. if (!this.ui.isDisposed) {
  3302. this.ui.dispose();
  3303. this.ui.removeFromParent();
  3304. this.ui = null;
  3305. }
  3306. }
  3307. }
  3308. class ui_D2Gan extends fgui.GComponent {
  3309. static createInstance() {
  3310. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3311. }
  3312. onConstruct() {
  3313. this.myIcon = (this.getChild("myIcon"));
  3314. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3315. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3316. this.self = (this.getChild("self"));
  3317. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3318. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3319. this.ai = (this.getChild("ai"));
  3320. }
  3321. }
  3322. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3323. class D2Gan {
  3324. constructor() {
  3325. this.offset = 0.15;
  3326. this.cell = 1.5;
  3327. this.onBallCell = 0.4;
  3328. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3329. this.moveNum = 70;
  3330. this.rulerRate = 0.1;
  3331. this.ui = ui_D2Gan.createInstance();
  3332. this.changeSelfRod();
  3333. this.changeAIRod();
  3334. }
  3335. changeSelfRod() {
  3336. let index = DataMgr.getCurBallRod();
  3337. let data = cfgTable.ballrodData[index + 1];
  3338. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3339. this.selfMySpine && this.selfMySpine.dispose();
  3340. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3341. if (data.spine) {
  3342. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3343. this.selfMySpine = new SpineMgr(data.spine, () => {
  3344. let xx = this.ui.selfEftRoot.width / 2;
  3345. let yy = this.ui.selfEftRoot.height / 2;
  3346. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3347. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3348. outSpine.rotation = -90;
  3349. });
  3350. }
  3351. }
  3352. changeAIRod() {
  3353. let length = Object.keys(cfgTable.ballrodData).length;
  3354. let rand = Math.floor(length * Math.random()) + 1;
  3355. let data = cfgTable.ballrodData[rand];
  3356. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3357. this.aiMySpine && this.aiMySpine.dispose();
  3358. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3359. if (data.spine) {
  3360. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3361. this.aiMySpine = new SpineMgr(data.spine, () => {
  3362. let xx = this.ui.aiEftRoot.width / 2;
  3363. let yy = this.ui.aiEftRoot.height / 2;
  3364. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3365. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3366. outSpine.rotation = -90;
  3367. });
  3368. }
  3369. }
  3370. setGanLastInfo() {
  3371. this.lastInfo.rotation = this.ui.rotation;
  3372. this.lastInfo.x = this.ui.x;
  3373. this.lastInfo.y = this.ui.y;
  3374. }
  3375. rotateSelf(flag, isRuler = false) {
  3376. let angle;
  3377. flag = flag * this.offset;
  3378. if (xGame.common.d2World.isHelpLineOnBall) {
  3379. angle = flag * this.onBallCell;
  3380. }
  3381. else {
  3382. angle = flag * this.cell;
  3383. }
  3384. if (isRuler) {
  3385. angle *= this.rulerRate;
  3386. }
  3387. this.ui.rotation += angle;
  3388. xGame.common.d2World.getHelpLine();
  3389. }
  3390. checkDistance() {
  3391. let target = xGame.common.d2World.targetBall;
  3392. let root = xGame.common.d2World.rootBall;
  3393. if (target == null) {
  3394. return 1;
  3395. }
  3396. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3397. if (dis <= 2500) {
  3398. return 5;
  3399. }
  3400. return 1;
  3401. }
  3402. rotDest(rot) {
  3403. this.ui.rotation = rot;
  3404. xGame.common.d2World.getHelpLine();
  3405. }
  3406. storagePower(powerNum) {
  3407. let pos = (powerNum / 100) * this.moveNum;
  3408. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3409. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3410. this.ui.x = this.lastInfo.x + xx;
  3411. this.ui.y = this.lastInfo.y + yy;
  3412. }
  3413. shoot() {
  3414. this.storagePower(0);
  3415. this.ui.visible = false;
  3416. }
  3417. destroySelf() {
  3418. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3419. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3420. this.selfMySpine && this.selfMySpine.dispose();
  3421. this.aiMySpine && this.aiMySpine.dispose();
  3422. this.lastInfo = null;
  3423. if (!this.ui.isDisposed) {
  3424. this.ui.removeFromParent();
  3425. this.ui.dispose();
  3426. }
  3427. }
  3428. }
  3429. class ui_HelpLine extends fgui.GComponent {
  3430. static createInstance() {
  3431. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3432. }
  3433. onConstruct() {
  3434. this.n10 = (this.getChild("n10"));
  3435. this.rect = (this.getChild("rect"));
  3436. this.dir11 = (this.getChild("dir11"));
  3437. this.dir = (this.getChild("dir"));
  3438. this.rootDir = (this.getChild("rootDir"));
  3439. this.dirDot = (this.getChild("dirDot"));
  3440. }
  3441. }
  3442. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3443. class D2HelpLine {
  3444. constructor() {
  3445. this.starX = 0;
  3446. this.starY = 0;
  3447. this.ui = ui_HelpLine.createInstance();
  3448. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3449. this.starX = this.ui.rect.x;
  3450. this.starY = this.ui.rect.y;
  3451. }
  3452. shoot() {
  3453. this.ui.visible = false;
  3454. }
  3455. destroySelf() {
  3456. if (this.ui.isDisposed) {
  3457. this.ui.removeFromParent();
  3458. this.ui.dispose();
  3459. }
  3460. }
  3461. }
  3462. class D2World extends Laya.Script {
  3463. constructor() {
  3464. super();
  3465. this.ballArr = [];
  3466. this.openCheckStill = false;
  3467. this.checkArr = [];
  3468. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3469. this.isHelpLineOnBall = false;
  3470. this.isOnSameLine = false;
  3471. this.reflectAngle = 0;
  3472. this.powerPercent = 0;
  3473. this.inHolesSpeed = [];
  3474. this.outDir = new Laya.Vector2();
  3475. this.rootDir = new Laya.Vector2();
  3476. this.aiLv = 0;
  3477. this.rootPos = new Laya.Vector2();
  3478. this.tempDir1 = new Laya.Vector2();
  3479. this.tempDir2 = new Laya.Vector2();
  3480. this.tempDir3 = new Laya.Vector2();
  3481. this.ballSize = 33;
  3482. this.destRot = 0;
  3483. }
  3484. initSelf() {
  3485. this.createBalls();
  3486. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3487. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3488. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3489. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3490. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3491. }
  3492. setBorderRect() {
  3493. let ui = xGame.common.gameUI.ui;
  3494. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3495. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3496. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3497. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3498. this.borderRect.x = starX;
  3499. this.borderRect.y = starY;
  3500. this.borderRect.width = width;
  3501. this.borderRect.height = height;
  3502. }
  3503. resetGame() {
  3504. this.openCheckStill = false;
  3505. let temp;
  3506. for (let index = 0; index < this.ballArr.length; index++) {
  3507. temp = this.ballArr[index];
  3508. temp.destroySelf();
  3509. }
  3510. xGame.common.d3World.ballRoot.destroyChildren();
  3511. xGame.common.gameUI.ui.ballNode.removeChildren();
  3512. console.log("进入摧毁逻辑");
  3513. this.d2Gan.destroySelf();
  3514. this.d2HelpLine.destroySelf();
  3515. this.ballArr = [];
  3516. }
  3517. setD2Gan() {
  3518. let ballNode = this.rootBall.ui;
  3519. let d2Gan = new D2Gan();
  3520. this.d2Gan = d2Gan;
  3521. let ganNode = d2Gan.ui;
  3522. ballNode.addChild(ganNode);
  3523. ganNode.pivotX = ganNode.pivotX;
  3524. ganNode.pivotY = ganNode.pivotY;
  3525. ganNode.x = ganNode.myIcon.width / 2;
  3526. ganNode.y = this.rootBall.gameObj.width;
  3527. d2Gan.setGanLastInfo();
  3528. }
  3529. setHelpLine() {
  3530. let d2Help = new D2HelpLine();
  3531. this.d2HelpLine = d2Help;
  3532. }
  3533. createBalls() {
  3534. let cfg;
  3535. switch (xGame.common.gameMode) {
  3536. case GameMode.classic:
  3537. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3538. break;
  3539. case GameMode.bigMove:
  3540. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3541. break;
  3542. case GameMode.placeBall:
  3543. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3544. break;
  3545. default:
  3546. break;
  3547. }
  3548. cfg = JSON.parse(JSON.stringify(cfg));
  3549. for (const key in cfg) {
  3550. if (cfg[key].value == 0) {
  3551. this.createRootBall(cfg[key]);
  3552. delete cfg[key];
  3553. break;
  3554. }
  3555. }
  3556. this.createOtherBalls(cfg);
  3557. }
  3558. createRootBall(data) {
  3559. let root = new D2Ball(true);
  3560. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3561. this.rootBall = root.d2Src;
  3562. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3563. let d3BallSrc = d3Ball.getComponent(Ball);
  3564. xGame.common.d3World.rootBall = d3Ball;
  3565. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3566. let xx = data.x;
  3567. let yy = data.y;
  3568. let numer = data.value;
  3569. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3570. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3571. this.ballArr.push(this.rootBall);
  3572. this.setD2Gan();
  3573. this.setHelpLine();
  3574. }
  3575. createOtherBalls(cfg) {
  3576. let temp;
  3577. let src;
  3578. let data;
  3579. for (const key in cfg) {
  3580. data = cfg[key];
  3581. temp = new D2Ball();
  3582. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3583. src = temp.d2Src;
  3584. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3585. src.initSelf(data.value, data.x, data.y, d3Ball);
  3586. this.ballArr.push(src);
  3587. }
  3588. }
  3589. shoot(percent) {
  3590. this.powerPercent = percent;
  3591. this.openCheckStill = true;
  3592. let d2Angle = this.d2Gan.ui.rotation;
  3593. this.rootBall.setSpeed(percent, d2Angle);
  3594. this.clearBallAllEft();
  3595. this.changePlayerView();
  3596. }
  3597. onUpdate() {
  3598. if (!this.openCheckStill)
  3599. return;
  3600. this.checkStill();
  3601. }
  3602. checkStill() {
  3603. for (let index = 0; index < this.ballArr.length; index++) {
  3604. if (!this.ballArr[index].isStill()) {
  3605. return;
  3606. }
  3607. }
  3608. xGame.eventMgr.event(ALL_BALL_STOP);
  3609. }
  3610. allBallStop() {
  3611. this.openCheckStill = false;
  3612. xGame.common.recoverCameraView();
  3613. }
  3614. waitShoot() {
  3615. if (!this.d2Gan.ui.isDisposed) {
  3616. this.d2Gan.ui.visible = true;
  3617. }
  3618. if (!this.d2HelpLine.ui.isDisposed) {
  3619. this.d2HelpLine.ui.visible = true;
  3620. }
  3621. this.clearBallAllEft();
  3622. this.showBallRightEft();
  3623. this.getHelpLine();
  3624. this.inHolesSpeed = [];
  3625. this.selectOneBall();
  3626. }
  3627. _getAllBallArr() {
  3628. let arr = this.ballArr;
  3629. let outArr = [];
  3630. for (let index = 0; index < arr.length; index++) {
  3631. if (arr[index] instanceof D2RootBallSrc)
  3632. continue;
  3633. if (arr[index].ballFunc == "ice")
  3634. continue;
  3635. if (arr[index].destroyed)
  3636. continue;
  3637. outArr.push(arr[index]);
  3638. }
  3639. return outArr;
  3640. }
  3641. _getBlackObj() {
  3642. let arr = this.ballArr;
  3643. for (let index = 0; index < arr.length; index++) {
  3644. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3645. return arr[index];
  3646. }
  3647. }
  3648. }
  3649. selectOneBall() {
  3650. let all = this._getAllBallArr();
  3651. let target;
  3652. switch (xGame.common.gameMode) {
  3653. case GameMode.classic:
  3654. if (xGame.common.gameMgr.selfTurn) {
  3655. let self = xGame.common.gameMgr.selfBallArr;
  3656. let black = this._getBlackObj();
  3657. if (xGame.common.gameMgr.ensureBallType) {
  3658. if (self.length > 0) {
  3659. let out = [];
  3660. for (let j = 0; j < all.length; j++) {
  3661. if (self.indexOf(all[j].number) > -1) {
  3662. out.push(all[j]);
  3663. }
  3664. }
  3665. target = this.selectBestEnterOne(out);
  3666. }
  3667. else {
  3668. target = this.selectBestEnterOne([black]);
  3669. }
  3670. }
  3671. else {
  3672. target = this.selectBestEnterOne(all);
  3673. }
  3674. }
  3675. else {
  3676. target = this.selectBestEnterOne(all);
  3677. }
  3678. break;
  3679. case GameMode.bigMove:
  3680. target = this.selectBestEnterOne(all);
  3681. break;
  3682. case GameMode.placeBall:
  3683. if (all.length > 0) {
  3684. target = this.selectBestEnterOne(all);
  3685. }
  3686. break;
  3687. default:
  3688. break;
  3689. }
  3690. if (target && !target.destroyed && target.onClick) {
  3691. target.onClick(0, true);
  3692. let num = -200 + xGame.common.randomNum(0, 400);
  3693. num /= 150;
  3694. if (xGame.common.longHelpLine) {
  3695. num = 0;
  3696. }
  3697. this.destRot += num;
  3698. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3699. }
  3700. }
  3701. removeOneBall(ball) {
  3702. for (let index = 0; index < this.ballArr.length; index++) {
  3703. if (this.ballArr[index].id == ball.id) {
  3704. this.ballArr.splice(index, 1);
  3705. break;
  3706. }
  3707. }
  3708. }
  3709. getHelpLine() {
  3710. this.d2HelpLine.ui.dirDot.visible = false;
  3711. this.isOnSameLine = false;
  3712. let startX = this.rootBall.gameObj.x;
  3713. let startY = this.rootBall.gameObj.y;
  3714. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3715. if (dis == null) {
  3716. this.d2HelpLine.ui.visible = false;
  3717. console.error("辅助线异常");
  3718. return;
  3719. }
  3720. this.d2HelpLine.ui.visible = true;
  3721. let angle = this.d2Gan.ui.rotation;
  3722. let radius = 16.5;
  3723. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3724. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3725. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3726. if (colliObj == null) {
  3727. this.getColliPos(disX, disY, radius, angle);
  3728. xGame.common.d2World.isHelpLineOnBall = false;
  3729. this.targetBall = null;
  3730. this.reflectAngle = 0;
  3731. this.showBallWrongEft();
  3732. }
  3733. else {
  3734. let target = colliObj.src;
  3735. let radius = 16.5;
  3736. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3737. dis1 = Math.sqrt(dis1);
  3738. let realDis = colliObj.disHon - dis1;
  3739. let dir = colliObj.dir;
  3740. let xx = startX + dir.x * realDis;
  3741. let yy = startY + dir.y * realDis;
  3742. this.getColliPos(xx, yy, radius, angle);
  3743. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3744. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3745. let offset = xGame.common.rodOffest;
  3746. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3747. this.isOnSameLine = true;
  3748. }
  3749. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3750. xGame.common.d2World.isHelpLineOnBall = true;
  3751. this.targetBall = target;
  3752. this.reflectAngle = reflectAngle;
  3753. this.showBallWrongEft();
  3754. if (xGame.common.longHelpLine) {
  3755. this.delayReflectLine(target, reflectAngle);
  3756. }
  3757. }
  3758. }
  3759. getBorderDot(startX, startY, angle) {
  3760. let radius = 17;
  3761. let distance;
  3762. let isDone;
  3763. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3764. isDone = this.judgeUpDown(distance, angle, startX);
  3765. if (isDone != null) {
  3766. return isDone;
  3767. }
  3768. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3769. isDone = this.judgeUpDown(distance, angle, startX);
  3770. if (isDone != null) {
  3771. return isDone;
  3772. }
  3773. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3774. isDone = this.judgeLeftRight(distance, angle, startY);
  3775. if (isDone != null) {
  3776. return isDone;
  3777. }
  3778. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3779. isDone = this.judgeLeftRight(distance, angle, startY);
  3780. if (isDone != null) {
  3781. return isDone;
  3782. }
  3783. }
  3784. judgeUpDown(distance, angle, startX) {
  3785. let flag = Math.sin(angle * Math.PI / 180);
  3786. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3787. if (distance >= 0) {
  3788. if (flag > 0) {
  3789. if (temp < this.borderRect.x + this.borderRect.width) {
  3790. return distance;
  3791. }
  3792. }
  3793. else {
  3794. if (temp > this.borderRect.x) {
  3795. return distance;
  3796. }
  3797. }
  3798. }
  3799. }
  3800. judgeLeftRight(distance, angle, starY) {
  3801. let flag = -Math.cos(angle * Math.PI / 180);
  3802. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3803. if (distance >= 0) {
  3804. if (flag > 0) {
  3805. if (temp < this.borderRect.y + this.borderRect.height) {
  3806. return distance;
  3807. }
  3808. }
  3809. else {
  3810. if (temp > this.borderRect.y) {
  3811. return distance;
  3812. }
  3813. }
  3814. }
  3815. }
  3816. clearBallAllEft() {
  3817. let temp;
  3818. for (let index = 0; index < this.ballArr.length; index++) {
  3819. temp = this.ballArr[index];
  3820. temp.clearBallEft();
  3821. }
  3822. }
  3823. showBallRightEft() {
  3824. let gameMgr = xGame.common.gameMgr;
  3825. let temp;
  3826. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3827. if (targetArr.length <= 0)
  3828. return;
  3829. for (let index = 0; index < this.ballArr.length; index++) {
  3830. temp = this.ballArr[index];
  3831. if (targetArr.indexOf(temp.number) > -1) {
  3832. temp.showRightEft();
  3833. }
  3834. }
  3835. }
  3836. showBallWrongEft() {
  3837. let gameMgr = xGame.common.gameMgr;
  3838. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3839. if (targetArr.length <= 0)
  3840. return;
  3841. let temp;
  3842. for (let index = 0; index < this.ballArr.length; index++) {
  3843. temp = this.ballArr[index];
  3844. if (this.targetBall && this.targetBall.number == temp.number) {
  3845. if (targetArr.indexOf(temp.number) <= -1) {
  3846. temp.showWrongEft();
  3847. }
  3848. else {
  3849. temp.clearBallWrongEft();
  3850. }
  3851. }
  3852. else {
  3853. temp.clearBallWrongEft();
  3854. }
  3855. }
  3856. }
  3857. getColliPos(x, y, radius, angle) {
  3858. this.d2HelpLine.ui.x = x;
  3859. this.d2HelpLine.ui.y = y;
  3860. let dirX = x - this.rootBall.gameObj.x;
  3861. let dirY = y - this.rootBall.gameObj.y;
  3862. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3863. if (rectH <= 0)
  3864. rectH = 0;
  3865. this.d2HelpLine.ui.rect.height = 0;
  3866. this.d2HelpLine.ui.rect.height = rectH;
  3867. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3868. if (rectH < this.rootBall.gameObj.width) {
  3869. this.d2HelpLine.ui.rect.visible = false;
  3870. }
  3871. else {
  3872. this.d2HelpLine.ui.rect.visible = true;
  3873. }
  3874. this.d2HelpLine.ui.dir.visible = false;
  3875. this.d2HelpLine.ui.rootDir.visible = false;
  3876. }
  3877. getReflectLine(x, y, radius, target) {
  3878. this.d2HelpLine.ui.dir.visible = true;
  3879. let dirX = target.x - x;
  3880. let dirY = target.y - y;
  3881. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3882. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3883. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3884. this.d2HelpLine.ui.dir.height = 48;
  3885. this.d2HelpLine.ui.dir.rotation = angle;
  3886. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3887. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3888. return angle;
  3889. }
  3890. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3891. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3892. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3893. let targetX = target.gameObj.x;
  3894. let targetY = target.gameObj.y;
  3895. this.outDir.setValue(targetX - xx, targetY - yy);
  3896. this.rootDir.setValue(rtX - xx, rtY - yy);
  3897. let ver = Math.PI / 2;
  3898. let sin = Math.sin(ver);
  3899. let cos = Math.cos(ver);
  3900. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3901. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3902. this.outDir.setValue(outX, outY);
  3903. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3904. Laya.Vector2.normalize(this.outDir, this.outDir);
  3905. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3906. if (Math.abs(result) <= 0.08) {
  3907. this.d2HelpLine.ui.rootDir.visible = false;
  3908. return;
  3909. }
  3910. if (result > 0) {
  3911. angle += 90;
  3912. }
  3913. else if (result < 0) {
  3914. angle -= 90;
  3915. }
  3916. this.d2HelpLine.ui.rootDir.visible = true;
  3917. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3918. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3919. this.d2HelpLine.ui.rootDir.rotation = angle;
  3920. }
  3921. delayReflectLine(obj, angle) {
  3922. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3923. return;
  3924. }
  3925. this.isOnSameLine = false;
  3926. let startX = obj.gameObj.x;
  3927. let startY = obj.gameObj.y;
  3928. let dis = this.getBorderDot(startX, startY, angle);
  3929. if (dis == null) {
  3930. this.d2HelpLine.ui.dirDot.visible = false;
  3931. return;
  3932. }
  3933. this.d2HelpLine.ui.visible = true;
  3934. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3935. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3936. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3937. if (colliObj == null) {
  3938. this.setDelayLine(disX, disY, obj, angle);
  3939. }
  3940. else {
  3941. let radius = 16;
  3942. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3943. dis1 = Math.sqrt(dis1);
  3944. let realDis = colliObj.disHon - dis1;
  3945. let dir = colliObj.dir;
  3946. let xx = startX + dir.x * realDis;
  3947. let yy = startY + dir.y * realDis;
  3948. this.setDelayLine(xx, yy, obj, angle);
  3949. }
  3950. }
  3951. setDelayLine(x, y, obj, angle) {
  3952. let dirX = x - obj.gameObj.x;
  3953. let dirY = y - obj.gameObj.y;
  3954. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3955. if (rectH <= 0)
  3956. rectH = 0;
  3957. this.d2HelpLine.ui.dir.height = rectH;
  3958. this.d2HelpLine.ui.dirDot.visible = true;
  3959. this.d2HelpLine.ui.dirDot.x = 17;
  3960. this.d2HelpLine.ui.dirDot.y = 17;
  3961. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3962. ;
  3963. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3964. }
  3965. changePlayerView() {
  3966. if (Math.random() >= 0.7)
  3967. return;
  3968. if (!this.targetBall) {
  3969. return;
  3970. }
  3971. if (!xGame.common.gameMgr.selfTurn)
  3972. return;
  3973. switch (xGame.common.gameMode) {
  3974. case GameMode.classic:
  3975. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3976. if (this.targetBall.number != 8) {
  3977. return;
  3978. }
  3979. }
  3980. break;
  3981. case GameMode.bigMove:
  3982. return;
  3983. case GameMode.placeBall:
  3984. break;
  3985. default:
  3986. break;
  3987. }
  3988. let startX = this.targetBall.gameObj.x;
  3989. let startY = this.targetBall.gameObj.y;
  3990. let angle = this.reflectAngle;
  3991. let dis = this.getBorderDot(startX, startY, angle);
  3992. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3993. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3994. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3995. if (colliObj) {
  3996. return;
  3997. }
  3998. let offset = 40;
  3999. let posObj = xGame.common.gameMgr.posObj;
  4000. let temp;
  4001. let radius;
  4002. let tarX, tarY;
  4003. for (const key in posObj) {
  4004. temp = posObj[key];
  4005. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4006. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4007. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4008. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4009. xGame.common.showOneCamera("angle" + key);
  4010. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4011. Laya.physicsTimer.scale = 0.7;
  4012. break;
  4013. }
  4014. }
  4015. }
  4016. selectBestEnterOne(arr) {
  4017. this.aiLv = xGame.tools.random(1, 11);
  4018. this.aiLv = 10;
  4019. this.wBall = xGame.common.d2World.rootBall;
  4020. this.rootPos.x = this.wBall.gameObj.x;
  4021. this.rootPos.y = this.wBall.gameObj.y;
  4022. this.initHoleBall(arr);
  4023. return this.selectBall();
  4024. }
  4025. selectBall() {
  4026. let ball = null;
  4027. this.destRot = 0;
  4028. let ai = 110 - this.aiLv * 10;
  4029. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4030. let score = false;
  4031. if (this.scoreBall.length < 1) {
  4032. if (this.lineBall.length < 1) {
  4033. for (let i = 0; i < this.kickBall.length; i++) {
  4034. let list = [];
  4035. let bo = this.kickBall[i];
  4036. let bobj = bo.gameObj;
  4037. let rect = xGame.common.d2World.borderRect;
  4038. let mobj = this.wBall.gameObj;
  4039. let minb = bobj.y - rect.y - 20;
  4040. let minw = mobj.y - rect.y - 50;
  4041. if (minb > 0 && minw > 0) {
  4042. let dlenx = 0;
  4043. let dleny = mobj.y - rect.y;
  4044. let spx = mobj.x;
  4045. let spy = rect.y - dleny;
  4046. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4047. }
  4048. minb = rect.y + rect.height - bobj.y - 20;
  4049. minw = rect.y + rect.height - mobj.y - 50;
  4050. if (minb > 0 && minw > 0) {
  4051. let dlenx = 0;
  4052. let dleny = rect.y + rect.height - mobj.y;
  4053. let spx = mobj.x;
  4054. let spy = rect.y + rect.height + dleny;
  4055. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4056. }
  4057. minb = bobj.x - rect.x - 20;
  4058. minw = mobj.x - rect.x - 50;
  4059. if (minb > 0 && minw > 0) {
  4060. let dlenx = mobj.x - rect.x;
  4061. let dleny = 0;
  4062. let spx = rect.x - dlenx;
  4063. let spy = mobj.y;
  4064. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4065. }
  4066. minb = rect.x + rect.width - bobj.x - 20;
  4067. minw = rect.x + rect.width - mobj.x - 50;
  4068. if (minb > 0 && minw > 0) {
  4069. let dlenx = rect.x + rect.width - mobj.x;
  4070. let dleny = 0;
  4071. let spx = rect.x + rect.width + dlenx;
  4072. let spy = mobj.y;
  4073. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4074. }
  4075. list.sort(function (a, b) {
  4076. return a.order - b.order;
  4077. });
  4078. for (let i = 0; i < list.length; i++) {
  4079. let data = list[i];
  4080. let mx = mobj.x - bobj.x;
  4081. let my = mobj.y - bobj.y;
  4082. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4083. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4084. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4085. if (num > 1)
  4086. num = 1;
  4087. let cos = Math.acos(num);
  4088. if (cos > 1.57)
  4089. cos = 1.57;
  4090. else if (cos < 0.01)
  4091. cos = 0.01;
  4092. let tan = Math.tan(cos);
  4093. let dx = tan * data.dleny;
  4094. let dy = tan * data.dlenx;
  4095. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4096. if (Math.abs(bx - 667) < 40)
  4097. continue;
  4098. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4099. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4100. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4101. this.forceMax = dis * 0.08;
  4102. this.destRot += mis * 0.1;
  4103. this.setKick(bx, by);
  4104. return true;
  4105. }
  4106. }
  4107. }
  4108. }
  4109. else {
  4110. ball = xGame.common.getRandArrEle(this.lineBall);
  4111. }
  4112. }
  4113. else {
  4114. for (let i = 0; i < this.scoreBall.length; i++) {
  4115. if (i < this.scoreBall.length - 1) {
  4116. let rand = 70 + this.aiLv * 10 + i * 10;
  4117. if (xGame.tools.random(0, 100) < rand) {
  4118. ball = this.scoreBall[i];
  4119. break;
  4120. }
  4121. }
  4122. else {
  4123. ball = this.scoreBall[i];
  4124. break;
  4125. }
  4126. }
  4127. score = true;
  4128. this.selectNum++;
  4129. }
  4130. if (!ball)
  4131. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4132. let dx = ball.gameObj.x;
  4133. let dy = ball.gameObj.y;
  4134. let kickAngle = 0;
  4135. if (score) {
  4136. dx = ball.kickPos.x;
  4137. dy = ball.kickPos.y;
  4138. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4139. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4140. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4141. if (adot > 1)
  4142. adot = 1;
  4143. kickAngle = Math.acos(adot) * 57.3;
  4144. if (kickAngle > 45) {
  4145. let kdx = ball.kickPos.x - ball.gameObj.x;
  4146. let kdy = ball.kickPos.y - ball.gameObj.y;
  4147. dx = ball.kickPos.x - kdx * mis * 0.3;
  4148. dy = ball.kickPos.y - kdy * mis * 0.3;
  4149. }
  4150. else
  4151. this.destRot += mis;
  4152. }
  4153. else if (ball.poleAngle != 0) {
  4154. this.destRot += ball.poleAngle;
  4155. }
  4156. if (xGame.common.gameMode == 0) {
  4157. let af = kickAngle * 0.08;
  4158. this.forceMax = ball.hard * 0.1 + af * af;
  4159. }
  4160. this.setKick(dx, dy);
  4161. return ball;
  4162. }
  4163. initHoleBall(arr) {
  4164. this.kickBall = [];
  4165. this.lineBall = [];
  4166. this.scoreBall = [];
  4167. this.holeBall = [];
  4168. this.selectNum = 0;
  4169. this.forceNum = 0;
  4170. this.forceMax = 0;
  4171. this.turnNum = 0;
  4172. let list = arr;
  4173. let holes = xGame.common.gameMgr.holePosList;
  4174. let self = xGame.common.aiPlayer;
  4175. for (let i = 0; i < list.length; i++) {
  4176. let obj = list[i];
  4177. if (!obj)
  4178. continue;
  4179. obj.kickPos.x = 0;
  4180. obj.kickPos.y = 0;
  4181. obj.poleAngle = 0;
  4182. obj.hard = 0;
  4183. obj.borderDis = 0;
  4184. obj.kickAngle = 180;
  4185. let b = obj.gameObj;
  4186. let wbp = this.rootPos;
  4187. let bx = wbp.x - b.x;
  4188. let by = wbp.y - b.y;
  4189. obj.borderDis = xGame.tools.random(0, 100);
  4190. this.kickBall.push(obj);
  4191. if (!this.isLine(wbp, obj))
  4192. continue;
  4193. obj.kickAngle = xGame.tools.random(90, 180);
  4194. obj.kickPos.x = b.x;
  4195. obj.kickPos.y = b.y;
  4196. this.lineBall.push(obj);
  4197. let minDis = 999999;
  4198. let hole = false;
  4199. for (let j = 0; j < holes.length; j++) {
  4200. let hp = holes[j];
  4201. if (bx >= 0 && hp.x > b.x + 100)
  4202. continue;
  4203. if (bx <= 0 && hp.x < b.x - 100)
  4204. continue;
  4205. if (by < -10 && hp.y < wbp.y)
  4206. continue;
  4207. if (by > 10 && hp.y > wbp.y)
  4208. continue;
  4209. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4210. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4211. if (dis < minDis) {
  4212. let dx = b.x - this.tempDir1.x * this.ballSize;
  4213. let dy = b.y - this.tempDir1.y * this.ballSize;
  4214. this.tempDir3.x = this.tempDir1.x;
  4215. this.tempDir3.y = this.tempDir1.y;
  4216. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4217. obj.kickPos.x = dx;
  4218. obj.kickPos.y = dy;
  4219. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4220. if (num > 1)
  4221. num = 1;
  4222. obj.kickAngle = Math.acos(num) * 57.3;
  4223. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4224. dis = dis * 2;
  4225. if (Math.abs(hp.x - 600) < 100)
  4226. dis += 50;
  4227. obj.hard = dis + obj.kickAngle * 3;
  4228. hole = true;
  4229. }
  4230. }
  4231. }
  4232. }
  4233. if (hole) {
  4234. this.scoreBall.push(obj);
  4235. this.holeBall.push(obj);
  4236. }
  4237. }
  4238. this.scoreBall.sort(function (a, b) {
  4239. return a.hard - b.hard;
  4240. });
  4241. this.holeBall.sort(function (a, b) {
  4242. return a.kickAngle - b.kickAngle;
  4243. });
  4244. this.kickBall.sort(function (a, b) {
  4245. return a.borderDis - b.borderDis;
  4246. });
  4247. }
  4248. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4249. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4250. let balls = xGame.common.d2World.ballArr;
  4251. let max = xGame.tools.getDis(hx, hy, bx, by);
  4252. for (let index = 0; index < balls.length; index++) {
  4253. let obj = balls[index];
  4254. if (obj.number == 0)
  4255. continue;
  4256. if (obj.number == bn || obj.number == dn)
  4257. continue;
  4258. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4259. if (dis * dis > max)
  4260. continue;
  4261. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4262. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4263. if (num > 1)
  4264. num = 1;
  4265. if (num < 0)
  4266. continue;
  4267. let gap = Math.sin(Math.acos(num)) * dis;
  4268. if (gap < this.ballSize)
  4269. return true;
  4270. }
  4271. return false;
  4272. }
  4273. isLine(xy, ball) {
  4274. let bx = xy.x;
  4275. let by = xy.y;
  4276. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4277. let dis = ball.getDestDis(xy);
  4278. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4279. let sin = Math.sin(angle);
  4280. let cos = Math.cos(angle);
  4281. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4282. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4283. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4284. let dx = bx + this.tempDir2.x * dis;
  4285. let dy = by + this.tempDir2.y * dis;
  4286. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4287. sin = Math.sin(-angle);
  4288. cos = Math.cos(-angle);
  4289. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4290. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4291. dx = bx + this.tempDir2.x * dis;
  4292. dy = by + this.tempDir2.y * dis;
  4293. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4294. if (isr && isl)
  4295. return false;
  4296. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4297. }
  4298. return true;
  4299. }
  4300. setKick(dx, dy) {
  4301. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4302. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4303. this.tempDir1.x = 0;
  4304. this.tempDir1.y = 1;
  4305. this.tempDir2.y = -this.tempDir2.y;
  4306. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4307. if (num > 1)
  4308. num = 1;
  4309. let rot = Math.acos(num) * 57.3;
  4310. if (this.tempDir2.x < 0)
  4311. rot = 360 - rot;
  4312. this.destRot += rot;
  4313. }
  4314. }
  4315. class ui_UIGame extends fgui.GComponent {
  4316. static createInstance() {
  4317. return (fgui.UIPackage.createObject("game", "UIGame"));
  4318. }
  4319. onConstruct() {
  4320. this.c1 = this.getController("c1");
  4321. this.d3Root = (this.getChild("d3Root"));
  4322. this.clickNode = (this.getChild("clickNode"));
  4323. this.d2Root = (this.getChild("d2Root"));
  4324. this.topNode = (this.getChild("topNode"));
  4325. this.n72 = (this.getChild("n72"));
  4326. this.n40 = (this.getChild("n40"));
  4327. this.rulerNode = (this.getChild("rulerNode"));
  4328. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4329. this.n50 = (this.getChild("n50"));
  4330. this.keduNode = (this.getChild("keduNode"));
  4331. this.powerTxt = (this.getChild("powerTxt"));
  4332. this.powerNode = (this.getChild("powerNode"));
  4333. this.colorNode = (this.getChild("colorNode"));
  4334. this.powerEft = (this.getChild("powerEft"));
  4335. this.myPowerNode = (this.getChild("myPowerNode"));
  4336. this.ganNode = (this.getChild("ganNode"));
  4337. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4338. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4339. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4340. this.skillRod = (this.getChild("skillRod"));
  4341. this.border = (this.getChild("border"));
  4342. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4343. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4344. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4345. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4346. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4347. this.guanyuNode = (this.getChild("guanyuNode"));
  4348. this.helpBtn = (this.getChild("helpBtn"));
  4349. this.wordsBtn = (this.getChild("wordsBtn"));
  4350. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4351. this.returnBtn = (this.getChild("returnBtn"));
  4352. this.ballNode = (this.getChild("ballNode"));
  4353. this.whiteAni = (this.getChild("whiteAni"));
  4354. this.blackAni = (this.getChild("blackAni"));
  4355. this.selfTurn = (this.getChild("selfTurn"));
  4356. this.aiTurn = (this.getChild("aiTurn"));
  4357. this.deskNode = (this.getChild("deskNode"));
  4358. this.moveNode = (this.getChild("moveNode"));
  4359. this.selfTalk = (this.getChild("selfTalk"));
  4360. this.aiTalk = (this.getChild("aiTalk"));
  4361. this.d2Node = (this.getChild("d2Node"));
  4362. this.snowNode = (this.getChild("snowNode"));
  4363. this.guide2 = (this.getChild("guide2"));
  4364. this.guide1 = (this.getChild("guide1"));
  4365. this.guide3 = (this.getChild("guide3"));
  4366. this.guideNode = (this.getChild("guideNode"));
  4367. }
  4368. }
  4369. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4370. class ui_UIGameEnd extends fgui.GComponent {
  4371. static createInstance() {
  4372. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4373. }
  4374. onConstruct() {
  4375. this.c1 = this.getController("c1");
  4376. this.n22 = (this.getChild("n22"));
  4377. this.n2 = (this.getChild("n2"));
  4378. this.n52 = (this.getChild("n52"));
  4379. this.n53 = (this.getChild("n53"));
  4380. this.coinNode = (this.getChild("coinNode"));
  4381. this.closeNode = (this.getChild("closeNode"));
  4382. this.moneyNode = (this.getChild("moneyNode"));
  4383. this.secretary = (this.getChild("secretary"));
  4384. this.n27 = (this.getChild("n27"));
  4385. this.n29 = (this.getChild("n29"));
  4386. this.talkNode = (this.getChild("talkNode"));
  4387. this.n38 = (this.getChild("n38"));
  4388. this.n39 = (this.getChild("n39"));
  4389. this.n40 = (this.getChild("n40"));
  4390. this.awardNode = (this.getChild("awardNode"));
  4391. this.starNumNode = (this.getChild("starNumNode"));
  4392. this.n47 = (this.getChild("n47"));
  4393. this.conditionNode = (this.getChild("conditionNode"));
  4394. this.isGetAward = (this.getChild("isGetAward"));
  4395. this.leftBtn = (this.getChild("leftBtn"));
  4396. this.rightBtn = (this.getChild("rightBtn"));
  4397. this.btnNode = (this.getChild("btnNode"));
  4398. }
  4399. }
  4400. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4401. class ui_UIAddCoin extends fgui.GComponent {
  4402. static createInstance() {
  4403. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4404. }
  4405. onConstruct() {
  4406. this.n11 = (this.getChild("n11"));
  4407. this.myNode = (this.getChild("myNode"));
  4408. this.t0 = this.getTransition("t0");
  4409. }
  4410. }
  4411. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4412. class UIAddCoin extends UIBase {
  4413. constructor() {
  4414. super();
  4415. this.coinNum = 2000;
  4416. }
  4417. onConstructor() {
  4418. this.ui = ui_UIAddCoin.createInstance();
  4419. this.contentPane = this.ui;
  4420. this.isEject = false;
  4421. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4422. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4423. }
  4424. show() {
  4425. super.show();
  4426. this.ui.t0.play();
  4427. }
  4428. videoAddCoin() {
  4429. console.log('zh:qjff_AD_for_UIAddCoin');
  4430. if (Laya.Browser.onAndroid) {
  4431. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4432. if (!boo) {
  4433. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4434. return;
  4435. }
  4436. }
  4437. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4438. }
  4439. else {
  4440. console.log('zh:AD 失败,直接发放奖励');
  4441. this.qjff_AD_for_UIAddCoin();
  4442. }
  4443. }
  4444. qjff_AD_for_UIAddCoin() {
  4445. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4446. this.hide();
  4447. }
  4448. }
  4449. UIAddCoin.uiName = "UIAddCoin";
  4450. class ui_UIInvitation extends fgui.GComponent {
  4451. static createInstance() {
  4452. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4453. }
  4454. onConstruct() {
  4455. this.n14 = (this.getChild("n14"));
  4456. this.myNode = (this.getChild("myNode"));
  4457. this.t0 = this.getTransition("t0");
  4458. }
  4459. }
  4460. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4461. class UIInvitation extends UIBase {
  4462. constructor() {
  4463. super();
  4464. }
  4465. onConstructor() {
  4466. this.ui = ui_UIInvitation.createInstance();
  4467. this.contentPane = this.ui;
  4468. this.isEject = false;
  4469. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4470. }
  4471. show() {
  4472. super.show();
  4473. }
  4474. enterGame() {
  4475. xGame.common.gameMode = GameMode.classic;
  4476. DataMgr.setChallengeTimes(1);
  4477. xGame.common.passAwardCoin = 2000;
  4478. let need = xGame.common.classicNiceNeddCoin;
  4479. if (DataMgr.coinEnough(need)) {
  4480. DataMgr.setCoin(-need);
  4481. xGame.eventMgr.event(RESTART_GAME, true);
  4482. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4483. }
  4484. else {
  4485. xGame.eventMgr.event(RESTART_GAME, true);
  4486. }
  4487. this.hide();
  4488. }
  4489. hide() {
  4490. super.hide();
  4491. }
  4492. }
  4493. UIInvitation.uiName = "UIInvitation";
  4494. class ui_UIMain extends fgui.GComponent {
  4495. static createInstance() {
  4496. return (fgui.UIPackage.createObject("game", "UIMain"));
  4497. }
  4498. onConstruct() {
  4499. this.n47 = (this.getChild("n47"));
  4500. this.n10 = (this.getChild("n10"));
  4501. this.secretary = (this.getChild("secretary"));
  4502. this.shopBtn = (this.getChild("shopBtn"));
  4503. this.moneyNode = (this.getChild("moneyNode"));
  4504. this.headNode = (this.getChild("headNode"));
  4505. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4506. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4507. this.classicBtn = (this.getChild("classicBtn"));
  4508. this.globalBtn = (this.getChild("globalBtn"));
  4509. this.n44 = (this.getChild("n44"));
  4510. this.signBtn = (this.getChild("signBtn"));
  4511. this.drawBtn = (this.getChild("drawBtn"));
  4512. this.settingNode = (this.getChild("settingNode"));
  4513. this.n_fuli = (this.getChild("n_fuli"));
  4514. this.n45 = (this.getChild("n45"));
  4515. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4516. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4517. this.rankBtn = (this.getChild("rankBtn"));
  4518. this.n46 = (this.getChild("n46"));
  4519. this.liucheng1 = (this.getChild("liucheng1"));
  4520. this.rightBtn = (this.getChild("rightBtn"));
  4521. this.n75 = (this.getChild("n75"));
  4522. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4523. this.liucheng2 = (this.getChild("liucheng2"));
  4524. this.guideBtn = (this.getChild("guideBtn"));
  4525. this.n73 = (this.getChild("n73"));
  4526. this.wordsNode = (this.getChild("wordsNode"));
  4527. this.enterGuide = (this.getChild("enterGuide"));
  4528. this.talkNode = (this.getChild("talkNode"));
  4529. this.n83 = (this.getChild("n83"));
  4530. this.n84 = (this.getChild("n84"));
  4531. this.n_Logout = (this.getChild("n_Logout"));
  4532. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4533. this.n_dengLu = (this.getChild("n_dengLu"));
  4534. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4535. }
  4536. }
  4537. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4538. class ui_UIMoyu extends fgui.GComponent {
  4539. static createInstance() {
  4540. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4541. }
  4542. onConstruct() {
  4543. this.ageTip = (this.getChild("ageTip"));
  4544. this.mainBg = (this.getChild("mainBg"));
  4545. this.xyNode = (this.getChild("xyNode"));
  4546. this.rnNode = (this.getChild("rnNode"));
  4547. this.fcmNode = (this.getChild("fcmNode"));
  4548. this.ageNode = (this.getChild("ageNode"));
  4549. this.tipNode = (this.getChild("tipNode"));
  4550. this.msgNode = (this.getChild("msgNode"));
  4551. }
  4552. }
  4553. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4554. class MoyuMgr {
  4555. static initMoyu() {
  4556. this.moyuView = new MoyuView();
  4557. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4558. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4559. this.moyuView.ui.displayObject.zOrder = 1000;
  4560. this.moyuView.init();
  4561. this.moyuView.showTip(true);
  4562. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4563. window['XApk'] = this;
  4564. }
  4565. static showAge(show) {
  4566. if (this.moyuView)
  4567. this.moyuView.showAge(show);
  4568. }
  4569. static onPlatMsg(idx) {
  4570. if (!MoyuMgr.moyuView)
  4571. return;
  4572. if (idx == '0') {
  4573. MoyuMgr.moyuView.showTip(false);
  4574. }
  4575. }
  4576. static showAgree(call) {
  4577. if (this.moyuView)
  4578. this.moyuView.showAgree(call);
  4579. else
  4580. call && call();
  4581. }
  4582. static showXy(type = 1) {
  4583. if (this.moyuView)
  4584. this.moyuView.showXy(type);
  4585. }
  4586. }
  4587. MoyuMgr.isAdvise = false;
  4588. class MoyuView {
  4589. constructor() {
  4590. this.ysxyNum = 1;
  4591. this.ysJson = null;
  4592. this.ui = ui_UIMoyu.createInstance();
  4593. }
  4594. init() {
  4595. this.ui.mainBg.visible = false;
  4596. this.ui.xyNode.visible = false;
  4597. this.ui.ageNode.visible = false;
  4598. this.ui.tipNode.visible = false;
  4599. this.ui.rnNode.visible = false;
  4600. this.ui.fcmNode.visible = false;
  4601. this.ui.ageTip.visible = false;
  4602. this.ui.msgNode.visible = false;
  4603. this.ui.visible = false;
  4604. this.ui.xyNode.xyList.setVirtual();
  4605. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4606. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4607. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4608. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4609. this.ui.xyNode.btnKnown.visible = false;
  4610. this.ui.xyNode.xy1.visible = false;
  4611. this.ui.xyNode.xy2.visible = false;
  4612. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4613. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4614. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4615. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4616. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4617. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4618. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4619. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4620. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4621. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4622. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4623. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4624. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4625. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4626. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4627. this.ysxyNum = 2;
  4628. }
  4629. }
  4630. onClick(obj) {
  4631. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4632. switch (obj) {
  4633. case this.ui.ageTip:
  4634. if (Moyu.isTTApk) {
  4635. this.ui.ageNode.visible = true;
  4636. this.ui.mainBg.visible = true;
  4637. }
  4638. break;
  4639. case this.ui.tipNode:
  4640. this.showTip(false);
  4641. break;
  4642. case this.ui.ageNode.btnAge:
  4643. this.ui.ageNode.visible = false;
  4644. this.ui.mainBg.visible = false;
  4645. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4646. this.ui.visible = false;
  4647. break;
  4648. case this.ui.xyNode.btnXy3:
  4649. case this.ui.xyNode.btnXy1:
  4650. this.loadXy(1);
  4651. break;
  4652. case this.ui.xyNode.btnXy2:
  4653. this.loadXy(2);
  4654. break;
  4655. case this.ui.xyNode.btnBack:
  4656. this.ui.xyNode.xy1.visible = true;
  4657. this.ui.xyNode.xy2.visible = false;
  4658. break;
  4659. case this.ui.xyNode.btnKnown:
  4660. this.ui.xyNode.visible = false;
  4661. this.ui.mainBg.visible = false;
  4662. this.ui.visible = false;
  4663. break;
  4664. case this.ui.rnNode.btnCheck:
  4665. this.check();
  4666. break;
  4667. case this.ui.rnNode.btnExit:
  4668. case this.ui.xyNode.btnNo:
  4669. this.ysxyNum--;
  4670. if (this.ysxyNum > 0)
  4671. this.showMsg("Refuse to quit the game once again");
  4672. else {
  4673. Moyu.userAgree(false);
  4674. Moyu.exit();
  4675. }
  4676. break;
  4677. case this.ui.xyNode.btnSure:
  4678. case this.ui.xyNode.btnYes:
  4679. DataMgr.userData.isAgree = true;
  4680. DataMgr.saveUserData();
  4681. this.onAgree();
  4682. break;
  4683. case this.ui.rnNode.btnDone:
  4684. this.ui.rnNode.visible = false;
  4685. this.ui.visible = false;
  4686. break;
  4687. case this.ui.fcmNode.btnRn:
  4688. this.showRn();
  4689. break;
  4690. }
  4691. }
  4692. showTip(show) {
  4693. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4694. return;
  4695. if (show) {
  4696. MoyuMgr.isAdvise = true;
  4697. this.ui.visible = true;
  4698. this.ui.tipNode.visible = true;
  4699. this.ui.tipNode.alpha = 1;
  4700. Laya.timer.once(1000, this, this.showTip, [false]);
  4701. }
  4702. else {
  4703. this.ui.tipNode.alpha = 1;
  4704. this.ui.tipNode.visible = true;
  4705. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4706. this.ui.tipNode.visible = false;
  4707. MoyuMgr.isAdvise = false;
  4708. }), 1000);
  4709. }
  4710. }
  4711. showAge(show, px = 0, py = 0) {
  4712. if (Moyu.platType > 10 && !Moyu.isIos) {
  4713. this.ui.ageTip.x = px;
  4714. this.ui.ageTip.y = py;
  4715. this.ui.ageTip.visible = show;
  4716. if (show)
  4717. this.ui.visible = true;
  4718. }
  4719. }
  4720. showAgree(call) {
  4721. this.agreeCall = call;
  4722. this.onAgree();
  4723. return;
  4724. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4725. this.showXy(0);
  4726. }
  4727. else
  4728. this.onAgree();
  4729. }
  4730. onAgree() {
  4731. if (!this.ui.ageNode.visible)
  4732. this.ui.visible = false;
  4733. this.ui.xyNode.visible = false;
  4734. Moyu.userAgree(true);
  4735. this.showAge(false);
  4736. this.agreeCall && this.agreeCall();
  4737. this.showRn();
  4738. }
  4739. showMsg(txt) {
  4740. this.ui.msgNode.txtMsg.text = txt;
  4741. this.ui.msgNode.visible = true;
  4742. this.ui.msgNode.alpha = 1;
  4743. this.ui.visible = true;
  4744. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4745. this.ui.msgNode.visible = false;
  4746. }), 2500, true);
  4747. }
  4748. showRn() {
  4749. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4750. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4751. this.ui.rnNode.rn1.visible = true;
  4752. this.ui.rnNode.rn2.visible = false;
  4753. this.ui.rnNode.rn3.visible = false;
  4754. this.ui.rnNode.rn4.visible = false;
  4755. this.ui.rnNode.visible = true;
  4756. this.ui.mainBg.visible = true;
  4757. this.ui.rnNode.btnDone.visible = false;
  4758. this.ui.rnNode.btnExit.visible = true;
  4759. this.ui.rnNode.btnCheck.visible = true;
  4760. this.ui.fcmNode.visible = false;
  4761. this.ui.visible = true;
  4762. return;
  4763. }
  4764. }
  4765. this.showFcm();
  4766. }
  4767. showFcm() {
  4768. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4769. Moyu.initFCM(true);
  4770. if (Moyu.gameTime < 1)
  4771. this.fcmLoop();
  4772. else if (Moyu.gameTime < 999)
  4773. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4774. }
  4775. }
  4776. fcmLoop() {
  4777. if (Moyu.gameTime < 1) {
  4778. this.ui.rnNode.visible = false;
  4779. this.ui.fcmNode.visible = true;
  4780. this.ui.mainBg.visible = true;
  4781. this.ui.visible = true;
  4782. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4783. Laya.timer.clear(this.ui, this.fcmLoop);
  4784. }
  4785. }
  4786. check() {
  4787. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4788. this.ui.rnNode.rn1.visible = false;
  4789. this.ui.rnNode.rn2.visible = false;
  4790. this.ui.rnNode.rn4.visible = true;
  4791. }
  4792. else if (this.ui.rnNode.rn4.visible) {
  4793. let name = this.ui.rnNode.inputName.text;
  4794. let code = this.ui.rnNode.inputCode.text;
  4795. if (code && code.length == 18) {
  4796. this.ui.rnNode.rn1.visible = false;
  4797. this.ui.rnNode.rn4.visible = false;
  4798. Moyu.authenticate(name, code, (res) => {
  4799. this.ui.rnNode.rn2.visible = !res;
  4800. this.ui.rnNode.rn3.visible = res;
  4801. this.ui.rnNode.btnDone.visible = res;
  4802. this.ui.rnNode.btnExit.visible = !res;
  4803. this.ui.rnNode.btnCheck.visible = !res;
  4804. if (res)
  4805. this.showFcm();
  4806. });
  4807. }
  4808. else
  4809. this.showMsg("信息填写不完整");
  4810. }
  4811. }
  4812. loadXy(type = 0) {
  4813. this.ui.xyNode.xy1.visible = false;
  4814. this.ui.xyNode.xy2.visible = true;
  4815. this.ui.xyNode.xyList.scrollToView(0);
  4816. if (type == 1) {
  4817. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4818. }
  4819. else if (type == 2) {
  4820. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4821. }
  4822. }
  4823. showXy(type = 0) {
  4824. this.xyBtn();
  4825. if (type == 0) {
  4826. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4827. this.ui.xyNode.btnSure.visible = true;
  4828. }
  4829. else {
  4830. this.ui.xyNode.btnYes.visible = true;
  4831. this.ui.xyNode.btnNo.visible = true;
  4832. }
  4833. }
  4834. else {
  4835. this.ui.xyNode.btnKnown.visible = true;
  4836. this.ui.mainBg.visible = true;
  4837. }
  4838. this.ui.xyNode.xy1.visible = true;
  4839. this.ui.xyNode.xy2.visible = false;
  4840. this.ui.xyNode.visible = true;
  4841. this.ui.visible = true;
  4842. }
  4843. xyBtn() {
  4844. this.ui.xyNode.btnSure.visible = false;
  4845. this.ui.xyNode.btnYes.visible = false;
  4846. this.ui.xyNode.btnNo.visible = false;
  4847. this.ui.xyNode.btnKnown.visible = false;
  4848. {
  4849. this.ui.xyNode.btnXy3.visible = false;
  4850. this.ui.xyNode.btnXy2.visible = true;
  4851. this.ui.xyNode.btnXy1.visible = true;
  4852. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4853. }
  4854. }
  4855. createXY(json) {
  4856. this.ysJson = json.content;
  4857. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4858. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4859. this.ui.xyNode.xy2.visible = true;
  4860. }
  4861. renderListItem(idx, cell) {
  4862. let xy = this.ysJson[idx];
  4863. cell.height = xy.line * 30;
  4864. cell.xyItem.text = xy.text;
  4865. }
  4866. onDestroy() {
  4867. this.agreeCall = null;
  4868. }
  4869. }
  4870. class SettingNode {
  4871. constructor(ui) {
  4872. this.showSetting = false;
  4873. this.openSound = true;
  4874. this.openShake = true;
  4875. this.ui = ui;
  4876. this.ui.soundBtn.onClick(this, this.switchSound);
  4877. this.ui.shakeBtn.onClick(this, this.switchShake);
  4878. this.ui.xyBtn.onClick(this, this.onXy);
  4879. this.ui.clickNode.onClick(this, this.changeSetting);
  4880. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4881. this.ui.xyBtn.visible = false;
  4882. this.ui.shakeBtn.visible = false;
  4883. }
  4884. changeSetting() {
  4885. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4886. this.showSetting = !this.showSetting;
  4887. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4888. }
  4889. switchSound() {
  4890. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4891. this.openSound = !this.openSound;
  4892. Moyu.onSetting(this.openSound, this.openShake);
  4893. xGame.soundMgr.onSetting(this.openSound);
  4894. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4895. }
  4896. switchShake() {
  4897. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4898. this.openShake = !this.openShake;
  4899. Moyu.onSetting(this.openSound, this.openShake);
  4900. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4901. }
  4902. onXy() {
  4903. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4904. MoyuMgr.showXy(1);
  4905. }
  4906. }
  4907. class ui_UILevelDisplay extends fgui.GComponent {
  4908. static createInstance() {
  4909. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4910. }
  4911. onConstruct() {
  4912. this.n9 = (this.getChild("n9"));
  4913. this.myNode = (this.getChild("myNode"));
  4914. this.closeNode = (this.getChild("closeNode"));
  4915. }
  4916. }
  4917. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4918. class ui_UILevelProp extends fgui.GComponent {
  4919. static createInstance() {
  4920. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4921. }
  4922. onConstruct() {
  4923. this.n16 = (this.getChild("n16"));
  4924. this.myNode = (this.getChild("myNode"));
  4925. this.closeBtn = (this.getChild("closeBtn"));
  4926. this.moneyNode = (this.getChild("moneyNode"));
  4927. this.t1 = this.getTransition("t1");
  4928. }
  4929. }
  4930. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4931. class ui_ShowItem extends fgui.GComponent {
  4932. static createInstance() {
  4933. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4934. }
  4935. onConstruct() {
  4936. this.myImg = (this.getChild("myImg"));
  4937. }
  4938. }
  4939. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4940. class ShowItem {
  4941. constructor() {
  4942. this.ui = ui_ShowItem.createInstance();
  4943. }
  4944. destroySelf() {
  4945. if (!this.ui.isDisposed) {
  4946. this.ui.removeFromParent();
  4947. this.ui.dispose();
  4948. }
  4949. }
  4950. setParent(parent) {
  4951. parent.addChild(this.ui);
  4952. }
  4953. setPos(x, y) {
  4954. this.ui.x = x;
  4955. this.ui.y = y;
  4956. }
  4957. setUrl(index) {
  4958. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4959. }
  4960. }
  4961. class ui_UIPower extends fgui.GComponent {
  4962. static createInstance() {
  4963. return (fgui.UIPackage.createObject("game", "UIPower"));
  4964. }
  4965. onConstruct() {
  4966. this.n11 = (this.getChild("n11"));
  4967. this.myNode = (this.getChild("myNode"));
  4968. this.t0 = this.getTransition("t0");
  4969. }
  4970. }
  4971. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4972. class UIPower extends UIBase {
  4973. constructor() {
  4974. super();
  4975. }
  4976. onConstructor() {
  4977. this.ui = ui_UIPower.createInstance();
  4978. this.contentPane = this.ui;
  4979. this.isEject = false;
  4980. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4981. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4982. }
  4983. show() {
  4984. super.show();
  4985. this.ui.t0.play();
  4986. }
  4987. videoGetPower() {
  4988. console.log('zh:qjff_AD_for_uipower');
  4989. if (Laya.Browser.onAndroid) {
  4990. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4991. if (!boo) {
  4992. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4993. return;
  4994. }
  4995. }
  4996. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4997. }
  4998. else {
  4999. console.log('zh:AD 失败,直接发放奖励');
  5000. this.qjff_AD_for_uipower();
  5001. }
  5002. }
  5003. qjff_AD_for_uipower() {
  5004. DataMgr.setPower(xGame.common.videoPower, true);
  5005. xGame.eventMgr.event(POWER_TIME);
  5006. this.hide();
  5007. }
  5008. }
  5009. UIPower.uiName = "UIPower";
  5010. class UILevelProp extends UIBase {
  5011. constructor() {
  5012. super();
  5013. this.firstPos = 385;
  5014. this.secondPos = 467;
  5015. this.showItemArr = [];
  5016. }
  5017. onFontLoaded() {
  5018. try {
  5019. this.ui.myNode.conditionTxt.font = "arial";
  5020. console.log("zh: onFontLoaded 设置arial字体成功");
  5021. }
  5022. catch (error) {
  5023. console.log("zh: constructor onFontLoaded加载arial字体失败");
  5024. }
  5025. }
  5026. onConstructor() {
  5027. this.ui = ui_UILevelProp.createInstance();
  5028. this.contentPane = this.ui;
  5029. this.isEject = false;
  5030. this.addUIClick(this.ui.closeBtn, this.hide);
  5031. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5032. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5033. }
  5034. show(level) {
  5035. super.show();
  5036. this.ui.t1.play();
  5037. this.level = level;
  5038. this.data = cfgTable.placeballData[this.level];
  5039. this.updateSelf();
  5040. this.showPreView();
  5041. this.moneyNode.ui.c1.selectedIndex = 2;
  5042. this.moneyNode.checkPowerTime();
  5043. this.moneyNode.powerChange();
  5044. }
  5045. showPreView() {
  5046. let item;
  5047. let data;
  5048. for (let index = 0; index < this.showItemArr.length; index++) {
  5049. item = this.showItemArr[index];
  5050. item.destroySelf();
  5051. }
  5052. this.showItemArr = [];
  5053. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5054. for (const key in cfgData) {
  5055. data = cfgData[key];
  5056. item = new ShowItem();
  5057. item.setParent(this.ui.myNode.displayRoot);
  5058. item.setPos(data.x, data.y);
  5059. item.setUrl(data.value);
  5060. this.showItemArr.push(item);
  5061. }
  5062. }
  5063. updateSelf() {
  5064. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5065. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5066. if (this.data.ball == -1) {
  5067. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5068. }
  5069. else {
  5070. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5071. }
  5072. let localData = DataMgr.getPlaceBallLevel(this.level);
  5073. let getAward = localData.getAward;
  5074. let cfg = cfgTable.placeballData[this.level];
  5075. let coin = this.data.award[0];
  5076. let diamond = this.data.award[1];
  5077. if (cfg.type == PlaceBallType.challenge) {
  5078. diamond = 0;
  5079. coin = 100;
  5080. }
  5081. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5082. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5083. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5084. if (cfg.type == PlaceBallType.challenge) {
  5085. this.ui.myNode.coinNode.numTxt.text = "";
  5086. }
  5087. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5088. if (coin > 0 && diamond > 0) {
  5089. this.ui.myNode.diamondNode.x = 385;
  5090. this.ui.myNode.coinNode.x = 467;
  5091. }
  5092. else {
  5093. this.ui.myNode.diamondNode.x = 385;
  5094. this.ui.myNode.coinNode.x = 385;
  5095. }
  5096. if (!getAward) {
  5097. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5098. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5099. }
  5100. else {
  5101. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5102. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5103. }
  5104. }
  5105. startGame() {
  5106. if (DataMgr.powerEnough()) {
  5107. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5108. this.ui.myNode.startBtn.touchable = false;
  5109. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5110. console.log('zh:startGame ');
  5111. this.ui.myNode.startBtn.touchable = true;
  5112. DataMgr.setPower(-1);
  5113. xGame.eventMgr.event(POWER_TIME);
  5114. xGame.common.gameMode = GameMode.placeBall;
  5115. xGame.common.placeBallCurLevel = this.level;
  5116. xGame.uiMgr.Show(UIGame);
  5117. this.logEventForChallenge_level_start(this.level);
  5118. xGame.uiMgr.Hide(UILevelDisplay);
  5119. xGame.uiMgr.Hide(UIMain);
  5120. this.hide();
  5121. }));
  5122. }
  5123. else {
  5124. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5125. xGame.uiMgr.Show(UIPower);
  5126. }
  5127. }
  5128. logEventForChallenge_level_start(level) {
  5129. let keyStr = 'sjmd_challenge_level_start';
  5130. let jsonStr = {
  5131. "count": 1,
  5132. "gold_balance ": DataMgr.getCoin(),
  5133. "level": level,
  5134. "diamond_balance ": DataMgr.getDiamond()
  5135. };
  5136. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5137. const d = LocalStorageManager.getItem(keyStr);
  5138. if (level > d.level) {
  5139. jsonStr.count = d.count + 1;
  5140. LocalStorageManager.setItem(keyStr, jsonStr);
  5141. }
  5142. else {
  5143. }
  5144. }
  5145. else {
  5146. LocalStorageManager.setItem(keyStr, jsonStr);
  5147. }
  5148. const reqStr = JSON.stringify(jsonStr);
  5149. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5150. }
  5151. hide() {
  5152. super.hide();
  5153. }
  5154. }
  5155. UILevelProp.uiName = "UILevelProp";
  5156. class PutBallLevelDisplay {
  5157. constructor(ui, index) {
  5158. this.index = 0;
  5159. this.ui = ui;
  5160. this.index = index;
  5161. this.ui.onClick(this, this.clickSelf);
  5162. this.updateSelf();
  5163. this.ui.levelTxt.text = (this.index + 1) + "";
  5164. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5165. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5166. }
  5167. updateSelf() {
  5168. let level = this.index + 1;
  5169. this.data = DataMgr.getPlaceBallLevel(level);
  5170. this.ui.starNode.c1.selectedIndex = this.data.star;
  5171. let isChallenge = cfgTable.placeballData[level].type;
  5172. if (this.data.isCur) {
  5173. if (isChallenge) {
  5174. this.ui.c1.selectedIndex = 5;
  5175. }
  5176. else {
  5177. this.ui.c1.selectedIndex = 2;
  5178. }
  5179. }
  5180. else {
  5181. if (this.data.play) {
  5182. if (this.data.star == 3) {
  5183. this.ui.c1.selectedIndex = 0;
  5184. }
  5185. else {
  5186. this.ui.c1.selectedIndex = 1;
  5187. }
  5188. }
  5189. else {
  5190. if (isChallenge) {
  5191. this.ui.c1.selectedIndex = 4;
  5192. }
  5193. else {
  5194. this.ui.c1.selectedIndex = 3;
  5195. }
  5196. }
  5197. }
  5198. }
  5199. clickSelf() {
  5200. if (!this.data.play)
  5201. return;
  5202. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5203. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5204. }
  5205. }
  5206. class UILevelDisplay extends UIBase {
  5207. constructor() {
  5208. super();
  5209. }
  5210. onConstructor() {
  5211. this.ui = ui_UILevelDisplay.createInstance();
  5212. this.contentPane = this.ui;
  5213. this.isEject = false;
  5214. this.myList = this.ui.myNode.myList;
  5215. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5216. this.levelItemArr = [];
  5217. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5218. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5219. this.myList.numItems = levelNum;
  5220. if (Moyu.isKs)
  5221. this.ui.closeNode.closeBtn.x += 100;
  5222. }
  5223. levelItemRender(index, target) {
  5224. let item = new PutBallLevelDisplay(target, index);
  5225. this.levelItemArr.push(item);
  5226. }
  5227. show() {
  5228. super.show();
  5229. this.updateLevel();
  5230. this.scrollToPlace();
  5231. }
  5232. updateLevel() {
  5233. let temp;
  5234. for (let index = 0; index < this.levelItemArr.length; index++) {
  5235. temp = this.levelItemArr[index];
  5236. temp.updateSelf();
  5237. }
  5238. }
  5239. scrollToPlace() {
  5240. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5241. let passArr = DataMgr.getPlaceBallLevelList();
  5242. let offest = passArr.length;
  5243. if (offest >= maxNum - 1)
  5244. offest = maxNum - 1;
  5245. this.myList.scrollToView(offest, true, true);
  5246. }
  5247. hide() {
  5248. super.hide();
  5249. }
  5250. }
  5251. UILevelDisplay.uiName = "UILevelDisplay";
  5252. class ui_UIMatching extends fgui.GComponent {
  5253. static createInstance() {
  5254. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5255. }
  5256. onConstruct() {
  5257. this.n5 = (this.getChild("n5"));
  5258. this.n49 = (this.getChild("n49"));
  5259. this.n51 = (this.getChild("n51"));
  5260. this.n64 = (this.getChild("n64"));
  5261. this.n2 = (this.getChild("n2"));
  5262. this.n53 = (this.getChild("n53"));
  5263. this.n54 = (this.getChild("n54"));
  5264. this.n56 = (this.getChild("n56"));
  5265. this.n58 = (this.getChild("n58"));
  5266. this.n59 = (this.getChild("n59"));
  5267. this.n57 = (this.getChild("n57"));
  5268. this.n60 = (this.getChild("n60"));
  5269. this.n62 = (this.getChild("n62"));
  5270. this.awardTxt = (this.getChild("awardTxt"));
  5271. this.n61 = (this.getChild("n61"));
  5272. this.selfHead = (this.getChild("selfHead"));
  5273. this.aiHead = (this.getChild("aiHead"));
  5274. this.n82 = (this.getChild("n82"));
  5275. this.n84 = (this.getChild("n84"));
  5276. this.n83 = (this.getChild("n83"));
  5277. this.t1 = this.getTransition("t1");
  5278. this.t2 = this.getTransition("t2");
  5279. this.t3 = this.getTransition("t3");
  5280. this.t4 = this.getTransition("t4");
  5281. }
  5282. }
  5283. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5284. class UIMatching extends UIBase {
  5285. constructor() {
  5286. super();
  5287. }
  5288. onConstructor() {
  5289. this.ui = ui_UIMatching.createInstance();
  5290. this.contentPane = this.ui;
  5291. this.isEject = false;
  5292. }
  5293. show(callback) {
  5294. super.show();
  5295. PlatMgr.showBanner(true);
  5296. this.callback = callback;
  5297. let user = Moyu.getUserInfo();
  5298. if (!this.selfPot) {
  5299. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5300. }
  5301. if (!this.aiPot) {
  5302. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5303. }
  5304. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5305. this.ui.selfHead.nameTxt.text = user.nickName;
  5306. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5307. this.ui.aiHead.nameTxt.text = "???";
  5308. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5309. this.ui.selfHead.c1.selectedIndex = 0;
  5310. this.ui.aiHead.c1.selectedIndex = 0;
  5311. this.ui.selfHead.x = this.selfPot.x;
  5312. this.ui.selfHead.y = this.selfPot.y;
  5313. this.ui.aiHead.x = this.aiPot.x;
  5314. this.ui.aiHead.y = this.aiPot.y;
  5315. switch (xGame.common.gameMode) {
  5316. case GameMode.classic:
  5317. break;
  5318. case GameMode.bigMove:
  5319. this.initSkillData();
  5320. break;
  5321. default:
  5322. break;
  5323. }
  5324. this.ui.t1.play(Laya.Handler.create(this, () => {
  5325. this.ui.t2.play(Laya.Handler.create(this, () => {
  5326. switch (xGame.common.gameMode) {
  5327. case GameMode.classic:
  5328. this.waitingPeople();
  5329. break;
  5330. case GameMode.bigMove:
  5331. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5332. break;
  5333. default:
  5334. break;
  5335. }
  5336. }));
  5337. }));
  5338. }
  5339. initSkillData() {
  5340. this.skillSelectData = [];
  5341. let skillUrl = xGame.common.skillIconList;
  5342. let skillName = xGame.common.skillNameList;
  5343. let skillLevel = DataMgr.getBigSkillList();
  5344. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5345. for (let index = 0; index < 5; index++) {
  5346. let obj = {};
  5347. obj.skillImg = skillUrl[index];
  5348. obj.skillName = skillName[index];
  5349. obj.skillType = skillType[index];
  5350. obj.skillLevel = skillLevel[index];
  5351. this.skillSelectData.push(obj);
  5352. }
  5353. }
  5354. getAISkillLevel(myLevel) {
  5355. let video = xGame.common.upSkillLevel;
  5356. let aiLevel;
  5357. let temp;
  5358. if (video) {
  5359. temp = xGame.common.randomNum(-2, -1);
  5360. }
  5361. else {
  5362. if (myLevel <= 5) {
  5363. temp = xGame.common.randomNum(1, 3);
  5364. }
  5365. else if (myLevel <= 9) {
  5366. temp = xGame.common.randomNum(-2, 1);
  5367. }
  5368. else {
  5369. temp = xGame.common.randomNum(-4, 0);
  5370. }
  5371. }
  5372. aiLevel = temp + myLevel;
  5373. if (aiLevel <= 1)
  5374. aiLevel = 1;
  5375. if (aiLevel >= 10)
  5376. aiLevel = 10;
  5377. return aiLevel;
  5378. }
  5379. getAISkillType() {
  5380. return xGame.common.randomNum(1, 4);
  5381. let successTimes = DataMgr.getSkillSuccessTimes();
  5382. let info = cfgTable.aiskillData[successTimes];
  5383. if (!info) {
  5384. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5385. info = cfgTable.aiskillData[max];
  5386. }
  5387. let dataArr = info.skillselect;
  5388. let myCfg = {};
  5389. for (let index = 0; index < dataArr.length; index++) {
  5390. let temp = dataArr[index].split('-');
  5391. myCfg[temp[0]] = {};
  5392. myCfg[temp[0]].id = parseInt(temp[0]);
  5393. myCfg[temp[0]].weight = parseInt(temp[1]);
  5394. }
  5395. let aiCfg = xGame.common.initWeight(myCfg);
  5396. let curData = xGame.common.getRandomWeightData(aiCfg);
  5397. return parseInt(curData.id);
  5398. }
  5399. getAISkillData(index) {
  5400. let myLevel = this.skillSelectData[index].skillLevel;
  5401. let aiLevel = this.getAISkillLevel(myLevel);
  5402. let aiType = this.getAISkillType() - 1;
  5403. return { aiLevel, aiType } = { aiLevel, aiType };
  5404. }
  5405. skillSelectFinish(index) {
  5406. let aiInfo = this.getAISkillData(index);
  5407. xGame.common.gameMgr.selfCurSkill = index;
  5408. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5409. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5410. this.ui.selfHead.c1.selectedIndex = 1;
  5411. this.ui.aiHead.c1.selectedIndex = 1;
  5412. let myData = this.skillSelectData[index];
  5413. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5414. let guide = DataMgr.getSkillGuide();
  5415. if (guide == 0) {
  5416. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5417. }
  5418. else {
  5419. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5420. }
  5421. let aiData = this.skillSelectData[aiInfo.aiType];
  5422. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5423. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5424. this.waitingPeople();
  5425. }
  5426. waitingPeople() {
  5427. let time = xGame.common.randomNum(1000, 3000);
  5428. time += 1000;
  5429. Laya.timer.once(time, this, () => {
  5430. this.matchingSuccess();
  5431. });
  5432. }
  5433. matchingSuccess() {
  5434. let gameUI = xGame.common.gameUI;
  5435. let name = gameUI.ui.topNode.aiNameTxt.text;
  5436. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5437. this.ui.aiHead.nameTxt.text = name;
  5438. this.ui.aiHead.headImg.url = url;
  5439. name = gameUI.ui.topNode.selfNameTxt.text;
  5440. url = gameUI.ui.topNode.selfHeadLoader.url;
  5441. this.ui.selfHead.nameTxt.text = name;
  5442. this.ui.selfHead.headImg.url = url;
  5443. this.ui.t3.play(Laya.Handler.create(this, () => {
  5444. this.callback && this.callback();
  5445. this.ui.t4.play(Laya.Handler.create(this, () => {
  5446. this.destroySelf();
  5447. }));
  5448. }));
  5449. }
  5450. destroySelf() {
  5451. this.callback = null;
  5452. this.skillSelectData = null;
  5453. this.selfPot = null;
  5454. this.aiPot = null;
  5455. if (!this.ui.isDisposed) {
  5456. this.ui.removeFromParent();
  5457. this.ui.dispose();
  5458. }
  5459. xGame.uiMgr.destroyUI(this);
  5460. }
  5461. }
  5462. UIMatching.uiName = "UIMatching";
  5463. class ui_UIRanking extends fgui.GComponent {
  5464. static createInstance() {
  5465. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5466. }
  5467. onConstruct() {
  5468. this.n26 = (this.getChild("n26"));
  5469. this.myNode = (this.getChild("myNode"));
  5470. }
  5471. }
  5472. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5473. class UIRanking extends UIBase {
  5474. constructor() {
  5475. super();
  5476. this.showSelf = true;
  5477. this.rankType = 1;
  5478. this.rankList = [];
  5479. this.topX = 10;
  5480. this.myIndex = this.topX + 1;
  5481. this.myStar = 0;
  5482. }
  5483. onConstructor() {
  5484. this.ui = ui_UIRanking.createInstance();
  5485. this.contentPane = this.ui;
  5486. this.isEject = false;
  5487. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5488. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5489. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5490. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5491. this.ui.myNode.myList.setVirtual();
  5492. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5493. }
  5494. show() {
  5495. super.show();
  5496. this.getPaiHangBangDataFormJosnFile();
  5497. this.updateSelf();
  5498. let self = Moyu.getUserInfo();
  5499. if (!self.isAuth) {
  5500. Moyu.initUser(this, () => {
  5501. DataMgr.upRankData();
  5502. });
  5503. }
  5504. }
  5505. getPaiHangBangDataFormJosnFile() {
  5506. const rankingList = cfgTable.paiHangBangData.list;
  5507. this.updateItemData(rankingList);
  5508. }
  5509. updateSelfItem() {
  5510. console.log('zh:Moyu.platType =' + Moyu.platType);
  5511. let self = Moyu.getUserInfo();
  5512. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5513. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5514. if (this.myIndex > this.topX) {
  5515. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5516. }
  5517. else {
  5518. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5519. }
  5520. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5521. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5522. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5523. }
  5524. updateItemData(data) {
  5525. this.myStar = xGame.common.getAllStarNum();
  5526. if (this.rankList.length < 2) {
  5527. this.rankList = data;
  5528. let self = Moyu.getUserInfo();
  5529. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5530. self.headIcon = self.headIcon;
  5531. for (let i = 0; i < data.length; i++) {
  5532. let data = this.rankList[i];
  5533. if (data.userId == self.userId) {
  5534. this.rankList.splice(i, 1);
  5535. break;
  5536. }
  5537. }
  5538. for (let i = 0; i < data.length; i++) {
  5539. let data = this.rankList[i];
  5540. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5541. this.myIndex = i + 1;
  5542. let user = { headIcon: self.headIcon, nickName: "myself" };
  5543. let ud = { user: user, data: {} };
  5544. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5545. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5546. if (Moyu.platType < 11) {
  5547. user.headIcon = self.headIcon;
  5548. user.nickName = self.nickName;
  5549. }
  5550. this.rankList.splice(i, 0, md);
  5551. break;
  5552. }
  5553. }
  5554. }
  5555. this.updateSelfItem();
  5556. this.ui.myNode.myList.numItems = this.rankList.length;
  5557. }
  5558. updateItemUI(index, obj) {
  5559. let data = this.rankList[index];
  5560. let userData = JSON.parse(data.userData).user;
  5561. obj.nameTxt.text = userData.nickName.toString();
  5562. obj.valueTxt.text = data.rankScore;
  5563. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5564. obj.rankTxt.text = index + 1;
  5565. switch (index) {
  5566. case 0:
  5567. this.setImg(obj, 1, 0, 0);
  5568. obj.rankTxt.color = "#FFC047";
  5569. break;
  5570. case 1:
  5571. this.setImg(obj, 0, 1, 0);
  5572. obj.rankTxt.color = "#ACACAC";
  5573. break;
  5574. case 2:
  5575. this.setImg(obj, 0, 0, 1);
  5576. obj.rankTxt.color = "#D09672";
  5577. break;
  5578. default:
  5579. this.setImg(obj, 0, 0, 0);
  5580. obj.rankTxt.color = "#496FAB";
  5581. break;
  5582. }
  5583. }
  5584. setImg(obj, a, b, c) {
  5585. obj.img1.visible = a ? true : false;
  5586. obj.img2.visible = b ? true : false;
  5587. obj.img3.visible = c ? true : false;
  5588. }
  5589. changeList(type) {
  5590. this.rankType = type;
  5591. this.updateSelf();
  5592. }
  5593. changeSelfNode() {
  5594. this.showSelf = !this.showSelf;
  5595. this.updateSelf();
  5596. }
  5597. updateSelf() {
  5598. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5599. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5600. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5601. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5602. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5603. }
  5604. }
  5605. UIRanking.uiName = "UIRanking";
  5606. class ui_UISecretary extends fgui.GComponent {
  5607. static createInstance() {
  5608. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5609. }
  5610. onConstruct() {
  5611. this.n0 = (this.getChild("n0"));
  5612. this.myNode = (this.getChild("myNode"));
  5613. this.closeBtn = (this.getChild("closeBtn"));
  5614. this.t0 = this.getTransition("t0");
  5615. }
  5616. }
  5617. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5618. class UISecretary extends UIBase {
  5619. constructor() {
  5620. super();
  5621. this.curIndex = 1;
  5622. }
  5623. onConstructor() {
  5624. this.ui = ui_UISecretary.createInstance();
  5625. this.contentPane = this.ui;
  5626. this.isEject = false;
  5627. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5628. this.nodeObj = { left: null, right: null, cur: null };
  5629. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5630. }
  5631. show() {
  5632. super.show();
  5633. this.ui.t0.play();
  5634. this.updateData();
  5635. }
  5636. addSecretarySpine(node, spineName) {
  5637. if (spineName == "mishu") {
  5638. if (this.secretarySpine1) {
  5639. node.displayObject.destroyChildren();
  5640. this.playWoman(this.secretarySpine1, node.displayObject);
  5641. }
  5642. else {
  5643. let spine1 = new SpineMgr("mishu", () => {
  5644. this.secretarySpine1 = spine1;
  5645. this.playWoman(this.secretarySpine1, node.displayObject);
  5646. });
  5647. }
  5648. }
  5649. else {
  5650. if (this.secretarySpine2) {
  5651. node.displayObject.destroyChildren();
  5652. this.playWoman(this.secretarySpine2, node.displayObject);
  5653. }
  5654. else {
  5655. let spine2 = new SpineMgr("xiaomishu2", () => {
  5656. this.secretarySpine2 = spine2;
  5657. this.playWoman(this.secretarySpine2, node.displayObject);
  5658. });
  5659. }
  5660. }
  5661. }
  5662. playWoman(node, parent) {
  5663. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5664. let yy = this.ui.myNode.gameNode3.secretary.height;
  5665. let scale = 1.5;
  5666. if (node == this.secretarySpine2) {
  5667. scale = 1.2;
  5668. }
  5669. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5670. node.play(data, 0, true, parent);
  5671. }
  5672. turnLeft() {
  5673. this.curIndex--;
  5674. if (this.curIndex < 1) {
  5675. this.curIndex = 2;
  5676. }
  5677. let left = this.nodeObj.left;
  5678. let right = this.nodeObj.right;
  5679. let cur = this.nodeObj.cur;
  5680. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5681. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5682. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5683. this.updateData();
  5684. }));
  5685. this.ui.myNode.setChildIndex(right, 2);
  5686. this.nodeObj.left = cur;
  5687. this.nodeObj.right = left;
  5688. this.nodeObj.cur = right;
  5689. }
  5690. turnRight() {
  5691. this.curIndex++;
  5692. if (this.curIndex > 2) {
  5693. this.curIndex = 1;
  5694. }
  5695. let left = this.nodeObj.left;
  5696. let right = this.nodeObj.right;
  5697. let cur = this.nodeObj.cur;
  5698. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5699. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5700. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5701. this.updateData();
  5702. }));
  5703. this.ui.myNode.setChildIndex(left, 2);
  5704. this.nodeObj.left = right;
  5705. this.nodeObj.right = cur;
  5706. this.nodeObj.cur = left;
  5707. }
  5708. updateData() {
  5709. console.log('zh: updateData FFFFFFFFFF');
  5710. let data = cfgTable.secretaryshopData;
  5711. let children = this.ui.myNode._children;
  5712. let temp;
  5713. let curData;
  5714. for (let index = 0; index < children.length; index++) {
  5715. temp = children[index];
  5716. curData = data[1];
  5717. temp.heightTxt.text = curData.height;
  5718. temp.foodTxt.text = curData.food;
  5719. temp.historyTxt.text = curData.history;
  5720. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5721. this.addSecretarySpine(temp.secretary, curData.spine);
  5722. let womanIndex = curData.id - 1;
  5723. let getWoman = DataMgr.getSecretary(womanIndex);
  5724. let curUse = DataMgr.getCurSecretary();
  5725. if (getWoman) {
  5726. if (curUse == womanIndex) {
  5727. temp.purchaseBtn.c1.selectedIndex = 1;
  5728. }
  5729. else {
  5730. temp.purchaseBtn.c1.selectedIndex = 2;
  5731. }
  5732. }
  5733. else {
  5734. temp.purchaseBtn.c1.selectedIndex = 0;
  5735. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5736. }
  5737. temp.purchaseBtn.visible = false;
  5738. }
  5739. }
  5740. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5741. console.log('zh: 点击了clickSecretary ');
  5742. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5743. if (getWoman) {
  5744. if (curUse != womanIndex) {
  5745. console.log();
  5746. DataMgr.setCurSecretary(womanIndex);
  5747. this.updateData();
  5748. }
  5749. }
  5750. else {
  5751. console.log('zh:点击购买了');
  5752. let need = needDiamond;
  5753. if (DataMgr.diamondEnough(need)) {
  5754. DataMgr.setDiamond(-need);
  5755. DataMgr.setSecretary(womanIndex, 1);
  5756. DataMgr.setCurSecretary(womanIndex);
  5757. this.updateData();
  5758. }
  5759. else {
  5760. xGame.uiMgr.Show(UIAddProp, 1);
  5761. }
  5762. }
  5763. }
  5764. closeSelf() {
  5765. this.hide();
  5766. }
  5767. }
  5768. UISecretary.uiName = "UISecretary";
  5769. class ui_UIShop extends fgui.GComponent {
  5770. static createInstance() {
  5771. return (fgui.UIPackage.createObject("game", "UIShop"));
  5772. }
  5773. onConstruct() {
  5774. this.n48 = (this.getChild("n48"));
  5775. this.n0 = (this.getChild("n0"));
  5776. this.secretary = (this.getChild("secretary"));
  5777. this.talkNode = (this.getChild("talkNode"));
  5778. this.closeNode = (this.getChild("closeNode"));
  5779. this.moneyNode = (this.getChild("moneyNode"));
  5780. this.myNode = (this.getChild("myNode"));
  5781. }
  5782. }
  5783. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5784. class ui_UIMsg extends fgui.GComponent {
  5785. static createInstance() {
  5786. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5787. }
  5788. onConstruct() {
  5789. this.tipsNode = (this.getChild("tipsNode"));
  5790. }
  5791. }
  5792. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5793. class UIMsg extends UIBase {
  5794. constructor() {
  5795. super();
  5796. }
  5797. onConstructor() {
  5798. this.ui = ui_UIMsg.createInstance();
  5799. this.contentPane = this.ui;
  5800. this.isEject = false;
  5801. this.isMuti = true;
  5802. }
  5803. show(msg, callback) {
  5804. super.show();
  5805. this.ui.tipsNode.msgTxt.text = msg;
  5806. this.ui.alpha = 1;
  5807. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5808. this.hide();
  5809. callback && callback();
  5810. }), 1000);
  5811. }
  5812. }
  5813. UIMsg.uiName = "UIMsg";
  5814. class BallRodDisplay {
  5815. constructor(ui, index) {
  5816. this.index = 0;
  5817. this.uiIndex = 0;
  5818. this.ui = ui;
  5819. this.index = index;
  5820. this.initData();
  5821. }
  5822. initData() {
  5823. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5824. let data = cfgTable.ballrodData[this.index + 1];
  5825. this.ui.nameTxt.text = data.name;
  5826. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5827. this.ui.levelNode.c1.selectedIndex = data.quality;
  5828. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5829. if (data.spine) {
  5830. this.mySpine = new SpineMgr(data.spine, () => {
  5831. let xx = 150;
  5832. let yy = 70;
  5833. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5834. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5835. });
  5836. }
  5837. }
  5838. updateSelf() {
  5839. console.log('zh:updateSelf -------------- ');
  5840. let get = DataMgr.getBallRod(this.index);
  5841. if (get == null)
  5842. get = 1;
  5843. let curUse = DataMgr.getCurBallRod();
  5844. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5845. if (get) {
  5846. if (curUse == this.index) {
  5847. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5848. }
  5849. else {
  5850. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5851. }
  5852. }
  5853. else {
  5854. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5855. }
  5856. }
  5857. buyBallRod() {
  5858. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5859. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5860. switch (selectedIndex) {
  5861. case 0:
  5862. break;
  5863. case 1:
  5864. console.log('zh:点击了 USE THIS');
  5865. DataMgr.setCurBallRod(this.index);
  5866. let curUse = DataMgr.getCurBallRod();
  5867. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5868. let ui = xGame.uiMgr.getUI(UIShop);
  5869. ui.updateBallRod();
  5870. break;
  5871. case 2:
  5872. let data = cfgTable.ballrodData[this.index + 1];
  5873. let need = data.price;
  5874. if (DataMgr.diamondEnough(need)) {
  5875. this.buyQiuGan(data);
  5876. DataMgr.setDiamond(-need);
  5877. DataMgr.setBallRod(this.index, 1);
  5878. DataMgr.setCurBallRod(this.index);
  5879. let ui = xGame.uiMgr.getUI(UIShop);
  5880. ui.updateBallRod();
  5881. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5882. }
  5883. else {
  5884. xGame.uiMgr.Show(UIAddProp, 1);
  5885. }
  5886. break;
  5887. default:
  5888. break;
  5889. }
  5890. }
  5891. buyQiuGan(qgItem) {
  5892. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5893. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5894. if (userInfo == null) {
  5895. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5896. return;
  5897. }
  5898. let reqData = xGame.httpMgr.getReqData();
  5899. let pd = JSON.parse(reqData);
  5900. pd.qiuGanData = qgItem;
  5901. reqData = JSON.stringify(pd);
  5902. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5903. try {
  5904. console.log('zh:buySp res = ' + JSON.stringify(res));
  5905. let code = res.code;
  5906. let msg = res.msg;
  5907. if (code == 401) {
  5908. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5909. alert(TIP_MSG_key.loginTimeOut);
  5910. xGame.uiMgr.Show(UIMsg, msg);
  5911. return;
  5912. }
  5913. if (code == 200) {
  5914. xGame.uiMgr.Show(UIMsg, msg);
  5915. DataMgr.getUserZiChanInfo();
  5916. }
  5917. else {
  5918. xGame.uiMgr.Show(UIMsg, msg);
  5919. }
  5920. }
  5921. catch (error) {
  5922. console.log('error=' + error);
  5923. alert(error);
  5924. }
  5925. finally {
  5926. }
  5927. });
  5928. }
  5929. logEventForGouMaiGan(qiuGanName) {
  5930. const ev = {
  5931. value: qiuGanName
  5932. };
  5933. const jsonStr = JSON.stringify(ev);
  5934. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5935. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5936. }
  5937. }
  5938. class DaoJuDisplay {
  5939. constructor(ui, index) {
  5940. this.index = 0;
  5941. this.uiIndex = 0;
  5942. this.ggSpid = "";
  5943. this.spid = 0;
  5944. this.ui = ui;
  5945. this.index = index;
  5946. this.initData();
  5947. }
  5948. initData() {
  5949. this.ui.btn_buy.onClick(this, this.gotoBuy);
  5950. let data = cfgTable.daoJuData[this.index + 1];
  5951. console.log('zh:' + JSON.stringify(data));
  5952. this.ui.nameTxt.text = data.spbt;
  5953. this.ui.n_jiaGe.text = data.spjg + "";
  5954. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5955. this.ggSpid = data.ggSpid;
  5956. this.spid = data.spid;
  5957. let baseUrl = "asset/sound/ogg/";
  5958. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5959. }
  5960. gotoBuy() {
  5961. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5962. if (userInfo != null) {
  5963. let token = userInfo.token;
  5964. let ggSpid = this.ggSpid;
  5965. let spid = this.spid;
  5966. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  5967. console.log('zh:gotoBuy1 spid =' + spid);
  5968. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  5969. return;
  5970. }
  5971. else {
  5972. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5973. }
  5974. }
  5975. gotoBuy1() {
  5976. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5977. let djItem = cfgTable.daoJuData[this.index + 1];
  5978. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  5979. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5980. if (userInfo == null) {
  5981. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5982. return;
  5983. }
  5984. let reqData = xGame.httpMgr.getReqData();
  5985. let pd = JSON.parse(reqData);
  5986. pd.spItem = djItem;
  5987. reqData = JSON.stringify(pd);
  5988. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  5989. try {
  5990. console.log('zh:buySp res = ' + JSON.stringify(res));
  5991. let code = res.code;
  5992. let msg = res.msg;
  5993. if (code == 401) {
  5994. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5995. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5996. return;
  5997. }
  5998. if (code == 200) {
  5999. xGame.uiMgr.Show(UIMsg, msg);
  6000. DataMgr.getUserZiChanInfo();
  6001. }
  6002. else {
  6003. xGame.uiMgr.Show(UIMsg, msg);
  6004. }
  6005. }
  6006. catch (error) {
  6007. console.log('error=' + error);
  6008. alert(error);
  6009. }
  6010. finally {
  6011. }
  6012. });
  6013. }
  6014. }
  6015. class UIShop extends UIBase {
  6016. constructor() {
  6017. super();
  6018. this.itemNums = 0;
  6019. this.itemNumsForDj = 0;
  6020. this.curType = "";
  6021. }
  6022. onConstructor() {
  6023. this.ui = ui_UIShop.createInstance();
  6024. this.contentPane = this.ui;
  6025. this.isEject = false;
  6026. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6027. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6028. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6029. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6030. this.addUIClick(this.ui, this.interuptSecretary);
  6031. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6032. this.ballRodArr = [];
  6033. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6034. this.ui.myNode.myList.numItems = this.itemNums;
  6035. this.loadDjdata_old();
  6036. }
  6037. loadDjdata_old() {
  6038. let fff = cfgTable.daoJuData;
  6039. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6040. this.daoJuArr = [];
  6041. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6042. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6043. }
  6044. getProductList() {
  6045. let reqData = xGame.httpMgr.getReqData();
  6046. let pd = JSON.parse(reqData);
  6047. pd.splx = "Consumable";
  6048. reqData = JSON.stringify(pd);
  6049. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6050. try {
  6051. let code = res.code;
  6052. let msg = res.msg;
  6053. if (code == 401) {
  6054. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6055. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6056. return;
  6057. }
  6058. if (code == 200) {
  6059. let data = res.data;
  6060. for (let index = 0; index < data.length; index++) {
  6061. let element = data[index];
  6062. cfgTable.daoJuData[element.spid] = element;
  6063. }
  6064. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6065. }
  6066. else {
  6067. xGame.uiMgr.Show(UIMsg, msg);
  6068. }
  6069. }
  6070. catch (error) {
  6071. console.log('error=' + error);
  6072. alert(error);
  6073. }
  6074. finally {
  6075. }
  6076. });
  6077. }
  6078. show(type) {
  6079. super.show();
  6080. this.curType = type == 0 ? "qiugan" : "daoju";
  6081. this.switchBtn("qiugan");
  6082. this.playSecretaryIdle();
  6083. this.updateBallRod();
  6084. }
  6085. test123() {
  6086. console.log('zh:test123 ');
  6087. }
  6088. switchBtn(type) {
  6089. console.log('zh:1111切換 sel type=' + type);
  6090. if (type == "") {
  6091. type = this.curType;
  6092. }
  6093. else {
  6094. if (this.curType == type) {
  6095. return;
  6096. }
  6097. else {
  6098. this.curType = type;
  6099. }
  6100. }
  6101. if (type == "qiugan") {
  6102. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6103. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6104. this.ui.myNode.c1.selectedIndex = 0;
  6105. this.ui.myNode.myList.visible = true;
  6106. this.ui.myNode.djList.visible = false;
  6107. }
  6108. else {
  6109. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6110. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6111. this.ui.myNode.c1.selectedIndex = 1;
  6112. this.ui.myNode.myList.visible = false;
  6113. this.ui.myNode.djList.visible = true;
  6114. }
  6115. }
  6116. updateBallRod() {
  6117. for (let index = 0; index < this.ballRodArr.length; index++) {
  6118. this.ballRodArr[index].updateSelf();
  6119. }
  6120. }
  6121. renderBallRod(sort, obj) {
  6122. let index = this.getIndexBySort(sort + 1) - 1;
  6123. let ballRod = new BallRodDisplay(obj, index);
  6124. this.ballRodArr.push(ballRod);
  6125. }
  6126. renderDaoJu(idx, obj) {
  6127. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6128. let b = new DaoJuDisplay(obj, index);
  6129. this.daoJuArr.push(b);
  6130. }
  6131. getIndexBySort(sort) {
  6132. let object = cfgTable.ballrodData;
  6133. for (const key in object) {
  6134. if (object[key].sort == sort) {
  6135. return parseInt(key);
  6136. }
  6137. }
  6138. }
  6139. getIndexBySortForDj(idx) {
  6140. let object = cfgTable.daoJuData;
  6141. for (const key in object) {
  6142. if (object[key].idx == idx) {
  6143. return parseInt(key);
  6144. }
  6145. }
  6146. }
  6147. playSecretaryIdle() {
  6148. let parent = this.ui.secretary.displayObject;
  6149. parent.destroyChildren();
  6150. let xx = this.ui.secretary.width / 2;
  6151. let yy = this.ui.secretary.height;
  6152. let scale = xGame.common.getSecretaryScale();
  6153. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6154. xGame.common.secretary.play(data, 0, true, parent);
  6155. }
  6156. interuptSecretary() {
  6157. Laya.timer.clearAll(this);
  6158. this.playSecretaryRandomSound();
  6159. }
  6160. playSecretaryRandomSound() {
  6161. if (this.isHide)
  6162. return;
  6163. let time = xGame.common.randomNum(45000, 60000);
  6164. Laya.timer.once(time, this, () => {
  6165. if (this.isHide)
  6166. return;
  6167. let index = xGame.common.randomNum(4, 7);
  6168. xGame.soundMgr.playSound("s_main0" + index);
  6169. let words = 1;
  6170. switch (index) {
  6171. case 4:
  6172. words = 5;
  6173. break;
  6174. case 5:
  6175. words = 3;
  6176. break;
  6177. case 6:
  6178. words = 6;
  6179. break;
  6180. case 7:
  6181. words = 7;
  6182. break;
  6183. default:
  6184. break;
  6185. }
  6186. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6187. this.playSecretaryRandomSound();
  6188. });
  6189. }
  6190. closeSelf() {
  6191. this.hide();
  6192. }
  6193. }
  6194. UIShop.uiName = "UIShop";
  6195. class ui_UISign extends fgui.GComponent {
  6196. static createInstance() {
  6197. return (fgui.UIPackage.createObject("game", "UISign"));
  6198. }
  6199. onConstruct() {
  6200. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6201. this.n6 = (this.getChild("n6"));
  6202. this.closeNode = (this.getChild("closeNode"));
  6203. this.myNode = (this.getChild("myNode"));
  6204. this.moneyNode = (this.getChild("moneyNode"));
  6205. this.secretary = (this.getChild("secretary"));
  6206. this.talkNode = (this.getChild("talkNode"));
  6207. this.tripleBtn = (this.getChild("tripleBtn"));
  6208. this.normalBtn = (this.getChild("normalBtn"));
  6209. this.tipsNode = (this.getChild("tipsNode"));
  6210. this.againBtn = (this.getChild("againBtn"));
  6211. this.t0 = this.getTransition("t0");
  6212. }
  6213. }
  6214. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6215. class SignMax {
  6216. constructor(ui) {
  6217. this.ui = ui;
  6218. }
  6219. updateSelf(index, sameDay, curDayIndex) {
  6220. let data = cfgTable.signData[index + 1];
  6221. this.ui.titleTxt.text = data.title;
  6222. let arr1 = data.award[0].split('-');
  6223. let arr2 = data.award[1].split('-');
  6224. let num1 = parseInt(arr1[1]);
  6225. let num2 = parseInt(arr2[1]);
  6226. this.ui.numTxt1.text = num1 + "";
  6227. this.ui.numTxt2.text = num2 + "";
  6228. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6229. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6230. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6231. this.ui.numTxt1.visible = false;
  6232. }
  6233. else {
  6234. this.ui.numTxt1.visible = true;
  6235. }
  6236. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6237. this.ui.numTxt2.visible = false;
  6238. }
  6239. else {
  6240. this.ui.numTxt2.visible = true;
  6241. }
  6242. if (index < curDayIndex) {
  6243. this.ui.c1.selectedIndex = 1;
  6244. }
  6245. else if (index == curDayIndex) {
  6246. if (sameDay) {
  6247. this.ui.c1.selectedIndex = 2;
  6248. }
  6249. else {
  6250. this.ui.c1.selectedIndex = 2;
  6251. }
  6252. }
  6253. else {
  6254. this.ui.c1.selectedIndex = 0;
  6255. }
  6256. }
  6257. }
  6258. class SignNormal {
  6259. constructor(ui) {
  6260. this.ui = ui;
  6261. }
  6262. updateSelf(index, sameDay, curDayIndex) {
  6263. let data = cfgTable.signData[index + 1];
  6264. this.ui.titleTxt.text = data.title;
  6265. let arr = data.award[0].split('-');
  6266. let type = parseInt(arr[0]);
  6267. let num = parseInt(arr[1]);
  6268. this.ui.numTxt.text = num + "";
  6269. if (type > 2) {
  6270. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6271. this.ui.myIcon.rotation = 0;
  6272. }
  6273. else {
  6274. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6275. this.ui.myIcon.rotation = 0;
  6276. }
  6277. if (xGame.common.signAwardContainsRod(data.award)) {
  6278. this.ui.numTxt.visible = false;
  6279. }
  6280. else {
  6281. this.ui.numTxt.visible = true;
  6282. }
  6283. if (index < curDayIndex) {
  6284. this.ui.c1.selectedIndex = 1;
  6285. }
  6286. else if (index == curDayIndex) {
  6287. if (sameDay) {
  6288. this.ui.c1.selectedIndex = 2;
  6289. }
  6290. else {
  6291. this.ui.c1.selectedIndex = 2;
  6292. }
  6293. }
  6294. else {
  6295. this.ui.c1.selectedIndex = 0;
  6296. }
  6297. }
  6298. }
  6299. class UISign extends UIBase {
  6300. constructor() {
  6301. super();
  6302. this.curDayIndex = 0;
  6303. this.starX = 0;
  6304. }
  6305. onConstructor() {
  6306. this.ui = ui_UISign.createInstance();
  6307. this.contentPane = this.ui;
  6308. this.isEject = false;
  6309. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6310. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6311. this.initSignItem();
  6312. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6313. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6314. }
  6315. show() {
  6316. super.show();
  6317. this.ui.t0.play();
  6318. this.playSecretaryIdle();
  6319. this.updateSign();
  6320. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6321. }
  6322. initSignItem() {
  6323. this.signArr = [];
  6324. for (let index = 0; index < 6; index++) {
  6325. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6326. this.signArr.push(temp);
  6327. }
  6328. this.signMax = new SignMax(this.ui.myNode.day7);
  6329. if (Moyu.isKs)
  6330. this.ui.closeNode.closeBtn.x += 100;
  6331. }
  6332. updateSign() {
  6333. let sameDay = xGame.common.judgeSameDay();
  6334. let max = 7;
  6335. this.curDayIndex = DataMgr.getSignData();
  6336. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6337. this.curDayIndex = 0;
  6338. if (!sameDay) {
  6339. this.ui.normalBtn.visible = true;
  6340. this.ui.tipsNode.visible = false;
  6341. this.ui.againBtn.visible = false;
  6342. }
  6343. else {
  6344. this.ui.normalBtn.visible = false;
  6345. let again = DataMgr.getExtraSign();
  6346. let isCurrency = false;
  6347. let index = this.curDayIndex;
  6348. if (index == 0)
  6349. index = 7;
  6350. let award = cfgTable.signData[index].award;
  6351. let num = award[0].split("-")[0];
  6352. if (num == "1" || num == "2")
  6353. isCurrency = true;
  6354. let showAgain = again == 0 && isCurrency;
  6355. this.ui.againBtn.visible = showAgain;
  6356. this.ui.tipsNode.visible = !showAgain;
  6357. }
  6358. for (let index = 0; index < this.signArr.length; index++) {
  6359. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6360. }
  6361. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6362. }
  6363. playSecretaryIdle() {
  6364. let parent = this.ui.secretary.displayObject;
  6365. parent.destroyChildren();
  6366. let xx = this.ui.secretary.width / 2;
  6367. let yy = this.ui.secretary.height;
  6368. let scale = xGame.common.getSecretaryScale();
  6369. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6370. xGame.common.secretary.play(data, 0, true, parent);
  6371. }
  6372. closeSelf() {
  6373. this.hide();
  6374. }
  6375. normalGetAward() {
  6376. let sameDay = xGame.common.judgeSameDay();
  6377. if (!sameDay) {
  6378. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6379. let temp;
  6380. let type;
  6381. let num;
  6382. let arr = [];
  6383. for (let index = 0; index < award.length; index++) {
  6384. temp = award[index].split("-");
  6385. type = parseInt(temp[0]);
  6386. num = parseInt(temp[1]);
  6387. let awardType = new AwardType();
  6388. awardType.num = num;
  6389. awardType.type = type;
  6390. arr.push(awardType);
  6391. }
  6392. xGame.common.getAward(arr, (watchVideo) => {
  6393. this.curDayIndex++;
  6394. if (this.curDayIndex > 7)
  6395. this.curDayIndex = 0;
  6396. DataMgr.setSignData(this.curDayIndex);
  6397. DataMgr.setSignTime(new Date().getTime());
  6398. if (watchVideo) {
  6399. DataMgr.setExtraSign(1);
  6400. Moyu.sendDataEvent("signIn1");
  6401. }
  6402. this.updateSign();
  6403. });
  6404. }
  6405. }
  6406. againGetAward() {
  6407. Moyu.sendDataEvent("signIn2");
  6408. console.log('zh:qjff_AD_for_uisign');
  6409. if (Laya.Browser.onAndroid) {
  6410. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6411. if (!boo) {
  6412. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6413. return;
  6414. }
  6415. }
  6416. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6417. }
  6418. else {
  6419. console.log('zh:AD 失败,直接发放奖励');
  6420. this.qjff_AD_for_uisign();
  6421. }
  6422. }
  6423. qjff_AD_for_uisign() {
  6424. let index = this.curDayIndex;
  6425. if (index == 0)
  6426. index = 7;
  6427. let award = cfgTable.signData[index].award;
  6428. let temp;
  6429. let type;
  6430. let num;
  6431. for (let index = 0; index < award.length; index++) {
  6432. temp = award[index].split("-");
  6433. type = parseInt(temp[0]);
  6434. num = parseInt(temp[1]) * 3;
  6435. xGame.common.playObjFlyAnim(num, type);
  6436. }
  6437. DataMgr.setExtraSign(1);
  6438. this.updateSign();
  6439. }
  6440. }
  6441. UISign.uiName = "UISign";
  6442. class ui_UISkill extends fgui.GComponent {
  6443. static createInstance() {
  6444. return (fgui.UIPackage.createObject("game", "UISkill"));
  6445. }
  6446. onConstruct() {
  6447. this.n48 = (this.getChild("n48"));
  6448. this.n0 = (this.getChild("n0"));
  6449. this.secretary = (this.getChild("secretary"));
  6450. this.talkNode = (this.getChild("talkNode"));
  6451. this.closeNode = (this.getChild("closeNode"));
  6452. this.moneyNode = (this.getChild("moneyNode"));
  6453. this.skillNode = (this.getChild("skillNode"));
  6454. this.guideNode = (this.getChild("guideNode"));
  6455. }
  6456. }
  6457. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6458. class SkillDisplay {
  6459. constructor(ui, data, uiIndex) {
  6460. this.starX = 0;
  6461. this.starY = 0;
  6462. this.index = 0;
  6463. this.ui = ui;
  6464. this.data = data;
  6465. this.index = uiIndex;
  6466. this.initSelf();
  6467. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6468. }
  6469. initSelf() {
  6470. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6471. this.ui.nameTxt.text = this.data.name;
  6472. this.ui.describeTxt.text = this.data.describe;
  6473. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6474. this.ui.startBtn.onClick(this, this.startGame);
  6475. this.updateSelf();
  6476. }
  6477. updateSelf() {
  6478. this.checkTry();
  6479. let level = DataMgr.getBigSkillByIndex(this.index);
  6480. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6481. }
  6482. checkTry() {
  6483. let index = this.index;
  6484. let level = DataMgr.getBigSkillByIndex(index);
  6485. if (level == null) {
  6486. DataMgr.setBigSkill(index, 1, false);
  6487. level = 1;
  6488. }
  6489. this.ui.levelTxt.text = "LV." + level;
  6490. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6491. this.ui.tryNode.visible = true;
  6492. else
  6493. this.ui.tryNode.visible = false;
  6494. }
  6495. clickAddLevel() {
  6496. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6497. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6498. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6499. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6500. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6501. }
  6502. else {
  6503. console.log('zh:AD 失败,直接发放奖励');
  6504. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6505. }
  6506. }
  6507. qjff_AD_for_skilldisplay_clickAddLevel() {
  6508. DataMgr.setBigSkill(this.data.index, 1);
  6509. this.updateSelf();
  6510. xGame.common.upSkillLevel = true;
  6511. }
  6512. startGame() {
  6513. console.log('zh:rod skill startgame');
  6514. if (this.data.index == 3) {
  6515. alert('Coming soon!');
  6516. return;
  6517. }
  6518. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6519. let needCoin = xGame.common.bigMoveNeedCoin;
  6520. xGame.common.passAwardCoin = 2000;
  6521. let guide = DataMgr.getSkillGuide();
  6522. console.log('zh:startGame guide=' + guide);
  6523. xGame.common.temSelfLevel = 0;
  6524. if (guide == 0) {
  6525. needCoin = 0;
  6526. xGame.common.temSelfLevel = 100;
  6527. }
  6528. if (DataMgr.coinEnough(needCoin)) {
  6529. DataMgr.setCoin(-needCoin);
  6530. xGame.common.curPlayerSkillType = this.index;
  6531. if (guide == 0)
  6532. xGame.common.curPlayerSkillType = 0;
  6533. console.log('zh: skilldisplay 1');
  6534. xGame.uiMgr.Show(UIGame);
  6535. xGame.uiMgr.Hide(UIMain);
  6536. xGame.uiMgr.Show(UIMatching, () => {
  6537. xGame.common.gameUI.ui.alpha = 1;
  6538. xGame.common.gameUI.startGame();
  6539. xGame.uiMgr.Hide(UISkill);
  6540. });
  6541. this.logEventForRod_start();
  6542. }
  6543. else {
  6544. console.log('zh: skilldisplay 2');
  6545. xGame.uiMgr.Show(UIAddProp, 0);
  6546. Moyu.sendDataEvent("AddCoinVideo");
  6547. }
  6548. }
  6549. logEventForRod_start() {
  6550. let gfmsIdx = xGame.common.curPlayerSkillType;
  6551. console.log('zh:选择的技能=' + gfmsIdx);
  6552. let gfmc = 'Skyfall Shot';
  6553. if (gfmsIdx == 0) {
  6554. gfmc = 'Skyfall Shot';
  6555. }
  6556. if (gfmsIdx == 1) {
  6557. gfmc = 'Surging break';
  6558. }
  6559. if (gfmsIdx == 2) {
  6560. gfmc = 'Frost Lock';
  6561. }
  6562. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6563. let jsonStr = {
  6564. "count": 0,
  6565. "name": gfmc
  6566. };
  6567. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6568. const d = LocalStorageManager.getItem(keyStr);
  6569. jsonStr.count = d.count + 1;
  6570. LocalStorageManager.setItem(keyStr, jsonStr);
  6571. }
  6572. else {
  6573. LocalStorageManager.setItem(keyStr, jsonStr);
  6574. }
  6575. const reqStr = JSON.stringify(jsonStr);
  6576. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6577. }
  6578. }
  6579. class UISkill extends UIBase {
  6580. constructor() {
  6581. super();
  6582. this.skillData = [];
  6583. }
  6584. onConstructor() {
  6585. this.ui = ui_UISkill.createInstance();
  6586. this.contentPane = this.ui;
  6587. this.isEject = false;
  6588. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6589. this.initSkillData();
  6590. console.log('zh:aaaaaa1111111111');
  6591. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6592. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6593. console.log('zh:aaaaaa22222222');
  6594. this.displayList = [];
  6595. this.ui.skillNode.skillList.numItems = 3;
  6596. this.addUIClick(this.ui, this.interuptSecretary);
  6597. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6598. this.ui.talkNode.visible = false;
  6599. if (Moyu.isKs)
  6600. this.ui.closeNode.closeBtn.x += 100;
  6601. }
  6602. show() {
  6603. super.show();
  6604. this.playSecretaryIdle();
  6605. this.moneyNode.ui.c1.selectedIndex = 1;
  6606. Laya.timer.clearAll(this);
  6607. xGame.soundMgr.playSound("s_start");
  6608. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6609. let guide = DataMgr.getSkillGuide();
  6610. this.ui.guideNode.visible = guide == 0;
  6611. let item = this.getSkillItemByUIIndex(0);
  6612. if (guide == 0) {
  6613. item.ui.c1.selectedIndex = 1;
  6614. }
  6615. else {
  6616. item.ui.c1.selectedIndex = 0;
  6617. }
  6618. this.ui.guideNode.guideBtn.visible = guide == 0;
  6619. for (let index = 0; index < this.displayList.length; index++) {
  6620. this.displayList[index].checkTry();
  6621. }
  6622. }
  6623. getSkillItemByUIIndex(cur) {
  6624. for (let index = 0; index < this.displayList.length; index++) {
  6625. if (this.displayList[index].index == cur) {
  6626. return this.displayList[index];
  6627. }
  6628. }
  6629. }
  6630. enterGuideLevel() {
  6631. let item = this.getSkillItemByUIIndex(0);
  6632. item.startGame();
  6633. if (DataMgr.getNewUser())
  6634. Moyu.sendDataEvent("gameStart1");
  6635. }
  6636. initSkillData() {
  6637. this.skillData = [];
  6638. let nameList = xGame.common.skillNameList;
  6639. let iconList = xGame.common.skillIconList;
  6640. let describeList = [
  6641. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6642. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6643. "The power of frost descends—freezing the flow and taking full control of the game!"
  6644. ];
  6645. console.log('zh:initSkillData 111111111');
  6646. let data;
  6647. for (let index = 0; index < nameList.length; index++) {
  6648. data = {};
  6649. data.name = nameList[index];
  6650. data.icon = iconList[index];
  6651. data.describe = describeList[index];
  6652. data.index = index;
  6653. this.skillData.push(data);
  6654. }
  6655. }
  6656. updateSkillItem(index, target) {
  6657. if (this.displayList[index] == null) {
  6658. let uiIndex;
  6659. switch (index) {
  6660. case 0:
  6661. uiIndex = 1;
  6662. break;
  6663. case 1:
  6664. uiIndex = 0;
  6665. break;
  6666. case 2:
  6667. uiIndex = 2;
  6668. break;
  6669. case 3:
  6670. uiIndex = 3;
  6671. break;
  6672. default:
  6673. break;
  6674. }
  6675. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6676. this.displayList.push(temp);
  6677. }
  6678. }
  6679. playSecretaryIdle() {
  6680. let parent = this.ui.secretary.displayObject;
  6681. parent.destroyChildren();
  6682. let xx = this.ui.secretary.width / 2;
  6683. let yy = this.ui.secretary.height;
  6684. let scale = xGame.common.getSecretaryScale();
  6685. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6686. xGame.common.secretary.play(data, 0, true, parent);
  6687. }
  6688. returnUIMain() {
  6689. this.hide();
  6690. xGame.common.stopGirlPop(this.ui.talkNode);
  6691. xGame.uiMgr.Show(UIMain);
  6692. }
  6693. interuptSecretary() {
  6694. Laya.timer.clearAll(this);
  6695. this.playSecretaryRandomSound();
  6696. }
  6697. playSecretaryRandomSound() {
  6698. if (this.isHide)
  6699. return;
  6700. let time = xGame.common.randomNum(45000, 60000);
  6701. Laya.timer.once(time, this, () => {
  6702. if (this.isHide)
  6703. return;
  6704. let index = xGame.common.randomNum(4, 7);
  6705. xGame.soundMgr.playSound("s_main0" + index);
  6706. let words = 1;
  6707. switch (index) {
  6708. case 4:
  6709. words = 5;
  6710. break;
  6711. case 5:
  6712. words = 3;
  6713. break;
  6714. case 6:
  6715. words = 6;
  6716. break;
  6717. case 7:
  6718. words = 7;
  6719. break;
  6720. default:
  6721. break;
  6722. }
  6723. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6724. this.playSecretaryRandomSound();
  6725. });
  6726. }
  6727. }
  6728. UISkill.uiName = "UISkill";
  6729. class ui_UIModeSelection extends fgui.GComponent {
  6730. static createInstance() {
  6731. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6732. }
  6733. onConstruct() {
  6734. this.n19 = (this.getChild("n19"));
  6735. this.closeBtn = (this.getChild("closeBtn"));
  6736. this.myNode = (this.getChild("myNode"));
  6737. this.t0 = this.getTransition("t0");
  6738. }
  6739. }
  6740. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6741. class UIModeSelection extends UIBase {
  6742. constructor() {
  6743. super();
  6744. }
  6745. onConstructor() {
  6746. this.ui = ui_UIModeSelection.createInstance();
  6747. this.contentPane = this.ui;
  6748. this.isEject = false;
  6749. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6750. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6751. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6752. this.addUIClick(this.ui.closeBtn, this.hide);
  6753. this.peopleArr = [65, 990, 580];
  6754. this.peopleOffest = [5, 10, 10];
  6755. }
  6756. show(callback) {
  6757. this.updateSelf();
  6758. super.show();
  6759. this.ui.t0.play();
  6760. this.callback = callback;
  6761. }
  6762. updateSelf() {
  6763. let cfg = cfgTable.modeselectData;
  6764. for (let index = 1; index <= 3; index++) {
  6765. let node = this.ui.myNode["type" + index];
  6766. node.need.text = cfg[index].need;
  6767. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6768. node.peopleTxt.text = this.getRandPeople(index - 1);
  6769. }
  6770. }
  6771. enterGame(type) {
  6772. console.log('zh: 进入经典模式 type: ' + type);
  6773. xGame.common.classicRoomType = type;
  6774. let cfg = cfgTable.modeselectData[type];
  6775. let need = cfg.need;
  6776. xGame.common.passAwardCoin = cfg.award;
  6777. if (DataMgr.coinEnough(need)) {
  6778. DataMgr.setCoin(-need);
  6779. this.ui.myNode["type" + type].t0.play();
  6780. Laya.timer.once(200, this, () => {
  6781. this.callback && this.callback();
  6782. });
  6783. this.logEventForClassic_start();
  6784. }
  6785. else {
  6786. Moyu.sendDataEvent("AddCoinVideo");
  6787. xGame.uiMgr.Show(UIAddProp, 0);
  6788. }
  6789. }
  6790. getRandPeople(index) {
  6791. let rand = this.peopleOffest[index];
  6792. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6793. }
  6794. logEventForClassic_start() {
  6795. let rtype = xGame.common.classicRoomType;
  6796. let msmc = '';
  6797. if (rtype == 1) {
  6798. msmc = 'beginner';
  6799. }
  6800. if (rtype == 2) {
  6801. msmc = 'expert';
  6802. }
  6803. if (rtype == 3) {
  6804. msmc = 'master';
  6805. }
  6806. let keyStr = 'sjmd_classic_start_' + rtype;
  6807. let jsonStr = {
  6808. "difficulty": msmc,
  6809. "classic_count": 1,
  6810. "difficulty_count": 1
  6811. };
  6812. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6813. const d = LocalStorageManager.getItem(keyStr);
  6814. jsonStr.classic_count = d.classic_count + 1;
  6815. jsonStr.difficulty_count = d.difficulty_count + 1;
  6816. LocalStorageManager.setItem(keyStr, jsonStr);
  6817. }
  6818. else {
  6819. LocalStorageManager.setItem(keyStr, jsonStr);
  6820. }
  6821. const reqStr = JSON.stringify(jsonStr);
  6822. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6823. }
  6824. }
  6825. UIModeSelection.uiName = "UIModeSelection";
  6826. class ui_UIReg extends fgui.GComponent {
  6827. static createInstance() {
  6828. return (fgui.UIPackage.createObject("game", "UIReg"));
  6829. }
  6830. onConstruct() {
  6831. this.n38 = (this.getChild("n38"));
  6832. this.n9 = (this.getChild("n9"));
  6833. this.n14 = (this.getChild("n14"));
  6834. this.n15 = (this.getChild("n15"));
  6835. this.n34 = (this.getChild("n34"));
  6836. this.closeBtn = (this.getChild("closeBtn"));
  6837. this.lab_tip = (this.getChild("lab_tip"));
  6838. this.n43 = (this.getChild("n43"));
  6839. this.txt_ua = (this.getChild("txt_ua"));
  6840. this.n44 = (this.getChild("n44"));
  6841. this.txt_up1 = (this.getChild("txt_up1"));
  6842. this.n45 = (this.getChild("n45"));
  6843. this.txt_up2 = (this.getChild("txt_up2"));
  6844. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6845. this.btn_reg = (this.getChild("btn_reg"));
  6846. this.n50 = (this.getChild("n50"));
  6847. }
  6848. }
  6849. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6850. class ui_UILogin extends fgui.GComponent {
  6851. static createInstance() {
  6852. return (fgui.UIPackage.createObject("game", "UILogin"));
  6853. }
  6854. onConstruct() {
  6855. this.c1 = this.getController("c1");
  6856. this.n18 = (this.getChild("n18"));
  6857. this.n7 = (this.getChild("n7"));
  6858. this.n5 = (this.getChild("n5"));
  6859. this.n6 = (this.getChild("n6"));
  6860. this.closeBtn = (this.getChild("closeBtn"));
  6861. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6862. this.btn_login = (this.getChild("btn_login"));
  6863. this.n30 = (this.getChild("n30"));
  6864. this.n31 = (this.getChild("n31"));
  6865. this.txt_up = (this.getChild("txt_up"));
  6866. this.n32 = (this.getChild("n32"));
  6867. this.txt_ua = (this.getChild("txt_ua"));
  6868. }
  6869. }
  6870. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6871. class UILogin extends UIBase {
  6872. constructor() {
  6873. super();
  6874. }
  6875. onConstructor() {
  6876. this.ui = ui_UILogin.createInstance();
  6877. this.contentPane = this.ui;
  6878. this.isEject = false;
  6879. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6880. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6881. this.addUIClick(this.ui.btn_login, this.userLogin);
  6882. }
  6883. show() {
  6884. super.show();
  6885. this.x = (Laya.stage.width - this.width) / 2;
  6886. this.y = (Laya.stage.height - this.height) / 2;
  6887. }
  6888. closeSelf() {
  6889. this.hide();
  6890. }
  6891. userLogin() {
  6892. let ua = this.ui.txt_ua.text;
  6893. let up = this.ui.txt_up.text;
  6894. if (ua && up) {
  6895. let reqData = JSON.stringify({
  6896. username: ua.trim(),
  6897. password: up.trim(),
  6898. fromMark: 'app_game'
  6899. });
  6900. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6901. try {
  6902. console.log('zh:res = ' + JSON.stringify(res));
  6903. let code = res.code;
  6904. let msg = res.msg;
  6905. if (code == 200) {
  6906. let keyStr = keyForLoginInfo;
  6907. let jsonStr = {
  6908. "username": res.username,
  6909. "token": res.token,
  6910. "buySpids": { 1: false, 7: false }
  6911. };
  6912. LocalStorageManager.setItem(keyStr, jsonStr);
  6913. let myu = Moyu.getUserInfo();
  6914. console.log('zh:myu = ' + JSON.stringify(myu));
  6915. DataMgr.updateUserNickName(res.username);
  6916. Moyu.updateUserInfo(res.username);
  6917. xGame.uiMgr.Show(UIMsg, msg);
  6918. DataMgr.getUserZiChanInfo();
  6919. xGame.eventMgr.event(LOGIN_IN);
  6920. this.closeSelf();
  6921. }
  6922. else {
  6923. xGame.uiMgr.Show(UIMsg, msg);
  6924. }
  6925. }
  6926. catch (error) {
  6927. console.log('error=' + error);
  6928. alert(error);
  6929. }
  6930. finally {
  6931. }
  6932. });
  6933. }
  6934. else {
  6935. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6936. }
  6937. }
  6938. gotoRegPage() {
  6939. this.closeSelf();
  6940. xGame.uiMgr.Show(UIReg);
  6941. }
  6942. }
  6943. UILogin.uiName = "UILogin";
  6944. class UIReg extends UIBase {
  6945. constructor() {
  6946. super();
  6947. }
  6948. onConstructor() {
  6949. this.ui = ui_UIReg.createInstance();
  6950. this.contentPane = this.ui;
  6951. this.isEject = false;
  6952. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6953. this.addUIClick(this.ui.btn_reg, this.regUser);
  6954. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6955. }
  6956. show() {
  6957. super.show();
  6958. this.x = (Laya.stage.width - this.width) / 2;
  6959. this.y = (Laya.stage.height - this.height) / 2;
  6960. }
  6961. closeSelf() {
  6962. this.hide();
  6963. }
  6964. regUser() {
  6965. this.ui.lab_tip.visible = false;
  6966. let ua = this.ui.txt_ua.text;
  6967. let up1 = this.ui.txt_up1.text;
  6968. let up2 = this.ui.txt_up2.text;
  6969. if (ua && up1 && up2 && up1 == up2) {
  6970. let reqData = JSON.stringify({
  6971. username: ua.trim(),
  6972. password: up1.trim(),
  6973. fromMark: 'app_game'
  6974. });
  6975. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6976. try {
  6977. console.log('zh:res = ' + JSON.stringify(res));
  6978. let code = res.code;
  6979. let msg = res.msg;
  6980. xGame.uiMgr.Show(UIMsg, msg);
  6981. if (code == 200) {
  6982. this.ui.lab_tip.color = "#FFFFFF";
  6983. xGame.uiMgr.Show(UIMsg, msg);
  6984. this.closeSelf();
  6985. }
  6986. else {
  6987. this.ui.lab_tip.color = "#FF0000";
  6988. xGame.uiMgr.Show(UIMsg, msg);
  6989. }
  6990. }
  6991. catch (error) {
  6992. console.log('error=' + error);
  6993. alert(error);
  6994. }
  6995. finally {
  6996. }
  6997. });
  6998. }
  6999. else {
  7000. if (up1 != up2) {
  7001. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7002. }
  7003. else {
  7004. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7005. }
  7006. }
  7007. }
  7008. gotoLogin() {
  7009. this.closeSelf();
  7010. xGame.uiMgr.Show(UILogin);
  7011. }
  7012. }
  7013. UIReg.uiName = "UIReg";
  7014. class ui_UIFuli1 extends fgui.GComponent {
  7015. static createInstance() {
  7016. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  7017. }
  7018. onConstruct() {
  7019. this.n1 = (this.getChild("n1"));
  7020. this.n2 = (this.getChild("n2"));
  7021. }
  7022. }
  7023. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  7024. class UIFuli1 extends UIBase {
  7025. constructor() {
  7026. super();
  7027. }
  7028. onConstructor() {
  7029. this.ui = ui_UIFuli1.createInstance();
  7030. this.contentPane = this.ui;
  7031. this.isEject = false;
  7032. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7033. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7034. }
  7035. show() {
  7036. super.show();
  7037. this.x = (Laya.stage.width - this.width) / 2;
  7038. this.y = (Laya.stage.height - this.height) / 2;
  7039. }
  7040. closeSelf() {
  7041. this.hide();
  7042. }
  7043. gotoBuy() {
  7044. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7045. if (userInfo != null) {
  7046. let token = userInfo.token;
  7047. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  7048. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  7049. return;
  7050. }
  7051. else {
  7052. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7053. }
  7054. }
  7055. gotoBuy2() {
  7056. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7057. if (userInfo == null) {
  7058. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7059. return;
  7060. }
  7061. let reqData = xGame.httpMgr.getReqData();
  7062. let pd = JSON.parse(reqData);
  7063. pd.productId = 1;
  7064. reqData = JSON.stringify(pd);
  7065. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7066. try {
  7067. console.log('zh:buySp res = ' + JSON.stringify(res));
  7068. let code = res.code;
  7069. let msg = res.msg;
  7070. if (code == 401) {
  7071. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7072. alert(TIP_MSG_key.loginTimeOut);
  7073. xGame.uiMgr.Show(UIMsg, msg);
  7074. return;
  7075. }
  7076. if (code == 200) {
  7077. xGame.uiMgr.Show(UIMsg, msg);
  7078. DataMgr.getUserZiChanInfo();
  7079. this.closeSelf();
  7080. }
  7081. else {
  7082. xGame.uiMgr.Show(UIMsg, msg);
  7083. }
  7084. }
  7085. catch (error) {
  7086. console.log('error=' + error);
  7087. alert(error);
  7088. }
  7089. finally {
  7090. }
  7091. });
  7092. }
  7093. }
  7094. UIFuli1.uiName = "UIFuli1";
  7095. class ui_UIFuli2 extends fgui.GComponent {
  7096. static createInstance() {
  7097. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  7098. }
  7099. onConstruct() {
  7100. this.n1 = (this.getChild("n1"));
  7101. this.n0 = (this.getChild("n0"));
  7102. }
  7103. }
  7104. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  7105. class UIFuli2 extends UIBase {
  7106. constructor() {
  7107. super();
  7108. }
  7109. onConstructor() {
  7110. this.ui = ui_UIFuli2.createInstance();
  7111. this.contentPane = this.ui;
  7112. this.isEject = false;
  7113. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  7114. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  7115. }
  7116. show() {
  7117. super.show();
  7118. this.x = (Laya.stage.width - this.width) / 2;
  7119. this.y = (Laya.stage.height - this.height) / 2;
  7120. }
  7121. closeSelf() {
  7122. this.hide();
  7123. }
  7124. gotoBuy() {
  7125. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7126. if (userInfo != null) {
  7127. let token = userInfo.token;
  7128. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  7129. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  7130. return;
  7131. }
  7132. else {
  7133. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7134. }
  7135. }
  7136. gotoBuy1() {
  7137. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7138. if (userInfo == null) {
  7139. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7140. return;
  7141. }
  7142. let reqData = xGame.httpMgr.getReqData();
  7143. let pd = JSON.parse(reqData);
  7144. pd.productId = 2;
  7145. reqData = JSON.stringify(pd);
  7146. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7147. try {
  7148. console.log('zh:buySp res = ' + JSON.stringify(res));
  7149. let code = res.code;
  7150. let msg = res.msg;
  7151. if (code == 401) {
  7152. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7153. alert(TIP_MSG_key.loginTimeOut);
  7154. xGame.uiMgr.Show(UIMsg, msg);
  7155. return;
  7156. }
  7157. if (code == 200) {
  7158. xGame.uiMgr.Show(UIMsg, msg);
  7159. DataMgr.getUserZiChanInfo();
  7160. this.closeSelf();
  7161. }
  7162. else {
  7163. xGame.uiMgr.Show(UIMsg, msg);
  7164. }
  7165. }
  7166. catch (error) {
  7167. console.log('error=' + error);
  7168. alert(error);
  7169. }
  7170. finally {
  7171. }
  7172. });
  7173. }
  7174. }
  7175. UIFuli2.uiName = "UIFuli2";
  7176. class ui_UIGetAward extends fgui.GComponent {
  7177. static createInstance() {
  7178. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7179. }
  7180. onConstruct() {
  7181. this.n4 = (this.getChild("n4"));
  7182. this.n0 = (this.getChild("n0"));
  7183. this.myList = (this.getChild("myList"));
  7184. this.n1 = (this.getChild("n1"));
  7185. this.eftNode = (this.getChild("eftNode"));
  7186. this.btnNode = (this.getChild("btnNode"));
  7187. this.t0 = this.getTransition("t0");
  7188. }
  7189. }
  7190. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7191. class UIGetAward extends UIBase {
  7192. constructor() {
  7193. super();
  7194. this.showTriple = true;
  7195. }
  7196. onConstructor() {
  7197. this.ui = ui_UIGetAward.createInstance();
  7198. this.contentPane = this.ui;
  7199. this.isEject = false;
  7200. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7201. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7202. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7203. }
  7204. show(arr, showTriple, callback) {
  7205. super.show();
  7206. this.ui.t0.play();
  7207. this.ui.eftNode.visible = true;
  7208. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7209. this.ui.eftNode.visible = false;
  7210. }), 1, 0, 0, 0.9);
  7211. this.awardArr = arr;
  7212. this.showTriple = showTriple;
  7213. this.callback = callback;
  7214. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7215. this.ui.myList.numItems = arr.length;
  7216. xGame.soundMgr.playSound("getaward");
  7217. }
  7218. updateSelf(index, obj) {
  7219. let temp = this.awardArr[index];
  7220. let icon = this.getIcon(temp.type);
  7221. let str = icon;
  7222. if (temp.type > 2) {
  7223. str = "s" + icon;
  7224. }
  7225. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7226. obj.myIcon.rotation = 0;
  7227. obj.numTxt.text = temp.num + "";
  7228. obj.numTxt.visible = temp.type > 2 ? false : true;
  7229. obj.nameTxt.text = this.getNameStr(temp.type);
  7230. }
  7231. renderItem(index, obj) {
  7232. this.updateSelf(index, obj);
  7233. }
  7234. tripleGetAward() {
  7235. console.log('zh:qjff_AD_for_uigetAward');
  7236. if (Laya.Browser.onAndroid) {
  7237. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7238. if (!boo) {
  7239. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7240. return;
  7241. }
  7242. }
  7243. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7244. }
  7245. else {
  7246. console.log('zh:AD 失败,直接发放奖励');
  7247. this.qjff_AD_for_uigetAward();
  7248. }
  7249. }
  7250. qjff_AD_for_uigetAward() {
  7251. this.getAward(3);
  7252. }
  7253. normalGetAward() {
  7254. if (PlatMgr.isMisVideo())
  7255. this.tripleGetAward();
  7256. else
  7257. this.getAward();
  7258. }
  7259. getAward(times = 1) {
  7260. this.hide();
  7261. for (let index = 0; index < this.awardArr.length; index++) {
  7262. this.awardArr[index].num *= times;
  7263. }
  7264. this.callback && this.callback(times != 1);
  7265. }
  7266. getIcon(type) {
  7267. switch (type) {
  7268. case Prop.diamond:
  7269. return "ty_zs";
  7270. case Prop.coin:
  7271. return "ty_jb";
  7272. case Prop.gan1:
  7273. return "qg1";
  7274. case Prop.gan2:
  7275. return "qg2";
  7276. case Prop.gan3:
  7277. return "qg3";
  7278. case Prop.gan4:
  7279. return "qg4";
  7280. default:
  7281. break;
  7282. }
  7283. }
  7284. getNameStr(type) {
  7285. switch (type) {
  7286. case Prop.diamond:
  7287. return "Diamond";
  7288. case Prop.coin:
  7289. return "Coins";
  7290. case Prop.gan1:
  7291. case Prop.gan2:
  7292. case Prop.gan3:
  7293. case Prop.gan4:
  7294. return cfgTable.ballrodData[type - 1].name;
  7295. default:
  7296. break;
  7297. }
  7298. }
  7299. }
  7300. UIGetAward.uiName = "UIGetAward";
  7301. class ui_UIRepentProp extends fgui.GComponent {
  7302. static createInstance() {
  7303. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7304. }
  7305. onConstruct() {
  7306. this.c1 = this.getController("c1");
  7307. this.n11 = (this.getChild("n11"));
  7308. this.regretNode = (this.getChild("regretNode"));
  7309. this.helpLineNode = (this.getChild("helpLineNode"));
  7310. this.t0 = this.getTransition("t0");
  7311. }
  7312. }
  7313. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7314. class UIRepentProp extends UIBase {
  7315. constructor() {
  7316. super();
  7317. this.viewType = 0;
  7318. this.regretType = 0;
  7319. }
  7320. onConstructor() {
  7321. this.ui = ui_UIRepentProp.createInstance();
  7322. this.contentPane = this.ui;
  7323. this.isEject = false;
  7324. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7325. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7326. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7327. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7328. }
  7329. show(viewType, regretType, callback) {
  7330. PlatMgr.showInsert(true);
  7331. this.viewType = viewType;
  7332. this.regretType = regretType;
  7333. this.callback = callback;
  7334. super.show();
  7335. this.ui.t0.play();
  7336. this.ui.c1.selectedIndex = this.viewType;
  7337. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7338. if (this.viewType == 0) {
  7339. let guide = DataMgr.getGuideHelpLine();
  7340. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7341. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7342. }
  7343. xGame.common.gameMgr.gamePause = true;
  7344. }
  7345. hideSelf() {
  7346. xGame.common.gameMgr.gamePause = false;
  7347. this.callback && this.callback(false);
  7348. this.hide();
  7349. }
  7350. videoRegret() {
  7351. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7352. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7353. }
  7354. else {
  7355. console.log('zh:AD 失败,直接发放奖励');
  7356. this.qjff_AD_for_UIrepentProp_videoRegret();
  7357. }
  7358. }
  7359. qjff_AD_for_UIrepentProp_videoRegret() {
  7360. this.callback && this.callback(true);
  7361. this.hideSelf();
  7362. }
  7363. videoAddHelpLine() {
  7364. let guide = DataMgr.getGuideHelpLine();
  7365. if (guide == 0) {
  7366. this.callback && this.callback(true);
  7367. this.hideSelf();
  7368. DataMgr.setGuideHelpLine();
  7369. xGame.common.gameUI.ui.guideNode.visible = false;
  7370. }
  7371. else {
  7372. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7373. if (Laya.Browser.onAndroid) {
  7374. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7375. if (!boo) {
  7376. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7377. return;
  7378. }
  7379. }
  7380. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7381. }
  7382. else {
  7383. console.log('zh:AD 失败,直接发放奖励');
  7384. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7385. }
  7386. }
  7387. }
  7388. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7389. this.callback && this.callback(true);
  7390. this.hideSelf();
  7391. }
  7392. }
  7393. UIRepentProp.uiName = "UIRepentProp";
  7394. class UIMain extends UIBase {
  7395. constructor() {
  7396. super();
  7397. this.firstEnter = true;
  7398. }
  7399. nativeCallJs(msg) {
  7400. let t = msg;
  7401. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7402. switch (t) {
  7403. case 'qjff_chouJiang':
  7404. let dui = xGame.uiMgr.getUI(UIDraw);
  7405. dui.qjff_chouJiang();
  7406. break;
  7407. case 'qjff_AD_for_uisign':
  7408. let dui2 = xGame.uiMgr.getUI(UISign);
  7409. dui2.qjff_AD_for_uisign();
  7410. break;
  7411. case 'qjff_AD_for_uitry':
  7412. let dui3 = xGame.uiMgr.getUI(UITry);
  7413. dui3.qjff_AD_for_uitry();
  7414. break;
  7415. case 'qjff_AD_for_uipower':
  7416. let dui4 = xGame.uiMgr.getUI(UIPower);
  7417. dui4.qjff_AD_for_uipower();
  7418. break;
  7419. case 'qjff_AD_for_uigetAward':
  7420. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7421. dui5.qjff_AD_for_uigetAward();
  7422. break;
  7423. case 'qjff_AD_for_uiGameEnd':
  7424. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7425. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7426. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7427. break;
  7428. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7429. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7430. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7431. break;
  7432. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7433. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7434. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7435. break;
  7436. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7437. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7438. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7439. break;
  7440. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7441. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7442. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7443. break;
  7444. case 'qjff_AD_for_UIBOX_onOpenBox':
  7445. let dui11 = xGame.uiMgr.getUI(UIBox);
  7446. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7447. break;
  7448. case 'qjff_AD_for_UIAddCoin':
  7449. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7450. dui12.qjff_AD_for_UIAddCoin();
  7451. break;
  7452. case '111a':
  7453. let dui14 = xGame.uiMgr.getUI(UISign);
  7454. dui14.qjff_AD_for_uisign();
  7455. break;
  7456. case '222a':
  7457. let dui15 = xGame.uiMgr.getUI(UISign);
  7458. dui15.qjff_AD_for_uisign();
  7459. break;
  7460. case '333a':
  7461. let dui16 = xGame.uiMgr.getUI(UISign);
  7462. dui16.qjff_AD_for_uisign();
  7463. break;
  7464. default:
  7465. console.log('zh:未知的方法名字' + t);
  7466. break;
  7467. }
  7468. }
  7469. onConstructor() {
  7470. console.log('zh: UIMain onConstructor');
  7471. this.ui = ui_UIMain.createInstance();
  7472. this.contentPane = this.ui;
  7473. this.isEject = false;
  7474. this.addEvent();
  7475. this.addClickSpine();
  7476. this.settingNode = new SettingNode(this.ui.settingNode);
  7477. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7478. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7479. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7480. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7481. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7482. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7483. let curUse = DataMgr.getCurSecretary();
  7484. this.changeSecretary(curUse);
  7485. this.ui.talkNode.visible = false;
  7486. let guide = DataMgr.getSkillGuide();
  7487. if (xGame.common.isNewDay && guide == 1) {
  7488. xGame.common.isNewDay = false;
  7489. xGame.soundMgr.playSound("s_main01");
  7490. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7491. console.log("zh:播放小秘书每天语音");
  7492. }
  7493. this.onGetUserInfo();
  7494. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7495. DataMgr.getUserZiChanInfo();
  7496. }
  7497. this.ui.n83.visible = false;
  7498. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7499. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7500. let ua = d.username;
  7501. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7502. }
  7503. this.c_btn_for_user();
  7504. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7505. this.loadUserSpOrderForAd();
  7506. this.ui.n_fuli.visible = false;
  7507. }
  7508. Logout() {
  7509. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7510. LocalStorageManager.removeItem(keyForLoginInfo);
  7511. this.freshUser();
  7512. }
  7513. JSBridgeUtils.instance.loginOutForApp();
  7514. this.setUserDefaultNickname();
  7515. }
  7516. setUserDefaultNickname() {
  7517. let defUsername = "player";
  7518. this.ui.headNode.nameTxt.text = defUsername;
  7519. DataMgr.updateUserNickName(defUsername);
  7520. Moyu.updateUserInfo(defUsername);
  7521. }
  7522. gotoLogin() {
  7523. xGame.uiMgr.Show(UILogin);
  7524. }
  7525. gotoRegUser() {
  7526. xGame.uiMgr.Show(UIReg);
  7527. }
  7528. showFuLiSp1() {
  7529. console.log('zh:福利1');
  7530. this.checkForShowFuLi17(1);
  7531. }
  7532. showFuLiSp7() {
  7533. console.log('zh:福利7');
  7534. this.checkForShowFuLi17(7);
  7535. }
  7536. loadUserSpOrderForAd() {
  7537. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7538. if (userInfo == null) {
  7539. return;
  7540. }
  7541. let reqData = xGame.httpMgr.getReqData();
  7542. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  7543. try {
  7544. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  7545. let code = res.code;
  7546. let msg = res.msg;
  7547. if (code == 401) {
  7548. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7549. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7550. return;
  7551. }
  7552. if (code == 200) {
  7553. let data = res.data;
  7554. let buy_spid1 = false;
  7555. let buy_spid7 = false;
  7556. for (let index = 0; index < data.length; index++) {
  7557. let element = data[index];
  7558. console.log('zh:list element.spid = ' + element.spid);
  7559. if (element.spid == 1) {
  7560. buy_spid1 = true;
  7561. }
  7562. if (element.spid == 7) {
  7563. buy_spid7 = true;
  7564. }
  7565. }
  7566. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  7567. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  7568. }
  7569. else {
  7570. xGame.uiMgr.Show(UIMsg, msg);
  7571. }
  7572. }
  7573. catch (error) {
  7574. console.log('error=' + error);
  7575. alert(error);
  7576. }
  7577. finally {
  7578. }
  7579. });
  7580. }
  7581. checkForShowFuLi17(spid) {
  7582. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7583. if (userInfo == null) {
  7584. if (spid === 1) {
  7585. xGame.uiMgr.Show(UIFuli1);
  7586. }
  7587. if (spid === 7) {
  7588. xGame.uiMgr.Show(UIFuli2);
  7589. }
  7590. return;
  7591. }
  7592. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  7593. let reqData = xGame.httpMgr.getReqData();
  7594. let pd = JSON.parse(reqData);
  7595. pd.productId = spid;
  7596. reqData = JSON.stringify(pd);
  7597. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  7598. try {
  7599. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  7600. let code = res.code;
  7601. let msg = res.msg;
  7602. if (code == 401) {
  7603. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7604. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7605. return;
  7606. }
  7607. if (code == 200) {
  7608. let isBuyOk = res.data;
  7609. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  7610. if (isBuyOk === false) {
  7611. if (spid === 1) {
  7612. xGame.uiMgr.Show(UIFuli1);
  7613. }
  7614. if (spid === 7) {
  7615. xGame.uiMgr.Show(UIFuli2);
  7616. }
  7617. }
  7618. else {
  7619. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  7620. }
  7621. }
  7622. else {
  7623. xGame.uiMgr.Show(UIMsg, msg);
  7624. }
  7625. }
  7626. catch (error) {
  7627. console.log('error=' + error);
  7628. alert(error);
  7629. }
  7630. finally {
  7631. }
  7632. });
  7633. }
  7634. c_btn_for_user() {
  7635. this.ui.n_Logout.visible = false;
  7636. this.ui.n_dengLu.visible = false;
  7637. this.ui.n_zhuCe.visible = false;
  7638. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7639. this.ui.n_Logout.visible = true;
  7640. }
  7641. else {
  7642. this.ui.n_dengLu.visible = true;
  7643. }
  7644. }
  7645. changeSecretary(curUse) {
  7646. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7647. xGame.common.secretary && xGame.common.secretary.dispose();
  7648. this.addSecretarySpine(name);
  7649. }
  7650. addSecretarySpine(name) {
  7651. let spine = new SpineMgr(name, () => {
  7652. this.playSecretaryIdle();
  7653. });
  7654. xGame.common.secretary = spine;
  7655. }
  7656. addClickSpine() {
  7657. let clickSpine = new SpineMgr("dianji", () => {
  7658. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7659. let parent = Laya.stage;
  7660. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7661. clickSpine.play(data, 0, false, parent, (spine) => {
  7662. spine.destroy(true);
  7663. });
  7664. });
  7665. });
  7666. }
  7667. addEvent() {
  7668. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7669. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7670. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7671. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7672. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7673. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7674. this.addUIClick(this.ui, this.interuptSecretary);
  7675. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7676. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7677. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7678. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7679. this.addUIClick(this.ui.signBtn, this.openSignView);
  7680. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7681. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7682. this.addUIClick(this.ui.n_Logout, this.Logout);
  7683. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7684. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7685. this.addUIClick(this.ui.n_fuli, this.showFuLiSp7);
  7686. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7687. }
  7688. show(showFailWords) {
  7689. super.show();
  7690. this.loadUserSpOrderForAd();
  7691. this.moneyNode.ui.c1.selectedIndex = 1;
  7692. this.playSecretaryIdle();
  7693. xGame.soundMgr.playMusic("caromhall01", 0);
  7694. Laya.timer.clearAll(this);
  7695. this.playSecretaryRandomSound();
  7696. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7697. if (showFailWords) {
  7698. console.log('zh:uimain.ts ');
  7699. setTimeout(() => {
  7700. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7701. let words = -1;
  7702. if (str == "s_main02") {
  7703. words = 2;
  7704. }
  7705. else {
  7706. words = 3;
  7707. }
  7708. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7709. xGame.soundMgr.playSound(str);
  7710. }, 300);
  7711. }
  7712. this.showGuide();
  7713. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7714. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7715. let guide = DataMgr.getSkillGuide();
  7716. if (guide == 1) {
  7717. let randTime = xGame.common.randomNum(300, 800);
  7718. if (this.firstEnter) {
  7719. console.log("zh: firstEnter");
  7720. this.firstEnter = false;
  7721. randTime += 900;
  7722. }
  7723. else {
  7724. console.log("zh: no firstEnter");
  7725. }
  7726. Laya.timer.once(randTime, this, () => {
  7727. });
  7728. Laya.timer.once(1000, this, () => {
  7729. console.log('zh: 1秒后 showFuLiSp1');
  7730. this.showFuLiSp1();
  7731. });
  7732. Laya.timer.once(10000, this, () => {
  7733. console.log('zh: 10秒后 showFuLiSp1');
  7734. this.showFuLiSp7();
  7735. });
  7736. }
  7737. }
  7738. checkActive(show) {
  7739. }
  7740. showGuide() {
  7741. let guide = DataMgr.getSkillGuide();
  7742. this.ui.guideBtn.visible = guide == 0;
  7743. this.ui.enterGuide.visible = false;
  7744. this.ui.secretaryGuide.visible = guide == 0;
  7745. if (guide == 0) {
  7746. console.log("zh:显示引导");
  7747. xGame.soundMgr.playSound("s_guide");
  7748. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7749. }
  7750. else {
  7751. console.log("zh:不需要显示引导");
  7752. }
  7753. }
  7754. ensureSecretary() {
  7755. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7756. this.ui.secretaryGuide.visible = false;
  7757. this.ui.enterGuide.visible = true;
  7758. this.ui.wordsNode.t0.play();
  7759. if (DataMgr.getNewUser())
  7760. Moyu.sendDataEvent("gameReady");
  7761. }
  7762. playSecretaryIdle() {
  7763. let parent = this.ui.secretary.displayObject;
  7764. parent.destroyChildren();
  7765. let xx = this.ui.secretary.width / 2;
  7766. let yy = this.ui.secretary.height;
  7767. let scale = xGame.common.getSecretaryScale();
  7768. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7769. xGame.common.secretary.play(data, 0, true, parent);
  7770. }
  7771. startGame(type) {
  7772. if (!this.isReadyForLoadNetSource()) {
  7773. return;
  7774. }
  7775. xGame.common.gameMode = type;
  7776. Moyu.sendDataEvent("PlayGame", { type: type });
  7777. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7778. switch (xGame.common.gameMode) {
  7779. case GameMode.classic:
  7780. console.log('zh:进入经典模式111111111');
  7781. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7782. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7783. console.log('zh:classic db_over_lev=', db_over_lev);
  7784. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7785. console.log('zh:判断是否可以玩该模式classic =NO');
  7786. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7787. xGame.uiMgr.Show(UIMsg, tipStr);
  7788. return;
  7789. }
  7790. else {
  7791. console.log('zh:可以玩该模式classic 66666666666666');
  7792. this.beginGame();
  7793. }
  7794. }
  7795. else {
  7796. console.log('zh:不需要判断是否可以玩该classic');
  7797. let challengeTimes = DataMgr.getChallengeTimes();
  7798. if (challengeTimes == 0) {
  7799. xGame.uiMgr.Show(UIInvitation);
  7800. }
  7801. else {
  7802. this.beginGame();
  7803. }
  7804. break;
  7805. }
  7806. case GameMode.bigMove:
  7807. console.error('zh:bigMove check');
  7808. let guide = DataMgr.getSkillGuide();
  7809. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7810. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7811. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7812. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7813. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7814. xGame.uiMgr.Show(UIMsg, tipStr);
  7815. return;
  7816. }
  7817. else {
  7818. console.log('zh:可以玩该模式 bigMove');
  7819. this.beginGame();
  7820. if (DataMgr.getNewUser())
  7821. Moyu.sendDataEvent("gameStart0");
  7822. }
  7823. }
  7824. else {
  7825. this.beginGame();
  7826. if (DataMgr.getNewUser())
  7827. Moyu.sendDataEvent("gameStart0");
  7828. }
  7829. break;
  7830. default:
  7831. console.error('zh:未知错误!!!!');
  7832. break;
  7833. }
  7834. }
  7835. beginGame(isNice = false) {
  7836. console.log('zh:beginGame ');
  7837. let guide = DataMgr.getSkillGuide();
  7838. if (guide == 1) {
  7839. console.log('zh:非新手引导,showInternAd ');
  7840. JSBridgeUtils.instance.showInternAd('beginGame');
  7841. }
  7842. else {
  7843. console.log('zh:新手引导,不显示AD ');
  7844. }
  7845. console.log('zh:beginGame 2 go');
  7846. if (xGame.common.gameMode == GameMode.classic) {
  7847. if (isNice) {
  7848. this.enterClassic();
  7849. }
  7850. else {
  7851. xGame.uiMgr.Show(UIModeSelection, () => {
  7852. console.log('zh:BBBBBBBBBBBBBBB');
  7853. this.enterClassic();
  7854. });
  7855. }
  7856. }
  7857. else if (xGame.common.gameMode == GameMode.bigMove) {
  7858. this.ui.enterGuide.visible = false;
  7859. xGame.uiMgr.Show(UISkill);
  7860. }
  7861. }
  7862. enterClassic() {
  7863. xGame.uiMgr.Show(UIGame);
  7864. xGame.uiMgr.Show(UIMatching, () => {
  7865. if (!this.isHide)
  7866. this.hide();
  7867. xGame.common.gameUI.ui.alpha = 1;
  7868. xGame.common.gameUI.startGame();
  7869. xGame.uiMgr.Hide(UIGameEnd);
  7870. });
  7871. }
  7872. start_debug_for_moni_payOk() {
  7873. console.log('zh:start_debug_for_moni_payOk');
  7874. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7875. if (userInfo != null) {
  7876. let token = userInfo.token;
  7877. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7878. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7879. alert('模拟支付OK');
  7880. return;
  7881. }
  7882. else {
  7883. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7884. }
  7885. }
  7886. startGlobal() {
  7887. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7888. }
  7889. startWeekly() {
  7890. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7891. }
  7892. zhouSaiMonth() {
  7893. console.log('zh: zhouSaiMonth 被调用');
  7894. }
  7895. isReadyForLoadNetSource() {
  7896. let reqCount = xGame.cfgMgr.httpReqCount;
  7897. let ok = xGame.cfgMgr.httpReqOkCount;
  7898. if (reqCount > ok) {
  7899. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7900. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7901. Laya.timer.once(5000, this, () => {
  7902. let retryCount = 0;
  7903. const maxRetries = 3;
  7904. const tryFetchConfig = () => {
  7905. try {
  7906. xGame.cfgMgr.getConfigFromServer();
  7907. }
  7908. catch (error) {
  7909. if (retryCount < maxRetries) {
  7910. retryCount++;
  7911. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7912. Laya.timer.once(5000, this, tryFetchConfig);
  7913. }
  7914. else {
  7915. console.error("❌ 达到最大重试次数,配置获取失败");
  7916. }
  7917. }
  7918. };
  7919. tryFetchConfig();
  7920. });
  7921. return false;
  7922. }
  7923. return true;
  7924. }
  7925. startPlaceBall() {
  7926. if (!this.isReadyForLoadNetSource()) {
  7927. return;
  7928. }
  7929. xGame.uiMgr.Show(UILevelDisplay);
  7930. }
  7931. hide() {
  7932. console.log('zh:uimain hide ...');
  7933. super.hide();
  7934. xGame.common.stopGirlPop(this.ui.talkNode);
  7935. }
  7936. onGetUserInfo(force = false) {
  7937. if (Moyu.isWx) {
  7938. let info = Moyu.getSystemInfo();
  7939. if (info)
  7940. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7941. }
  7942. else {
  7943. Moyu.initUser(this, this.freshUser, force);
  7944. }
  7945. this.freshUser();
  7946. }
  7947. event_login_in() {
  7948. console.log("zh:event_login_in被触发");
  7949. this.freshUser();
  7950. }
  7951. freshUser() {
  7952. let user = Moyu.getUserInfo();
  7953. if (!user.isAuth) {
  7954. user.headIcon = 'res/ty_touxiang.png';
  7955. }
  7956. else {
  7957. DataMgr.upRankData();
  7958. }
  7959. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7960. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7961. let keyStr = keyForLoginInfo;
  7962. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7963. const d = LocalStorageManager.getItem(keyStr);
  7964. let ua = d.username;
  7965. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7966. }
  7967. else {
  7968. }
  7969. this.c_btn_for_user();
  7970. }
  7971. interuptSecretary() {
  7972. Laya.timer.clearAll(this);
  7973. this.playSecretaryRandomSound();
  7974. }
  7975. playSecretaryRandomSound() {
  7976. if (this.isHide)
  7977. return;
  7978. let time = xGame.common.randomNum(45000, 60000);
  7979. Laya.timer.once(time, this, () => {
  7980. if (this.isHide)
  7981. return;
  7982. let index = xGame.common.randomNum(4, 7);
  7983. xGame.soundMgr.playSound("s_main0" + index);
  7984. let words = 1;
  7985. switch (index) {
  7986. case 4:
  7987. words = 5;
  7988. break;
  7989. case 5:
  7990. words = 3;
  7991. break;
  7992. case 6:
  7993. words = 6;
  7994. break;
  7995. case 7:
  7996. words = 7;
  7997. break;
  7998. default:
  7999. break;
  8000. }
  8001. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8002. this.playSecretaryRandomSound();
  8003. });
  8004. }
  8005. openSecretaryView() {
  8006. xGame.uiMgr.Show(UISecretary);
  8007. Moyu.sendDataEvent("secretary");
  8008. }
  8009. openShopView() {
  8010. xGame.uiMgr.Show(UIShop, 0);
  8011. }
  8012. openSignView() {
  8013. xGame.uiMgr.Show(UISign);
  8014. }
  8015. openDrawView() {
  8016. xGame.uiMgr.Show(UIDraw);
  8017. }
  8018. openRanking() {
  8019. console.log('zh:phb openRanking');
  8020. xGame.uiMgr.Show(UIRanking);
  8021. Moyu.sendDataEvent("rankingList");
  8022. }
  8023. }
  8024. UIMain.uiName = "UIMain";
  8025. class UIGameEnd extends UIBase {
  8026. constructor() {
  8027. super();
  8028. this.success = false;
  8029. this.awardCoinNum = 1000;
  8030. this.awardDiamondNum = 10;
  8031. }
  8032. onConstructor() {
  8033. this.ui = ui_UIGameEnd.createInstance();
  8034. this.contentPane = this.ui;
  8035. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8036. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8037. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8038. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8039. this.ui.talkNode.visible = false;
  8040. if (Moyu.isKs)
  8041. this.ui.closeNode.closeBtn.x += 100;
  8042. }
  8043. updateType() {
  8044. switch (xGame.common.gameMode) {
  8045. case GameMode.classic:
  8046. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8047. this.ui.coinNode.visible = this.success;
  8048. if (!this.success) {
  8049. Laya.timer.once(500, this, () => {
  8050. xGame.uiMgr.Show(UIAddCoin);
  8051. });
  8052. }
  8053. else {
  8054. this.logEventForClassic_win();
  8055. }
  8056. this.logEventForClassic_complete();
  8057. this.ui.isGetAward.visible = false;
  8058. this.ui.leftBtn.c1.selectedIndex = 3;
  8059. this.ui.rightBtn.c1.selectedIndex = 0;
  8060. this.moneyNode.ui.c1.selectedIndex = 1;
  8061. break;
  8062. case GameMode.bigMove:
  8063. console.log('zh:招法模式 aaaaaa bigMove');
  8064. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8065. this.ui.coinNode.visible = this.success;
  8066. if (xGame.common.gameMode == GameMode.bigMove) {
  8067. if (this.success) {
  8068. DataMgr.setSkillSuccessTimes(1, true);
  8069. DataMgr.setSkillAccTimes(1);
  8070. }
  8071. else {
  8072. DataMgr.setSkillSuccessTimes(0, false);
  8073. }
  8074. }
  8075. this.logEventForRod_complete_N();
  8076. if (!this.success) {
  8077. Laya.timer.once(500, this, () => {
  8078. xGame.uiMgr.Show(UIAddCoin);
  8079. });
  8080. }
  8081. else {
  8082. this.logEventForRod_win();
  8083. }
  8084. this.ui.isGetAward.visible = false;
  8085. this.ui.leftBtn.c1.selectedIndex = 3;
  8086. this.ui.rightBtn.c1.selectedIndex = 0;
  8087. this.moneyNode.ui.c1.selectedIndex = 1;
  8088. break;
  8089. case GameMode.placeBall:
  8090. this.ui.coinNode.visible = false;
  8091. if (this.success) {
  8092. if (xGame.common.placeBallStarNum == 3) {
  8093. this.ui.c1.selectedIndex = 2;
  8094. }
  8095. else {
  8096. this.ui.c1.selectedIndex = 3;
  8097. }
  8098. let level = xGame.common.placeBallCurLevel;
  8099. if (level > 59) {
  8100. this.logEventForChallenge_level_complete(level);
  8101. }
  8102. else {
  8103. this.logEventForChallenge_level_N(level);
  8104. }
  8105. }
  8106. else {
  8107. this.ui.c1.selectedIndex = 4;
  8108. }
  8109. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8110. if (cfg.type == PlaceBallType.challenge) {
  8111. this.ui.c1.selectedIndex = 2;
  8112. }
  8113. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8114. this.updatePlaceBallBtn();
  8115. this.updatePlaceBallStarNum();
  8116. this.updatePlaceBallAwardState();
  8117. this.moneyNode.ui.c1.selectedIndex = 2;
  8118. this.moneyNode.checkPowerTime();
  8119. this.moneyNode.powerChange();
  8120. DataMgr.upRankData();
  8121. break;
  8122. default:
  8123. break;
  8124. }
  8125. }
  8126. logEventForRod_complete_N() {
  8127. let gfmsIdx = xGame.common.curPlayerSkillType;
  8128. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8129. let gfmc = 'Skyfall Shot';
  8130. if (gfmsIdx == 0) {
  8131. gfmc = 'Skyfall Shot';
  8132. }
  8133. if (gfmsIdx == 1) {
  8134. gfmc = 'Surging break';
  8135. }
  8136. if (gfmsIdx == 2) {
  8137. gfmc = 'Frost Lock';
  8138. }
  8139. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8140. console.log('zh:logEventForRod_complete_N level = ' + level);
  8141. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8142. let jsonStr = {
  8143. "count": 0,
  8144. "name": gfmc
  8145. };
  8146. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8147. const d = LocalStorageManager.getItem(keyStr);
  8148. jsonStr.count = d.count + 1;
  8149. LocalStorageManager.setItem(keyStr, jsonStr);
  8150. }
  8151. else {
  8152. LocalStorageManager.setItem(keyStr, jsonStr);
  8153. }
  8154. const d2 = LocalStorageManager.getItem(keyStr);
  8155. let count = d2.count;
  8156. console.log('zh:logEventForRod_complete_N count = ' + count);
  8157. if (count % 5 == 0) {
  8158. const reqStr = JSON.stringify(jsonStr);
  8159. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8160. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8161. }
  8162. }
  8163. logEventForRod_win() {
  8164. console.log('zh:logEventForRod_win,胜利');
  8165. let gfmsIdx = xGame.common.curPlayerSkillType;
  8166. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8167. let gfmc = 'Skyfall Shot';
  8168. if (gfmsIdx == 0) {
  8169. gfmc = 'Skyfall Shot';
  8170. }
  8171. if (gfmsIdx == 1) {
  8172. gfmc = 'Surging break';
  8173. }
  8174. if (gfmsIdx == 2) {
  8175. gfmc = 'Frost Lock';
  8176. }
  8177. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8178. console.log('zh:logEventForRod_win level = ' + level);
  8179. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8180. let jsonStr = {
  8181. "count": 1,
  8182. "name": gfmc + ' Lev' + level
  8183. };
  8184. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8185. const d = LocalStorageManager.getItem(keyStr);
  8186. jsonStr.count = d.count + 1;
  8187. LocalStorageManager.setItem(keyStr, jsonStr);
  8188. }
  8189. else {
  8190. LocalStorageManager.setItem(keyStr, jsonStr);
  8191. }
  8192. const reqStr = JSON.stringify(jsonStr);
  8193. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8194. }
  8195. logEventForClassic_win() {
  8196. console.log('zh:logEventForClassic_win,胜利');
  8197. let rtype = xGame.common.classicRoomType;
  8198. let msmc = '';
  8199. if (rtype == 1) {
  8200. msmc = 'beginner';
  8201. }
  8202. if (rtype == 2) {
  8203. msmc = 'expert';
  8204. }
  8205. if (rtype == 3) {
  8206. msmc = 'master';
  8207. }
  8208. let keyStr = 'sjmd_classic_win_' + rtype;
  8209. let jsonStr = {
  8210. "difficulty": msmc,
  8211. "classic_count": 1,
  8212. "difficulty_count": 1
  8213. };
  8214. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8215. const d = LocalStorageManager.getItem(keyStr);
  8216. jsonStr.classic_count = d.classic_count + 1;
  8217. jsonStr.difficulty_count = d.difficulty_count + 1;
  8218. LocalStorageManager.setItem(keyStr, jsonStr);
  8219. }
  8220. else {
  8221. LocalStorageManager.setItem(keyStr, jsonStr);
  8222. }
  8223. const reqStr = JSON.stringify(jsonStr);
  8224. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8225. }
  8226. logEventForClassic_complete() {
  8227. console.log('zh:logEventForClassic_complete,胜利');
  8228. let rtype = xGame.common.classicRoomType;
  8229. let msmc = '';
  8230. if (rtype == 1) {
  8231. msmc = 'beginner';
  8232. }
  8233. if (rtype == 2) {
  8234. msmc = 'expert';
  8235. }
  8236. if (rtype == 3) {
  8237. msmc = 'master';
  8238. }
  8239. let keyStr = 'sjmd_classic_complete_' + rtype;
  8240. let jsonStr = {
  8241. "msmc": msmc,
  8242. "count": 0
  8243. };
  8244. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8245. const d = LocalStorageManager.getItem(keyStr);
  8246. jsonStr.count = d.count + 1;
  8247. LocalStorageManager.setItem(keyStr, jsonStr);
  8248. }
  8249. else {
  8250. LocalStorageManager.setItem(keyStr, jsonStr);
  8251. }
  8252. if (jsonStr.count % 5 == 0) {
  8253. const reqStr = JSON.stringify(jsonStr);
  8254. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8255. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8256. }
  8257. }
  8258. updatePlaceBallBtn() {
  8259. this.ui.leftBtn.c1.selectedIndex = 5;
  8260. if (this.success) {
  8261. this.ui.rightBtn.c1.selectedIndex = 14;
  8262. }
  8263. else {
  8264. if (xGame.common.placeBallStarNum == 3) {
  8265. this.ui.rightBtn.c1.selectedIndex = 14;
  8266. }
  8267. else {
  8268. this.ui.rightBtn.c1.selectedIndex = 1;
  8269. }
  8270. }
  8271. }
  8272. updatePlaceBallStarNum() {
  8273. let starNum = xGame.common.placeBallStarNum;
  8274. if (starNum == 0)
  8275. this.ui.starNumNode.c1.selectedIndex = 3;
  8276. else {
  8277. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8278. }
  8279. }
  8280. updatePlaceBallAwardState() {
  8281. let level = xGame.common.placeBallCurLevel;
  8282. let starNum = xGame.common.placeBallStarNum;
  8283. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8284. let data = cfgTable.placeballData[level].award;
  8285. let cfg = cfgTable.placeballData[level];
  8286. this.awardDiamondNum = data[1];
  8287. this.awardCoinNum = data[0];
  8288. if (cfg.type == PlaceBallType.challenge) {
  8289. this.awardDiamondNum = 0;
  8290. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8291. }
  8292. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8293. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8294. if (cfg.type == PlaceBallType.challenge) {
  8295. this.ui.awardNode.coinNode.visible = true;
  8296. }
  8297. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8298. this.ui.awardNode.diamondNode.x = 265;
  8299. this.ui.awardNode.coinNode.x = 354;
  8300. }
  8301. else {
  8302. this.ui.awardNode.diamondNode.x = 291;
  8303. this.ui.awardNode.coinNode.x = 291;
  8304. }
  8305. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8306. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8307. if (this.awardCoinNum == 0) {
  8308. this.ui.awardNode.coinNode.numTxt.text = "";
  8309. }
  8310. if (getAward) {
  8311. this.ui.isGetAward.visible = true;
  8312. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8313. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8314. }
  8315. else {
  8316. this.ui.isGetAward.visible = false;
  8317. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8318. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8319. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8320. }
  8321. else {
  8322. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8323. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8324. }
  8325. }
  8326. }
  8327. show(success) {
  8328. super.show();
  8329. xGame.eventMgr.event(RESET_GAME);
  8330. this.success = success;
  8331. Laya.timer.clearAll(this);
  8332. this.playSecretaryAni();
  8333. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8334. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8335. offsetTime = Math.floor(offsetTime / 1000);
  8336. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8337. this.updateType();
  8338. Laya.timer.once(200, this, () => {
  8339. this.addAward(() => {
  8340. this.updateType();
  8341. Laya.timer.once(500, this, () => {
  8342. this.showChallengeLevel();
  8343. });
  8344. });
  8345. });
  8346. if (this.success) {
  8347. JSBridgeUtils.instance.showInternAd('gameend_success');
  8348. console.log('zh:game end 成功');
  8349. xGame.soundMgr.playSound('slots_roll01');
  8350. xGame.soundMgr.playSound("s_win");
  8351. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8352. this.diyGameDataUtilForGameWin();
  8353. }
  8354. else {
  8355. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8356. console.log('zh:game end失败');
  8357. xGame.soundMgr.playSound('matchwin01');
  8358. xGame.soundMgr.playSound("s_lose");
  8359. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8360. }
  8361. let challengeNum = DataMgr.getChallengeTimes();
  8362. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8363. DataMgr.setChallengeTimes(1);
  8364. }
  8365. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8366. DataMgr.setClassicTimes();
  8367. }
  8368. }
  8369. diyGameDataUtilForGameWin() {
  8370. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8371. switch (xGame.common.gameMode) {
  8372. case GameMode.classic:
  8373. console.log('zh:DiyGameDataUtilForGameWin 111');
  8374. case GameMode.bigMove:
  8375. console.log('zh:DiyGameDataUtilForGameWin 222');
  8376. this.restartGame();
  8377. break;
  8378. case GameMode.placeBall:
  8379. console.log('zh:DiyGameDataUtilForGameWin 333');
  8380. var level = xGame.common.placeBallCurLevel;
  8381. console.log('zh:练习模式 联系了多少LEV=' + level);
  8382. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8383. if (level > db_over_lev) {
  8384. DataMgr.setChallengeMode_overLev(level);
  8385. }
  8386. break;
  8387. default:
  8388. console.log('zh:DiyGameDataUtilForGameWin 444');
  8389. break;
  8390. }
  8391. }
  8392. showChallengeLevel() {
  8393. if (DataMgr.getChallengeTimes() != 0)
  8394. return;
  8395. let skill = DataMgr.getSkillAccTimes();
  8396. let put = DataMgr.getPlaceBallLevelList().length;
  8397. if (skill >= 3 || put >= 5) {
  8398. xGame.uiMgr.Show(UIInvitation);
  8399. this.hide();
  8400. }
  8401. }
  8402. addAward(callback) {
  8403. if (!this.success) {
  8404. callback && callback();
  8405. return;
  8406. }
  8407. switch (xGame.common.gameMode) {
  8408. case GameMode.classic:
  8409. this.awardCoinNum = xGame.common.passAwardCoin;
  8410. this.awardDiamondNum = 0;
  8411. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8412. break;
  8413. case GameMode.bigMove:
  8414. this.awardCoinNum = xGame.common.passAwardCoin;
  8415. this.awardDiamondNum = 0;
  8416. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8417. callback && callback();
  8418. break;
  8419. case GameMode.placeBall:
  8420. let level = xGame.common.placeBallCurLevel;
  8421. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8422. if (xGame.common.placeBallStarNum != 3) {
  8423. callback && callback();
  8424. return;
  8425. }
  8426. else {
  8427. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8428. if (getAward) {
  8429. callback && callback();
  8430. return;
  8431. }
  8432. }
  8433. let cfg = cfgTable.placeballData[level];
  8434. let data = cfgTable.placeballData[level].award;
  8435. this.awardCoinNum = data[0];
  8436. this.awardDiamondNum = data[1];
  8437. if (cfg.type == PlaceBallType.challenge) {
  8438. this.awardDiamondNum = 0;
  8439. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8440. }
  8441. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8442. let diamondAward;
  8443. if (this.awardDiamondNum > 0) {
  8444. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8445. xGame.common.getAward([diamondAward, coinAward], callback);
  8446. }
  8447. else {
  8448. xGame.common.getAward([coinAward], callback);
  8449. }
  8450. if (cfg.type == PlaceBallType.normal) {
  8451. DataMgr.setPlaceBallAward(level);
  8452. }
  8453. break;
  8454. default:
  8455. break;
  8456. }
  8457. }
  8458. playSecretaryAni_old() {
  8459. let parent = this.ui.secretary.displayObject;
  8460. parent.destroyChildren();
  8461. let xx = this.ui.secretary.width / 2;
  8462. let yy = this.ui.secretary.height;
  8463. let scale = xGame.common.getSecretaryScale();
  8464. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8465. if (this.success) {
  8466. let rand = Math.random() <= 0.5 ? 2 : 3;
  8467. xGame.common.secretary.play(data, rand, false, parent, () => {
  8468. xGame.common.secretary.play(data, 1, true, parent);
  8469. });
  8470. }
  8471. else {
  8472. xGame.common.secretary.play(data, 0, true, parent);
  8473. }
  8474. }
  8475. playSecretaryAni() {
  8476. let parent = this.ui.secretary.displayObject;
  8477. parent.destroyChildren();
  8478. let xx = this.ui.secretary.width / 2;
  8479. let yy = this.ui.secretary.height;
  8480. let scale = xGame.common.getSecretaryScale();
  8481. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8482. if (this.success) {
  8483. let rand = 0;
  8484. xGame.common.secretary.play(data, 0, true, parent);
  8485. }
  8486. else {
  8487. xGame.common.secretary.play(data, 0, true, parent);
  8488. }
  8489. }
  8490. restartGame() {
  8491. switch (xGame.common.gameMode) {
  8492. case GameMode.classic:
  8493. xGame.eventMgr.event(RESTART_GAME);
  8494. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8495. break;
  8496. case GameMode.bigMove:
  8497. this.hide();
  8498. xGame.eventMgr.event(RESTART_GAME);
  8499. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8500. break;
  8501. default:
  8502. break;
  8503. }
  8504. }
  8505. hide() {
  8506. super.hide();
  8507. xGame.common.stopGirlPop(this.ui.talkNode);
  8508. PlatMgr.showBanner(false);
  8509. }
  8510. returnHome() {
  8511. this.hide();
  8512. let showFailWords = !this.success;
  8513. xGame.uiMgr.Show(UIMain, showFailWords);
  8514. }
  8515. clickLeftBtn() {
  8516. switch (xGame.common.gameMode) {
  8517. case GameMode.classic:
  8518. case GameMode.bigMove:
  8519. this.returnHome();
  8520. break;
  8521. case GameMode.placeBall:
  8522. let level = xGame.common.placeBallCurLevel;
  8523. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8524. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8525. break;
  8526. default:
  8527. break;
  8528. }
  8529. }
  8530. powerStartPlaceBallLevel(level, btn) {
  8531. if (DataMgr.powerEnough()) {
  8532. btn.touchable = false;
  8533. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8534. btn.touchable = true;
  8535. DataMgr.setPower(-1);
  8536. xGame.eventMgr.event(POWER_TIME);
  8537. this.startPlaceBallLevel(level);
  8538. this.logEventForChallenge_level_start(level);
  8539. }));
  8540. }
  8541. else {
  8542. xGame.uiMgr.Show(UIPower, 0);
  8543. }
  8544. }
  8545. clickRightBtn() {
  8546. switch (xGame.common.gameMode) {
  8547. case GameMode.classic:
  8548. console.log('zh:clickRightBtn 111');
  8549. case GameMode.bigMove:
  8550. console.log('zh:clickRightBtn 222');
  8551. this.restartGame();
  8552. break;
  8553. case GameMode.placeBall:
  8554. console.log('zh:clickRightBtn 333');
  8555. let level = xGame.common.placeBallCurLevel;
  8556. let data = DataMgr.getPlaceBallLevel(level);
  8557. let curPss = data.play && !data.isCur;
  8558. if (curPss) {
  8559. console.log('zh:clickRightBtn 333-111');
  8560. console.log('zh:当前LV=' + level);
  8561. if (level == 60) {
  8562. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8563. Laya.timer.once(3000, this, () => {
  8564. this.returnHome();
  8565. });
  8566. }
  8567. else {
  8568. let lev = level + 1;
  8569. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8570. }
  8571. }
  8572. else {
  8573. console.log('zh:clickRightBtn 333-000');
  8574. Moyu.sendDataEvent("placeBallNextLevel");
  8575. console.log('zh:qjff_AD_for_uiGameEnd');
  8576. if (Laya.Browser.onAndroid) {
  8577. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8578. if (!boo) {
  8579. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8580. return;
  8581. }
  8582. }
  8583. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8584. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8585. }
  8586. else {
  8587. console.log('zh:AD 失败,直接发放奖励');
  8588. this.qjff_AD_for_uiGameEnd(level);
  8589. }
  8590. }
  8591. break;
  8592. default:
  8593. console.log('zh:clickRightBtn 444');
  8594. break;
  8595. }
  8596. }
  8597. logEventForChallenge_level_start(level) {
  8598. let keyStr = 'sjmd_challenge_level_start';
  8599. let jsonStr = {
  8600. "count": 0,
  8601. "gold_balance ": DataMgr.getCoin(),
  8602. "level": level,
  8603. "diamond_balance ": DataMgr.getDiamond()
  8604. };
  8605. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8606. const d = LocalStorageManager.getItem(keyStr);
  8607. if (level > d.level) {
  8608. jsonStr.count = d.count + 1;
  8609. LocalStorageManager.setItem(keyStr, jsonStr);
  8610. }
  8611. else {
  8612. }
  8613. }
  8614. else {
  8615. LocalStorageManager.setItem(keyStr, jsonStr);
  8616. }
  8617. const reqStr = JSON.stringify(jsonStr);
  8618. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8619. }
  8620. qjff_AD_for_uiGameEnd(level) {
  8621. DataMgr.setPlaceBallLevel(level, 1);
  8622. this.startPlaceBallLevel(level + 1);
  8623. }
  8624. startPlaceBallLevel(level) {
  8625. xGame.common.gameMode = GameMode.placeBall;
  8626. xGame.common.placeBallCurLevel = level;
  8627. xGame.uiMgr.Show(UIGame);
  8628. this.hide();
  8629. }
  8630. logEventForChallenge_level_complete(level) {
  8631. let keyStr = 'sjmd_challenge_level_complete';
  8632. let jsonStr = {
  8633. "count": 1,
  8634. "gold_balance ": DataMgr.getCoin(),
  8635. "level": level,
  8636. "diamond_balance ": DataMgr.getDiamond()
  8637. };
  8638. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8639. const d = LocalStorageManager.getItem(keyStr);
  8640. jsonStr.count = d.count + 1;
  8641. LocalStorageManager.setItem(keyStr, jsonStr);
  8642. }
  8643. else {
  8644. LocalStorageManager.setItem(keyStr, jsonStr);
  8645. }
  8646. const reqStr = JSON.stringify(jsonStr);
  8647. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8648. }
  8649. logEventForChallenge_level_N(level) {
  8650. console.log('zh:logEventForChallenge_level_N ' + level);
  8651. let keyStr = 'sjmd_challenge_level_N';
  8652. if (LocalStorageManager.hasKey(keyStr)) {
  8653. let lev = LocalStorageManager.getItem(keyStr);
  8654. if (level > lev) {
  8655. LocalStorageManager.setItem(keyStr, level);
  8656. }
  8657. if ((level) % 5 == 0) {
  8658. console.log('zh:每5关上报1次');
  8659. let sjmc = 'challenge_level_' + level;
  8660. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8661. let sjmcForFirebase = 'challenge_level_' + level;
  8662. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8663. }
  8664. else {
  8665. console.log('zh:5 no 上报');
  8666. }
  8667. }
  8668. else {
  8669. LocalStorageManager.setItem(keyStr, level);
  8670. }
  8671. }
  8672. }
  8673. UIGameEnd.uiName = "UIGameEnd";
  8674. class ui_UIVideoShare extends fgui.GComponent {
  8675. static createInstance() {
  8676. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8677. }
  8678. onConstruct() {
  8679. this.n10 = (this.getChild("n10"));
  8680. this.myNode = (this.getChild("myNode"));
  8681. this.t0 = this.getTransition("t0");
  8682. }
  8683. }
  8684. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8685. class UIVideoShare extends UIBase {
  8686. constructor() {
  8687. super();
  8688. this.success = false;
  8689. this.awardNum = 0;
  8690. this.isShared = true;
  8691. }
  8692. onConstructor() {
  8693. this.ui = ui_UIVideoShare.createInstance();
  8694. this.contentPane = this.ui;
  8695. this.isEject = false;
  8696. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8697. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8698. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8699. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8700. }
  8701. show(success) {
  8702. super.show();
  8703. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8704. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8705. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8706. this.success = success;
  8707. let time = xGame.common.randomNum(600, 1500);
  8708. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8709. if (success)
  8710. xGame.soundMgr.playSound("applause");
  8711. this.ui.t0.play();
  8712. this.checkShareState();
  8713. let times = DataMgr.getDailyVideoShareTimes();
  8714. this.awardNum = times == 0 ? 2000 : 200;
  8715. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8716. }
  8717. checkShareState() {
  8718. if (PlatMgr.forceShare == 0) {
  8719. this.ui.myNode.closeBtn.visible = true;
  8720. this.ui.myNode.tipsNode.visible = false;
  8721. this.ui.myNode.closeBtn.x = 90;
  8722. this.ui.myNode.shareBtn.x = 342;
  8723. }
  8724. else if (PlatMgr.forceShare == 1) {
  8725. this.ui.myNode.closeBtn.visible = false;
  8726. this.ui.myNode.tipsNode.visible = true;
  8727. this.ui.myNode.shareBtn.x = 218;
  8728. this.isShared = true;
  8729. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8730. }
  8731. }
  8732. checkForceShare() {
  8733. this.isShared = !this.isShared;
  8734. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8735. }
  8736. videoShare() {
  8737. if (PlatMgr.forceShare == 1) {
  8738. if (this.isShared) {
  8739. this.shareGame();
  8740. }
  8741. else {
  8742. this.hideSelf();
  8743. }
  8744. }
  8745. else {
  8746. this.shareGame();
  8747. }
  8748. }
  8749. shareGame() {
  8750. Moyu.sendDataEvent("VideoShare");
  8751. if (Moyu.canShare() > 100) {
  8752. Moyu.shareGame((success) => {
  8753. if (success) {
  8754. DataMgr.setDailyVideoShareTimes(1);
  8755. DataMgr.setCoin(this.awardNum);
  8756. }
  8757. this.hideSelf();
  8758. }, this);
  8759. }
  8760. else {
  8761. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8762. this.hideSelf();
  8763. }
  8764. }
  8765. hideSelf() {
  8766. this.hide();
  8767. xGame.uiMgr.Show(UIGameEnd, this.success);
  8768. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8769. xGame.common.screenImg.destroy();
  8770. xGame.common.screenImg = null;
  8771. }
  8772. }
  8773. }
  8774. UIVideoShare.uiName = "UIVideoShare";
  8775. class ui_UITips extends fgui.GComponent {
  8776. static createInstance() {
  8777. return (fgui.UIPackage.createObject("game", "UITips"));
  8778. }
  8779. onConstruct() {
  8780. this.n0 = (this.getChild("n0"));
  8781. this.myNode = (this.getChild("myNode"));
  8782. this.t0 = this.getTransition("t0");
  8783. }
  8784. }
  8785. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8786. class UITips extends UIBase {
  8787. constructor() {
  8788. super();
  8789. this.type = 0;
  8790. }
  8791. onConstructor() {
  8792. this.ui = ui_UITips.createInstance();
  8793. this.contentPane = this.ui;
  8794. this.isEject = false;
  8795. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8796. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8797. }
  8798. show(tipsTxt, womanTxt, type) {
  8799. super.show();
  8800. this.ui.t0.play();
  8801. this.ui.myNode.tipsTxt.text = tipsTxt;
  8802. this.ui.myNode.womanTxt.text = womanTxt;
  8803. PlatMgr.showInsert(true);
  8804. this.ui.myNode.c1.selectedIndex = type;
  8805. this.type = type;
  8806. switch (this.type) {
  8807. case TipsType.exitGame:
  8808. xGame.common.gameMgr.gamePause = true;
  8809. break;
  8810. case TipsType.foul:
  8811. Laya.timer.once(200, this, () => {
  8812. xGame.common.gameMgr.gamePause = true;
  8813. });
  8814. break;
  8815. default:
  8816. break;
  8817. }
  8818. }
  8819. clickLeftBtn() {
  8820. this.hide();
  8821. xGame.common.gameMgr.gamePause = false;
  8822. switch (this.type) {
  8823. case TipsType.exitGame:
  8824. break;
  8825. case TipsType.foul:
  8826. break;
  8827. default:
  8828. break;
  8829. }
  8830. }
  8831. clickRightBtn() {
  8832. this.hide();
  8833. switch (this.type) {
  8834. case TipsType.exitGame:
  8835. xGame.eventMgr.event(RESET_GAME);
  8836. xGame.uiMgr.Show(UIMain);
  8837. Moyu.recordEnd(this, null);
  8838. xGame.common.longHelpLine = false;
  8839. break;
  8840. case TipsType.foul:
  8841. xGame.common.gameMgr.gamePause = false;
  8842. Laya.timer.clearAll(this);
  8843. break;
  8844. default:
  8845. break;
  8846. }
  8847. }
  8848. }
  8849. UITips.uiName = "UITips";
  8850. class GameMgr {
  8851. constructor() {
  8852. this.selfCamp = "";
  8853. this.selfFoulNum = 0;
  8854. this.selfBallArr = [];
  8855. this.selfTimer = 0;
  8856. this.selfScore = 0;
  8857. this.aiCamp = "";
  8858. this.aiFoulNum = 0;
  8859. this.aiBallArr = [];
  8860. this.aiTimer = 0;
  8861. this.aiScore = 0;
  8862. this.aiSkillLevelNum = 1;
  8863. this.targertScore = 0;
  8864. this.setTime = 30;
  8865. this.selfTurnRate = 0.5;
  8866. this.accTime = 0;
  8867. this.curFoul = "";
  8868. this.maxFoulTimes = 3;
  8869. this.isFirstInGame = true;
  8870. this.firstColliObj = null;
  8871. this.inHoleBalls = [];
  8872. this.blackNum = 8;
  8873. this.success = false;
  8874. this.holePosList = [];
  8875. this.posObj = {};
  8876. this._selfTurn = false;
  8877. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8878. this.ensureBallType = false;
  8879. this.isOpenBall = true;
  8880. this.finishOneShoot = true;
  8881. this.isEnd = false;
  8882. this.isChangeTurn = false;
  8883. this.isInterrupt = false;
  8884. this.aiPlayedBreakArmy = false;
  8885. this.isTouchedBall = false;
  8886. this.finishBalls = 0;
  8887. this.needBalls = 0;
  8888. this.allBallNum = 0;
  8889. this.placeBallPosData = {};
  8890. this.curHP = 0;
  8891. this.showLongView = false;
  8892. this.firstShoot = true;
  8893. this._gamePause = false;
  8894. this.trunCount = 0;
  8895. this.isBlackInHole = false;
  8896. this.isEnter = true;
  8897. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8898. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8899. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8900. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8901. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8902. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8903. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8904. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8905. }
  8906. get gamePause() {
  8907. return this._gamePause;
  8908. }
  8909. set gamePause(v) {
  8910. if (v) {
  8911. Laya.physicsTimer.pause();
  8912. }
  8913. else {
  8914. Laya.physicsTimer.resume();
  8915. }
  8916. this._gamePause = v;
  8917. }
  8918. get selfTurn() {
  8919. return this._selfTurn;
  8920. }
  8921. set selfTurn(val) {
  8922. this.trunCount++;
  8923. this._selfTurn = val;
  8924. if (val) {
  8925. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8926. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8927. }
  8928. else {
  8929. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8930. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8931. if (this.trunCount > 1)
  8932. PlatMgr.openBox();
  8933. }
  8934. }
  8935. resetGame() {
  8936. this.inHoleBalls = [];
  8937. this.isFirstInGame = true;
  8938. this.firstColliObj = null;
  8939. this.aiCamp = "";
  8940. this.selfCamp = "";
  8941. this.aiFoulNum = 0;
  8942. this.selfFoulNum = 0;
  8943. this.selfBallArr = [];
  8944. this.aiBallArr = [];
  8945. this.gamePause = false;
  8946. this.ensureBallType = false;
  8947. this.isInterrupt = false;
  8948. this.updateLeftBall();
  8949. this.clearTime();
  8950. this.aiPlayedBreakArmy = false;
  8951. this.isBlackInHole = false;
  8952. this.placeBallPosData = {};
  8953. if (xGame.common.d3World.knifeRoot) {
  8954. xGame.common.d3World.knifeRoot.destroyChildren();
  8955. }
  8956. }
  8957. gameReady() {
  8958. this.trunCount = 0;
  8959. this.firstColliObj = null;
  8960. this.isFirstInGame = true;
  8961. this.selfTurn = Math.random() <= this.selfTurnRate;
  8962. let challengeNum = DataMgr.getChallengeTimes();
  8963. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8964. this.selfTurn = true;
  8965. }
  8966. if (xGame.common.gameMode == GameMode.placeBall)
  8967. this.selfTurn = true;
  8968. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8969. this.selfTurn = true;
  8970. }
  8971. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8972. this.checkGuide();
  8973. if (xGame.common.uiRodMethod)
  8974. xGame.common.uiRodMethod.resetRod();
  8975. xGame.common.d2World.getHelpLine();
  8976. this.isOpenBall = true;
  8977. this.isTouchedBall = false;
  8978. xGame.common.aiPlayer.stopRun();
  8979. this.setTime = 30;
  8980. let ui = xGame.common.gameUI.ui;
  8981. switch (xGame.common.gameMode) {
  8982. case GameMode.classic:
  8983. xGame.common.aiPlayer.init();
  8984. this.blackNum = 8;
  8985. this.placeRootBall();
  8986. this.peoplePlay(9, 10);
  8987. ui.wordsBtn.visible = true;
  8988. ui.aiWordsBtn.visible = true;
  8989. xGame.common.talkMgr.changeAIState(true);
  8990. DataMgr.gameData.gameCount++;
  8991. DataMgr.saveGameData();
  8992. break;
  8993. case GameMode.bigMove:
  8994. this.blackNum = -1;
  8995. this.selfScore = 0;
  8996. this.aiScore = 0;
  8997. xGame.common.aiPlayer.init();
  8998. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8999. this.updateSelfScore();
  9000. this.updateAIScore();
  9001. this.updateTargetSroce();
  9002. this.placeRootBall();
  9003. this.peoplePlay(9, 10);
  9004. ui.wordsBtn.visible = true;
  9005. ui.aiWordsBtn.visible = true;
  9006. xGame.common.talkMgr.changeAIState(true);
  9007. if (DataMgr.getSkillGuide() < 1)
  9008. DataMgr.gameData.gameCount = 0;
  9009. else {
  9010. DataMgr.gameData.gameCount++;
  9011. DataMgr.saveGameData();
  9012. PlatMgr.openTry();
  9013. }
  9014. if (xGame.common.d3World.knifeRoot) {
  9015. xGame.common.d3World.knifeRoot.destroyChildren();
  9016. }
  9017. break;
  9018. case GameMode.placeBall:
  9019. this.blackNum = -1;
  9020. this.selfTurn = true;
  9021. this.setTime = 10000;
  9022. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9023. this.curHP = this.placeBallData.hp;
  9024. if (this.placeBallData.ball == -1)
  9025. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9026. else
  9027. this.needBalls = this.placeBallData.ball;
  9028. console.log("需要的进球数目", this.needBalls);
  9029. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9030. this.finishBalls = 0;
  9031. this.placeBallPosData = {};
  9032. this.updatePlaceBallPos();
  9033. this.updatePlaceBallState();
  9034. this.finishOneShoot = true;
  9035. xGame.common.gameUI.ui.moveNode.visible = false;
  9036. this.isOpenBall = false;
  9037. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9038. ui.wordsBtn.visible = false;
  9039. ui.aiWordsBtn.visible = false;
  9040. xGame.common.talkMgr.changeAIState(false);
  9041. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9042. PlatMgr.openBox();
  9043. });
  9044. break;
  9045. default:
  9046. break;
  9047. }
  9048. this.showLongView = false;
  9049. xGame.common.wordsMgr.comboTimes = 1;
  9050. let guide = DataMgr.getSkillGuide();
  9051. if (guide)
  9052. xGame.eventMgr.event(WAIT_SHOOT);
  9053. xGame.common.upSkillLevel = false;
  9054. xGame.common.gameStartTime = new Date().getTime();
  9055. this.firstShoot = true;
  9056. }
  9057. checkGuide() {
  9058. let guide = DataMgr.getSkillGuide();
  9059. let gameUI = xGame.common.gameUI.ui;
  9060. gameUI.guide1.visible = false;
  9061. gameUI.guide2.visible = false;
  9062. gameUI.guide3.visible = false;
  9063. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9064. this.selfTurn = true;
  9065. }
  9066. else {
  9067. return;
  9068. }
  9069. let oneBall = this.getOneBall();
  9070. gameUI.guide1.visible = true;
  9071. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9072. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9073. }
  9074. getOneBall() {
  9075. let arr = xGame.common.d2World.ballArr;
  9076. for (let index = 0; index < arr.length; index++) {
  9077. if (arr[index].number == 0)
  9078. continue;
  9079. return arr[index];
  9080. }
  9081. }
  9082. updateSelfScore() {
  9083. let ui = xGame.common.gameUI.ui.topNode;
  9084. ui.selfScoreTxt.text = this.selfScore + "";
  9085. }
  9086. updateAIScore() {
  9087. let ui = xGame.common.gameUI.ui.topNode;
  9088. ui.aiScoreTxt.text = this.aiScore + "";
  9089. }
  9090. updateTargetSroce() {
  9091. let ui = xGame.common.gameUI.ui.topNode;
  9092. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9093. }
  9094. updateLeftBall() {
  9095. let topUI = xGame.common.gameUI.ui.topNode;
  9096. topUI.selfBallList.numItems = this.selfBallArr.length;
  9097. topUI.aiBallList.numItems = this.aiBallArr.length;
  9098. }
  9099. ballShoot() {
  9100. this.clearTime();
  9101. this.finishOneShoot = false;
  9102. xGame.common.gameUI.ui.moveNode.visible = false;
  9103. if (xGame.common.gameUI.ui.guideNode.visible) {
  9104. xGame.common.gameUI.ui.guideNode.visible = false;
  9105. }
  9106. if (this.firstShoot) {
  9107. this.firstShoot = false;
  9108. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9109. }
  9110. }
  9111. ensureCamp(number) {
  9112. this.ensureBallType = true;
  9113. this.isOpenBall = false;
  9114. if (xGame.common.gameMode != GameMode.classic)
  9115. return;
  9116. let full = [1, 2, 3, 4, 5, 6, 7];
  9117. let flower = [9, 10, 11, 12, 13, 14, 15];
  9118. let sayWords = "";
  9119. if (this.selfTurn) {
  9120. if (number <= 7) {
  9121. this.selfCamp = ballCamp.full;
  9122. this.selfBallArr = full;
  9123. this.aiCamp = ballCamp.flower;
  9124. this.aiBallArr = flower;
  9125. sayWords = cfgTable.wordsData[3].msg;
  9126. }
  9127. else {
  9128. this.selfCamp = ballCamp.flower;
  9129. this.selfBallArr = flower;
  9130. this.aiCamp = ballCamp.full;
  9131. this.aiBallArr = full;
  9132. sayWords = cfgTable.wordsData[4].msg;
  9133. }
  9134. }
  9135. else {
  9136. if (number <= 7) {
  9137. this.selfCamp = ballCamp.flower;
  9138. this.selfBallArr = flower;
  9139. this.aiCamp = ballCamp.full;
  9140. this.aiBallArr = full;
  9141. sayWords = cfgTable.wordsData[2].msg;
  9142. }
  9143. else {
  9144. this.selfCamp = ballCamp.full;
  9145. this.selfBallArr = full;
  9146. this.aiCamp = ballCamp.flower;
  9147. this.aiBallArr = flower;
  9148. sayWords = cfgTable.wordsData[1].msg;
  9149. }
  9150. }
  9151. this.updateLeftBall();
  9152. xGame.uiMgr.Show(UIMsg, sayWords);
  9153. }
  9154. updatePlaceBallState() {
  9155. let ui = xGame.common.gameUI.ui;
  9156. switch (this.placeBallData.type) {
  9157. case PlaceBallType.normal:
  9158. let normal = ui.placeNormalNode;
  9159. normal.hpTxt.text = this.curHP + "";
  9160. this.updatePlaceBallStar(normal);
  9161. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9162. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9163. break;
  9164. case PlaceBallType.challenge:
  9165. let challenge = ui.placeChallengeNode;
  9166. challenge.hpTxt.text = "Shots:" + this.curHP;
  9167. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9168. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9169. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9170. break;
  9171. default:
  9172. break;
  9173. }
  9174. }
  9175. playSubHpAni() {
  9176. let ui = xGame.common.gameUI.ui;
  9177. switch (this.placeBallData.type) {
  9178. case PlaceBallType.normal:
  9179. let normal = ui.placeNormalNode;
  9180. normal.hpTxt.visible = false;
  9181. normal.starAni.c1.selectedIndex = 1;
  9182. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9183. normal.hpTxt.visible = true;
  9184. normal.starAni.c1.selectedIndex = 0;
  9185. }));
  9186. break;
  9187. default:
  9188. break;
  9189. }
  9190. }
  9191. getEndStarNum() {
  9192. let num;
  9193. let level = xGame.common.placeBallCurLevel;
  9194. if (this.curHP == this.placeBallData.hp) {
  9195. num = 3;
  9196. }
  9197. else if (this.curHP <= 1) {
  9198. num = 1;
  9199. }
  9200. else {
  9201. num = 2;
  9202. }
  9203. if (!this.success) {
  9204. num = 0;
  9205. }
  9206. else {
  9207. DataMgr.setPlaceBallLevel(level, num);
  9208. }
  9209. let myType = cfgTable.placeballData[level].type;
  9210. if (this.success && myType == 1) {
  9211. num = 3;
  9212. }
  9213. xGame.common.placeBallStarNum = num;
  9214. }
  9215. updatePlaceBallStar(node) {
  9216. let star = 0;
  9217. if (this.curHP == this.placeBallData.hp) {
  9218. star = 3;
  9219. }
  9220. else if (this.curHP >= 2) {
  9221. star = 2;
  9222. }
  9223. else if (this.curHP == 1) {
  9224. star = 1;
  9225. }
  9226. else {
  9227. star = 0;
  9228. }
  9229. let temp;
  9230. for (let index = 1; index <= 3; index++) {
  9231. temp = node["star" + index];
  9232. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9233. }
  9234. node.myProgress.value = (star / 3) * 100;
  9235. }
  9236. openRegretView(isFoul, GoalNum, challenge = false) {
  9237. let regretType = -1;
  9238. if (isFoul) {
  9239. regretType = 1;
  9240. }
  9241. else {
  9242. if (GoalNum <= 0) {
  9243. regretType = 0;
  9244. }
  9245. }
  9246. if (challenge) {
  9247. regretType = 1;
  9248. }
  9249. if (regretType != -1) {
  9250. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9251. if (success) {
  9252. this.curHP++;
  9253. this.updatePlaceBallState();
  9254. this.setPlaceBallAllPos();
  9255. xGame.common.gameUI.ui.moveNode.visible = false;
  9256. }
  9257. else {
  9258. if (this.curHP <= 0) {
  9259. this.success = false;
  9260. this.gameEnd();
  9261. }
  9262. this.playSubHpAni();
  9263. }
  9264. this.updatePlaceBallState();
  9265. this.updatePlaceBallPos();
  9266. });
  9267. }
  9268. }
  9269. setPlaceBallAllPos() {
  9270. let allBall = xGame.common.d2World.ballArr;
  9271. let cfgArr = this.placeBallPosData;
  9272. let temp;
  9273. let obj;
  9274. for (let index = 0; index < allBall.length; index++) {
  9275. temp = allBall[index];
  9276. if (temp.destroyed)
  9277. continue;
  9278. obj = cfgArr[temp.myUNID];
  9279. if (obj && obj.src && !obj.src.destroyed) {
  9280. temp.gameObj.x = obj.posX;
  9281. temp.gameObj.y = obj.posY;
  9282. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9283. }
  9284. }
  9285. xGame.common.d2World.getHelpLine();
  9286. }
  9287. updatePlaceBallPos() {
  9288. let arr = xGame.common.d2World.ballArr;
  9289. let temp;
  9290. for (let index = 0; index < arr.length; index++) {
  9291. temp = arr[index];
  9292. if (!this.placeBallPosData[temp.myUNID]) {
  9293. this.placeBallPosData[temp.myUNID] = {
  9294. src: temp,
  9295. posX: temp.gameObj.x,
  9296. posY: temp.gameObj.y
  9297. };
  9298. }
  9299. else {
  9300. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9301. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9302. }
  9303. }
  9304. let check;
  9305. for (const key in this.placeBallPosData) {
  9306. check = this.placeBallPosData[key];
  9307. if (check.src.destroyed) {
  9308. delete this.placeBallPosData[key];
  9309. }
  9310. }
  9311. }
  9312. gameRun(type) {
  9313. if (this.gamePause)
  9314. return;
  9315. this.curFoul = this.getFoulType();
  9316. if (type) {
  9317. xGame.common.d2World.d2Gan.shoot();
  9318. xGame.common.gameUI.forceCancel();
  9319. this.curFoul = type;
  9320. }
  9321. this.isEnd = false;
  9322. this.isChangeTurn = true;
  9323. if (xGame.common.gameMode == GameMode.classic) {
  9324. this.judgeClassic(this.curFoul);
  9325. this.checkClassicWords(() => {
  9326. xGame.common.destroyClassicEmotion();
  9327. if (this.isEnd) {
  9328. if (this.isBlackInHole) {
  9329. xGame.common.gameUI.ui.blackAni.visible = true;
  9330. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9331. xGame.common.gameUI.ui.blackAni.visible = false;
  9332. this.gameEnd();
  9333. }));
  9334. }
  9335. else {
  9336. this.gameEnd();
  9337. }
  9338. }
  9339. else {
  9340. this.waitShoot();
  9341. xGame.eventMgr.event(WAIT_SHOOT);
  9342. }
  9343. });
  9344. }
  9345. else if (xGame.common.gameMode == GameMode.bigMove) {
  9346. xGame.common.aiPlayer.stopRun();
  9347. let scoreArr = this.getScore(this.curFoul);
  9348. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9349. this.isEnd = true;
  9350. }
  9351. this.checkBigSkillWords(() => {
  9352. if (this.isEnd) {
  9353. this.gameEnd();
  9354. }
  9355. else {
  9356. this.waitShoot();
  9357. xGame.eventMgr.event(WAIT_SHOOT);
  9358. }
  9359. });
  9360. }
  9361. else if (xGame.common.gameMode == GameMode.placeBall) {
  9362. xGame.common.destroyAwardSpine();
  9363. let isFoul = this.curFoul == FoulType.rootHole;
  9364. let GoalNum = this.inHoleBalls.length;
  9365. if (this.inHoleBalls.indexOf(0) > -1)
  9366. GoalNum -= 1;
  9367. if (isFoul) {
  9368. this.placeRootBall();
  9369. }
  9370. console.log("neeballs", this.needBalls);
  9371. console.log("当前完成的goalNum", GoalNum);
  9372. this.finishBalls += GoalNum;
  9373. console.log("当前完成的finishballs", this.finishBalls);
  9374. let need = this.needBalls;
  9375. if (this.placeBallData.type == PlaceBallType.challenge) {
  9376. need += 100;
  9377. }
  9378. if (this.finishBalls >= need) {
  9379. this.success = true;
  9380. this.gameEnd();
  9381. }
  9382. else {
  9383. switch (this.placeBallData.type) {
  9384. case PlaceBallType.normal:
  9385. if (!isFoul && GoalNum > 0) {
  9386. this.updatePlaceBallPos();
  9387. this.updatePlaceBallState();
  9388. }
  9389. else {
  9390. this.curHP--;
  9391. this.openRegretView(isFoul, GoalNum);
  9392. }
  9393. this.waitShoot();
  9394. xGame.eventMgr.event(WAIT_SHOOT);
  9395. break;
  9396. case PlaceBallType.challenge:
  9397. this.curHP--;
  9398. this.updatePlaceBallState();
  9399. if (isFoul) {
  9400. this.openRegretView(isFoul, GoalNum, true);
  9401. }
  9402. else {
  9403. this.updatePlaceBallPos();
  9404. if (this.curHP <= 0) {
  9405. this.success = true;
  9406. this.gameEnd();
  9407. }
  9408. }
  9409. this.waitShoot();
  9410. xGame.eventMgr.event(WAIT_SHOOT);
  9411. break;
  9412. default:
  9413. break;
  9414. }
  9415. }
  9416. }
  9417. }
  9418. checkClassicWords(callback) {
  9419. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9420. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9421. let type = this.getClassicWordsType();
  9422. if (condition && type != -1) {
  9423. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9424. xGame.soundMgr.playSound(str);
  9425. xGame.common.wordsMgr.playClassicWords(type, callback);
  9426. }
  9427. else {
  9428. Laya.timer.once(300, this, () => {
  9429. callback && callback();
  9430. });
  9431. }
  9432. }
  9433. getClassicWordsType() {
  9434. let d2world = xGame.common.d2World;
  9435. let type = -1;
  9436. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9437. type = ClassicWordsType.perfectShow;
  9438. return type;
  9439. }
  9440. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9441. type = ClassicWordsType.directShoot;
  9442. return type;
  9443. }
  9444. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9445. type = ClassicWordsType.anotherShoot;
  9446. return type;
  9447. }
  9448. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9449. type = ClassicWordsType.bigPower;
  9450. return type;
  9451. }
  9452. let minSpeed = 1;
  9453. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9454. type = ClassicWordsType.hardShoot;
  9455. return type;
  9456. }
  9457. if (this.inHoleBalls.length > 0) {
  9458. type = ClassicWordsType.directShoot;
  9459. return type;
  9460. }
  9461. return type;
  9462. }
  9463. checkBigSkillWords(callback) {
  9464. if (this.curFoul == FoulType.timeOut) {
  9465. callback && callback();
  9466. }
  9467. else {
  9468. let playSkill = false;
  9469. if (this.selfTurn) {
  9470. playSkill = true;
  9471. }
  9472. else {
  9473. if (!this.aiPlayedBreakArmy) {
  9474. this.aiPlayedBreakArmy = true;
  9475. playSkill = true;
  9476. }
  9477. if (this.aiCurSkill != SkillType.breakArmy) {
  9478. playSkill = true;
  9479. }
  9480. }
  9481. if (xGame.common.skillMgr.playedLastSkill) {
  9482. xGame.common.skillMgr.playedLastSkill = false;
  9483. playSkill = false;
  9484. }
  9485. if (playSkill) {
  9486. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9487. let selfExtra = 0;
  9488. let aiExtra = 0;
  9489. if (this.selfTurn)
  9490. selfExtra += extraScore;
  9491. else
  9492. aiExtra += extraScore;
  9493. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9494. this.isEnd = true;
  9495. }
  9496. this.playBigSkillTimes(callback);
  9497. });
  9498. }
  9499. else {
  9500. this.playBigSkillTimes(callback);
  9501. }
  9502. }
  9503. }
  9504. playBigSkillTimes(callback) {
  9505. let length = this.inHoleBalls.length;
  9506. if (this.inHoleBalls.indexOf(0) > -1) {
  9507. length = this.inHoleBalls.length - 1;
  9508. }
  9509. if (length <= 0) {
  9510. callback && callback();
  9511. return;
  9512. }
  9513. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9514. callback && callback();
  9515. });
  9516. }
  9517. playSkillTips() {
  9518. let levelNum = 0;
  9519. let curType;
  9520. if (this.selfTurn) {
  9521. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9522. curType = this.selfCurSkill;
  9523. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9524. levelNum += 5;
  9525. }
  9526. }
  9527. else {
  9528. levelNum = this.aiSkillLevelNum;
  9529. curType = this.aiCurSkill;
  9530. }
  9531. let str = ``;
  9532. switch (curType) {
  9533. case SkillType.highSpace:
  9534. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9535. break;
  9536. case SkillType.breakArmy:
  9537. str = `You pocketed ${levelNum} extra balls`;
  9538. break;
  9539. case SkillType.ice:
  9540. str = `${levelNum * 2} extra balls were frozen`;
  9541. break;
  9542. case SkillType.fireworks:
  9543. str = `${levelNum} extra balls exploded `;
  9544. break;
  9545. case SkillType.GuanYu:
  9546. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9547. break;
  9548. default:
  9549. break;
  9550. }
  9551. xGame.uiMgr.Show(UIMsg, str);
  9552. }
  9553. getFoulType() {
  9554. let foulType = "";
  9555. if (this.firstColliObj == null) {
  9556. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9557. return FoulType.rootHole;
  9558. }
  9559. return FoulType.notTouch;
  9560. }
  9561. else {
  9562. if (this.selfTurn) {
  9563. if (this.selfBallArr.length > 0) {
  9564. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9565. foulType = FoulType.wrongTouch;
  9566. }
  9567. }
  9568. else {
  9569. if (this.ensureBallType) {
  9570. }
  9571. else {
  9572. if (this.firstColliObj == this.blackNum) {
  9573. foulType = FoulType.wrongTouch;
  9574. }
  9575. }
  9576. }
  9577. }
  9578. else {
  9579. if (this.aiBallArr.length > 0) {
  9580. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9581. foulType = FoulType.wrongTouch;
  9582. }
  9583. }
  9584. else {
  9585. if (this.ensureBallType) {
  9586. }
  9587. else {
  9588. if (this.firstColliObj == this.blackNum) {
  9589. foulType = FoulType.wrongTouch;
  9590. }
  9591. }
  9592. }
  9593. }
  9594. if (this.inHoleBalls.length <= 0) {
  9595. return foulType;
  9596. }
  9597. let temp;
  9598. if (this.inHoleBalls.indexOf(0) > -1) {
  9599. foulType = FoulType.rootHole;
  9600. }
  9601. else {
  9602. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9603. temp = this.inHoleBalls[index];
  9604. if (this.selfTurn) {
  9605. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9606. foulType = FoulType.wrongHole;
  9607. break;
  9608. }
  9609. }
  9610. else {
  9611. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9612. foulType = FoulType.wrongHole;
  9613. break;
  9614. }
  9615. }
  9616. }
  9617. }
  9618. let foo;
  9619. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9620. temp = this.inHoleBalls[index];
  9621. foo = this.selfBallArr.indexOf(temp);
  9622. if (foo > -1) {
  9623. this.selfBallArr.splice(foo, 1);
  9624. }
  9625. foo = this.aiBallArr.indexOf(temp);
  9626. if (foo > -1) {
  9627. this.aiBallArr.splice(foo, 1);
  9628. }
  9629. }
  9630. this.updateLeftBall();
  9631. }
  9632. return foulType;
  9633. }
  9634. judgeGameEndByBlack(arr) {
  9635. if (this.selfTurn) {
  9636. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9637. this.selfFoulNum = this.maxFoulTimes;
  9638. return true;
  9639. }
  9640. }
  9641. else {
  9642. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9643. this.aiFoulNum = this.maxFoulTimes;
  9644. return true;
  9645. }
  9646. }
  9647. }
  9648. judgeClassic(type) {
  9649. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9650. xGame.common.aiPlayer.stopRun();
  9651. if (this.judgeNormalSuccess()) {
  9652. this.isEnd = true;
  9653. return;
  9654. }
  9655. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9656. if (this.selfTurn) {
  9657. if (isFoul) {
  9658. this.selfFoulNum++;
  9659. }
  9660. if (this.selfFoulNum >= this.maxFoulTimes) {
  9661. this.success = false;
  9662. this.isEnd = true;
  9663. return;
  9664. }
  9665. }
  9666. else {
  9667. if (isFoul)
  9668. this.aiFoulNum++;
  9669. if (this.aiFoulNum >= this.maxFoulTimes) {
  9670. this.success = true;
  9671. this.isEnd = true;
  9672. return;
  9673. }
  9674. }
  9675. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9676. this.isChangeTurn = false;
  9677. }
  9678. else {
  9679. this.isInterrupt = true;
  9680. }
  9681. }
  9682. waitShoot() {
  9683. if (xGame.common.gameMode == GameMode.classic) {
  9684. switch (this.curFoul) {
  9685. case FoulType.timeOut:
  9686. case FoulType.rootHole:
  9687. this.selfTurn = !this.selfTurn;
  9688. this.peoplePlay(5, 6, true);
  9689. break;
  9690. case FoulType.notTouch:
  9691. this.selfTurn = !this.selfTurn;
  9692. this.peoplePlay(7, 7);
  9693. break;
  9694. case FoulType.wrongHole:
  9695. this.selfTurn = !this.selfTurn;
  9696. this.peoplePlay(11, 11);
  9697. break;
  9698. default:
  9699. if (this.inHoleBalls.length > 0) {
  9700. this.peoplePlay(0, 0, false, false);
  9701. }
  9702. else {
  9703. this.selfTurn = !this.selfTurn;
  9704. this.peoplePlay(7, 7);
  9705. }
  9706. break;
  9707. }
  9708. }
  9709. else if (xGame.common.gameMode == GameMode.bigMove) {
  9710. if (this.curFoul == FoulType.timeOut) {
  9711. this.selfTurn = !this.selfTurn;
  9712. this.peoplePlay(14, 15);
  9713. this.placeRootBall();
  9714. }
  9715. else {
  9716. this.selfTurn = !this.selfTurn;
  9717. if (this.curFoul == FoulType.rootHole) {
  9718. this.peoplePlay(12, 13);
  9719. this.placeRootBall();
  9720. }
  9721. else {
  9722. this.peoplePlay(0, 0, false, false);
  9723. }
  9724. }
  9725. }
  9726. else if (xGame.common.gameMode == GameMode.placeBall) {
  9727. this.finishOneShoot = true;
  9728. }
  9729. this.gameResult();
  9730. }
  9731. gameResult() {
  9732. this.firstColliObj = null;
  9733. this.inHoleBalls = [];
  9734. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9735. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9736. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9737. if (xGame.common.uiRodMethod)
  9738. xGame.common.uiRodMethod.resetRod();
  9739. xGame.common.d2World.rootBall.showSelf();
  9740. this.clearIceSkill();
  9741. if (this.selfTurn) {
  9742. PlatMgr.gameInsert();
  9743. }
  9744. xGame.common.d3World.knifeRoot.destroyChildren();
  9745. if (this.selfTurn) {
  9746. xGame.common.gameUI.showHelpLineGuide();
  9747. xGame.common.gameUI.setTurnAlpha(true);
  9748. }
  9749. else {
  9750. xGame.common.gameUI.setTurnAlpha(false);
  9751. }
  9752. }
  9753. getScore(type) {
  9754. let selfAdd = 0;
  9755. let aiAdd = 0;
  9756. if (type == FoulType.timeOut) {
  9757. if (this.selfTurn)
  9758. aiAdd += 3;
  9759. else
  9760. selfAdd += 3;
  9761. }
  9762. else {
  9763. if (this.inHoleBalls.length > 0) {
  9764. if (this.selfTurn) {
  9765. if (type == FoulType.rootHole) {
  9766. aiAdd += 3;
  9767. if (this.inHoleBalls.length - 1 > 0) {
  9768. selfAdd += this.inHoleBalls.length - 1;
  9769. }
  9770. }
  9771. else {
  9772. selfAdd += this.inHoleBalls.length;
  9773. }
  9774. }
  9775. else {
  9776. if (type == FoulType.rootHole) {
  9777. selfAdd += 3;
  9778. if (this.inHoleBalls.length - 1 > 0) {
  9779. aiAdd += this.inHoleBalls.length - 1;
  9780. }
  9781. }
  9782. else {
  9783. aiAdd += this.inHoleBalls.length;
  9784. }
  9785. }
  9786. }
  9787. }
  9788. return [selfAdd, aiAdd];
  9789. }
  9790. judgeScoreEnd(selfAdd, aiAdd) {
  9791. this.selfScore += selfAdd;
  9792. this.aiScore += aiAdd;
  9793. this.updateAIScore();
  9794. this.updateSelfScore();
  9795. if (this.selfScore >= this.targertScore) {
  9796. this.success = true;
  9797. return true;
  9798. }
  9799. if (this.aiScore >= this.targertScore) {
  9800. this.success = false;
  9801. return true;
  9802. }
  9803. let ballArr = xGame.common.d2World.ballArr;
  9804. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9805. if (this.selfScore > this.aiScore) {
  9806. this.success = true;
  9807. return true;
  9808. }
  9809. else if (this.selfScore < this.aiScore) {
  9810. this.success = false;
  9811. return true;
  9812. }
  9813. else {
  9814. if (this.selfTurn) {
  9815. this.success = false;
  9816. }
  9817. else {
  9818. this.success = true;
  9819. }
  9820. return true;
  9821. }
  9822. }
  9823. }
  9824. clearIceSkill() {
  9825. let arr = xGame.common.d2World.ballArr;
  9826. let temp;
  9827. if (this.selfTurn) {
  9828. if (this.selfCurSkill == SkillType.ice) {
  9829. for (let index = 0; index < arr.length; index++) {
  9830. temp = arr[index];
  9831. if (temp.ballFunc == "ice") {
  9832. temp.setBallFunc("normal", "self");
  9833. }
  9834. }
  9835. }
  9836. }
  9837. else {
  9838. if (this.aiCurSkill == SkillType.ice) {
  9839. for (let index = 0; index < arr.length; index++) {
  9840. temp = arr[index];
  9841. if (temp.ballFunc == "ice") {
  9842. temp.setBallFunc("normal", "ai");
  9843. }
  9844. }
  9845. }
  9846. }
  9847. }
  9848. judgeNormalSuccess() {
  9849. if (this.selfTurn) {
  9850. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9851. this.success = true;
  9852. return true;
  9853. }
  9854. }
  9855. else {
  9856. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9857. this.success = false;
  9858. return true;
  9859. }
  9860. }
  9861. }
  9862. gameEnd() {
  9863. if (Moyu.isTT) {
  9864. xGame.common.screenImg = getScreenImg();
  9865. }
  9866. console.log("游戏结束", this.success);
  9867. xGame.common.aiPlayer.stopRun();
  9868. if (xGame.common.gameMode == GameMode.placeBall) {
  9869. this.getEndStarNum();
  9870. this.updatePlaceBallState();
  9871. }
  9872. this.isEnter = false;
  9873. Moyu.recordEnd(this, () => {
  9874. if (this.isEnter)
  9875. return;
  9876. this.isEnter = true;
  9877. console.log("进入录结束回调");
  9878. this.enterNext();
  9879. });
  9880. Laya.timer.once(1000, this, () => {
  9881. if (this.isEnter)
  9882. return;
  9883. this.isEnter = true;
  9884. this.enterNext();
  9885. });
  9886. xGame.common.longHelpLine = false;
  9887. }
  9888. enterNext() {
  9889. Laya.timer.clearAll(this);
  9890. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9891. xGame.uiMgr.Show(UIVideoShare, this.success);
  9892. }
  9893. else {
  9894. xGame.uiMgr.Show(UIGameEnd, this.success);
  9895. }
  9896. }
  9897. aiLeave() {
  9898. let ui = xGame.common.gameUI.ui;
  9899. ui.topNode.aiNameTxt.text = "offline";
  9900. }
  9901. aiGameEnd(suc) {
  9902. this.success = suc;
  9903. xGame.common.aiPlayer.stopRun();
  9904. if (this.success) {
  9905. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9906. Laya.timer.once(1000, this, () => {
  9907. this.clearTime();
  9908. this.gameEnd();
  9909. });
  9910. }
  9911. }
  9912. openTimer() {
  9913. let src = xGame.common.gameUI;
  9914. if (this.selfTurn) {
  9915. src.ui.topNode.selfProgress.visible = true;
  9916. src.ui.topNode.aiProgress.visible = false;
  9917. this.curTimer = src.ui.topNode.selfProgress;
  9918. }
  9919. else {
  9920. src.ui.topNode.selfProgress.visible = false;
  9921. src.ui.topNode.aiProgress.visible = true;
  9922. this.curTimer = src.ui.topNode.aiProgress;
  9923. }
  9924. this.accTime = 0;
  9925. Laya.timer.clearAll(this);
  9926. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9927. this.curTimer.value = 100;
  9928. }
  9929. updateTime(dt) {
  9930. if (this.gamePause)
  9931. return;
  9932. this.accTime += dt;
  9933. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9934. if (this.accTime >= this.setTime) {
  9935. this.clearTime();
  9936. console.log("时钟进入了gameRun");
  9937. this.gameRun(FoulType.timeOut);
  9938. }
  9939. }
  9940. clearTime() {
  9941. let src = xGame.common.gameUI;
  9942. src.ui.topNode.selfProgress.visible = false;
  9943. src.ui.topNode.aiProgress.visible = false;
  9944. Laya.timer.clearAll(this);
  9945. }
  9946. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9947. let ui = xGame.common.gameUI.ui;
  9948. let selfMsg, aiMsg;
  9949. if (sayWords) {
  9950. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9951. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9952. if (Foul) {
  9953. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9954. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9955. this.placeRootBall();
  9956. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9957. if (this.curFoul == FoulType.rootHole) {
  9958. if (!DataMgr.getRootBallFoul()) {
  9959. DataMgr.setRootBallFoul();
  9960. aiMsg = "";
  9961. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9962. let woman = "Boss, pay attention next time~";
  9963. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9964. }
  9965. }
  9966. else if (this.curFoul == FoulType.timeOut) {
  9967. if (!DataMgr.getTimeoutFoul()) {
  9968. DataMgr.setTimeoutFoul();
  9969. aiMsg = "";
  9970. let tips = "Game timeout, 3 fouls, this game failed.";
  9971. let woman = "Boss, pay attention to the timeline~";
  9972. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9973. }
  9974. }
  9975. }
  9976. }
  9977. }
  9978. if (this.selfTurn) {
  9979. if (sayWords) {
  9980. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9981. ui.selfTurn.visible = true;
  9982. ui.aiTurn.visible = false;
  9983. ui.selfTurn.t0.play();
  9984. Moyu.vibration();
  9985. });
  9986. }
  9987. }
  9988. else {
  9989. let aiNum = xGame.tools.random(1, 11);
  9990. let challengeNum = DataMgr.getChallengeTimes();
  9991. let delay = false;
  9992. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9993. aiNum = 9;
  9994. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9995. aiNum = 3;
  9996. if (challengeNum == 3) {
  9997. if (!this.showLongView) {
  9998. this.showLongView = true;
  9999. delay = true;
  10000. }
  10001. }
  10002. }
  10003. }
  10004. if (delay) {
  10005. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10006. if (success) {
  10007. xGame.common.longHelpLine = true;
  10008. xGame.common.d2World.getHelpLine();
  10009. }
  10010. else {
  10011. aiNum = 10;
  10012. }
  10013. xGame.common.aiPlayer.setAiLevel(aiNum);
  10014. if (sayWords) {
  10015. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10016. xGame.common.aiPlayer.runAI();
  10017. ui.selfTurn.visible = false;
  10018. ui.aiTurn.visible = true;
  10019. ui.aiTurn.t0.play();
  10020. });
  10021. }
  10022. else {
  10023. xGame.common.aiPlayer.runAI();
  10024. }
  10025. this.openTimer();
  10026. this.finishOneShoot = true;
  10027. if (this.selfTurn) {
  10028. ui.topNode.selfKuang.visible = true;
  10029. ui.topNode.aiKuang.visible = false;
  10030. ui.topNode.selfTips.visible = true;
  10031. ui.topNode.aiTips.visible = false;
  10032. }
  10033. else {
  10034. ui.topNode.selfKuang.visible = false;
  10035. ui.topNode.aiKuang.visible = true;
  10036. ui.topNode.selfTips.visible = false;
  10037. ui.topNode.aiTips.visible = true;
  10038. }
  10039. });
  10040. return;
  10041. }
  10042. if (xGame.common.gameMode == GameMode.classic) {
  10043. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10044. if (cfg) {
  10045. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10046. aiNum = aiLevel;
  10047. }
  10048. }
  10049. xGame.common.aiPlayer.setAiLevel(aiNum);
  10050. if (sayWords) {
  10051. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10052. xGame.common.aiPlayer.runAI();
  10053. ui.selfTurn.visible = false;
  10054. ui.aiTurn.visible = true;
  10055. ui.aiTurn.t0.play();
  10056. });
  10057. }
  10058. else {
  10059. xGame.common.aiPlayer.runAI();
  10060. }
  10061. }
  10062. this.openTimer();
  10063. this.finishOneShoot = true;
  10064. if (this.selfTurn) {
  10065. ui.topNode.selfKuang.visible = true;
  10066. ui.topNode.aiKuang.visible = false;
  10067. ui.topNode.selfTips.visible = true;
  10068. ui.topNode.aiTips.visible = false;
  10069. }
  10070. else {
  10071. ui.topNode.selfKuang.visible = false;
  10072. ui.topNode.aiKuang.visible = true;
  10073. ui.topNode.selfTips.visible = false;
  10074. ui.topNode.aiTips.visible = true;
  10075. }
  10076. }
  10077. placeRootBall() {
  10078. let rootBall = xGame.common.d2World.rootBall;
  10079. if (!rootBall)
  10080. return;
  10081. rootBall.gameObj.x = this.lastRootBallPos.x;
  10082. rootBall.gameObj.y = this.lastRootBallPos.y;
  10083. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10084. let moveNode = xGame.common.gameUI.ui.moveNode;
  10085. moveNode.visible = true;
  10086. moveNode.x = this.lastRootBallPos.x;
  10087. moveNode.y = this.lastRootBallPos.y;
  10088. if (!this.selfTurn) {
  10089. xGame.common.aiPlayer.resetRoot();
  10090. }
  10091. }
  10092. }
  10093. class ui_guanyuAni extends fgui.GComponent {
  10094. static createInstance() {
  10095. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10096. }
  10097. onConstruct() {
  10098. this.n0 = (this.getChild("n0"));
  10099. }
  10100. }
  10101. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10102. class UIFireworks extends UIBase {
  10103. constructor() {
  10104. super();
  10105. }
  10106. onConstructor() {
  10107. this.isEject = false;
  10108. }
  10109. show(callback) {
  10110. super.show();
  10111. }
  10112. }
  10113. UIFireworks.uiName = "UIFireworks";
  10114. class ui_UIGuanYu extends fgui.GComponent {
  10115. static createInstance() {
  10116. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10117. }
  10118. onConstruct() {
  10119. this.n2 = (this.getChild("n2"));
  10120. this.n1 = (this.getChild("n1"));
  10121. this.n3 = (this.getChild("n3"));
  10122. this.n4 = (this.getChild("n4"));
  10123. this.n5 = (this.getChild("n5"));
  10124. this.n6 = (this.getChild("n6"));
  10125. this.n8 = (this.getChild("n8"));
  10126. this.n7 = (this.getChild("n7"));
  10127. this.t0 = this.getTransition("t0");
  10128. }
  10129. }
  10130. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10131. class UIGuanYu extends UIBase {
  10132. constructor() {
  10133. super();
  10134. }
  10135. onConstructor() {
  10136. this.ui = ui_UIGuanYu.createInstance();
  10137. this.contentPane = this.ui;
  10138. this.isEject = false;
  10139. }
  10140. show(callback) {
  10141. super.show();
  10142. this.ui.t0.play(Laya.Handler.create(this, () => {
  10143. callback && callback();
  10144. this.hide();
  10145. }));
  10146. }
  10147. }
  10148. UIGuanYu.uiName = "UIGuanYu";
  10149. class SkillMgr {
  10150. constructor() {
  10151. this.leveNum = 0;
  10152. this.extraScore = 0;
  10153. this.selfTurn = false;
  10154. this.playedLastSkill = false;
  10155. this.tweenArr = [];
  10156. this._finishNum = 0;
  10157. this._curFinish = 0;
  10158. this._rootX = 0;
  10159. this._rootY = 0;
  10160. this.knifeTimes = 0;
  10161. this.knifeV2 = new Laya.Vector2();
  10162. this.knifeV3 = new Laya.Vector3();
  10163. this.rtStarX = 0;
  10164. this.rtStarY = 0;
  10165. this.addBigSkillSpine();
  10166. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10167. }
  10168. addBigSkillSpine() {
  10169. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10170. console.log("extra2 success");
  10171. });
  10172. }
  10173. runBigSkill(callback) {
  10174. this.tweenArr = [];
  10175. this.callback = callback;
  10176. this.judgeSkill();
  10177. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10178. let guide = DataMgr.getSkillGuide();
  10179. if (!xGame.common.gameMgr.selfTurn) {
  10180. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10181. }
  10182. else {
  10183. if (xGame.common.temSelfLevel != 0) {
  10184. this.leveNum = xGame.common.temSelfLevel;
  10185. }
  10186. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10187. this.leveNum += 5;
  10188. }
  10189. }
  10190. if (guide == 0) {
  10191. DataMgr.setSkillGuide(1);
  10192. if (DataMgr.getNewUser()) {
  10193. Moyu.sendDataEvent("gameFirstPlay");
  10194. DataMgr.setNewUser();
  10195. }
  10196. }
  10197. this.playSpineAni(() => {
  10198. switch (this.curSkill) {
  10199. case SkillType.highSpace:
  10200. this.runHighSpace();
  10201. break;
  10202. case SkillType.breakArmy:
  10203. this.runBreakArmy();
  10204. break;
  10205. case SkillType.ice:
  10206. this.runIce();
  10207. break;
  10208. case SkillType.fireworks:
  10209. this.runFireworks();
  10210. break;
  10211. case SkillType.GuanYu:
  10212. this.runGuanYu();
  10213. break;
  10214. default:
  10215. break;
  10216. }
  10217. });
  10218. }
  10219. judgeSkill() {
  10220. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10221. let gameMgr = xGame.common.gameMgr;
  10222. let type;
  10223. for (let index = 0; index < typeArr.length; index++) {
  10224. type = typeArr[index];
  10225. if (gameMgr.selfTurn) {
  10226. if (gameMgr.selfCurSkill == type) {
  10227. this.selfTurn = true;
  10228. this.curSkill = type;
  10229. return;
  10230. }
  10231. }
  10232. else {
  10233. if (gameMgr.aiCurSkill == type) {
  10234. this.selfTurn = false;
  10235. this.curSkill = type;
  10236. return;
  10237. }
  10238. }
  10239. }
  10240. }
  10241. playSpineAni(callback) {
  10242. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10243. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10244. parent.destroyChildren();
  10245. let aniIndex = 0;
  10246. let skillSpine;
  10247. switch (this.curSkill) {
  10248. case SkillType.highSpace:
  10249. aniIndex = 1;
  10250. xGame.soundMgr.playSound("skill01");
  10251. skillSpine = this.skillSpine2;
  10252. data.scaleX = 0.5;
  10253. data.scaleY = 0.5;
  10254. skillSpine.play(data, 1, false, parent, () => {
  10255. callback && callback();
  10256. });
  10257. break;
  10258. case SkillType.breakArmy:
  10259. aniIndex = 2;
  10260. xGame.soundMgr.playSound("skill02");
  10261. skillSpine = this.skillSpine2;
  10262. data.scaleX = 0.5;
  10263. data.scaleY = 0.5;
  10264. skillSpine.play(data, 2, false, parent, () => {
  10265. callback && callback();
  10266. });
  10267. break;
  10268. case SkillType.ice:
  10269. aniIndex = 0;
  10270. xGame.soundMgr.playSound("skill03");
  10271. skillSpine = this.skillSpine2;
  10272. data.scaleX = 0.5;
  10273. data.scaleY = 0.5;
  10274. skillSpine.play(data, 0, false, parent, () => {
  10275. callback && callback();
  10276. });
  10277. break;
  10278. case SkillType.fireworks:
  10279. xGame.soundMgr.playSound("skill_04_01");
  10280. xGame.soundMgr.playSound("skill04");
  10281. xGame.uiMgr.Show(UIFireworks, callback);
  10282. break;
  10283. case SkillType.GuanYu:
  10284. xGame.soundMgr.playSound("skill05_1");
  10285. xGame.soundMgr.playSound("skill05");
  10286. xGame.uiMgr.Show(UIGuanYu, callback);
  10287. break;
  10288. default:
  10289. break;
  10290. }
  10291. }
  10292. getAllBallArr() {
  10293. let arr = xGame.common.d2World.ballArr;
  10294. let outArr = [];
  10295. for (let index = 0; index < arr.length; index++) {
  10296. if (arr[index] instanceof D2RootBallSrc)
  10297. continue;
  10298. if (arr[index].ballFunc == "ice")
  10299. continue;
  10300. if (arr[index].destroyed)
  10301. continue;
  10302. outArr.push(arr[index]);
  10303. }
  10304. return outArr;
  10305. }
  10306. getOneArr(deletObj) {
  10307. let allArr = this.getAllBallArr();
  10308. let temp;
  10309. for (let index = 0; index < allArr.length; index++) {
  10310. temp = allArr[index];
  10311. if (temp.id == deletObj.id) {
  10312. allArr.splice(index, 1);
  10313. break;
  10314. }
  10315. }
  10316. return allArr;
  10317. }
  10318. getNearBallBag(ball) {
  10319. let ui = xGame.common.gameUI.ui;
  10320. let circleArr = [];
  10321. for (let index = 1; index <= 6; index++) {
  10322. circleArr.push(ui.border["circle" + index]);
  10323. }
  10324. let outIndex = 0;
  10325. let temp;
  10326. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10327. ;
  10328. let dis = 0;
  10329. for (let index = 1; index < circleArr.length; index++) {
  10330. temp = circleArr[index];
  10331. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10332. if (dis < min) {
  10333. min = dis;
  10334. outIndex = index;
  10335. }
  10336. }
  10337. return [circleArr[outIndex], outIndex];
  10338. }
  10339. ballFlyToBag(ballArr, time = 300) {
  10340. let temp;
  10341. let hole;
  10342. this._finishNum = ballArr.length;
  10343. this._curFinish = 0;
  10344. let holeObj = {};
  10345. let holeCfg = {
  10346. "1": 0,
  10347. "2": 0,
  10348. "3": 0,
  10349. "4": 0,
  10350. "5": 0,
  10351. "6": 0
  10352. };
  10353. for (let index = 0; index < ballArr.length; index++) {
  10354. temp = ballArr[index];
  10355. temp.outColli.isSensor = true;
  10356. temp.innerColli.isSensor = true;
  10357. temp.isRunSkillAni = true;
  10358. let holeArr = this.getNearBallBag(temp);
  10359. hole = holeArr[0];
  10360. holeObj[index] = holeArr[1];
  10361. temp.d3BallSrc.scaleXYZ = 0.5;
  10362. this.tweenArr.push(temp.d3BallSrc, temp);
  10363. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10364. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10365. }));
  10366. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10367. let mIndex = holeObj[this._curFinish];
  10368. let isDone = holeCfg[mIndex];
  10369. if (isDone) {
  10370. ballArr[this._curFinish].checkWrongBall(false);
  10371. }
  10372. else {
  10373. holeCfg[mIndex] = 1;
  10374. ballArr[this._curFinish].checkWrongBall();
  10375. }
  10376. this._curFinish++;
  10377. if (this._curFinish >= this._finishNum) {
  10378. if (this.curSkill == SkillType.highSpace) {
  10379. }
  10380. else if (this.curSkill == SkillType.breakArmy) {
  10381. let rootBall = xGame.common.d2World.rootBall;
  10382. rootBall.gameObj.x = this._rootX;
  10383. rootBall.gameObj.y = this._rootY;
  10384. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10385. xGame.common.d2World.d2Gan.ui.visible = true;
  10386. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10387. xGame.common.d2World.getHelpLine();
  10388. this.callback && this.callback(this.extraScore);
  10389. }
  10390. }
  10391. }));
  10392. }
  10393. }
  10394. runHighSpace() {
  10395. let rootBall = xGame.common.d2World.rootBall;
  10396. rootBall.showSelf();
  10397. let d3Src = rootBall.d3BallSrc;
  10398. let allArr = this.getAllBallArr();
  10399. if (allArr.length <= 0) {
  10400. this.callback && this.callback(0);
  10401. return;
  10402. }
  10403. let selectBall = xGame.common.d2World.targetBall;
  10404. let wrong = selectBall && selectBall.destroyed;
  10405. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10406. selectBall = xGame.common.getRandArrEle(allArr);
  10407. }
  10408. let targetD3Src = selectBall.d3BallSrc;
  10409. xGame.common.d2World.d2Gan.ui.visible = false;
  10410. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10411. d3Src.scaleXYZ = 0.5;
  10412. this.tweenArr.push(d3Src);
  10413. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10414. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10415. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10416. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10417. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10418. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10419. let outArr = [selectBall];
  10420. let other = this.leveNum - 1;
  10421. if (other > 0) {
  10422. let nearArr = this.getOneArr(selectBall);
  10423. if (nearArr.length > 0) {
  10424. xGame.common.botherArr(nearArr);
  10425. if (other >= nearArr.length)
  10426. other = nearArr.length;
  10427. for (let index = 0; index < other; index++) {
  10428. outArr.push(nearArr[index]);
  10429. }
  10430. }
  10431. }
  10432. xGame.common.extraMoveNum = other + 1;
  10433. this.extraScore = other + 1;
  10434. this._rootX = selectBall.gameObj.x;
  10435. this._rootY = selectBall.gameObj.y;
  10436. rootBall.gameObj.x = this._rootX;
  10437. rootBall.gameObj.y = this._rootY;
  10438. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10439. Laya.Tween.clearAll(d3Src);
  10440. this.addRandomForce(outArr);
  10441. }));
  10442. }));
  10443. }
  10444. addRandomForce(outArr) {
  10445. if (outArr.length > 0) {
  10446. xGame.common.d2World.openCheckStill = true;
  10447. this.playedLastSkill = true;
  10448. }
  10449. let temp;
  10450. for (let index = 0; index < outArr.length; index++) {
  10451. let angle = xGame.common.randomNum(0, 360);
  10452. let linearPercent = xGame.common.randomNum(65, 100);
  10453. temp = outArr[index];
  10454. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10455. }
  10456. }
  10457. setLinearSpeed(angle, rigy, linearPercent) {
  10458. let sin = Math.sin(angle * Math.PI / 180);
  10459. let cos = Math.cos(angle * Math.PI / 180);
  10460. let maxSpeed = 4;
  10461. let speed = new Laya.Vector2();
  10462. speed.x = maxSpeed * linearPercent * sin;
  10463. speed.y = -maxSpeed * linearPercent * cos;
  10464. rigy.applyLinearImpulseToCenter(speed);
  10465. }
  10466. runBreakArmy() {
  10467. xGame.common.d2World.d2Gan.ui.visible = false;
  10468. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10469. let gameUI = xGame.common.gameUI.ui;
  10470. gameUI.skillRod.visible = true;
  10471. gameUI.skillRod.rotation = 110;
  10472. let outArr = this.getAllBallArr();
  10473. if (outArr.length <= 0) {
  10474. gameUI.skillRod.visible = false;
  10475. this.callback && this.callback(0);
  10476. return;
  10477. }
  10478. xGame.common.botherArr(outArr);
  10479. if (this.leveNum >= outArr.length)
  10480. this.leveNum = outArr.length;
  10481. let deleteNum = outArr.length - this.leveNum;
  10482. outArr.splice(0, deleteNum);
  10483. this.extraScore = this.leveNum;
  10484. let potX = gameUI.skillRod.x;
  10485. let potY = gameUI.skillRod.y;
  10486. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10487. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10488. let disArr = [];
  10489. for (let index = 0; index < outArr.length; index++) {
  10490. let obj = outArr[index];
  10491. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10492. dis = Math.pow(dis, 0.5);
  10493. disArr.push(dis);
  10494. }
  10495. this.tweenArr.push(gameUI.skillRod);
  10496. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10497. })).update = Laya.Handler.create(this, (e, t, c) => {
  10498. let angle = gameUI.skillRod.rotation;
  10499. let xx;
  10500. let yy;
  10501. let temp;
  10502. for (let index = 0; index < outArr.length; index++) {
  10503. temp = outArr[index];
  10504. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10505. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10506. yy -= 20;
  10507. temp.gameObj.x = xx;
  10508. temp.gameObj.y = yy;
  10509. temp.d3BallSrc.setTransPos(xx, yy);
  10510. }
  10511. if (angle <= 60) {
  10512. Laya.Tween.clearAll(gameUI.skillRod);
  10513. this.ballFlyToBag(outArr, 150);
  10514. gameUI.skillRod.visible = false;
  10515. }
  10516. }, null, false);
  10517. }
  10518. runIce() {
  10519. let ballArr = xGame.common.d2World.ballArr;
  10520. this.leveNum *= 2;
  10521. if (this.leveNum >= ballArr.length - 1)
  10522. this.leveNum = ballArr.length - 1;
  10523. let tempArr = [];
  10524. let outArr = [];
  10525. for (let index = 0; index < ballArr.length; index++) {
  10526. if (ballArr[index] instanceof D2RootBallSrc)
  10527. continue;
  10528. tempArr.push(ballArr[index]);
  10529. }
  10530. if (tempArr.length <= 0) {
  10531. this.callback && this.callback(0);
  10532. return;
  10533. }
  10534. xGame.common.botherArr(tempArr);
  10535. for (let index = 0; index < this.leveNum; index++) {
  10536. outArr.push(tempArr[index]);
  10537. }
  10538. this.extraScore = this.leveNum;
  10539. let temp;
  10540. for (let index = 0; index < outArr.length; index++) {
  10541. temp = outArr[index];
  10542. temp.d3BallSrc.playIceEft();
  10543. }
  10544. Laya.timer.once(2000, this, () => {
  10545. for (let index = 0; index < outArr.length; index++) {
  10546. temp = outArr[index];
  10547. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10548. temp.setBallFunc("ice", str);
  10549. }
  10550. this.callback && this.callback(0);
  10551. });
  10552. }
  10553. runFireworks() {
  10554. let allArr = this.getAllBallArr();
  10555. if (allArr.length <= 0) {
  10556. this.callback && this.callback(0);
  10557. return;
  10558. }
  10559. xGame.common.d2World.d2Gan.ui.visible = false;
  10560. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10561. let outArr = [];
  10562. let other = this.leveNum;
  10563. if (other > 0) {
  10564. if (allArr.length > 0) {
  10565. xGame.common.botherArr(allArr);
  10566. if (other >= allArr.length)
  10567. other = allArr.length;
  10568. for (let index = 0; index < other; index++) {
  10569. outArr.push(allArr[index]);
  10570. }
  10571. }
  10572. }
  10573. xGame.common.extraMoveNum = other;
  10574. this.extraScore = other;
  10575. this.addRandmomFireworks(outArr);
  10576. }
  10577. addRandmomFireworks(outArr) {
  10578. Laya.timer.once(1100, this, () => {
  10579. if (outArr.length > 0) {
  10580. xGame.common.d2World.openCheckStill = true;
  10581. this.playedLastSkill = true;
  10582. }
  10583. });
  10584. xGame.soundMgr.playSound("skill_04_02");
  10585. let temp;
  10586. let delay = -200;
  10587. for (let index = 0; index < outArr.length; index++) {
  10588. temp = outArr[index];
  10589. delay += 200;
  10590. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10591. let angle = xGame.common.randomNum(0, 360);
  10592. angle = this.getFireworksAngle(obj);
  10593. let linearPercent = xGame.common.randomNum(45, 80);
  10594. if (!obj.destroyed)
  10595. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10596. });
  10597. }
  10598. }
  10599. getFireworksAngle(obj) {
  10600. let rootBall = xGame.common.d2World.rootBall;
  10601. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10602. }
  10603. resetGame() {
  10604. Laya.timer.clearAll(this);
  10605. if (this.tweenArr) {
  10606. for (let index = 0; index < this.tweenArr.length; index++) {
  10607. Laya.Tween.clearAll(this.tweenArr[index]);
  10608. }
  10609. }
  10610. this.tweenArr = null;
  10611. }
  10612. runGuanYu() {
  10613. xGame.common.d2World.d2Gan.ui.visible = false;
  10614. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10615. let rootBall = xGame.common.d2World.rootBall;
  10616. if (rootBall.isInHole) {
  10617. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10618. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10619. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10620. rootBall.showSelf();
  10621. }
  10622. this.rtStarX = rootBall.gameObj.x;
  10623. this.rtStarY = rootBall.gameObj.y;
  10624. this.knifeTimes = 0;
  10625. this.playedLastSkill = true;
  10626. rootBall.forceRun = true;
  10627. rootBall.rigy.type = "static";
  10628. xGame.common.d2World.openCheckStill = true;
  10629. this.guanyuRandomKnife();
  10630. }
  10631. guanyuRandomKnife() {
  10632. let rootBall = xGame.common.d2World.rootBall;
  10633. let dir = this.getRandDir();
  10634. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10635. console.log("当前angle", angle);
  10636. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10637. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10638. let dis = 324;
  10639. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10640. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10641. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10642. this.rtStarX = rootBall.gameObj.x;
  10643. this.rtStarY = rootBall.gameObj.y;
  10644. this.knifeTimes++;
  10645. let skillLevel;
  10646. if (xGame.common.gameMgr.selfTurn) {
  10647. skillLevel = DataMgr.getBigSkillByIndex(4);
  10648. }
  10649. else {
  10650. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10651. }
  10652. if (!skillLevel)
  10653. skillLevel = 1;
  10654. skillLevel += 2;
  10655. if (this.knifeTimes < skillLevel) {
  10656. Laya.timer.once(400, this, () => {
  10657. this.guanyuRandomKnife();
  10658. });
  10659. }
  10660. else {
  10661. rootBall.forceRun = false;
  10662. rootBall.rigy.type = "dynamic";
  10663. xGame.common.extraMoveNum = skillLevel;
  10664. }
  10665. }));
  10666. }
  10667. getRandDir() {
  10668. let rootBall = xGame.common.d2World.rootBall;
  10669. let allBall = this.getAllBallArr();
  10670. let target = xGame.common.getRandArrEle(allBall);
  10671. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10672. return this.knifeV2;
  10673. }
  10674. cloneKnife(x, y, rotation) {
  10675. let parent = xGame.common.d3World.knifeRoot;
  10676. let prefab = xGame.common.d3World.knife;
  10677. let clone = prefab.clone();
  10678. parent.addChild(clone);
  10679. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10680. clone.transform.localPositionX = this.knifeV3.x;
  10681. clone.transform.localPositionY = 0;
  10682. clone.transform.localPositionZ = this.knifeV3.z;
  10683. clone.transform.localRotationEulerX = 0;
  10684. clone.transform.localRotationEulerY = rotation;
  10685. clone.transform.localRotationEulerZ = 0;
  10686. clone.active = true;
  10687. return clone;
  10688. }
  10689. cloneGuanYuEft(x, y, angle) {
  10690. return;
  10691. let parent = xGame.common.gameUI.ui.guanyuNode;
  10692. let eft = new ui_guanyuAni();
  10693. eft.parent = parent;
  10694. eft.x = x;
  10695. eft.y = y;
  10696. eft.rotation = angle;
  10697. }
  10698. }
  10699. class ui_UIWordsList extends fgui.GComponent {
  10700. static createInstance() {
  10701. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10702. }
  10703. onConstruct() {
  10704. this.c1 = this.getController("c1");
  10705. this.n74 = (this.getChild("n74"));
  10706. this.clickNode = (this.getChild("clickNode"));
  10707. this.myNode = (this.getChild("myNode"));
  10708. this.n68 = (this.getChild("n68"));
  10709. this.n66 = (this.getChild("n66"));
  10710. this.n55 = (this.getChild("n55"));
  10711. this.wordsBtn = (this.getChild("wordsBtn"));
  10712. this.emotionBtn = (this.getChild("emotionBtn"));
  10713. this.mybggg = (this.getChild("mybggg"));
  10714. this.wordsList = (this.getChild("wordsList"));
  10715. this.emotionList = (this.getChild("emotionList"));
  10716. this.myRoot = (this.getChild("myRoot"));
  10717. }
  10718. }
  10719. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10720. class EmotionDisplay {
  10721. constructor(index, ui) {
  10722. this.ui = ui;
  10723. this.index = index;
  10724. this.ui.onClick(this, this.clickSelf);
  10725. this.updateSelf();
  10726. }
  10727. updateSelf() {
  10728. let data = cfgTable.emotionData[this.index + 1];
  10729. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10730. }
  10731. clickSelf() {
  10732. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10733. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10734. xGame.common.talkMgr.closeTalkView();
  10735. }
  10736. }
  10737. class WordsDisplay {
  10738. constructor(index, ui) {
  10739. this.ui = ui;
  10740. this.index = index;
  10741. this.ui.onClick(this, this.clickSelf);
  10742. this.updateSelf();
  10743. }
  10744. updateSelf() {
  10745. let data = cfgTable.talkwordsData[this.index + 1];
  10746. this.ui.txt.text = data.msg;
  10747. }
  10748. clickSelf() {
  10749. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10750. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10751. xGame.common.talkMgr.closeTalkView();
  10752. }
  10753. }
  10754. class UIWordsList extends UIBase {
  10755. constructor() {
  10756. super();
  10757. }
  10758. onConstructor() {
  10759. this.ui = ui_UIWordsList.createInstance();
  10760. this.contentPane = this.ui;
  10761. this.isEject = false;
  10762. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10763. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10764. this.addUIClick(this.ui.clickNode, this.hide);
  10765. this.initTalkList();
  10766. this.initEmotionList();
  10767. }
  10768. show() {
  10769. super.show();
  10770. }
  10771. initTalkList() {
  10772. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10773. let data = cfgTable.talkwordsData;
  10774. let length = Object.keys(data).length;
  10775. this.ui.wordsList.numItems = length;
  10776. }
  10777. initEmotionList() {
  10778. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10779. let data = cfgTable.emotionData;
  10780. let length = Object.keys(data).length;
  10781. this.ui.emotionList.numItems = length;
  10782. }
  10783. renderTalkItem(index, obj) {
  10784. let temp = new WordsDisplay(index, obj);
  10785. }
  10786. renderEmotionItem(index, obj) {
  10787. let temp = new EmotionDisplay(index, obj);
  10788. }
  10789. openTalkList() {
  10790. this.ui.c1.selectedIndex = 0;
  10791. }
  10792. openEmotionList() {
  10793. this.ui.c1.selectedIndex = 1;
  10794. }
  10795. }
  10796. UIWordsList.uiName = "UIWordsList";
  10797. class TalkMgr {
  10798. constructor() {
  10799. this.aiSpeak = true;
  10800. this.emotionList = [];
  10801. this.talkList = [];
  10802. this.addEvent();
  10803. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10804. this.emotionList = [];
  10805. this.talkList = [];
  10806. for (let k in cfgTable.emotionData) {
  10807. this.emotionList.push(cfgTable.emotionData[k].id);
  10808. }
  10809. for (let k in cfgTable.talkwordsData) {
  10810. this.talkList.push(cfgTable.talkwordsData[k].id);
  10811. }
  10812. }
  10813. addEvent() {
  10814. let ui = xGame.common.gameUI.ui;
  10815. ui.wordsBtn.visible = true;
  10816. ui.wordsBtn.onClick(this, this.openTalkView);
  10817. ui.aiWordsBtn.visible = true;
  10818. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10819. }
  10820. openTalkView() {
  10821. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10822. xGame.uiMgr.Show(UIWordsList);
  10823. }
  10824. closeTalkView() {
  10825. xGame.uiMgr.Hide(UIWordsList);
  10826. }
  10827. clickAIState() {
  10828. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10829. this.aiSpeak = !this.aiSpeak;
  10830. this.changeAIState(this.aiSpeak);
  10831. }
  10832. changeAIState(speak) {
  10833. this.aiSpeak = speak;
  10834. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10835. if (speak) {
  10836. btn.c1.selectedIndex = 0;
  10837. }
  10838. else {
  10839. btn.c1.selectedIndex = 1;
  10840. }
  10841. }
  10842. showSelfTalk(wordsId) {
  10843. let ui = xGame.common.gameUI.ui;
  10844. ui.selfTalk.visible = true;
  10845. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10846. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10847. ui.selfTalk.t0.play();
  10848. }
  10849. showSelfEmotion(emotionId) {
  10850. let ui = xGame.common.gameUI.ui;
  10851. ui.selfTalk.visible = true;
  10852. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10853. this.selfSpine && this.selfSpine.dispose();
  10854. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10855. let spineData = cfgTable.emotionData[emotionId].spine;
  10856. this.selfSpine = new SpineMgr(spineData, () => {
  10857. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10858. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10859. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10860. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10861. });
  10862. ui.selfTalk.t0.play();
  10863. }
  10864. showAITalk(wordsId) {
  10865. if (!this.aiSpeak)
  10866. return;
  10867. if (DataMgr.gameData.gameCount < 2)
  10868. return;
  10869. if (wordsId < 1)
  10870. wordsId = this.getRandTalk();
  10871. let ui = xGame.common.gameUI.ui;
  10872. ui.aiTalk.visible = true;
  10873. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10874. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10875. ui.aiTalk.t0.play();
  10876. }
  10877. getRandTalk() {
  10878. let rand = xGame.tools.random(0, this.talkList.length);
  10879. return this.emotionList[rand];
  10880. }
  10881. getRandEmotion() {
  10882. let rand = xGame.tools.random(0, this.emotionList.length);
  10883. return this.emotionList[rand];
  10884. }
  10885. showAIEmotion(emotionId) {
  10886. if (!this.aiSpeak)
  10887. return;
  10888. if (DataMgr.gameData.gameCount < 2)
  10889. return;
  10890. if (emotionId < 1)
  10891. emotionId = this.getRandEmotion();
  10892. let ui = xGame.common.gameUI.ui;
  10893. ui.aiTalk.visible = true;
  10894. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10895. this.aiSpine && this.aiSpine.dispose();
  10896. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10897. let spineData = cfgTable.emotionData[emotionId].spine;
  10898. this.aiSpine = new SpineMgr(spineData, () => {
  10899. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10900. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10901. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10902. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10903. });
  10904. ui.aiTalk.t0.play();
  10905. }
  10906. resetGame() {
  10907. let ui = xGame.common.gameUI.ui;
  10908. ui.aiTalk.visible = false;
  10909. ui.selfTalk.visible = false;
  10910. this.aiSpine && this.aiSpine.dispose();
  10911. this.selfSpine && this.selfSpine.dispose();
  10912. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10913. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10914. this.closeTalkView();
  10915. }
  10916. }
  10917. class WordsMgr {
  10918. constructor() {
  10919. this.comboTimes = 1;
  10920. this.skillTimes = 0;
  10921. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10922. this.comboSpine = new SpineMgr("yxz_liangan");
  10923. this.skillSpine = new SpineMgr("yiganxqiu");
  10924. this.scoreSpine = new SpineMgr("defen");
  10925. }
  10926. setClassicCombo(isInterrupt) {
  10927. if (isInterrupt) {
  10928. this.comboTimes = 0;
  10929. }
  10930. }
  10931. playClassicWords(type, callback) {
  10932. this.callback = callback;
  10933. let aniIndex = type;
  10934. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10935. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10936. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10937. mySpine.destroy(true);
  10938. this.playClassicTimes();
  10939. });
  10940. }
  10941. playClassicTimes() {
  10942. this.comboTimes++;
  10943. if (this.comboTimes <= 1) {
  10944. this.callback && this.callback();
  10945. }
  10946. else {
  10947. let aniIndex = this.comboTimes - 1;
  10948. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10949. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10950. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10951. mySpine.destroy(true);
  10952. this.callback && this.callback();
  10953. });
  10954. }
  10955. }
  10956. playBigSkillTimes(times, callback) {
  10957. if (times <= 0) {
  10958. callback && callback();
  10959. return;
  10960. }
  10961. this.callback = callback;
  10962. let pre = "sz_0";
  10963. let aniIndex = 0;
  10964. this.getWordsImg(times, pre, () => {
  10965. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10966. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10967. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10968. let r1 = ``;
  10969. let r2 = ``;
  10970. if (times <= 9) {
  10971. r1 = `res/d2Res/${pre}${times}.png`;
  10972. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10973. aniIndex = 0;
  10974. }
  10975. else {
  10976. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10977. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10978. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10979. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10980. aniIndex = 1;
  10981. }
  10982. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10983. mySpine.destroy(true);
  10984. xGame.common.gameMgr.playSkillTips();
  10985. this.playScore(times);
  10986. xGame.common.playRandomMutiBallBigSkillSound();
  10987. }, mySpine);
  10988. });
  10989. }
  10990. playScore(score) {
  10991. let pre = "sz_";
  10992. let aniIndex = 0;
  10993. this.getWordsImg(score, pre, () => {
  10994. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10995. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10996. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10997. let r1 = ``;
  10998. let r2 = ``;
  10999. if (score <= 9) {
  11000. r1 = `res/d2Res/${pre}${score}.png`;
  11001. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11002. aniIndex = 0;
  11003. }
  11004. else {
  11005. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11006. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11007. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11008. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11009. aniIndex = 1;
  11010. }
  11011. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11012. mySpine.destroy(true);
  11013. this.callback && this.callback();
  11014. }, mySpine);
  11015. });
  11016. }
  11017. getWordsImg(number, pre = "", callback) {
  11018. let arr = [];
  11019. if (number <= 9) {
  11020. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11021. }
  11022. else {
  11023. 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 });
  11024. }
  11025. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11026. callback && callback();
  11027. }));
  11028. }
  11029. }
  11030. class ui_UIRodMethod extends fgui.GComponent {
  11031. static createInstance() {
  11032. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11033. }
  11034. onConstruct() {
  11035. this.n24 = (this.getChild("n24"));
  11036. this.white = (this.getChild("white"));
  11037. this.dot = (this.getChild("dot"));
  11038. this.sureBtn = (this.getChild("sureBtn"));
  11039. this.n20 = (this.getChild("n20"));
  11040. this.n21 = (this.getChild("n21"));
  11041. this.n22 = (this.getChild("n22"));
  11042. this.n23 = (this.getChild("n23"));
  11043. this.n5 = (this.getChild("n5"));
  11044. this.n14 = (this.getChild("n14"));
  11045. this.t0 = this.getTransition("t0");
  11046. }
  11047. }
  11048. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11049. class UIRodMethod extends UIBase {
  11050. constructor() {
  11051. super();
  11052. this.isPressd = false;
  11053. }
  11054. onConstructor() {
  11055. this.ui = ui_UIRodMethod.createInstance();
  11056. this.contentPane = this.ui;
  11057. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11058. this.moveDir = new Laya.Vector2();
  11059. this.moveDest = new Laya.Vector2();
  11060. this.centerPos = new Laya.Vector2();
  11061. xGame.common.uiRodMethod = this;
  11062. }
  11063. show() {
  11064. super.show();
  11065. xGame.common.gameMgr.gamePause = true;
  11066. this.openPressDotEvent();
  11067. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11068. this.centerPos.x = this.ui.white.x;
  11069. this.centerPos.y = this.ui.white.y;
  11070. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11071. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11072. this.setDot();
  11073. }
  11074. setDot() {
  11075. this.ui.dot.x = this.moveDest.x;
  11076. this.ui.dot.y = this.moveDest.y;
  11077. }
  11078. closeSelf() {
  11079. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11080. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11081. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11082. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11083. xGame.common.gameMgr.gamePause = false;
  11084. this.hide();
  11085. }
  11086. openPressDotEvent() {
  11087. this.closePressDotEvent();
  11088. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11089. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11090. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11091. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11092. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11093. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11094. }
  11095. closePressDotEvent() {
  11096. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11097. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11098. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11099. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11100. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11101. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11102. }
  11103. onDown(e) {
  11104. if (e.type == Laya.Event.MOUSE_DOWN)
  11105. this.isPressd = true;
  11106. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11107. this.isPressd = false;
  11108. if (!this.isPressd)
  11109. return;
  11110. this.moveDest.x = e.stageX;
  11111. this.moveDest.y = e.stageY;
  11112. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11113. if (dis > 6724) {
  11114. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11115. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11116. }
  11117. this.setDot();
  11118. }
  11119. resetRod() {
  11120. this.ui.dot.x = this.ui.white.x;
  11121. this.ui.dot.y = this.ui.white.y;
  11122. this.gameRod.dot.x = this.gameRod.bg.x;
  11123. this.gameRod.dot.y = this.gameRod.bg.y;
  11124. xGame.common.rodOffest.x = 0;
  11125. xGame.common.rodOffest.y = 0;
  11126. }
  11127. }
  11128. UIRodMethod.uiName = "UIRodMethod";
  11129. class UIGame extends UIBase {
  11130. constructor() {
  11131. super();
  11132. this.powerNum = 0;
  11133. this.isD3Inited = false;
  11134. this.isPrePlay = false;
  11135. this.isMoveRod = false;
  11136. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11137. this.rulerDis = 20;
  11138. this.rulerOffset = 0;
  11139. }
  11140. onConstructor() {
  11141. this.ui = ui_UIGame.createInstance();
  11142. this.contentPane = this.ui;
  11143. this.ui.x += xGame.common.sysOffestNum;
  11144. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11145. this.isEject = false;
  11146. xGame.common.gameUI = this;
  11147. this.initSelf();
  11148. }
  11149. isTurnSelf() {
  11150. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11151. return true;
  11152. }
  11153. }
  11154. initSelf() {
  11155. let topUI = this.ui.topNode;
  11156. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11157. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11158. this.barInfo = {};
  11159. this.barInfo.curY = 0;
  11160. this.barInfo.height = this.ui.powerNode.height;
  11161. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11162. this.barInfo.powerStartY = this.ui.powerNode.y;
  11163. xGame.common.aiPlayer = new AIPlayer();
  11164. xGame.common.gameMgr = new GameMgr();
  11165. xGame.common.skillMgr = new SkillMgr();
  11166. xGame.common.wordsMgr = new WordsMgr();
  11167. xGame.common.talkMgr = new TalkMgr();
  11168. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11169. console.log("加载经典模式表情文件chenggon !");
  11170. });
  11171. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11172. console.log("挑战模式奖励模式spine加载成功!");
  11173. });
  11174. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11175. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11176. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11177. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11178. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11179. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11180. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11181. }
  11182. getGanZiImg() {
  11183. let index = DataMgr.getCurBallRod();
  11184. let data = cfgTable.ballrodData[index + 1];
  11185. let gan_url = xGame.common.getGameIconUrl(data.img);
  11186. console.log('zh:getGanZiImg gan_url==' + gan_url);
  11187. this.ui.powerNode.showImg.url = gan_url;
  11188. console.log('zh:修改杆子图标O K');
  11189. }
  11190. returnHome() {
  11191. let tips = "Are you sure to exit the game?";
  11192. let woman = "Boss, why don't you play for a while longer?";
  11193. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11194. }
  11195. addRodMethodClick() {
  11196. if (this.isTurnSelf()) {
  11197. xGame.uiMgr.Show(UIRodMethod);
  11198. }
  11199. }
  11200. clickHelpLineBtn(force = false) {
  11201. if (!this.isTurnSelf())
  11202. return;
  11203. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11204. if (success) {
  11205. xGame.common.longHelpLine = true;
  11206. xGame.common.d2World.getHelpLine();
  11207. Moyu.sendDataEvent("guideNum");
  11208. }
  11209. else {
  11210. }
  11211. });
  11212. }
  11213. renderSelfDisplayBalls(index, target) {
  11214. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11215. target.myImg.url = xGame.common.getGameIconUrl(str);
  11216. }
  11217. renderAIDisplayBalls(index, target) {
  11218. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11219. target.myImg.url = xGame.common.getGameIconUrl(str);
  11220. ;
  11221. }
  11222. updateMode() {
  11223. if (xGame.common.gameMode == GameMode.classic) {
  11224. this.ui.topNode.scoreNode.visible = false;
  11225. }
  11226. else if (xGame.common.gameMode == GameMode.bigMove) {
  11227. this.ui.topNode.scoreNode.visible = true;
  11228. }
  11229. }
  11230. show() {
  11231. super.show();
  11232. console.log("zh:uigame show AADD");
  11233. this.ui.alpha = 0;
  11234. this.updateSelf();
  11235. xGame.common.gameMgr.gamePause = false;
  11236. xGame.common.gameUI.ui.blackAni.visible = false;
  11237. xGame.common.gameUI.ui.whiteAni.visible = false;
  11238. this.ui.powerEft.visible = false;
  11239. this.ui.colorNode.visible = false;
  11240. this.updateHead();
  11241. let curUse = DataMgr.getCurBallRod();
  11242. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  11243. this.getGanZiImg();
  11244. }
  11245. updateSelf() {
  11246. if (xGame.common.gameMode == GameMode.classic) {
  11247. this.ui.c1.selectedIndex = 0;
  11248. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11249. this.ui.topNode.middleNode.visible = true;
  11250. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11251. }
  11252. else if (xGame.common.gameMode == GameMode.bigMove) {
  11253. this.ui.c1.selectedIndex = 0;
  11254. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11255. this.ui.topNode.middleNode.visible = false;
  11256. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11257. let rand = xGame.common.randomNum(1, max);
  11258. let guide = DataMgr.getSkillGuide();
  11259. if (guide == 0)
  11260. rand = 1;
  11261. xGame.common.bigMoveLevelIndex = rand;
  11262. }
  11263. else if (xGame.common.gameMode == GameMode.placeBall) {
  11264. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11265. this.ui.c1.selectedIndex = 1 + data.type;
  11266. this.ui.alpha = 1;
  11267. this.startGame();
  11268. }
  11269. this.updateMode();
  11270. this.initD3world();
  11271. this.initD2world();
  11272. }
  11273. startGame() {
  11274. this.ui.snowNode.visible = Math.random() <= 0.1;
  11275. this.ui.d2Node.visible = false;
  11276. xGame.common.d3World.d3Hand.gameObj.active = false;
  11277. xGame.common.d3World.tableSrc.init();
  11278. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11279. this.cameraViewChange(() => {
  11280. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11281. switch (xGame.common.gameMode) {
  11282. case GameMode.classic:
  11283. xGame.common.d3World.d3Hand.gameObj.active = true;
  11284. this.playPutBallD3Ani();
  11285. break;
  11286. case GameMode.bigMove:
  11287. this.enterGame();
  11288. Laya.timer.once(500, this, () => {
  11289. this.ui.topNode.middleNode.visible = true;
  11290. this.ui.topNode.middleNode.t0.play();
  11291. });
  11292. break;
  11293. case GameMode.placeBall:
  11294. this.enterGame();
  11295. break;
  11296. default:
  11297. break;
  11298. }
  11299. });
  11300. PlatMgr.showBanner(false);
  11301. }
  11302. enterGame() {
  11303. this.ui.d2Node.visible = true;
  11304. xGame.common.d3World.d3Hand.gameObj.active = false;
  11305. xGame.common.showOneCamera("mainCamera");
  11306. Moyu.recordGame(30, true);
  11307. if (!this.isPrePlay) {
  11308. this.isPrePlay = true;
  11309. xGame.common.d3World.prePlayEft();
  11310. }
  11311. xGame.common.gameMgr.gameReady();
  11312. this.openAllEvent();
  11313. this.ui.snowNode.visible = false;
  11314. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11315. this.ui.helpBtn.visible = condition;
  11316. }
  11317. showHelpLineGuide() {
  11318. let longGuide = DataMgr.getGuideHelpLine();
  11319. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11320. this.ui.helpBtn.visible = true;
  11321. this.ui.guideNode.visible = true;
  11322. }
  11323. }
  11324. setTurnAlpha(alpha) {
  11325. this.ui.keduNode.alpha = alpha;
  11326. this.ui.ganNode.alpha = alpha;
  11327. this.ui.rodMethodNode.alpha = alpha;
  11328. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11329. }
  11330. cameraViewChange(callback) {
  11331. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11332. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11333. xGame.common.showOneCamera("visitAngle");
  11334. cameraSrc.localRotationEulerY = 180;
  11335. cameraSrc.localRotationEulerZ = 0;
  11336. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11337. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11338. callback && callback();
  11339. }));
  11340. }));
  11341. }
  11342. playPutBallD3Ani() {
  11343. xGame.common.showOneCamera("mainCamera");
  11344. let handSrc = xGame.common.d3World.d3Hand;
  11345. handSrc.gameObj.active = true;
  11346. handSrc.transform.localPositionZ = 3;
  11347. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11348. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11349. handSrc.gameObj.active = false;
  11350. this.enterGame();
  11351. }), 400);
  11352. }));
  11353. }
  11354. updateHead() {
  11355. let user = Moyu.getUserInfo();
  11356. this.ui.topNode.selfNameTxt.text = user.nickName;
  11357. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11358. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11359. if (DataMgr.getSkillGuide() < 1) {
  11360. this.ui.topNode.aiNameTxt.text = 'billiards';
  11361. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11362. }
  11363. else {
  11364. this.ui.topNode.aiNameTxt.text = aiData.name;
  11365. let randNo = Math.floor(Math.random() * 10) + 1;
  11366. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11367. }
  11368. }
  11369. initD2world() {
  11370. let node = this.ui.d2Root.displayObject;
  11371. let src = node.getComponent(D2World);
  11372. if (!src) {
  11373. xGame.common.d2World = node.addComponent(D2World);
  11374. }
  11375. xGame.common.d2World.initSelf();
  11376. }
  11377. initD3world() {
  11378. if (this.isD3Inited)
  11379. return;
  11380. this.isD3Inited = true;
  11381. let scene3D = xGame.common.d3Scene;
  11382. this.ui.d3Root.displayObject.addChild(scene3D);
  11383. scene3D.active = true;
  11384. xGame.common.d3World.tableSrc.setBorderPos();
  11385. }
  11386. onRootMove(e) {
  11387. let rootBall = xGame.common.d2World.rootBall;
  11388. this.ui.moveNode.x = e.x;
  11389. this.ui.moveNode.y = e.y;
  11390. rootBall.gameObj.x = e.x;
  11391. rootBall.gameObj.y = e.y;
  11392. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11393. }
  11394. aiRootMove(move) {
  11395. if (move)
  11396. this.hideBallUI();
  11397. else {
  11398. this.showBallUI();
  11399. xGame.common.d2World.getHelpLine();
  11400. }
  11401. }
  11402. aiForce(type, force = 0) {
  11403. this.pressTarget = PressType.powerNode;
  11404. if (type == 1)
  11405. this.onEventUp({ force: true });
  11406. else if (type == 2)
  11407. this.onEventMove({ stageY: force, force: true });
  11408. }
  11409. onEventPress(e) {
  11410. if (e.stopPropagation)
  11411. e.stopPropagation();
  11412. if (!this.isTurnSelf())
  11413. return;
  11414. let target = e.target;
  11415. switch (target) {
  11416. case this.ui.myPowerNode.displayObject:
  11417. this.pressTarget = PressType.powerNode;
  11418. this.barInfo.curY = e.stageY;
  11419. this.updateBarInfo();
  11420. break;
  11421. case this.ui.moveNode.displayObject:
  11422. this.pressTarget = PressType.moveNode;
  11423. this.hideBallUI();
  11424. this.eventObj.curX = this.ui.moveNode.x;
  11425. this.eventObj.curY = this.ui.moveNode.y;
  11426. this.ui.moveNode.finger.visible = false;
  11427. this.eventObj.lastX = e.stageX;
  11428. this.eventObj.lastY = e.stageY;
  11429. break;
  11430. case this.ui.rulerClickNode.displayObject:
  11431. this.pressTarget = PressType.rulerNode;
  11432. this.eventObj.lastY = e.stageY;
  11433. break;
  11434. case this.ui.d2Root.displayObject:
  11435. this.pressTarget = PressType.d2Root;
  11436. this.eventObj.lastX = e.stageX;
  11437. this.eventObj.lastY = e.stageY;
  11438. this.eventObj.starX = e.stageX;
  11439. this.eventObj.starY = e.stageY;
  11440. this.eventObj.curX = 0;
  11441. this.eventObj.curY = 0;
  11442. xGame.common.d2World.d2Gan.setGanLastInfo();
  11443. this.rulerOffset = 0;
  11444. break;
  11445. default:
  11446. break;
  11447. }
  11448. }
  11449. onEventMove(e) {
  11450. if (e.stopPropagation)
  11451. e.stopPropagation();
  11452. if (e && e.force) {
  11453. }
  11454. else {
  11455. if (!this.isTurnSelf())
  11456. return;
  11457. }
  11458. switch (this.pressTarget) {
  11459. case PressType.powerNode:
  11460. this.barInfo.curY = e.stageY;
  11461. this.updateBarInfo();
  11462. this.isMoveRod = true;
  11463. break;
  11464. case PressType.moveNode:
  11465. let rootBall = xGame.common.d2World.rootBall;
  11466. let radius = rootBall.gameObj.width / 2;
  11467. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11468. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11469. let border = xGame.common.d2World.borderRect;
  11470. if (curX <= border.x + radius)
  11471. curX = border.x + radius;
  11472. else if (curX >= border.x + border.width - radius)
  11473. curX = border.x + border.width - radius;
  11474. if (curY <= border.y + radius)
  11475. curY = border.y + radius;
  11476. else if (curY >= border.y + border.height - radius)
  11477. curY = border.y + border.height - radius;
  11478. if (xGame.common.gameMgr.isOpenBall) {
  11479. if (curX >= border.x + border.openBallW - radius)
  11480. curX = border.x + border.openBallW - radius;
  11481. }
  11482. this.ui.moveNode.x = curX;
  11483. this.ui.moveNode.y = curY;
  11484. rootBall.gameObj.x = curX;
  11485. rootBall.gameObj.y = curY;
  11486. rootBall.d3BallSrc.setTransPos(curX, curY);
  11487. this.isMoveRod = true;
  11488. break;
  11489. case PressType.rulerNode:
  11490. let yy = e.stageY - this.eventObj.lastY;
  11491. this.eventObj.lastY = e.stageY;
  11492. let ruler1 = this.ui.rulerNode.img1;
  11493. let ruler2 = this.ui.rulerNode.img2;
  11494. ruler1.y += yy;
  11495. ruler2.y += yy;
  11496. this.rulerOffset += yy;
  11497. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11498. this.rulerOffset = 0;
  11499. xGame.soundMgr.playSound("inch", 1, 10);
  11500. }
  11501. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11502. let h = ruler1.height;
  11503. this.checkGuide();
  11504. this.isMoveRod = true;
  11505. if (ruler1.y >= h) {
  11506. ruler1.y = -h;
  11507. ruler2.y = 0;
  11508. return;
  11509. }
  11510. else if (ruler1.y <= -h) {
  11511. ruler1.y = h;
  11512. ruler2.y = 0;
  11513. return;
  11514. }
  11515. if (ruler2.y >= h) {
  11516. ruler2.y = -h;
  11517. ruler1.y = 0;
  11518. return;
  11519. }
  11520. else if (ruler2.y <= -h) {
  11521. ruler2.y = h;
  11522. ruler1.y = 0;
  11523. return;
  11524. }
  11525. break;
  11526. case PressType.d2Root:
  11527. this.eventObj.curX = e.stageX;
  11528. this.eventObj.curY = e.stageY;
  11529. let offset = this.checkRodMoveDir();
  11530. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11531. this.eventObj.lastX = e.stageX;
  11532. this.eventObj.lastY = e.stageY;
  11533. break;
  11534. default:
  11535. break;
  11536. }
  11537. }
  11538. onEventUp(e) {
  11539. if (e.stopPropagation)
  11540. e.stopPropagation();
  11541. if (e && e.force) {
  11542. }
  11543. else {
  11544. if (!this.isTurnSelf())
  11545. return;
  11546. }
  11547. switch (this.pressTarget) {
  11548. case PressType.powerNode:
  11549. this.ui.powerNode.value = 0;
  11550. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11551. this.ui.powerTxt.text = "";
  11552. if (this.powerNum > 0) {
  11553. xGame.eventMgr.event(BALL_SHOOT);
  11554. xGame.common.d2World.shoot(this.powerNum);
  11555. xGame.common.d2World.d2Gan.shoot();
  11556. xGame.common.d2World.d2HelpLine.shoot();
  11557. this.finishGuide();
  11558. this.ui.powerEft.visible = false;
  11559. this.ui.colorNode.visible = false;
  11560. let ganStr = "";
  11561. if (this.powerNum <= 30) {
  11562. ganStr = "gan_30";
  11563. }
  11564. else if (this.powerNum <= 60) {
  11565. ganStr = "gan_50";
  11566. }
  11567. else {
  11568. ganStr = "gan_80";
  11569. }
  11570. xGame.soundMgr.playSound(ganStr);
  11571. }
  11572. break;
  11573. case PressType.moveNode:
  11574. let rootBall = xGame.common.d2World.rootBall;
  11575. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11576. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11577. let isIntersect = this.judgeBallIntersect();
  11578. if (isIntersect) {
  11579. this.ui.moveNode.x = lastX;
  11580. this.ui.moveNode.y = lastY;
  11581. rootBall.gameObj.x = lastX;
  11582. rootBall.gameObj.y = lastY;
  11583. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11584. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11585. }
  11586. else {
  11587. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11588. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11589. }
  11590. this.showBallUI();
  11591. this.ui.moveNode.finger.visible = true;
  11592. xGame.common.d2World.getHelpLine();
  11593. break;
  11594. case PressType.rulerNode:
  11595. break;
  11596. case PressType.d2Root:
  11597. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11598. if (dis <= 25) {
  11599. this.moveToClickDot(e);
  11600. }
  11601. break;
  11602. default:
  11603. break;
  11604. }
  11605. this.pressTarget = -1;
  11606. }
  11607. checkGuide() {
  11608. let guide = DataMgr.getSkillGuide();
  11609. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11610. xGame.common.guideStep++;
  11611. xGame.common.gameUI.ui.guide2.visible = false;
  11612. xGame.common.gameUI.ui.guide3.visible = true;
  11613. }
  11614. }
  11615. finishGuide() {
  11616. let guide = DataMgr.getSkillGuide();
  11617. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11618. xGame.common.guideStep = 10;
  11619. this.closeAllGuide();
  11620. console.log('zh: 新手引导完毕');
  11621. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11622. }
  11623. }
  11624. closeAllGuide() {
  11625. xGame.common.gameUI.ui.guide1.visible = false;
  11626. xGame.common.gameUI.ui.guide2.visible = false;
  11627. xGame.common.gameUI.ui.guide3.visible = false;
  11628. }
  11629. updateBarInfo() {
  11630. let star = this.ui.powerNode.y;
  11631. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11632. if (rate >= 1)
  11633. rate = 1;
  11634. if (rate <= 0)
  11635. rate = 0;
  11636. this.powerNum = Math.ceil(rate * 100);
  11637. this.ui.powerNode.value = this.powerNum;
  11638. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11639. this.ui.colorNode.value = this.powerNum;
  11640. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11641. this.ui.powerEft.visible = this.powerNum != 0;
  11642. this.ui.colorNode.visible = this.powerNum != 0;
  11643. this.ui.powerTxt.text = this.powerNum + "";
  11644. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11645. }
  11646. forceCancel() {
  11647. this.ui.powerNode.value = 0;
  11648. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11649. this.ui.powerTxt.text = "";
  11650. }
  11651. checkRodMoveDir() {
  11652. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11653. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11654. if (tempX >= 0 && tempY <= 0) {
  11655. return this.checkDir();
  11656. }
  11657. else if (tempX < 0 && tempY < 0) {
  11658. return this.checkDir(1, -1);
  11659. }
  11660. else if (tempX < 0 && tempY > 0) {
  11661. return this.checkDir(-1, -1);
  11662. }
  11663. else {
  11664. return this.checkDir(-1, 1);
  11665. }
  11666. }
  11667. checkDir(flagX = 1, flagY = 1) {
  11668. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11669. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11670. if (offsetY == 0) {
  11671. return offsetX * flagX;
  11672. }
  11673. if (offsetX == 0) {
  11674. return offsetY * flagY;
  11675. }
  11676. let angle = offsetY / offsetX;
  11677. if (Math.abs(angle) >= 1) {
  11678. return offsetY * flagY;
  11679. }
  11680. else {
  11681. return offsetX * flagX;
  11682. }
  11683. }
  11684. judgeBallIntersect() {
  11685. let rootBall = xGame.common.d2World.rootBall;
  11686. let ballArr = xGame.common.d2World.ballArr;
  11687. let radius = rootBall.gameObj.width / 2;
  11688. let temp;
  11689. let isIntersect = false;
  11690. for (let index = 0; index < ballArr.length; index++) {
  11691. temp = ballArr[index];
  11692. if (temp.number == rootBall.number)
  11693. continue;
  11694. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11695. if (isIntersect) {
  11696. break;
  11697. }
  11698. }
  11699. return isIntersect;
  11700. }
  11701. hideBallUI() {
  11702. let d2Gan = xGame.common.d2World.d2Gan;
  11703. if (!d2Gan.ui.isDisposed)
  11704. d2Gan.ui.visible = false;
  11705. let d2Help = xGame.common.d2World.d2HelpLine;
  11706. if (!d2Help.ui.isDisposed)
  11707. d2Help.ui.visible = false;
  11708. let rootBall = xGame.common.d2World.rootBall;
  11709. if (!rootBall.destroyed) {
  11710. rootBall.gameObj.active = false;
  11711. }
  11712. }
  11713. showBallUI() {
  11714. let d2Gan = xGame.common.d2World.d2Gan;
  11715. if (!d2Gan.ui.isDisposed)
  11716. d2Gan.ui.visible = true;
  11717. let d2Help = xGame.common.d2World.d2HelpLine;
  11718. if (!d2Help.ui.isDisposed)
  11719. d2Help.ui.visible = true;
  11720. let rootBall = xGame.common.d2World.rootBall;
  11721. if (!rootBall.destroyed) {
  11722. rootBall.gameObj.active = true;
  11723. }
  11724. }
  11725. moveToClickDot(e) {
  11726. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11727. let root = xGame.common.d2World.rootBall.gameObj;
  11728. let xx = e.stageX - xGame.common.sysOffestNum;
  11729. let yy = e.stageY;
  11730. let x = xx - root.x;
  11731. let y = yy - root.y;
  11732. let angle = xGame.common.getfguiRotation(x, y);
  11733. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11734. xGame.common.d2World.getHelpLine();
  11735. }
  11736. this.isMoveRod = false;
  11737. xGame.common.clickedBall = false;
  11738. }
  11739. openAllEvent() {
  11740. this.closeAllEvent();
  11741. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11742. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11743. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11744. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11745. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11746. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11747. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11748. }
  11749. closeAllEvent() {
  11750. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11751. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11752. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11753. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11754. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11755. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11756. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11757. }
  11758. resetGame() {
  11759. this.closeAllEvent();
  11760. this.hideBallUI();
  11761. xGame.common.gameMgr.gamePause = true;
  11762. }
  11763. }
  11764. UIGame.uiName = "UIGame";
  11765. class UIAddProp extends UIBase {
  11766. constructor() {
  11767. super();
  11768. this.curType = "";
  11769. }
  11770. onConstructor() {
  11771. this.ui = ui_UIAddProp.createInstance();
  11772. this.contentPane = this.ui;
  11773. this.isEject = false;
  11774. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11775. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11776. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11777. this.updateUI();
  11778. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11779. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11780. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11781. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11782. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11783. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11784. }
  11785. show(type) {
  11786. super.show();
  11787. this.curType = type == 0 ? "coin" : "diamond";
  11788. this.switchBtn("");
  11789. this.ui.t0.play();
  11790. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11791. PlatMgr.showInsert(true);
  11792. }
  11793. closeSelf() {
  11794. this.hide();
  11795. }
  11796. updateUI() {
  11797. let data = cfgTable.moneyData;
  11798. let temp;
  11799. let obj;
  11800. for (const key in data) {
  11801. temp = data[key];
  11802. obj = this.ui.myNode["node" + key];
  11803. if (parseInt(key) <= 2) {
  11804. obj.diamondTxt.text = "+" + temp.num;
  11805. }
  11806. else {
  11807. obj.coinTxt.text = temp.num;
  11808. obj.diamondTxt.text = temp.get.split('_')[1];
  11809. }
  11810. }
  11811. this.updateDiamondShare();
  11812. }
  11813. updateDiamondShare() {
  11814. let data = DataMgr.getShareDiamondTimes();
  11815. if (data >= xGame.common.maxShareDiamondTimes) {
  11816. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11817. this.ui.myNode.node1.touchable = false;
  11818. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11819. }
  11820. else {
  11821. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11822. this.ui.myNode.node1.touchable = true;
  11823. }
  11824. }
  11825. switchBtn(type) {
  11826. if (type == "")
  11827. type = this.curType;
  11828. else {
  11829. if (this.curType == type) {
  11830. return;
  11831. }
  11832. else {
  11833. this.curType = type;
  11834. }
  11835. }
  11836. if (type == "coin") {
  11837. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11838. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11839. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11840. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11841. this.ui.myNode.c1.selectedIndex = 0;
  11842. }
  11843. else {
  11844. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11845. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11846. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11847. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11848. this.ui.myNode.c1.selectedIndex = 1;
  11849. }
  11850. }
  11851. convertCoin(index) {
  11852. let data = cfgTable.moneyData[index];
  11853. let coinNum = data.num;
  11854. let str = data.get.split('_')[1];
  11855. let needDiamond = parseInt(str);
  11856. if (DataMgr.diamondEnough(needDiamond)) {
  11857. DataMgr.setDiamond(-needDiamond);
  11858. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11859. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11860. }
  11861. else {
  11862. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11863. this.switchBtn("diamond");
  11864. }
  11865. }
  11866. videoGetDiamond() {
  11867. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11868. if (Laya.Browser.onAndroid) {
  11869. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11870. if (!boo) {
  11871. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11872. return;
  11873. }
  11874. }
  11875. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11876. }
  11877. else {
  11878. console.log('zh:AD 失败,直接发放奖励');
  11879. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11880. }
  11881. }
  11882. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11883. let num = cfgTable.moneyData[2].num;
  11884. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11885. this.closeSelf();
  11886. }
  11887. videoGetCoin() {
  11888. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11889. if (Laya.Browser.onAndroid) {
  11890. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11891. if (!boo) {
  11892. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11893. return;
  11894. }
  11895. }
  11896. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11897. }
  11898. else {
  11899. console.log('zh:AD 失败,直接发放奖励');
  11900. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11901. }
  11902. }
  11903. qjff_AD_for_uiAddProp_videoGetCoin() {
  11904. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11905. this.closeSelf();
  11906. }
  11907. shareGetDiamond() {
  11908. let times = DataMgr.getShareDiamondTimes();
  11909. if (times >= xGame.common.maxShareDiamondTimes) {
  11910. console.log('zh: 233333333333 maxShareDiamondTimes');
  11911. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11912. }
  11913. else {
  11914. console.log('zh:33333333333333ad');
  11915. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11916. if (Laya.Browser.onAndroid) {
  11917. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11918. if (!boo) {
  11919. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11920. return;
  11921. }
  11922. }
  11923. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11924. }
  11925. else {
  11926. console.log('zh:AD 失败,直接发放奖励');
  11927. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11928. }
  11929. }
  11930. }
  11931. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11932. let diamond = xGame.common.randomNum(50, 100);
  11933. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11934. DataMgr.setShareDiamondTimes(1);
  11935. this.updateDiamondShare();
  11936. }
  11937. openPutBallView() {
  11938. let end = xGame.uiMgr.getUI(UIGameEnd);
  11939. let skill = xGame.uiMgr.getUI(UISkill);
  11940. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11941. let uigame = xGame.uiMgr.getUI(UIGame);
  11942. if (end && !end.isHide) {
  11943. xGame.uiMgr.Hide(UIGameEnd);
  11944. xGame.uiMgr.Show(UIMain);
  11945. }
  11946. if (skill && !skill.isHide)
  11947. xGame.uiMgr.Hide(UISkill);
  11948. if (uigame && !uigame.isHide)
  11949. xGame.uiMgr.Hide(UIGame);
  11950. if (level && !level.isHide) {
  11951. }
  11952. else {
  11953. xGame.uiMgr.Show(UILevelDisplay);
  11954. }
  11955. this.closeSelf();
  11956. }
  11957. }
  11958. UIAddProp.uiName = "UIAddProp";
  11959. class MoneyNode {
  11960. constructor(ui) {
  11961. this.leftTime = 0;
  11962. this.ui = ui;
  11963. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11964. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11965. this.ui.addPowerBtn.onClick(this, this.addPower);
  11966. this.ui.c1.selectedIndex = 1;
  11967. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11968. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11969. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11970. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11971. this.coinChange();
  11972. this.diamondChange();
  11973. this.powerChange();
  11974. }
  11975. addPower() {
  11976. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11977. xGame.uiMgr.Show(UIPower);
  11978. }
  11979. powerChange() {
  11980. let powerNum = DataMgr.getPower();
  11981. this.ui.powerTxt.text = powerNum + "";
  11982. }
  11983. checkPowerTime() {
  11984. let cur = new Date().getTime();
  11985. let last = DataMgr.getPowerTime();
  11986. if (last == 0) {
  11987. last = cur;
  11988. DataMgr.setPowerTime(cur);
  11989. }
  11990. let power = DataMgr.getPower();
  11991. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11992. Laya.timer.clearAll(this);
  11993. if (power >= xGame.common.natureMaxPower) {
  11994. this.ui.powerTimeTxt.text = "";
  11995. DataMgr.setPowerTime(cur);
  11996. return;
  11997. }
  11998. if (power + offset >= xGame.common.natureMaxPower) {
  11999. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12000. this.ui.powerTimeTxt.text = "";
  12001. DataMgr.setPowerTime(cur);
  12002. }
  12003. else {
  12004. if (offset > 0) {
  12005. DataMgr.setPower(offset);
  12006. DataMgr.setPowerTime(cur);
  12007. }
  12008. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12009. this.leftTime = xGame.common.powerRecoverNum - time;
  12010. if (this.leftTime <= 0)
  12011. this.leftTime = 0;
  12012. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12013. Laya.timer.loop(1000, this, this.updatePowerTime);
  12014. }
  12015. }
  12016. updatePowerTime() {
  12017. this.leftTime -= 1;
  12018. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12019. if (this.leftTime <= 0) {
  12020. this.checkPowerTime();
  12021. }
  12022. }
  12023. coinChange() {
  12024. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12025. }
  12026. diamondChange() {
  12027. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12028. }
  12029. addCoin() {
  12030. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12031. Moyu.sendDataEvent("AddCoinBtn");
  12032. xGame.uiMgr.Show(UIAddProp, 0);
  12033. }
  12034. addDiamond() {
  12035. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12036. Moyu.sendDataEvent("AddDiamondBtn");
  12037. xGame.uiMgr.Show(UIAddProp, 1);
  12038. }
  12039. }
  12040. class UIDraw extends UIBase {
  12041. constructor() {
  12042. super();
  12043. this.curKey = 0;
  12044. }
  12045. onConstructor() {
  12046. this.ui = ui_UIDraw.createInstance();
  12047. this.contentPane = this.ui;
  12048. this.isEject = false;
  12049. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12050. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12051. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12052. this.initDraw();
  12053. this.initUI();
  12054. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12055. }
  12056. show() {
  12057. super.show();
  12058. this.ui.t0.play();
  12059. this.playSecretaryIdle();
  12060. this.updateDraw();
  12061. this.checkFree();
  12062. if (PlatMgr.bannerDelay > 0) {
  12063. this.ui.closeNode.closeBtn.visible = false;
  12064. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12065. this.ui.closeNode.closeBtn.visible = true;
  12066. });
  12067. }
  12068. PlatMgr.showRateBanner();
  12069. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12070. }
  12071. hide() {
  12072. Laya.timer.clearAll(this);
  12073. super.hide();
  12074. }
  12075. checkFree() {
  12076. let isFree = DataMgr.getDailyfreeDrawTimes();
  12077. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12078. }
  12079. initDraw() {
  12080. this.drawObj = [];
  12081. let data = cfgTable.drawData;
  12082. let temp;
  12083. let weight = 0;
  12084. for (const key in data) {
  12085. temp = data[key];
  12086. weight += temp.weight;
  12087. this.drawObj.push(weight);
  12088. }
  12089. this.allWeight = weight;
  12090. }
  12091. initUI() {
  12092. let data = cfgTable.drawData;
  12093. let temp;
  12094. let img;
  12095. let txt;
  12096. for (const key in data) {
  12097. temp = data[key];
  12098. img = this.ui.myNode.rotNode["img" + key];
  12099. txt = this.ui.myNode.rotNode["txt" + key];
  12100. img.url = xGame.common.getGameIconUrl(temp.icon);
  12101. txt.visible = true;
  12102. if (temp.award > 2) {
  12103. img.rotation = 0;
  12104. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12105. }
  12106. else {
  12107. img.rotation = temp.rotation;
  12108. txt.text = temp.num;
  12109. }
  12110. }
  12111. }
  12112. getCurkey() {
  12113. let rand = Math.random() * this.allWeight;
  12114. let temp;
  12115. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12116. temp = this.drawObj[index];
  12117. if (index == 0) {
  12118. if (rand < temp) {
  12119. return index + 1;
  12120. }
  12121. }
  12122. else {
  12123. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12124. return index + 1;
  12125. }
  12126. }
  12127. }
  12128. return 2;
  12129. }
  12130. startDraw() {
  12131. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12132. if (freeTimes > 0) {
  12133. this.beginDraw();
  12134. DataMgr.setDailyfreeDrawTimes(0);
  12135. this.checkFree();
  12136. }
  12137. else {
  12138. if (Laya.Browser.onAndroid) {
  12139. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12140. if (!boo) {
  12141. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12142. return;
  12143. }
  12144. }
  12145. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12146. }
  12147. else {
  12148. console.log('zh:AD 失败,直接发放奖励');
  12149. this.qjff_chouJiang();
  12150. }
  12151. }
  12152. }
  12153. qjff_chouJiang() {
  12154. this.beginDraw();
  12155. }
  12156. beginDraw() {
  12157. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12158. this.ui.drawBtn.touchable = false;
  12159. this.curKey = this.getCurkey();
  12160. console.log("当前key", this.curKey);
  12161. let cell = 60;
  12162. let lap = 3;
  12163. let angle = cell * (this.curKey - 1) + lap * 360;
  12164. let target = this.ui.myNode.rotNode;
  12165. target.rotation = 0;
  12166. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12167. console.log("旋转完成");
  12168. this.ui.drawBtn.touchable = true;
  12169. this.getAward();
  12170. }));
  12171. }
  12172. getAward() {
  12173. let data = cfgTable.drawData[this.curKey];
  12174. let temp = new AwardType();
  12175. temp.type = data.award;
  12176. temp.num = data.num;
  12177. xGame.common.getAward([temp], () => {
  12178. DataMgr.setDrawTimes(1);
  12179. this.updateDraw();
  12180. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12181. });
  12182. }
  12183. updateDraw() {
  12184. let drawTimes = DataMgr.getDrawTimes();
  12185. let awardTimes = DataMgr.getDrawAwardTimes();
  12186. if (Math.floor(drawTimes / 3) > awardTimes) {
  12187. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12188. this.ui.extraNode.boxBtn.touchable = true;
  12189. this.ui.extraNode.tipsTxt.text = "3/3";
  12190. this.ui.extraNode.barNode.width = 265;
  12191. this.getExtraAward();
  12192. }
  12193. else {
  12194. this.ui.extraNode.boxBtn.t0.stop();
  12195. this.ui.extraNode.boxBtn.touchable = false;
  12196. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12197. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12198. }
  12199. let data = cfgTable.drawData[1];
  12200. if (awardTimes == 0) {
  12201. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12202. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12203. this.ui.myNode.rotNode.img1.rotation = 0;
  12204. }
  12205. else {
  12206. let award = data.nextid;
  12207. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12208. this.ui.myNode.rotNode.txt1.text = award[1];
  12209. this.ui.myNode.rotNode.img1.rotation = 0;
  12210. }
  12211. }
  12212. getExtraAward() {
  12213. let drawTimes = DataMgr.getDrawTimes();
  12214. let awardTimes = DataMgr.getDrawAwardTimes();
  12215. let data = cfgTable.drawData[1];
  12216. let award = new AwardType();
  12217. if (awardTimes == 0) {
  12218. award.num = data.num;
  12219. award.type = data.award;
  12220. xGame.common.getAward([award], () => {
  12221. let all = Math.floor(drawTimes / 3);
  12222. DataMgr.setDrawAwardTimes(all);
  12223. this.updateDraw();
  12224. });
  12225. }
  12226. else {
  12227. award.num = parseInt(data.nextid[1]);
  12228. award.type = parseInt(data.nextid[0]);
  12229. xGame.common.getAward([award], () => {
  12230. let all = Math.floor(drawTimes / 3);
  12231. DataMgr.setDrawAwardTimes(all);
  12232. this.updateDraw();
  12233. });
  12234. }
  12235. }
  12236. closeSelf() {
  12237. this.hide();
  12238. }
  12239. playSecretaryIdle() {
  12240. let parent = this.ui.secretary.displayObject;
  12241. parent.destroyChildren();
  12242. let xx = this.ui.secretary.width / 2;
  12243. let yy = this.ui.secretary.height;
  12244. let scale = xGame.common.getSecretaryScale();
  12245. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12246. xGame.common.secretary.play(data, 0, true, parent);
  12247. }
  12248. }
  12249. UIDraw.uiName = "UIDraw";
  12250. class ui_UIFlyEft extends fgui.GComponent {
  12251. static createInstance() {
  12252. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12253. }
  12254. onConstruct() {
  12255. this.n0 = (this.getChild("n0"));
  12256. this.n1 = (this.getChild("n1"));
  12257. this.n2 = (this.getChild("n2"));
  12258. this.n3 = (this.getChild("n3"));
  12259. this.n4 = (this.getChild("n4"));
  12260. this.n5 = (this.getChild("n5"));
  12261. this.n6 = (this.getChild("n6"));
  12262. this.n7 = (this.getChild("n7"));
  12263. this.iconNode = (this.getChild("iconNode"));
  12264. this.txt = (this.getChild("txt"));
  12265. this.txtNode = (this.getChild("txtNode"));
  12266. }
  12267. }
  12268. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12269. class UIFlyEft extends UIBase {
  12270. constructor() {
  12271. super();
  12272. this.max = 8;
  12273. this.delay = 0;
  12274. }
  12275. onConstructor() {
  12276. this.ui = ui_UIFlyEft.createInstance();
  12277. this.contentPane = this.ui;
  12278. this.isEject = false;
  12279. this.isMuti = true;
  12280. this.ui.x += xGame.common.sysOffestNum;
  12281. }
  12282. getArrPos() {
  12283. if (this.iconPos && this.iconPos.length > 0)
  12284. return;
  12285. this.iconPos = [];
  12286. let temp;
  12287. for (let index = 0; index < this.max; index++) {
  12288. temp = this.ui["n" + index];
  12289. this.iconPos.push([temp.x, temp.y]);
  12290. }
  12291. }
  12292. show(stPos, edPos, num, type, callback) {
  12293. super.show();
  12294. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12295. this.getArrPos();
  12296. this.updateUI(type);
  12297. this.updatePos();
  12298. this.runFly(edPos, callback);
  12299. this.runWorlds(stPos, num);
  12300. }
  12301. updateUI(type) {
  12302. let temp;
  12303. let str;
  12304. for (let index = 0; index < this.max; index++) {
  12305. temp = this.ui["n" + index];
  12306. str = this.getIconStr(type);
  12307. temp.url = xGame.common.getGameIconUrl(str);
  12308. }
  12309. }
  12310. getIconStr(type) {
  12311. switch (type) {
  12312. case Prop.diamond:
  12313. return "ty_zs";
  12314. case Prop.coin:
  12315. return "ty_jb";
  12316. default:
  12317. break;
  12318. }
  12319. }
  12320. updatePos() {
  12321. let temp;
  12322. for (let index = 0; index < this.max; index++) {
  12323. temp = this.ui["n" + index];
  12324. temp.x = this.iconPos[index][0];
  12325. temp.y = this.iconPos[index][1];
  12326. }
  12327. }
  12328. runFly(endPos, callback) {
  12329. let all = 0;
  12330. let temp;
  12331. for (let index = 0; index < this.max; index++) {
  12332. temp = this.ui["n" + index];
  12333. temp.visible = true;
  12334. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12335. temp.visible = false;
  12336. all++;
  12337. if (all >= this.max) {
  12338. callback && callback();
  12339. }
  12340. }), 20 * index);
  12341. }
  12342. }
  12343. runWorlds(stPos, num) {
  12344. let str = "+" + num;
  12345. this.ui.txt.text = str;
  12346. let starX = stPos.x;
  12347. let starY = stPos.y + 50;
  12348. this.ui.txt.x = starX;
  12349. this.ui.txt.y = starY;
  12350. this.ui.txt.visible = true;
  12351. this.ui.txt.alpha = 1;
  12352. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12353. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12354. this.ui.txt.visible = false;
  12355. this.hide();
  12356. }));
  12357. }));
  12358. }
  12359. }
  12360. UIFlyEft.uiName = "UIFlyEft";
  12361. class Common {
  12362. constructor() {
  12363. this.convertNum = 0.025;
  12364. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12365. this.scaleV3One = new Laya.Vector3();
  12366. this.scaleV3Two = new Laya.Vector3();
  12367. this.posV4 = new Laya.Vector4();
  12368. this.showDebug = false;
  12369. this.openGuide = true;
  12370. this.rodOffest = new Laya.Vector2(0, 0);
  12371. this.rodAngle = 0;
  12372. this.gameMode = GameMode.classic;
  12373. this.bigMoveLevelIndex = 1;
  12374. this.bigMoveNeedCoin = 1000;
  12375. this.classicNiceNeddCoin = 1000;
  12376. this.passAwardCoin = 2000;
  12377. this.classicRoomType = 1;
  12378. this.maxPower = 20;
  12379. this.natureMaxPower = 5;
  12380. this.videoPower = 2;
  12381. this.powerRecoverNum = 900;
  12382. this.curPlayerSkillType = 0;
  12383. this.isNewDay = false;
  12384. this.clickedBall = false;
  12385. this.placeBallCurLevel = 0;
  12386. this.placeBallStarNum = 0;
  12387. this.longHelpLine = false;
  12388. this.maxShareDiamondTimes = 3;
  12389. this.guideStep = 0;
  12390. this.temSelfLevel = 0;
  12391. this.extraMoveNum = 0;
  12392. this.curRankID = 0;
  12393. this.rankID = {
  12394. normalStar: 12000,
  12395. wxStar: 12001
  12396. };
  12397. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  12398. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12399. this.btnClickStr = "buttonclick";
  12400. this.maxSkillLevel = 10;
  12401. this.upSkillLevel = false;
  12402. this.gameStartTime = 0;
  12403. this._sysOffestNum = 0;
  12404. this.angleV2 = new Laya.Vector2();
  12405. this.rootV = new Laya.Vector2(0, 1);
  12406. this.tempDir1 = new Laya.Vector2();
  12407. this.tempDir2 = new Laya.Vector2();
  12408. this.ballSize = 33;
  12409. this.stPos = new Laya.Point();
  12410. this.edPos = new Laya.Point();
  12411. Common._instance = this;
  12412. window["common"] = this;
  12413. }
  12414. static getInstance() {
  12415. if (!this._instance) {
  12416. this._instance = new Common();
  12417. }
  12418. return this._instance;
  12419. }
  12420. get sysOffestNum() {
  12421. if (this._sysOffestNum == 0) {
  12422. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12423. }
  12424. return this._sysOffestNum;
  12425. }
  12426. testShader() {
  12427. let test = new LightShader();
  12428. test.texture = "res/d3Res/ballTexture/ball1.png";
  12429. Laya.stage.addChild(test);
  12430. }
  12431. playScale(node) {
  12432. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12433. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12434. }));
  12435. }));
  12436. }
  12437. setGroup(colli, ...group) {
  12438. let out = 0;
  12439. for (let index = 0; index < group.length; index++) {
  12440. if (index == 0) {
  12441. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12442. }
  12443. else {
  12444. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12445. }
  12446. }
  12447. colli.collisionGroup = out;
  12448. }
  12449. setCanGroupWith(colli, ...group) {
  12450. let out = 0;
  12451. for (let index = 0; index < group.length; index++) {
  12452. if (index == 0) {
  12453. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12454. }
  12455. else {
  12456. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12457. }
  12458. }
  12459. colli.canCollideWith = out;
  12460. }
  12461. loadPrefab(name, callback) {
  12462. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12463. let prefab = new Laya.Prefab();
  12464. prefab.json = obj;
  12465. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12466. callback && callback(img);
  12467. }));
  12468. }
  12469. pos2to3Convert(x, y, d3Pos) {
  12470. x = x + this.sysOffestNum;
  12471. d3Pos.setValue(x, y, 0);
  12472. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12473. if (success) {
  12474. }
  12475. else {
  12476. console.error("转换出错了。。。。。。。。");
  12477. }
  12478. }
  12479. scale2to3Convert(num) {
  12480. this.scaleV3One.setValue(0, 0, 0);
  12481. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12482. this.scaleV3Two.setValue(0, num, 0);
  12483. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12484. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12485. return outNum;
  12486. }
  12487. pos3to2Convert(d3Pos) {
  12488. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12489. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12490. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12491. d3Pos.x -= this.sysOffestNum;
  12492. }
  12493. scale3to2Convert(num) {
  12494. let scale = this.scale2to3Convert(1);
  12495. let d2Out = num / scale;
  12496. return d2Out;
  12497. }
  12498. getCollider(type, restitution = 0.9, density = 10) {
  12499. let colli;
  12500. if (type == "box")
  12501. colli = new Laya.BoxCollider();
  12502. else
  12503. colli = new Laya.CircleCollider();
  12504. colli.friction = 0;
  12505. colli.restitution = restitution;
  12506. colli.density = density;
  12507. return colli;
  12508. }
  12509. getRigbody() {
  12510. let rigy = new Laya.RigidBody();
  12511. rigy.bullet = true;
  12512. rigy.allowRotation = false;
  12513. rigy.allowSleep = false;
  12514. rigy.gravityScale = 0;
  12515. return rigy;
  12516. }
  12517. getfguiRotation(x, y) {
  12518. this.angleV2.setValue(x, y);
  12519. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12520. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12521. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12522. angle = -angle;
  12523. }
  12524. return 180 + angle;
  12525. }
  12526. getAngle(x, y) {
  12527. this.angleV2.setValue(x, y);
  12528. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12529. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12530. return angle;
  12531. }
  12532. randomNum(a, b) {
  12533. return a + Math.floor((b - a + 1) * Math.random());
  12534. }
  12535. getRandArrEle(arr) {
  12536. return arr[Math.floor(arr.length * Math.random())];
  12537. }
  12538. getSign(val) {
  12539. return val >= 0 ? 1 : -1;
  12540. }
  12541. botherArr(arr) {
  12542. let times = arr.length + 2;
  12543. let length = arr.length;
  12544. let a;
  12545. let b;
  12546. let temp;
  12547. for (let index = 0; index < times; index++) {
  12548. a = Math.floor(Math.random() * length);
  12549. b = Math.floor(Math.random() * length);
  12550. temp = arr[a];
  12551. arr[a] = arr[b];
  12552. arr[b] = temp;
  12553. }
  12554. }
  12555. getGameIconUrl(id) {
  12556. return "ui://game/" + id;
  12557. }
  12558. getComponentUrl(id) {
  12559. return "ui://game/" + id;
  12560. }
  12561. getAnimation() {
  12562. }
  12563. judgeSkillType(type = SkillType.highSpace) {
  12564. if (this.gameMode == GameMode.classic)
  12565. return;
  12566. let gameMgr = this.gameMgr;
  12567. if (gameMgr.selfTurn) {
  12568. if (gameMgr.selfCurSkill == type) {
  12569. return true;
  12570. }
  12571. }
  12572. else {
  12573. if (gameMgr.aiCurSkill == type) {
  12574. return true;
  12575. }
  12576. }
  12577. }
  12578. ballColliHole(collider) {
  12579. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12580. xGame.common.gameMgr.isFirstInGame = false;
  12581. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12582. }
  12583. collider.owner.mySrc.checkWrongBall();
  12584. }
  12585. getArrMaxEle(arr) {
  12586. let max = -Infinity;
  12587. for (let index = 0; index < arr.length; index++) {
  12588. max = Math.max(arr[index], max);
  12589. }
  12590. return max;
  12591. }
  12592. getArrMinEle(arr) {
  12593. let min = Infinity;
  12594. for (let index = 0; index < arr.length; index++) {
  12595. min = Math.min(arr[index], min);
  12596. }
  12597. return min;
  12598. }
  12599. playRandomMutiBallBigSkillSound() {
  12600. if (Math.random() <= 0.5)
  12601. return;
  12602. let rand = this.randomNum(1, 6);
  12603. let str = "ganfa0" + rand;
  12604. xGame.soundMgr.playSound(str);
  12605. }
  12606. showOneCamera(type) {
  12607. let object = xGame.common.d3World.cameraObj;
  12608. for (const key in object) {
  12609. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12610. object[key].init();
  12611. object[key].owner.active = key == type;
  12612. }
  12613. }
  12614. }
  12615. checkBallOverBorder(x, y) {
  12616. let radius = 17;
  12617. let condition = this._checkBorder(x + radius, y) ||
  12618. this._checkBorder(x - radius, y) ||
  12619. this._checkBorder(x, y + radius) ||
  12620. this._checkBorder(x, y - radius);
  12621. if (condition) {
  12622. return true;
  12623. }
  12624. }
  12625. _checkBorder(x, y) {
  12626. let borderRect = this.d2World.borderRect;
  12627. let xOffest = 20;
  12628. let yOffest = 20;
  12629. if (y <= borderRect.y - yOffest) {
  12630. return true;
  12631. }
  12632. if (y >= borderRect.y + borderRect.height + yOffest) {
  12633. return true;
  12634. }
  12635. if (x <= borderRect.x - xOffest) {
  12636. return true;
  12637. }
  12638. if (x >= borderRect.x + borderRect.width + xOffest) {
  12639. return true;
  12640. }
  12641. }
  12642. initWeight(cfg) {
  12643. let allCfgData = { data: {}, allWeightNum: 0 };
  12644. let weightCfg = allCfgData.data;
  12645. let weight = 0;
  12646. for (const key in cfg) {
  12647. weightCfg[key] = {};
  12648. weightCfg[key].id = cfg[key].id;
  12649. weightCfg[key].minWeight = weight;
  12650. weight += cfg[key].weight;
  12651. weightCfg[key].maxWeight = weight;
  12652. }
  12653. allCfgData.allWeightNum = weight;
  12654. return allCfgData;
  12655. }
  12656. getRandomWeightData(cfg) {
  12657. let weightCfg = cfg.data;
  12658. let allWeightNum = cfg.allWeightNum;
  12659. let rand = Math.floor(Math.random() * allWeightNum);
  12660. for (const key in weightCfg) {
  12661. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12662. return weightCfg[key];
  12663. }
  12664. }
  12665. return weightCfg[1];
  12666. }
  12667. showGirlTalkPop(wordsIndex, node, msgNode) {
  12668. node.visible = true;
  12669. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12670. node.t0.play(Laya.Handler.create(this, () => {
  12671. node.visible = false;
  12672. }));
  12673. }
  12674. stopGirlPop(node) {
  12675. node.t0.stop();
  12676. node.visible = false;
  12677. }
  12678. createHead(loader, url, size = 107) {
  12679. if (Laya.Browser.name == "Browser") {
  12680. loader.url = url;
  12681. return;
  12682. }
  12683. else {
  12684. console.log('zh:url=', url);
  12685. loader.url = url;
  12686. }
  12687. }
  12688. addTestCoin(num) {
  12689. DataMgr.setCoin(num);
  12690. }
  12691. addTestDiamond(num) {
  12692. DataMgr.setDiamond(num);
  12693. }
  12694. addTestSkill() {
  12695. DataMgr.setBigSkill(0, 99);
  12696. DataMgr.setBigSkill(1, 99);
  12697. DataMgr.setBigSkill(2, 99);
  12698. }
  12699. playClassicEmotion(number, x, y) {
  12700. if (this.gameMode == GameMode.bigMove)
  12701. return;
  12702. let randIndex = this.randomNum(0, 2);
  12703. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12704. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12705. if (this.gameMgr.selfTurn) {
  12706. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12707. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12708. }
  12709. else {
  12710. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12711. }
  12712. else {
  12713. if (number == this.gameMgr.blackNum) {
  12714. if (this.gameMgr.selfBallArr.length == 0) {
  12715. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12716. }
  12717. else {
  12718. }
  12719. }
  12720. else {
  12721. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12722. }
  12723. }
  12724. }
  12725. }
  12726. else {
  12727. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12728. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12729. }
  12730. else {
  12731. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12732. }
  12733. else {
  12734. if (number == this.gameMgr.blackNum) {
  12735. if (this.gameMgr.aiBallArr.length == 0) {
  12736. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12737. }
  12738. else {
  12739. }
  12740. }
  12741. else {
  12742. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12743. }
  12744. }
  12745. }
  12746. }
  12747. }
  12748. playHappySound(number) {
  12749. if (this.gameMode != GameMode.classic)
  12750. return;
  12751. if (number == 8)
  12752. return;
  12753. let play = false;
  12754. if (this.gameMgr.selfTurn) {
  12755. if (this.gameMgr.ensureBallType) {
  12756. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12757. play = true;
  12758. }
  12759. }
  12760. else {
  12761. play = true;
  12762. }
  12763. }
  12764. else {
  12765. if (this.gameMgr.ensureBallType) {
  12766. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12767. play = true;
  12768. }
  12769. }
  12770. else {
  12771. play = true;
  12772. }
  12773. }
  12774. if (play)
  12775. xGame.soundMgr.playSound("applause");
  12776. }
  12777. destroyClassicEmotion() {
  12778. if (this.gameMode == GameMode.bigMove)
  12779. return;
  12780. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12781. parent.destroyChildren();
  12782. }
  12783. playAwardSpine(x, y) {
  12784. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12785. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12786. this.awardSpine.play(data, 0, false, parent);
  12787. }
  12788. destroyAwardSpine() {
  12789. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12790. parent.destroyChildren();
  12791. }
  12792. isBlock(bx, by, hx, hy, except = null) {
  12793. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12794. let balls = xGame.common.d2World.ballArr;
  12795. let outArr = [];
  12796. for (let index = 0; index < balls.length; index++) {
  12797. let obj = balls[index];
  12798. if (obj.number == 0)
  12799. continue;
  12800. if (obj == except)
  12801. continue;
  12802. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12803. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12804. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12805. if (num >= 1)
  12806. num = 1;
  12807. if (num < 0)
  12808. continue;
  12809. let gap = Math.sin(Math.acos(num)) * dis;
  12810. if (gap < this.ballSize) {
  12811. outArr.push({
  12812. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12813. disHon: Math.cos(Math.acos(num)) * dis,
  12814. disVer: Math.sin(Math.acos(num)) * dis,
  12815. src: balls[index],
  12816. dir: this.tempDir1
  12817. });
  12818. }
  12819. }
  12820. if (outArr.length > 0) {
  12821. outArr.sort((a, b) => { return a.dis - b.dis; });
  12822. return outArr[0];
  12823. }
  12824. }
  12825. AngleBetween(vector1, vector2) {
  12826. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12827. return rad * (180 / Math.PI);
  12828. }
  12829. getSecretaryScale() {
  12830. if (this.secretary.spineName == "mishu") {
  12831. return 1.28;
  12832. }
  12833. else {
  12834. return 1.024;
  12835. }
  12836. }
  12837. signAwardContainsRod(arr) {
  12838. let temp;
  12839. for (let index = 0; index < arr.length; index++) {
  12840. temp = arr[index].split('-')[0];
  12841. if (parseInt(temp) > 2) {
  12842. return true;
  12843. }
  12844. }
  12845. }
  12846. judgeSameDay() {
  12847. let lastTime = DataMgr.getSignTime();
  12848. let curTime = new Date().getTime();
  12849. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12850. return true;
  12851. }
  12852. return false;
  12853. }
  12854. getAward(arr, callback) {
  12855. let showTriple = arr[0].type <= 2;
  12856. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12857. let temp;
  12858. for (let index = 0; index < arr.length; index++) {
  12859. temp = arr[index];
  12860. switch (temp.type) {
  12861. case 1:
  12862. this.playObjFlyAnim(temp.num, temp.type);
  12863. break;
  12864. case 2:
  12865. this.playObjFlyAnim(temp.num, temp.type);
  12866. break;
  12867. case 3:
  12868. case 4:
  12869. case 5:
  12870. case 6:
  12871. DataMgr.setBallRod(temp.type - 2, 1);
  12872. DataMgr.setCurBallRod(temp.type - 2);
  12873. break;
  12874. default:
  12875. break;
  12876. }
  12877. }
  12878. callback && callback(watchVideo);
  12879. });
  12880. }
  12881. getMoneyNode() {
  12882. let moneyNode;
  12883. let sign = xGame.uiMgr.getUI(UISign);
  12884. let draw = xGame.uiMgr.getUI(UIDraw);
  12885. let end = xGame.uiMgr.getUI(UIGameEnd);
  12886. let skill = xGame.uiMgr.getUI(UISkill);
  12887. if (sign && !sign.isHide)
  12888. moneyNode = sign.ui.moneyNode;
  12889. if (draw && !draw.isHide)
  12890. moneyNode = draw.ui.moneyNode;
  12891. if (end && !end.isHide)
  12892. moneyNode = end.ui.moneyNode;
  12893. if (skill && !skill.isHide)
  12894. moneyNode = skill.ui.moneyNode;
  12895. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12896. let main = xGame.uiMgr.getUI(UIMain);
  12897. if (condition1 && main && !main.isHide) {
  12898. moneyNode = main.ui.moneyNode;
  12899. }
  12900. return moneyNode;
  12901. }
  12902. playObjFlyAnim(num, type, callback = null) {
  12903. this.stPos.x = Laya.stage.width / 2;
  12904. this.stPos.y = Laya.stage.height / 2;
  12905. let moneyNode = this.getMoneyNode();
  12906. switch (type) {
  12907. case Prop.diamond:
  12908. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12909. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12910. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12911. this.edPos.x /= 2;
  12912. this.edPos.y /= 2;
  12913. break;
  12914. case Prop.coin:
  12915. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12916. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12917. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12918. this.edPos.x /= 2;
  12919. this.edPos.y /= 2;
  12920. break;
  12921. default:
  12922. break;
  12923. }
  12924. xGame.soundMgr.playSound("coinbag");
  12925. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12926. switch (type) {
  12927. case Prop.diamond:
  12928. DataMgr.setDiamond(num);
  12929. break;
  12930. case Prop.coin:
  12931. DataMgr.setCoin(num);
  12932. break;
  12933. default:
  12934. break;
  12935. }
  12936. callback && callback();
  12937. });
  12938. }
  12939. autoPopUIView() {
  12940. let arr = [];
  12941. let sign = this.judgeSameDay() ? false : true;
  12942. if (sign)
  12943. arr.push("sign");
  12944. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12945. if (draw)
  12946. arr.push("draw");
  12947. if (arr.length <= 0)
  12948. return;
  12949. let str = this.getRandArrEle(arr);
  12950. switch (str) {
  12951. case "sign":
  12952. xGame.uiMgr.Show(UISign);
  12953. break;
  12954. case "draw":
  12955. xGame.uiMgr.Show(UIDraw);
  12956. break;
  12957. default:
  12958. break;
  12959. }
  12960. }
  12961. getMSTime(time) {
  12962. let min = Math.floor(time / 60);
  12963. let sec = Math.floor((time - min * 60));
  12964. if (sec < 10)
  12965. sec = "0" + sec;
  12966. if (min < 10)
  12967. min = "0" + min;
  12968. return `${min}:${sec}`;
  12969. }
  12970. testPower() {
  12971. DataMgr.setPower(0, false);
  12972. }
  12973. getAllStarNum() {
  12974. let data = DataMgr.getPlaceBallLevelList();
  12975. let out = 0;
  12976. for (let index = 0; index < data.length; index++) {
  12977. out += data[index].star;
  12978. }
  12979. return out;
  12980. }
  12981. recoverCameraView() {
  12982. Laya.timer.once(900, this, () => {
  12983. xGame.common.showOneCamera("mainCamera");
  12984. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12985. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12986. xGame.common.gameUI.ui.border.alpha = 0;
  12987. if (Laya.physicsTimer.scale < 1) {
  12988. Laya.physicsTimer.scale = 1;
  12989. }
  12990. }
  12991. });
  12992. }
  12993. getClassicLevel() {
  12994. let successTimes = DataMgr.getClassicTimes();
  12995. let needKey = "";
  12996. let lastKey = "";
  12997. let cfg = cfgTable.classictimesData;
  12998. let data;
  12999. for (const key in cfg) {
  13000. data = cfg[key];
  13001. if (successTimes <= data.times) {
  13002. needKey = key;
  13003. }
  13004. lastKey = key;
  13005. }
  13006. if (needKey == "")
  13007. needKey = lastKey;
  13008. return cfg[needKey];
  13009. }
  13010. }
  13011. Common._instance = null;
  13012. class ui_Component92 extends fgui.GComponent {
  13013. static createInstance() {
  13014. return (fgui.UIPackage.createObject("game", "Component92"));
  13015. }
  13016. onConstruct() {
  13017. this.n0 = (this.getChild("n0"));
  13018. }
  13019. }
  13020. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13021. class ui_Component129 extends fgui.GProgressBar {
  13022. static createInstance() {
  13023. return (fgui.UIPackage.createObject("game", "Component129"));
  13024. }
  13025. onConstruct() {
  13026. this.bar_v = (this.getChild("bar_v"));
  13027. this.n84 = (this.getChild("n84"));
  13028. }
  13029. }
  13030. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13031. class ui_Component130 extends fgui.GComponent {
  13032. static createInstance() {
  13033. return (fgui.UIPackage.createObject("game", "Component130"));
  13034. }
  13035. onConstruct() {
  13036. this.ani = (this.getChild("ani"));
  13037. this.t0 = this.getTransition("t0");
  13038. }
  13039. }
  13040. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13041. class ui_powerEft extends fgui.GComponent {
  13042. static createInstance() {
  13043. return (fgui.UIPackage.createObject("game", "powerEft"));
  13044. }
  13045. onConstruct() {
  13046. this.ani = (this.getChild("ani"));
  13047. this.n88 = (this.getChild("n88"));
  13048. this.n89 = (this.getChild("n89"));
  13049. }
  13050. }
  13051. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13052. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13053. static createInstance() {
  13054. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13055. }
  13056. onConstruct() {
  13057. this.c1 = this.getController("c1");
  13058. this.n2 = (this.getChild("n2"));
  13059. this.n22 = (this.getChild("n22"));
  13060. this.n23 = (this.getChild("n23"));
  13061. this.n15 = (this.getChild("n15"));
  13062. this.challenge = (this.getChild("challenge"));
  13063. this.n17 = (this.getChild("n17"));
  13064. this.n3 = (this.getChild("n3"));
  13065. this.starNode = (this.getChild("starNode"));
  13066. this.levelTxt = (this.getChild("levelTxt"));
  13067. this.n14 = (this.getChild("n14"));
  13068. this.n19 = (this.getChild("n19"));
  13069. this.n20 = (this.getChild("n20"));
  13070. this.n21 = (this.getChild("n21"));
  13071. this.special = (this.getChild("special"));
  13072. }
  13073. }
  13074. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13075. class ui_Component79 extends fgui.GComponent {
  13076. static createInstance() {
  13077. return (fgui.UIPackage.createObject("game", "Component79"));
  13078. }
  13079. onConstruct() {
  13080. this.c1 = this.getController("c1");
  13081. this.n7 = (this.getChild("n7"));
  13082. this.n8 = (this.getChild("n8"));
  13083. this.n9 = (this.getChild("n9"));
  13084. this.n10 = (this.getChild("n10"));
  13085. this.n11 = (this.getChild("n11"));
  13086. this.n12 = (this.getChild("n12"));
  13087. }
  13088. }
  13089. ui_Component79.URL = "ui://isxx5ak7avag477";
  13090. class ui_Component80 extends fgui.GComponent {
  13091. static createInstance() {
  13092. return (fgui.UIPackage.createObject("game", "Component80"));
  13093. }
  13094. onConstruct() {
  13095. this.n0 = (this.getChild("n0"));
  13096. this.n1 = (this.getChild("n1"));
  13097. this.myList = (this.getChild("myList"));
  13098. this.t0 = this.getTransition("t0");
  13099. }
  13100. }
  13101. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13102. class ui_SignNormal extends fgui.GComponent {
  13103. static createInstance() {
  13104. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13105. }
  13106. onConstruct() {
  13107. this.c1 = this.getController("c1");
  13108. this.n7 = (this.getChild("n7"));
  13109. this.n15 = (this.getChild("n15"));
  13110. this.titleTxt = (this.getChild("titleTxt"));
  13111. this.n8 = (this.getChild("n8"));
  13112. this.myIcon = (this.getChild("myIcon"));
  13113. this.numTxt = (this.getChild("numTxt"));
  13114. this.n12 = (this.getChild("n12"));
  13115. this.n13 = (this.getChild("n13"));
  13116. this.n17 = (this.getChild("n17"));
  13117. this.n14 = (this.getChild("n14"));
  13118. }
  13119. }
  13120. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13121. class ui_Button_reg extends fgui.GButton {
  13122. static createInstance() {
  13123. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13124. }
  13125. onConstruct() {
  13126. this.button = this.getController("button");
  13127. this.n6 = (this.getChild("n6"));
  13128. this.n4 = (this.getChild("n4"));
  13129. }
  13130. }
  13131. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13132. class ui_screenNode extends fgui.GComponent {
  13133. static createInstance() {
  13134. return (fgui.UIPackage.createObject("game", "screenNode"));
  13135. }
  13136. onConstruct() {
  13137. this.n9 = (this.getChild("n9"));
  13138. this.screenImg = (this.getChild("screenImg"));
  13139. }
  13140. }
  13141. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13142. class ui_GetAwrad_com1 extends fgui.GComponent {
  13143. static createInstance() {
  13144. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13145. }
  13146. onConstruct() {
  13147. this.n38 = (this.getChild("n38"));
  13148. this.n39 = (this.getChild("n39"));
  13149. this.n40 = (this.getChild("n40"));
  13150. this.t0 = this.getTransition("t0");
  13151. this.t1 = this.getTransition("t1");
  13152. }
  13153. }
  13154. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13155. class ui_GetAwrad_com2 extends fgui.GComponent {
  13156. static createInstance() {
  13157. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13158. }
  13159. onConstruct() {
  13160. this.n39 = (this.getChild("n39"));
  13161. this.n40 = (this.getChild("n40"));
  13162. this.t0 = this.getTransition("t0");
  13163. }
  13164. }
  13165. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13166. class ui_Component128 extends fgui.GComponent {
  13167. static createInstance() {
  13168. return (fgui.UIPackage.createObject("game", "Component128"));
  13169. }
  13170. onConstruct() {
  13171. this.n38 = (this.getChild("n38"));
  13172. this.n40 = (this.getChild("n40"));
  13173. }
  13174. }
  13175. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13176. class ui_Component100_1 extends fgui.GComponent {
  13177. static createInstance() {
  13178. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13179. }
  13180. onConstruct() {
  13181. this.myNode = (this.getChild("myNode"));
  13182. this.t0 = this.getTransition("t0");
  13183. }
  13184. }
  13185. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13186. class ui_Component142 extends fgui.GComponent {
  13187. static createInstance() {
  13188. return (fgui.UIPackage.createObject("game", "Component142"));
  13189. }
  13190. onConstruct() {
  13191. this.n41 = (this.getChild("n41"));
  13192. this.n42 = (this.getChild("n42"));
  13193. }
  13194. }
  13195. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13196. class ui_main_guang extends fgui.GComponent {
  13197. static createInstance() {
  13198. return (fgui.UIPackage.createObject("game", "main_guang"));
  13199. }
  13200. onConstruct() {
  13201. this.n1 = (this.getChild("n1"));
  13202. this.n2 = (this.getChild("n2"));
  13203. this.n3 = (this.getChild("n3"));
  13204. this.n4 = (this.getChild("n4"));
  13205. this.n5 = (this.getChild("n5"));
  13206. this.n6 = (this.getChild("n6"));
  13207. this.n8 = (this.getChild("n8"));
  13208. this.t0 = this.getTransition("t0");
  13209. }
  13210. }
  13211. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13212. class ui_try_com1 extends fgui.GComponent {
  13213. static createInstance() {
  13214. return (fgui.UIPackage.createObject("game", "try_com1"));
  13215. }
  13216. onConstruct() {
  13217. this.c1 = this.getController("c1");
  13218. this.n0 = (this.getChild("n0"));
  13219. this.n2 = (this.getChild("n2"));
  13220. this.cancelBtn = (this.getChild("cancelBtn"));
  13221. this.videoBtn = (this.getChild("videoBtn"));
  13222. this.n9 = (this.getChild("n9"));
  13223. this.n24 = (this.getChild("n24"));
  13224. this.titleTxt = (this.getChild("titleTxt"));
  13225. this.n32 = (this.getChild("n32"));
  13226. this.n29 = (this.getChild("n29"));
  13227. this.n36 = (this.getChild("n36"));
  13228. this.txtTime = (this.getChild("txtTime"));
  13229. this.t0 = this.getTransition("t0");
  13230. }
  13231. }
  13232. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13233. class ui_try_com2 extends fgui.GComponent {
  13234. static createInstance() {
  13235. return (fgui.UIPackage.createObject("game", "try_com2"));
  13236. }
  13237. onConstruct() {
  13238. this.skillicon = (this.getChild("skillicon"));
  13239. this.n35 = (this.getChild("n35"));
  13240. this.n31 = (this.getChild("n31"));
  13241. this.n32 = (this.getChild("n32"));
  13242. this.n33 = (this.getChild("n33"));
  13243. this.n34 = (this.getChild("n34"));
  13244. }
  13245. }
  13246. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13247. class ui_try_com3 extends fgui.GComponent {
  13248. static createInstance() {
  13249. return (fgui.UIPackage.createObject("game", "try_com3"));
  13250. }
  13251. onConstruct() {
  13252. this.n33 = (this.getChild("n33"));
  13253. this.n34 = (this.getChild("n34"));
  13254. this.n35 = (this.getChild("n35"));
  13255. this.t0 = this.getTransition("t0");
  13256. }
  13257. }
  13258. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13259. class ui_huihe1 extends fgui.GComponent {
  13260. static createInstance() {
  13261. return (fgui.UIPackage.createObject("game", "huihe1"));
  13262. }
  13263. onConstruct() {
  13264. this.n0 = (this.getChild("n0"));
  13265. this.n1 = (this.getChild("n1"));
  13266. this.t0 = this.getTransition("t0");
  13267. }
  13268. }
  13269. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13270. class ui_huihe2 extends fgui.GComponent {
  13271. static createInstance() {
  13272. return (fgui.UIPackage.createObject("game", "huihe2"));
  13273. }
  13274. onConstruct() {
  13275. this.n0 = (this.getChild("n0"));
  13276. this.n1 = (this.getChild("n1"));
  13277. this.t0 = this.getTransition("t0");
  13278. }
  13279. }
  13280. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13281. class ui_Component143 extends fgui.GComponent {
  13282. static createInstance() {
  13283. return (fgui.UIPackage.createObject("game", "Component143"));
  13284. }
  13285. onConstruct() {
  13286. this.n3 = (this.getChild("n3"));
  13287. this.n4 = (this.getChild("n4"));
  13288. this.n5 = (this.getChild("n5"));
  13289. this.n6 = (this.getChild("n6"));
  13290. this.n7 = (this.getChild("n7"));
  13291. this.n8 = (this.getChild("n8"));
  13292. this.n9 = (this.getChild("n9"));
  13293. this.n10 = (this.getChild("n10"));
  13294. this.t0 = this.getTransition("t0");
  13295. }
  13296. }
  13297. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13298. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13299. static createInstance() {
  13300. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13301. }
  13302. onConstruct() {
  13303. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13304. }
  13305. }
  13306. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13307. class ui_dh_jingbi2 extends fgui.GComponent {
  13308. static createInstance() {
  13309. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13310. }
  13311. onConstruct() {
  13312. this.n0 = (this.getChild("n0"));
  13313. this.n1 = (this.getChild("n1"));
  13314. this.n2 = (this.getChild("n2"));
  13315. this.n3 = (this.getChild("n3"));
  13316. this.n4 = (this.getChild("n4"));
  13317. this.n5 = (this.getChild("n5"));
  13318. this.n6 = (this.getChild("n6"));
  13319. this.n8 = (this.getChild("n8"));
  13320. this.n10 = (this.getChild("n10"));
  13321. this.t0 = this.getTransition("t0");
  13322. }
  13323. }
  13324. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13325. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13326. static createInstance() {
  13327. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13328. }
  13329. onConstruct() {
  13330. this.n1 = (this.getChild("n1"));
  13331. this.n4 = (this.getChild("n4"));
  13332. this.t0 = this.getTransition("t0");
  13333. }
  13334. }
  13335. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13336. class ui_dh_jingbi3 extends fgui.GComponent {
  13337. static createInstance() {
  13338. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13339. }
  13340. onConstruct() {
  13341. this.n0 = (this.getChild("n0"));
  13342. this.n1 = (this.getChild("n1"));
  13343. this.n2 = (this.getChild("n2"));
  13344. this.n3 = (this.getChild("n3"));
  13345. this.n4 = (this.getChild("n4"));
  13346. this.n5 = (this.getChild("n5"));
  13347. this.n6 = (this.getChild("n6"));
  13348. this.n8 = (this.getChild("n8"));
  13349. this.n10 = (this.getChild("n10"));
  13350. this.t0 = this.getTransition("t0");
  13351. }
  13352. }
  13353. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13354. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13355. static createInstance() {
  13356. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13357. }
  13358. onConstruct() {
  13359. this.n3 = (this.getChild("n3"));
  13360. this.n1 = (this.getChild("n1"));
  13361. this.t0 = this.getTransition("t0");
  13362. }
  13363. }
  13364. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13365. class ui_hb_jinbi1 extends fgui.GButton {
  13366. static createInstance() {
  13367. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13368. }
  13369. onConstruct() {
  13370. this.n20 = (this.getChild("n20"));
  13371. this.n25 = (this.getChild("n25"));
  13372. this.coinTxt = (this.getChild("coinTxt"));
  13373. this.n28 = (this.getChild("n28"));
  13374. this.n32 = (this.getChild("n32"));
  13375. this.n38 = (this.getChild("n38"));
  13376. this.n45 = (this.getChild("n45"));
  13377. this.getTips = (this.getChild("getTips"));
  13378. this.n39 = (this.getChild("n39"));
  13379. this.diamondTxt = (this.getChild("diamondTxt"));
  13380. this.n41 = (this.getChild("n41"));
  13381. this.n42 = (this.getChild("n42"));
  13382. this.n46 = (this.getChild("n46"));
  13383. this.n47 = (this.getChild("n47"));
  13384. this.n48 = (this.getChild("n48"));
  13385. this.t0 = this.getTransition("t0");
  13386. }
  13387. }
  13388. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13389. class ui_hb_jinbi2 extends fgui.GButton {
  13390. static createInstance() {
  13391. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13392. }
  13393. onConstruct() {
  13394. this.n20 = (this.getChild("n20"));
  13395. this.n25 = (this.getChild("n25"));
  13396. this.coinTxt = (this.getChild("coinTxt"));
  13397. this.n28 = (this.getChild("n28"));
  13398. this.n32 = (this.getChild("n32"));
  13399. this.n38 = (this.getChild("n38"));
  13400. this.n39 = (this.getChild("n39"));
  13401. this.diamondTxt = (this.getChild("diamondTxt"));
  13402. this.n41 = (this.getChild("n41"));
  13403. this.n42 = (this.getChild("n42"));
  13404. this.n43 = (this.getChild("n43"));
  13405. this.n44 = (this.getChild("n44"));
  13406. this.n45 = (this.getChild("n45"));
  13407. this.t0 = this.getTransition("t0");
  13408. }
  13409. }
  13410. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13411. class ui_hb_jinbi3 extends fgui.GButton {
  13412. static createInstance() {
  13413. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13414. }
  13415. onConstruct() {
  13416. this.n20 = (this.getChild("n20"));
  13417. this.n25 = (this.getChild("n25"));
  13418. this.coinTxt = (this.getChild("coinTxt"));
  13419. this.n28 = (this.getChild("n28"));
  13420. this.n32 = (this.getChild("n32"));
  13421. this.n38 = (this.getChild("n38"));
  13422. this.n39 = (this.getChild("n39"));
  13423. this.diamondTxt = (this.getChild("diamondTxt"));
  13424. this.n41 = (this.getChild("n41"));
  13425. this.n42 = (this.getChild("n42"));
  13426. this.n43 = (this.getChild("n43"));
  13427. this.n44 = (this.getChild("n44"));
  13428. this.n45 = (this.getChild("n45"));
  13429. this.t0 = this.getTransition("t0");
  13430. }
  13431. }
  13432. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13433. class ui_Component104 extends fgui.GComponent {
  13434. static createInstance() {
  13435. return (fgui.UIPackage.createObject("game", "Component104"));
  13436. }
  13437. onConstruct() {
  13438. this.c1 = this.getController("c1");
  13439. this.n12 = (this.getChild("n12"));
  13440. this.coinBtn = (this.getChild("coinBtn"));
  13441. this.diamondBtn = (this.getChild("diamondBtn"));
  13442. this.node3 = (this.getChild("node3"));
  13443. this.node4 = (this.getChild("node4"));
  13444. this.node5 = (this.getChild("node5"));
  13445. this.node1 = (this.getChild("node1"));
  13446. this.node2 = (this.getChild("node2"));
  13447. this.node6 = (this.getChild("node6"));
  13448. this.t0 = this.getTransition("t0");
  13449. }
  13450. }
  13451. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13452. class ui_Component105 extends fgui.GButton {
  13453. static createInstance() {
  13454. return (fgui.UIPackage.createObject("game", "Component105"));
  13455. }
  13456. onConstruct() {
  13457. this.c1 = this.getController("c1");
  13458. this.n49 = (this.getChild("n49"));
  13459. this.n18 = (this.getChild("n18"));
  13460. this.n46 = (this.getChild("n46"));
  13461. this.n48 = (this.getChild("n48"));
  13462. }
  13463. }
  13464. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13465. class ui_Component106 extends fgui.GButton {
  13466. static createInstance() {
  13467. return (fgui.UIPackage.createObject("game", "Component106"));
  13468. }
  13469. onConstruct() {
  13470. this.c1 = this.getController("c1");
  13471. this.n49 = (this.getChild("n49"));
  13472. this.n18 = (this.getChild("n18"));
  13473. this.n46 = (this.getChild("n46"));
  13474. this.n48 = (this.getChild("n48"));
  13475. }
  13476. }
  13477. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13478. class ui_hb_zs1 extends fgui.GButton {
  13479. static createInstance() {
  13480. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13481. }
  13482. onConstruct() {
  13483. this.c1 = this.getController("c1");
  13484. this.n20 = (this.getChild("n20"));
  13485. this.n21 = (this.getChild("n21"));
  13486. this.n26 = (this.getChild("n26"));
  13487. this.n27 = (this.getChild("n27"));
  13488. this.shareTxt = (this.getChild("shareTxt"));
  13489. this.n32 = (this.getChild("n32"));
  13490. this.n38 = (this.getChild("n38"));
  13491. this.n39 = (this.getChild("n39"));
  13492. this.n44 = (this.getChild("n44"));
  13493. this.diamondTxt = (this.getChild("diamondTxt"));
  13494. this.n41 = (this.getChild("n41"));
  13495. this.n45 = (this.getChild("n45"));
  13496. this.n47 = (this.getChild("n47"));
  13497. this.n48 = (this.getChild("n48"));
  13498. this.randTxt = (this.getChild("randTxt"));
  13499. this.n50 = (this.getChild("n50"));
  13500. this.t0 = this.getTransition("t0");
  13501. }
  13502. }
  13503. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13504. class ui_dh_zs1 extends fgui.GComponent {
  13505. static createInstance() {
  13506. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13507. }
  13508. onConstruct() {
  13509. this.n10 = (this.getChild("n10"));
  13510. this.n9 = (this.getChild("n9"));
  13511. this.n1 = (this.getChild("n1"));
  13512. this.n2 = (this.getChild("n2"));
  13513. this.n3 = (this.getChild("n3"));
  13514. this.n4 = (this.getChild("n4"));
  13515. this.n5 = (this.getChild("n5"));
  13516. this.n6 = (this.getChild("n6"));
  13517. this.n8 = (this.getChild("n8"));
  13518. this.n11 = (this.getChild("n11"));
  13519. this.t0 = this.getTransition("t0");
  13520. }
  13521. }
  13522. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13523. class ui_dh_zs1_1 extends fgui.GComponent {
  13524. static createInstance() {
  13525. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13526. }
  13527. onConstruct() {
  13528. this.n3 = (this.getChild("n3"));
  13529. this.n1 = (this.getChild("n1"));
  13530. this.t0 = this.getTransition("t0");
  13531. }
  13532. }
  13533. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13534. class ui_hb_zs2 extends fgui.GButton {
  13535. static createInstance() {
  13536. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13537. }
  13538. onConstruct() {
  13539. this.n20 = (this.getChild("n20"));
  13540. this.n21 = (this.getChild("n21"));
  13541. this.n26 = (this.getChild("n26"));
  13542. this.n27 = (this.getChild("n27"));
  13543. this.n32 = (this.getChild("n32"));
  13544. this.n38 = (this.getChild("n38"));
  13545. this.n39 = (this.getChild("n39"));
  13546. this.n44 = (this.getChild("n44"));
  13547. this.diamondTxt = (this.getChild("diamondTxt"));
  13548. this.n41 = (this.getChild("n41"));
  13549. this.n45 = (this.getChild("n45"));
  13550. this.t0 = this.getTransition("t0");
  13551. }
  13552. }
  13553. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13554. class ui_hb_zs3 extends fgui.GButton {
  13555. static createInstance() {
  13556. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13557. }
  13558. onConstruct() {
  13559. this.n20 = (this.getChild("n20"));
  13560. this.n21 = (this.getChild("n21"));
  13561. this.n26 = (this.getChild("n26"));
  13562. this.n27 = (this.getChild("n27"));
  13563. this.n32 = (this.getChild("n32"));
  13564. this.n38 = (this.getChild("n38"));
  13565. this.n47 = (this.getChild("n47"));
  13566. this.t0 = this.getTransition("t0");
  13567. }
  13568. }
  13569. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13570. class ui_dh_zs2 extends fgui.GComponent {
  13571. static createInstance() {
  13572. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13573. }
  13574. onConstruct() {
  13575. this.n10 = (this.getChild("n10"));
  13576. this.n9 = (this.getChild("n9"));
  13577. this.n1 = (this.getChild("n1"));
  13578. this.n2 = (this.getChild("n2"));
  13579. this.n3 = (this.getChild("n3"));
  13580. this.n4 = (this.getChild("n4"));
  13581. this.n5 = (this.getChild("n5"));
  13582. this.n6 = (this.getChild("n6"));
  13583. this.n8 = (this.getChild("n8"));
  13584. this.n11 = (this.getChild("n11"));
  13585. this.t0 = this.getTransition("t0");
  13586. }
  13587. }
  13588. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13589. class ui_dh_zs2_1 extends fgui.GComponent {
  13590. static createInstance() {
  13591. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13592. }
  13593. onConstruct() {
  13594. this.n3 = (this.getChild("n3"));
  13595. this.n1 = (this.getChild("n1"));
  13596. this.t0 = this.getTransition("t0");
  13597. }
  13598. }
  13599. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13600. class ui_dh_zs3 extends fgui.GComponent {
  13601. static createInstance() {
  13602. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13603. }
  13604. onConstruct() {
  13605. this.n10 = (this.getChild("n10"));
  13606. this.n9 = (this.getChild("n9"));
  13607. this.n1 = (this.getChild("n1"));
  13608. this.n2 = (this.getChild("n2"));
  13609. this.n3 = (this.getChild("n3"));
  13610. this.n4 = (this.getChild("n4"));
  13611. this.n5 = (this.getChild("n5"));
  13612. this.n6 = (this.getChild("n6"));
  13613. this.n8 = (this.getChild("n8"));
  13614. this.n11 = (this.getChild("n11"));
  13615. this.t0 = this.getTransition("t0");
  13616. }
  13617. }
  13618. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13619. class ui_dh_zs3_1 extends fgui.GComponent {
  13620. static createInstance() {
  13621. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13622. }
  13623. onConstruct() {
  13624. this.n3 = (this.getChild("n3"));
  13625. this.n1 = (this.getChild("n1"));
  13626. this.t0 = this.getTransition("t0");
  13627. }
  13628. }
  13629. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13630. class ui_Component107 extends fgui.GComponent {
  13631. static createInstance() {
  13632. return (fgui.UIPackage.createObject("game", "Component107"));
  13633. }
  13634. onConstruct() {
  13635. this.n18 = (this.getChild("n18"));
  13636. this.n19 = (this.getChild("n19"));
  13637. this.n20 = (this.getChild("n20"));
  13638. this.n21 = (this.getChild("n21"));
  13639. this.n22 = (this.getChild("n22"));
  13640. this.levelTxt = (this.getChild("levelTxt"));
  13641. this.t0 = this.getTransition("t0");
  13642. }
  13643. }
  13644. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13645. class ui_box_com1 extends fgui.GComponent {
  13646. static createInstance() {
  13647. return (fgui.UIPackage.createObject("game", "box_com1"));
  13648. }
  13649. onConstruct() {
  13650. this.n14 = (this.getChild("n14"));
  13651. this.n6 = (this.getChild("n6"));
  13652. this.t0 = this.getTransition("t0");
  13653. }
  13654. }
  13655. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13656. class ui_box_com2 extends fgui.GProgressBar {
  13657. static createInstance() {
  13658. return (fgui.UIPackage.createObject("game", "box_com2"));
  13659. }
  13660. onConstruct() {
  13661. this.bg0 = (this.getChild("bg0"));
  13662. this.bg = (this.getChild("bg"));
  13663. this.bar = (this.getChild("bar"));
  13664. this.n7 = (this.getChild("n7"));
  13665. this.n8 = (this.getChild("n8"));
  13666. this.n10 = (this.getChild("n10"));
  13667. this.n11 = (this.getChild("n11"));
  13668. this.n12 = (this.getChild("n12"));
  13669. }
  13670. }
  13671. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13672. class ui_box_com4 extends fgui.GComponent {
  13673. static createInstance() {
  13674. return (fgui.UIPackage.createObject("game", "box_com4"));
  13675. }
  13676. onConstruct() {
  13677. this.n8 = (this.getChild("n8"));
  13678. this.t0 = this.getTransition("t0");
  13679. }
  13680. }
  13681. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13682. class ui_box_com3 extends fgui.GComponent {
  13683. static createInstance() {
  13684. return (fgui.UIPackage.createObject("game", "box_com3"));
  13685. }
  13686. onConstruct() {
  13687. this.n2 = (this.getChild("n2"));
  13688. this.n3 = (this.getChild("n3"));
  13689. this.n4 = (this.getChild("n4"));
  13690. this.n5 = (this.getChild("n5"));
  13691. this.t0 = this.getTransition("t0");
  13692. this.t1 = this.getTransition("t1");
  13693. }
  13694. }
  13695. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13696. class ui_Component97 extends fgui.GComponent {
  13697. static createInstance() {
  13698. return (fgui.UIPackage.createObject("game", "Component97"));
  13699. }
  13700. onConstruct() {
  13701. this.c1 = this.getController("c1");
  13702. this.n46 = (this.getChild("n46"));
  13703. this.diamondNode = (this.getChild("diamondNode"));
  13704. this.coinNode = (this.getChild("coinNode"));
  13705. this.t0 = this.getTransition("t0");
  13706. }
  13707. }
  13708. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13709. class ui_Component98 extends fgui.GButton {
  13710. static createInstance() {
  13711. return (fgui.UIPackage.createObject("game", "Component98"));
  13712. }
  13713. onConstruct() {
  13714. this.n8 = (this.getChild("n8"));
  13715. this.n40 = (this.getChild("n40"));
  13716. }
  13717. }
  13718. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13719. class ui_Component28_11 extends fgui.GButton {
  13720. static createInstance() {
  13721. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13722. }
  13723. onConstruct() {
  13724. this.c1 = this.getController("c1");
  13725. this.n12 = (this.getChild("n12"));
  13726. this.n17 = (this.getChild("n17"));
  13727. this.n13 = (this.getChild("n13"));
  13728. this.diamondTxt = (this.getChild("diamondTxt"));
  13729. this.n15 = (this.getChild("n15"));
  13730. this.n16 = (this.getChild("n16"));
  13731. }
  13732. }
  13733. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13734. class ui_Component58_11 extends fgui.GComponent {
  13735. static createInstance() {
  13736. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13737. }
  13738. onConstruct() {
  13739. this.c1 = this.getController("c1");
  13740. this.n23 = (this.getChild("n23"));
  13741. this.n41 = (this.getChild("n41"));
  13742. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13743. this.n_daoju = (this.getChild("n_daoju"));
  13744. this.myList = (this.getChild("myList"));
  13745. this.djList = (this.getChild("djList"));
  13746. this.t0 = this.getTransition("t0");
  13747. }
  13748. }
  13749. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13750. class ui_Component100 extends fgui.GComponent {
  13751. static createInstance() {
  13752. return (fgui.UIPackage.createObject("game", "Component100"));
  13753. }
  13754. onConstruct() {
  13755. this.c1 = this.getController("c1");
  13756. this.n75 = (this.getChild("n75"));
  13757. this.n76 = (this.getChild("n76"));
  13758. this.n80 = (this.getChild("n80"));
  13759. this.txt = (this.getChild("txt"));
  13760. this.spineRoot = (this.getChild("spineRoot"));
  13761. }
  13762. }
  13763. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13764. class ui_Component101 extends fgui.GComponent {
  13765. static createInstance() {
  13766. return (fgui.UIPackage.createObject("game", "Component101"));
  13767. }
  13768. onConstruct() {
  13769. this.c1 = this.getController("c1");
  13770. this.n36 = (this.getChild("n36"));
  13771. this.n35 = (this.getChild("n35"));
  13772. this.n33 = (this.getChild("n33"));
  13773. this.n34 = (this.getChild("n34"));
  13774. }
  13775. }
  13776. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13777. class ui_Component53 extends fgui.GComponent {
  13778. static createInstance() {
  13779. return (fgui.UIPackage.createObject("game", "Component53"));
  13780. }
  13781. onConstruct() {
  13782. this.n0 = (this.getChild("n0"));
  13783. this.n1 = (this.getChild("n1"));
  13784. this.n2 = (this.getChild("n2"));
  13785. this.n3 = (this.getChild("n3"));
  13786. this.n4 = (this.getChild("n4"));
  13787. this.n5 = (this.getChild("n5"));
  13788. this.n6 = (this.getChild("n6"));
  13789. this.n7 = (this.getChild("n7"));
  13790. this.n8 = (this.getChild("n8"));
  13791. this.n9 = (this.getChild("n9"));
  13792. this.n10 = (this.getChild("n10"));
  13793. this.n11 = (this.getChild("n11"));
  13794. this.n12 = (this.getChild("n12"));
  13795. this.n13 = (this.getChild("n13"));
  13796. this.n14 = (this.getChild("n14"));
  13797. this.n15 = (this.getChild("n15"));
  13798. this.n16 = (this.getChild("n16"));
  13799. this.n19 = (this.getChild("n19"));
  13800. this.n20 = (this.getChild("n20"));
  13801. this.n21 = (this.getChild("n21"));
  13802. this.n22 = (this.getChild("n22"));
  13803. this.n23 = (this.getChild("n23"));
  13804. this.n24 = (this.getChild("n24"));
  13805. this.n25 = (this.getChild("n25"));
  13806. this.n26 = (this.getChild("n26"));
  13807. this.n27 = (this.getChild("n27"));
  13808. this.n28 = (this.getChild("n28"));
  13809. this.n29 = (this.getChild("n29"));
  13810. this.n30 = (this.getChild("n30"));
  13811. this.n31 = (this.getChild("n31"));
  13812. this.n32 = (this.getChild("n32"));
  13813. this.n33 = (this.getChild("n33"));
  13814. this.n34 = (this.getChild("n34"));
  13815. this.n35 = (this.getChild("n35"));
  13816. this.t0 = this.getTransition("t0");
  13817. }
  13818. }
  13819. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13820. class ui_Component58 extends fgui.GComponent {
  13821. static createInstance() {
  13822. return (fgui.UIPackage.createObject("game", "Component58"));
  13823. }
  13824. onConstruct() {
  13825. this.n23 = (this.getChild("n23"));
  13826. this.n41 = (this.getChild("n41"));
  13827. this.n8 = (this.getChild("n8"));
  13828. this.skillList = (this.getChild("skillList"));
  13829. this.t0 = this.getTransition("t0");
  13830. }
  13831. }
  13832. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13833. class ui_Component59 extends fgui.GComponent {
  13834. static createInstance() {
  13835. return (fgui.UIPackage.createObject("game", "Component59"));
  13836. }
  13837. onConstruct() {
  13838. this.n3 = (this.getChild("n3"));
  13839. this.msgTxt = (this.getChild("msgTxt"));
  13840. this.t0 = this.getTransition("t0");
  13841. }
  13842. }
  13843. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13844. class ui_RulerNode extends fgui.GComponent {
  13845. static createInstance() {
  13846. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13847. }
  13848. onConstruct() {
  13849. this.n6 = (this.getChild("n6"));
  13850. this.n4 = (this.getChild("n4"));
  13851. this.img1 = (this.getChild("img1"));
  13852. this.img2 = (this.getChild("img2"));
  13853. }
  13854. }
  13855. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13856. class ui_Component108 extends fgui.GComponent {
  13857. static createInstance() {
  13858. return (fgui.UIPackage.createObject("game", "Component108"));
  13859. }
  13860. onConstruct() {
  13861. this.n19 = (this.getChild("n19"));
  13862. this.t0 = this.getTransition("t0");
  13863. }
  13864. }
  13865. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13866. class ui_Component63 extends fgui.GComponent {
  13867. static createInstance() {
  13868. return (fgui.UIPackage.createObject("game", "Component63"));
  13869. }
  13870. onConstruct() {
  13871. this.n66 = (this.getChild("n66"));
  13872. this.n56 = (this.getChild("n56"));
  13873. this.n63 = (this.getChild("n63"));
  13874. this.n65 = (this.getChild("n65"));
  13875. this.t0 = this.getTransition("t0");
  13876. }
  13877. }
  13878. ui_Component63.URL = "ui://isxx5ak7h657452";
  13879. class ui_topNode extends fgui.GComponent {
  13880. static createInstance() {
  13881. return (fgui.UIPackage.createObject("game", "topNode"));
  13882. }
  13883. onConstruct() {
  13884. this.selfProgress = (this.getChild("selfProgress"));
  13885. this.aiProgress = (this.getChild("aiProgress"));
  13886. this.selfKuang = (this.getChild("selfKuang"));
  13887. this.aiKuang = (this.getChild("aiKuang"));
  13888. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13889. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13890. this.n33 = (this.getChild("n33"));
  13891. this.n34 = (this.getChild("n34"));
  13892. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13893. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13894. this.selfBallList = (this.getChild("selfBallList"));
  13895. this.aiBallList = (this.getChild("aiBallList"));
  13896. this.middleNode = (this.getChild("middleNode"));
  13897. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13898. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13899. this.scoreNode = (this.getChild("scoreNode"));
  13900. this.selfTips = (this.getChild("selfTips"));
  13901. this.aiTips = (this.getChild("aiTips"));
  13902. }
  13903. }
  13904. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13905. class ui_selfProgress extends fgui.GProgressBar {
  13906. static createInstance() {
  13907. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13908. }
  13909. onConstruct() {
  13910. this.n3 = (this.getChild("n3"));
  13911. this.bar = (this.getChild("bar"));
  13912. }
  13913. }
  13914. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13915. class ui_aiProgress extends fgui.GProgressBar {
  13916. static createInstance() {
  13917. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13918. }
  13919. onConstruct() {
  13920. this.n3 = (this.getChild("n3"));
  13921. this.bar = (this.getChild("bar"));
  13922. }
  13923. }
  13924. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13925. class ui_ballDisplay extends fgui.GComponent {
  13926. static createInstance() {
  13927. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13928. }
  13929. onConstruct() {
  13930. this.myImg = (this.getChild("myImg"));
  13931. }
  13932. }
  13933. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13934. class ui_moveNode extends fgui.GComponent {
  13935. static createInstance() {
  13936. return (fgui.UIPackage.createObject("game", "moveNode"));
  13937. }
  13938. onConstruct() {
  13939. this.n8 = (this.getChild("n8"));
  13940. this.finger = (this.getChild("finger"));
  13941. }
  13942. }
  13943. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13944. class ui_cancelBtn extends fgui.GButton {
  13945. static createInstance() {
  13946. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13947. }
  13948. onConstruct() {
  13949. this.c1 = this.getController("c1");
  13950. this.n0 = (this.getChild("n0"));
  13951. this.n1 = (this.getChild("n1"));
  13952. }
  13953. }
  13954. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13955. class ui_shareBtn extends fgui.GButton {
  13956. static createInstance() {
  13957. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13958. }
  13959. onConstruct() {
  13960. this.c1 = this.getController("c1");
  13961. this.n2 = (this.getChild("n2"));
  13962. this.n1 = (this.getChild("n1"));
  13963. this.n3 = (this.getChild("n3"));
  13964. this.n4 = (this.getChild("n4"));
  13965. this.n5 = (this.getChild("n5"));
  13966. this.n6 = (this.getChild("n6"));
  13967. }
  13968. }
  13969. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13970. class ui_share2Btn extends fgui.GButton {
  13971. static createInstance() {
  13972. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13973. }
  13974. onConstruct() {
  13975. this.n3 = (this.getChild("n3"));
  13976. }
  13977. }
  13978. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13979. class ui_rodMethodNode extends fgui.GComponent {
  13980. static createInstance() {
  13981. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13982. }
  13983. onConstruct() {
  13984. this.bg = (this.getChild("bg"));
  13985. this.dot = (this.getChild("dot"));
  13986. }
  13987. }
  13988. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13989. class ui_sureBtn extends fgui.GButton {
  13990. static createInstance() {
  13991. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13992. }
  13993. onConstruct() {
  13994. this.n2 = (this.getChild("n2"));
  13995. this.n1 = (this.getChild("n1"));
  13996. }
  13997. }
  13998. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13999. class ui_Component18 extends fgui.GComponent {
  14000. static createInstance() {
  14001. return (fgui.UIPackage.createObject("game", "Component18"));
  14002. }
  14003. onConstruct() {
  14004. this.c1 = this.getController("c1");
  14005. this.nameTxt = (this.getChild("nameTxt"));
  14006. this.headImg = (this.getChild("headImg"));
  14007. this.n24 = (this.getChild("n24"));
  14008. this.skillImg = (this.getChild("skillImg"));
  14009. this.skillTxt = (this.getChild("skillTxt"));
  14010. }
  14011. }
  14012. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14013. class ui_Component45 extends fgui.GComponent {
  14014. static createInstance() {
  14015. return (fgui.UIPackage.createObject("game", "Component45"));
  14016. }
  14017. onConstruct() {
  14018. this.c1 = this.getController("c1");
  14019. this.n40 = (this.getChild("n40"));
  14020. this.n41 = (this.getChild("n41"));
  14021. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14022. this.n42 = (this.getChild("n42"));
  14023. this.awardTxt = (this.getChild("awardTxt"));
  14024. this.n44 = (this.getChild("n44"));
  14025. this.t0 = this.getTransition("t0");
  14026. }
  14027. }
  14028. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14029. class ui_emotionDisplay extends fgui.GButton {
  14030. static createInstance() {
  14031. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14032. }
  14033. onConstruct() {
  14034. this.myIcon = (this.getChild("myIcon"));
  14035. }
  14036. }
  14037. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14038. class ui_Component49 extends fgui.GButton {
  14039. static createInstance() {
  14040. return (fgui.UIPackage.createObject("game", "Component49"));
  14041. }
  14042. onConstruct() {
  14043. this.n69 = (this.getChild("n69"));
  14044. this.n56 = (this.getChild("n56"));
  14045. }
  14046. }
  14047. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14048. class ui_Component50 extends fgui.GButton {
  14049. static createInstance() {
  14050. return (fgui.UIPackage.createObject("game", "Component50"));
  14051. }
  14052. onConstruct() {
  14053. this.n54 = (this.getChild("n54"));
  14054. this.n65 = (this.getChild("n65"));
  14055. }
  14056. }
  14057. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14058. class ui_Component51 extends fgui.GButton {
  14059. static createInstance() {
  14060. return (fgui.UIPackage.createObject("game", "Component51"));
  14061. }
  14062. onConstruct() {
  14063. this.c1 = this.getController("c1");
  14064. this.n51 = (this.getChild("n51"));
  14065. this.n54 = (this.getChild("n54"));
  14066. }
  14067. }
  14068. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14069. class ui_Button5 extends fgui.GButton {
  14070. static createInstance() {
  14071. return (fgui.UIPackage.createObject("game", "Button5"));
  14072. }
  14073. onConstruct() {
  14074. this.c1 = this.getController("c1");
  14075. this.n0 = (this.getChild("n0"));
  14076. this.n2 = (this.getChild("n2"));
  14077. }
  14078. }
  14079. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14080. class ui_Component124 extends fgui.GComponent {
  14081. static createInstance() {
  14082. return (fgui.UIPackage.createObject("game", "Component124"));
  14083. }
  14084. onConstruct() {
  14085. this.n22 = (this.getChild("n22"));
  14086. this.shareNode = (this.getChild("shareNode"));
  14087. }
  14088. }
  14089. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14090. class ui_Component125 extends fgui.GComponent {
  14091. static createInstance() {
  14092. return (fgui.UIPackage.createObject("game", "Component125"));
  14093. }
  14094. onConstruct() {
  14095. this.n29 = (this.getChild("n29"));
  14096. this.coinTxt = (this.getChild("coinTxt"));
  14097. }
  14098. }
  14099. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14100. class ui_Component52 extends fgui.GButton {
  14101. static createInstance() {
  14102. return (fgui.UIPackage.createObject("game", "Component52"));
  14103. }
  14104. onConstruct() {
  14105. this.n35 = (this.getChild("n35"));
  14106. this.n36 = (this.getChild("n36"));
  14107. }
  14108. }
  14109. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14110. class ui_Component_fl_1 extends fgui.GComponent {
  14111. static createInstance() {
  14112. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14113. }
  14114. onConstruct() {
  14115. this.n0 = (this.getChild("n0"));
  14116. this.n6 = (this.getChild("n6"));
  14117. this.n7 = (this.getChild("n7"));
  14118. this.n8 = (this.getChild("n8"));
  14119. this.n5 = (this.getChild("n5"));
  14120. this.n9 = (this.getChild("n9"));
  14121. this.n10 = (this.getChild("n10"));
  14122. this.txt_price = (this.getChild("txt_price"));
  14123. this.n_no = (this.getChild("n_no"));
  14124. this.n_buy = (this.getChild("n_buy"));
  14125. }
  14126. }
  14127. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14128. class ui_Component_fl_2 extends fgui.GComponent {
  14129. static createInstance() {
  14130. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14131. }
  14132. onConstruct() {
  14133. this.n0 = (this.getChild("n0"));
  14134. this.txt_price = (this.getChild("txt_price"));
  14135. this.n4 = (this.getChild("n4"));
  14136. this.n6 = (this.getChild("n6"));
  14137. this.n7 = (this.getChild("n7"));
  14138. this.n5 = (this.getChild("n5"));
  14139. this.n8 = (this.getChild("n8"));
  14140. this.n9 = (this.getChild("n9"));
  14141. this.n_no = (this.getChild("n_no"));
  14142. this.n_buy = (this.getChild("n_buy"));
  14143. }
  14144. }
  14145. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14146. class ui_drawBtn extends fgui.GButton {
  14147. static createInstance() {
  14148. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14149. }
  14150. onConstruct() {
  14151. this.c1 = this.getController("c1");
  14152. this.n2 = (this.getChild("n2"));
  14153. this.n1 = (this.getChild("n1"));
  14154. this.n5 = (this.getChild("n5"));
  14155. }
  14156. }
  14157. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14158. class ui_Component43 extends fgui.GButton {
  14159. static createInstance() {
  14160. return (fgui.UIPackage.createObject("game", "Component43"));
  14161. }
  14162. onConstruct() {
  14163. this.n49 = (this.getChild("n49"));
  14164. }
  14165. }
  14166. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14167. class ui_wordsDisplay extends fgui.GComponent {
  14168. static createInstance() {
  14169. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14170. }
  14171. onConstruct() {
  14172. this.txt = (this.getChild("txt"));
  14173. this.n63 = (this.getChild("n63"));
  14174. }
  14175. }
  14176. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14177. class ui_Component_phb extends fgui.GComponent {
  14178. static createInstance() {
  14179. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14180. }
  14181. onConstruct() {
  14182. this.n3 = (this.getChild("n3"));
  14183. this.n4 = (this.getChild("n4"));
  14184. }
  14185. }
  14186. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14187. class ui_Component3 extends fgui.GComponent {
  14188. static createInstance() {
  14189. return (fgui.UIPackage.createObject("game", "Component3"));
  14190. }
  14191. onConstruct() {
  14192. this.n26 = (this.getChild("n26"));
  14193. this.n24 = (this.getChild("n24"));
  14194. this.nameTxt = (this.getChild("nameTxt"));
  14195. this.headRoot = (this.getChild("headRoot"));
  14196. }
  14197. }
  14198. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14199. class ui_Component4 extends fgui.GComponent {
  14200. static createInstance() {
  14201. return (fgui.UIPackage.createObject("game", "Component4"));
  14202. }
  14203. onConstruct() {
  14204. this.headImg = (this.getChild("headImg"));
  14205. }
  14206. }
  14207. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14208. class ui_Component7 extends fgui.GButton {
  14209. static createInstance() {
  14210. return (fgui.UIPackage.createObject("game", "Component7"));
  14211. }
  14212. onConstruct() {
  14213. this.n17 = (this.getChild("n17"));
  14214. }
  14215. }
  14216. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14217. class ui_Component8 extends fgui.GButton {
  14218. static createInstance() {
  14219. return (fgui.UIPackage.createObject("game", "Component8"));
  14220. }
  14221. onConstruct() {
  14222. this.n19 = (this.getChild("n19"));
  14223. }
  14224. }
  14225. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14226. class ui_Component10 extends fgui.GButton {
  14227. static createInstance() {
  14228. return (fgui.UIPackage.createObject("game", "Component10"));
  14229. }
  14230. onConstruct() {
  14231. this.c1 = this.getController("c1");
  14232. this.n40 = (this.getChild("n40"));
  14233. }
  14234. }
  14235. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14236. class ui_Component11 extends fgui.GButton {
  14237. static createInstance() {
  14238. return (fgui.UIPackage.createObject("game", "Component11"));
  14239. }
  14240. onConstruct() {
  14241. this.n34 = (this.getChild("n34"));
  14242. }
  14243. }
  14244. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14245. class ui_Component12 extends fgui.GButton {
  14246. static createInstance() {
  14247. return (fgui.UIPackage.createObject("game", "Component12"));
  14248. }
  14249. onConstruct() {
  14250. this.n35 = (this.getChild("n35"));
  14251. }
  14252. }
  14253. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14254. class ui_Component13 extends fgui.GButton {
  14255. static createInstance() {
  14256. return (fgui.UIPackage.createObject("game", "Component13"));
  14257. }
  14258. onConstruct() {
  14259. this.n27 = (this.getChild("n27"));
  14260. this.n36 = (this.getChild("n36"));
  14261. }
  14262. }
  14263. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14264. class ui_dh_js_tuowei extends fgui.GComponent {
  14265. static createInstance() {
  14266. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14267. }
  14268. onConstruct() {
  14269. this.n19 = (this.getChild("n19"));
  14270. this.n18 = (this.getChild("n18"));
  14271. this.n0 = (this.getChild("n0"));
  14272. this.n3 = (this.getChild("n3"));
  14273. this.n4 = (this.getChild("n4"));
  14274. this.n5 = (this.getChild("n5"));
  14275. this.n6 = (this.getChild("n6"));
  14276. this.n8 = (this.getChild("n8"));
  14277. this.n9 = (this.getChild("n9"));
  14278. this.n10 = (this.getChild("n10"));
  14279. this.n11 = (this.getChild("n11"));
  14280. this.n12 = (this.getChild("n12"));
  14281. this.n13 = (this.getChild("n13"));
  14282. this.n14 = (this.getChild("n14"));
  14283. this.n15 = (this.getChild("n15"));
  14284. this.n20 = (this.getChild("n20"));
  14285. this.t0 = this.getTransition("t0");
  14286. this.t1 = this.getTransition("t1");
  14287. }
  14288. }
  14289. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14290. class ui_dh_js_tw_g extends fgui.GComponent {
  14291. static createInstance() {
  14292. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14293. }
  14294. onConstruct() {
  14295. this.n0 = (this.getChild("n0"));
  14296. this.n1 = (this.getChild("n1"));
  14297. this.t0 = this.getTransition("t0");
  14298. }
  14299. }
  14300. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14301. class ui_dh_js_xingxing extends fgui.GComponent {
  14302. static createInstance() {
  14303. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14304. }
  14305. onConstruct() {
  14306. this.n1 = (this.getChild("n1"));
  14307. this.n2 = (this.getChild("n2"));
  14308. this.n3 = (this.getChild("n3"));
  14309. this.n4 = (this.getChild("n4"));
  14310. this.n0 = (this.getChild("n0"));
  14311. this.t2 = this.getTransition("t2");
  14312. this.t1 = this.getTransition("t1");
  14313. }
  14314. }
  14315. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14316. class ui_dh_zy_jiazai extends fgui.GComponent {
  14317. static createInstance() {
  14318. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14319. }
  14320. onConstruct() {
  14321. this.c1 = this.getController("c1");
  14322. this.n0 = (this.getChild("n0"));
  14323. this.n1 = (this.getChild("n1"));
  14324. this.n2 = (this.getChild("n2"));
  14325. this.n4 = (this.getChild("n4"));
  14326. this.n5 = (this.getChild("n5"));
  14327. this.n6 = (this.getChild("n6"));
  14328. this.n8 = (this.getChild("n8"));
  14329. this.n7 = (this.getChild("n7"));
  14330. this.t0 = this.getTransition("t0");
  14331. }
  14332. }
  14333. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14334. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14335. static createInstance() {
  14336. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14337. }
  14338. onConstruct() {
  14339. this.c1 = this.getController("c1");
  14340. this.n3 = (this.getChild("n3"));
  14341. this.n5 = (this.getChild("n5"));
  14342. this.n4 = (this.getChild("n4"));
  14343. this.n0 = (this.getChild("n0"));
  14344. this.n1 = (this.getChild("n1"));
  14345. this.n2 = (this.getChild("n2"));
  14346. }
  14347. }
  14348. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14349. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14350. static createInstance() {
  14351. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14352. }
  14353. onConstruct() {
  14354. this.n19 = (this.getChild("n19"));
  14355. this.n21 = (this.getChild("n21"));
  14356. this.n0 = (this.getChild("n0"));
  14357. this.n3 = (this.getChild("n3"));
  14358. this.n4 = (this.getChild("n4"));
  14359. this.n5 = (this.getChild("n5"));
  14360. this.n6 = (this.getChild("n6"));
  14361. this.n8 = (this.getChild("n8"));
  14362. this.n9 = (this.getChild("n9"));
  14363. this.n10 = (this.getChild("n10"));
  14364. this.n11 = (this.getChild("n11"));
  14365. this.n12 = (this.getChild("n12"));
  14366. this.n13 = (this.getChild("n13"));
  14367. this.n14 = (this.getChild("n14"));
  14368. this.n15 = (this.getChild("n15"));
  14369. this.n23 = (this.getChild("n23"));
  14370. this.t0 = this.getTransition("t0");
  14371. this.t1 = this.getTransition("t1");
  14372. }
  14373. }
  14374. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14375. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14376. static createInstance() {
  14377. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14378. }
  14379. onConstruct() {
  14380. this.n1 = (this.getChild("n1"));
  14381. this.n2 = (this.getChild("n2"));
  14382. this.t0 = this.getTransition("t0");
  14383. }
  14384. }
  14385. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14386. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14387. static createInstance() {
  14388. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14389. }
  14390. onConstruct() {
  14391. this.n4 = (this.getChild("n4"));
  14392. this.n2 = (this.getChild("n2"));
  14393. this.n3 = (this.getChild("n3"));
  14394. this.idle = this.getTransition("idle");
  14395. this.attack = this.getTransition("attack");
  14396. }
  14397. }
  14398. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14399. class ui_special extends fgui.GComponent {
  14400. static createInstance() {
  14401. return (fgui.UIPackage.createObject("game", "special"));
  14402. }
  14403. onConstruct() {
  14404. this.n18 = (this.getChild("n18"));
  14405. this.n19 = (this.getChild("n19"));
  14406. this.n20 = (this.getChild("n20"));
  14407. this.n21 = (this.getChild("n21"));
  14408. this.n22 = (this.getChild("n22"));
  14409. this.levelTxt = (this.getChild("levelTxt"));
  14410. this.n24 = (this.getChild("n24"));
  14411. this.n25 = (this.getChild("n25"));
  14412. this.t0 = this.getTransition("t0");
  14413. }
  14414. }
  14415. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14416. class ui_Component145 extends fgui.GComponent {
  14417. static createInstance() {
  14418. return (fgui.UIPackage.createObject("game", "Component145"));
  14419. }
  14420. onConstruct() {
  14421. this.guanyuNode = (this.getChild("guanyuNode"));
  14422. }
  14423. }
  14424. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14425. class ui_longBtn extends fgui.GButton {
  14426. static createInstance() {
  14427. return (fgui.UIPackage.createObject("game", "longBtn"));
  14428. }
  14429. onConstruct() {
  14430. this.c1 = this.getController("c1");
  14431. this.n2 = (this.getChild("n2"));
  14432. this.n1 = (this.getChild("n1"));
  14433. this.n4 = (this.getChild("n4"));
  14434. }
  14435. }
  14436. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14437. class ui_Component146 extends fgui.GComponent {
  14438. static createInstance() {
  14439. return (fgui.UIPackage.createObject("game", "Component146"));
  14440. }
  14441. onConstruct() {
  14442. this.n89 = (this.getChild("n89"));
  14443. this.n90 = (this.getChild("n90"));
  14444. this.guideBtn = (this.getChild("guideBtn"));
  14445. }
  14446. }
  14447. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14448. class ui_Component146_11 extends fgui.GComponent {
  14449. static createInstance() {
  14450. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14451. }
  14452. onConstruct() {
  14453. this.n89 = (this.getChild("n89"));
  14454. this.n90 = (this.getChild("n90"));
  14455. this.guideBtn = (this.getChild("guideBtn"));
  14456. }
  14457. }
  14458. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14459. class ui_Component111_1 extends fgui.GComponent {
  14460. static createInstance() {
  14461. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14462. }
  14463. onConstruct() {
  14464. this.n68 = (this.getChild("n68"));
  14465. this.myMask = (this.getChild("myMask"));
  14466. }
  14467. }
  14468. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14469. class ui_Component64_1 extends fgui.GComponent {
  14470. static createInstance() {
  14471. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14472. }
  14473. onConstruct() {
  14474. this.n57 = (this.getChild("n57"));
  14475. this.n54 = (this.getChild("n54"));
  14476. this.n55 = (this.getChild("n55"));
  14477. this.n56 = (this.getChild("n56"));
  14478. this.t1 = this.getTransition("t1");
  14479. }
  14480. }
  14481. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14482. class ui_ModeSelection_com123 extends fgui.GComponent {
  14483. static createInstance() {
  14484. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14485. }
  14486. onConstruct() {
  14487. this.type1 = (this.getChild("type1"));
  14488. this.type2 = (this.getChild("type2"));
  14489. this.type3 = (this.getChild("type3"));
  14490. this.n38 = (this.getChild("n38"));
  14491. this.t0 = this.getTransition("t0");
  14492. }
  14493. }
  14494. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14495. class ui_Component132_2 extends fgui.GComponent {
  14496. static createInstance() {
  14497. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14498. }
  14499. onConstruct() {
  14500. this.n25 = (this.getChild("n25"));
  14501. this.n26 = (this.getChild("n26"));
  14502. this.n27 = (this.getChild("n27"));
  14503. this.t0 = this.getTransition("t0");
  14504. }
  14505. }
  14506. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14507. class ui_UIPower$1 extends fgui.GComponent {
  14508. static createInstance() {
  14509. return (fgui.UIPackage.createObject("game", "UIPower"));
  14510. }
  14511. onConstruct() {
  14512. this.n11 = (this.getChild("n11"));
  14513. this.myNode = (this.getChild("myNode"));
  14514. this.t0 = this.getTransition("t0");
  14515. }
  14516. }
  14517. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14518. class ui_Component133 extends fgui.GComponent {
  14519. static createInstance() {
  14520. return (fgui.UIPackage.createObject("game", "Component133"));
  14521. }
  14522. onConstruct() {
  14523. this.n29 = (this.getChild("n29"));
  14524. this.n30 = (this.getChild("n30"));
  14525. }
  14526. }
  14527. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14528. class ui_Component134 extends fgui.GComponent {
  14529. static createInstance() {
  14530. return (fgui.UIPackage.createObject("game", "Component134"));
  14531. }
  14532. onConstruct() {
  14533. this.n30 = (this.getChild("n30"));
  14534. this.n31 = (this.getChild("n31"));
  14535. this.t0 = this.getTransition("t0");
  14536. }
  14537. }
  14538. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14539. class ui_Component135 extends fgui.GComponent {
  14540. static createInstance() {
  14541. return (fgui.UIPackage.createObject("game", "Component135"));
  14542. }
  14543. onConstruct() {
  14544. this.n30 = (this.getChild("n30"));
  14545. this.t0 = this.getTransition("t0");
  14546. }
  14547. }
  14548. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14549. class ui_Component137 extends fgui.GComponent {
  14550. static createInstance() {
  14551. return (fgui.UIPackage.createObject("game", "Component137"));
  14552. }
  14553. onConstruct() {
  14554. this.n28 = (this.getChild("n28"));
  14555. this.n29 = (this.getChild("n29"));
  14556. this.n30 = (this.getChild("n30"));
  14557. this.n32 = (this.getChild("n32"));
  14558. }
  14559. }
  14560. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14561. class ui_dh_zuanshi extends fgui.GButton {
  14562. static createInstance() {
  14563. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14564. }
  14565. onConstruct() {
  14566. this.n1 = (this.getChild("n1"));
  14567. this.n2 = (this.getChild("n2"));
  14568. this.n0 = (this.getChild("n0"));
  14569. this.n3 = (this.getChild("n3"));
  14570. this.n4 = (this.getChild("n4"));
  14571. }
  14572. }
  14573. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14574. class ui_Component138 extends fgui.GComponent {
  14575. static createInstance() {
  14576. return (fgui.UIPackage.createObject("game", "Component138"));
  14577. }
  14578. onConstruct() {
  14579. this.n1 = (this.getChild("n1"));
  14580. this.n2 = (this.getChild("n2"));
  14581. this.t0 = this.getTransition("t0");
  14582. }
  14583. }
  14584. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14585. class ui_Component139 extends fgui.GComponent {
  14586. static createInstance() {
  14587. return (fgui.UIPackage.createObject("game", "Component139"));
  14588. }
  14589. onConstruct() {
  14590. this.n0 = (this.getChild("n0"));
  14591. this.t0 = this.getTransition("t0");
  14592. }
  14593. }
  14594. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14595. class ui_Component140 extends fgui.GComponent {
  14596. static createInstance() {
  14597. return (fgui.UIPackage.createObject("game", "Component140"));
  14598. }
  14599. onConstruct() {
  14600. this.n2 = (this.getChild("n2"));
  14601. this.n3 = (this.getChild("n3"));
  14602. this.t0 = this.getTransition("t0");
  14603. }
  14604. }
  14605. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14606. class ui_Component141 extends fgui.GComponent {
  14607. static createInstance() {
  14608. return (fgui.UIPackage.createObject("game", "Component141"));
  14609. }
  14610. onConstruct() {
  14611. this.n0 = (this.getChild("n0"));
  14612. this.t0 = this.getTransition("t0");
  14613. }
  14614. }
  14615. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14616. class ui_powerNode extends fgui.GProgressBar {
  14617. static createInstance() {
  14618. return (fgui.UIPackage.createObject("game", "powerNode"));
  14619. }
  14620. onConstruct() {
  14621. this.n2 = (this.getChild("n2"));
  14622. this.bar_v = (this.getChild("bar_v"));
  14623. this.showImg = (this.getChild("showImg"));
  14624. this.n12 = (this.getChild("n12"));
  14625. }
  14626. }
  14627. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14628. class ui_dh_jingbi1 extends fgui.GComponent {
  14629. static createInstance() {
  14630. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14631. }
  14632. onConstruct() {
  14633. this.n0 = (this.getChild("n0"));
  14634. this.n1 = (this.getChild("n1"));
  14635. this.n2 = (this.getChild("n2"));
  14636. this.n3 = (this.getChild("n3"));
  14637. this.n4 = (this.getChild("n4"));
  14638. this.n5 = (this.getChild("n5"));
  14639. this.n6 = (this.getChild("n6"));
  14640. this.n8 = (this.getChild("n8"));
  14641. this.t0 = this.getTransition("t0");
  14642. }
  14643. }
  14644. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14645. class ui_Component94 extends fgui.GButton {
  14646. static createInstance() {
  14647. return (fgui.UIPackage.createObject("game", "Component94"));
  14648. }
  14649. onConstruct() {
  14650. this.n77 = (this.getChild("n77"));
  14651. }
  14652. }
  14653. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14654. class ui_Component95 extends fgui.GButton {
  14655. static createInstance() {
  14656. return (fgui.UIPackage.createObject("game", "Component95"));
  14657. }
  14658. onConstruct() {
  14659. this.n77 = (this.getChild("n77"));
  14660. }
  14661. }
  14662. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14663. class ui_Component126 extends fgui.GComponent {
  14664. static createInstance() {
  14665. return (fgui.UIPackage.createObject("game", "Component126"));
  14666. }
  14667. onConstruct() {
  14668. this.c1 = this.getController("c1");
  14669. this.normalBtn = (this.getChild("normalBtn"));
  14670. this.tripleBtn = (this.getChild("tripleBtn"));
  14671. }
  14672. }
  14673. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14674. class ui_Component60 extends fgui.GComponent {
  14675. static createInstance() {
  14676. return (fgui.UIPackage.createObject("game", "Component60"));
  14677. }
  14678. onConstruct() {
  14679. this.c1 = this.getController("c1");
  14680. this.n48 = (this.getChild("n48"));
  14681. this.womanTxt = (this.getChild("womanTxt"));
  14682. this.t0 = this.getTransition("t0");
  14683. }
  14684. }
  14685. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14686. class ui_Component_fuli1 extends fgui.GComponent {
  14687. static createInstance() {
  14688. return (fgui.UIPackage.createObject("game", "Component_fuli1"));
  14689. }
  14690. onConstruct() {
  14691. this.n0 = (this.getChild("n0"));
  14692. }
  14693. }
  14694. ui_Component_fuli1.URL = "ui://isxx5ak7loypv59q";
  14695. class ui_Button_h extends fgui.GButton {
  14696. static createInstance() {
  14697. return (fgui.UIPackage.createObject("game", "Button_h"));
  14698. }
  14699. onConstruct() {
  14700. this.button = this.getController("button");
  14701. this.n0 = (this.getChild("n0"));
  14702. this.n1 = (this.getChild("n1"));
  14703. }
  14704. }
  14705. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14706. class ui_Button_lv extends fgui.GButton {
  14707. static createInstance() {
  14708. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14709. }
  14710. onConstruct() {
  14711. this.button = this.getController("button");
  14712. this.n0 = (this.getChild("n0"));
  14713. this.n1 = (this.getChild("n1"));
  14714. }
  14715. }
  14716. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14717. class ui_Component98_3 extends fgui.GButton {
  14718. static createInstance() {
  14719. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14720. }
  14721. onConstruct() {
  14722. this.c1 = this.getController("c1");
  14723. this.n8 = (this.getChild("n8"));
  14724. this.n41 = (this.getChild("n41"));
  14725. this.n40 = (this.getChild("n40"));
  14726. }
  14727. }
  14728. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14729. class ui_ModeSelection_com1 extends fgui.GButton {
  14730. static createInstance() {
  14731. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14732. }
  14733. onConstruct() {
  14734. this.n34 = (this.getChild("n34"));
  14735. this.n36 = (this.getChild("n36"));
  14736. this.n22 = (this.getChild("n22"));
  14737. this.n20 = (this.getChild("n20"));
  14738. this.n23 = (this.getChild("n23"));
  14739. this.n24 = (this.getChild("n24"));
  14740. this.n26 = (this.getChild("n26"));
  14741. this.n33 = (this.getChild("n33"));
  14742. this.coinImg = (this.getChild("coinImg"));
  14743. this.need = (this.getChild("need"));
  14744. this.n35 = (this.getChild("n35"));
  14745. this.n29 = (this.getChild("n29"));
  14746. this.tipsTxt = (this.getChild("tipsTxt"));
  14747. this.n30 = (this.getChild("n30"));
  14748. this.peopleTxt = (this.getChild("peopleTxt"));
  14749. this.t0 = this.getTransition("t0");
  14750. }
  14751. }
  14752. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14753. class ui_ModeSelection_com2 extends fgui.GButton {
  14754. static createInstance() {
  14755. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14756. }
  14757. onConstruct() {
  14758. this.n36 = (this.getChild("n36"));
  14759. this.n34 = (this.getChild("n34"));
  14760. this.n22 = (this.getChild("n22"));
  14761. this.n20 = (this.getChild("n20"));
  14762. this.n23 = (this.getChild("n23"));
  14763. this.n24 = (this.getChild("n24"));
  14764. this.n26 = (this.getChild("n26"));
  14765. this.n33 = (this.getChild("n33"));
  14766. this.coinImg = (this.getChild("coinImg"));
  14767. this.need = (this.getChild("need"));
  14768. this.n35 = (this.getChild("n35"));
  14769. this.n29 = (this.getChild("n29"));
  14770. this.tipsTxt = (this.getChild("tipsTxt"));
  14771. this.n30 = (this.getChild("n30"));
  14772. this.peopleTxt = (this.getChild("peopleTxt"));
  14773. this.t0 = this.getTransition("t0");
  14774. }
  14775. }
  14776. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14777. class ui_ModeSelection_com3 extends fgui.GButton {
  14778. static createInstance() {
  14779. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14780. }
  14781. onConstruct() {
  14782. this.n34 = (this.getChild("n34"));
  14783. this.n36 = (this.getChild("n36"));
  14784. this.n22 = (this.getChild("n22"));
  14785. this.n20 = (this.getChild("n20"));
  14786. this.n23 = (this.getChild("n23"));
  14787. this.n24 = (this.getChild("n24"));
  14788. this.n26 = (this.getChild("n26"));
  14789. this.n33 = (this.getChild("n33"));
  14790. this.coinImg = (this.getChild("coinImg"));
  14791. this.need = (this.getChild("need"));
  14792. this.n35 = (this.getChild("n35"));
  14793. this.n29 = (this.getChild("n29"));
  14794. this.tipsTxt = (this.getChild("tipsTxt"));
  14795. this.n30 = (this.getChild("n30"));
  14796. this.peopleTxt = (this.getChild("peopleTxt"));
  14797. this.t0 = this.getTransition("t0");
  14798. }
  14799. }
  14800. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14801. class ui_Invitation_com1 extends fgui.GComponent {
  14802. static createInstance() {
  14803. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14804. }
  14805. onConstruct() {
  14806. this.n14 = (this.getChild("n14"));
  14807. this.n13 = (this.getChild("n13"));
  14808. this.n3 = (this.getChild("n3"));
  14809. this.n1 = (this.getChild("n1"));
  14810. this.n6 = (this.getChild("n6"));
  14811. this.n7 = (this.getChild("n7"));
  14812. this.enterBtn = (this.getChild("enterBtn"));
  14813. this.n11 = (this.getChild("n11"));
  14814. this.n12 = (this.getChild("n12"));
  14815. this.n15 = (this.getChild("n15"));
  14816. this.t0 = this.getTransition("t0");
  14817. this.t1 = this.getTransition("t1");
  14818. }
  14819. }
  14820. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14821. class ui_Component87_1 extends fgui.GComponent {
  14822. static createInstance() {
  14823. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14824. }
  14825. onConstruct() {
  14826. this.n74 = (this.getChild("n74"));
  14827. this.n73 = (this.getChild("n73"));
  14828. this.ballTxt = (this.getChild("ballTxt"));
  14829. this.n76 = (this.getChild("n76"));
  14830. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14831. this.levelTxt = (this.getChild("levelTxt"));
  14832. this.n87 = (this.getChild("n87"));
  14833. this.n84 = (this.getChild("n84"));
  14834. this.hpTxt = (this.getChild("hpTxt"));
  14835. this.n89 = (this.getChild("n89"));
  14836. this.tipsTxt = (this.getChild("tipsTxt"));
  14837. }
  14838. }
  14839. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14840. class ui_sqg1 extends fgui.GComponent {
  14841. static createInstance() {
  14842. return (fgui.UIPackage.createObject("game", "sqg1"));
  14843. }
  14844. onConstruct() {
  14845. this.n1 = (this.getChild("n1"));
  14846. this.n0 = (this.getChild("n0"));
  14847. }
  14848. }
  14849. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14850. class ui_sqg2 extends fgui.GComponent {
  14851. static createInstance() {
  14852. return (fgui.UIPackage.createObject("game", "sqg2"));
  14853. }
  14854. onConstruct() {
  14855. this.n1 = (this.getChild("n1"));
  14856. this.n0 = (this.getChild("n0"));
  14857. }
  14858. }
  14859. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14860. class ui_sqg3 extends fgui.GComponent {
  14861. static createInstance() {
  14862. return (fgui.UIPackage.createObject("game", "sqg3"));
  14863. }
  14864. onConstruct() {
  14865. this.n1 = (this.getChild("n1"));
  14866. this.n0 = (this.getChild("n0"));
  14867. }
  14868. }
  14869. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14870. class ui_sqg4 extends fgui.GComponent {
  14871. static createInstance() {
  14872. return (fgui.UIPackage.createObject("game", "sqg4"));
  14873. }
  14874. onConstruct() {
  14875. this.n1 = (this.getChild("n1"));
  14876. this.n0 = (this.getChild("n0"));
  14877. }
  14878. }
  14879. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14880. class ui_Component36 extends fgui.GButton {
  14881. static createInstance() {
  14882. return (fgui.UIPackage.createObject("game", "Component36"));
  14883. }
  14884. onConstruct() {
  14885. this.c1 = this.getController("c1");
  14886. this.n53 = (this.getChild("n53"));
  14887. this.n56 = (this.getChild("n56"));
  14888. }
  14889. }
  14890. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14891. class ui_Component37 extends fgui.GButton {
  14892. static createInstance() {
  14893. return (fgui.UIPackage.createObject("game", "Component37"));
  14894. }
  14895. onConstruct() {
  14896. this.c1 = this.getController("c1");
  14897. this.n52 = (this.getChild("n52"));
  14898. this.n54 = (this.getChild("n54"));
  14899. }
  14900. }
  14901. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14902. class ui_UISetting extends fgui.GComponent {
  14903. static createInstance() {
  14904. return (fgui.UIPackage.createObject("game", "UISetting"));
  14905. }
  14906. onConstruct() {
  14907. this.c1 = this.getController("c1");
  14908. this.n4 = (this.getChild("n4"));
  14909. this.soundBtn = (this.getChild("soundBtn"));
  14910. this.shakeBtn = (this.getChild("shakeBtn"));
  14911. this.clickNode = (this.getChild("clickNode"));
  14912. this.xyBtn = (this.getChild("xyBtn"));
  14913. }
  14914. }
  14915. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14916. class ui_Component39 extends fgui.GComponent {
  14917. static createInstance() {
  14918. return (fgui.UIPackage.createObject("game", "Component39"));
  14919. }
  14920. onConstruct() {
  14921. this.n5 = (this.getChild("n5"));
  14922. this.n6 = (this.getChild("n6"));
  14923. this.n7 = (this.getChild("n7"));
  14924. this.t0 = this.getTransition("t0");
  14925. }
  14926. }
  14927. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14928. class ui_Component40 extends fgui.GButton {
  14929. static createInstance() {
  14930. return (fgui.UIPackage.createObject("game", "Component40"));
  14931. }
  14932. onConstruct() {
  14933. this.n46 = (this.getChild("n46"));
  14934. this.n47 = (this.getChild("n47"));
  14935. }
  14936. }
  14937. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14938. class ui_Component41 extends fgui.GComponent {
  14939. static createInstance() {
  14940. return (fgui.UIPackage.createObject("game", "Component41"));
  14941. }
  14942. onConstruct() {
  14943. this.c1 = this.getController("c1");
  14944. this.n0 = (this.getChild("n0"));
  14945. this.titleTxt = (this.getChild("titleTxt"));
  14946. this.n2 = (this.getChild("n2"));
  14947. this.msgTips = (this.getChild("msgTips"));
  14948. this.numTxt = (this.getChild("numTxt"));
  14949. this.n18 = (this.getChild("n18"));
  14950. this.cancelBtn = (this.getChild("cancelBtn"));
  14951. this.videoBtn = (this.getChild("videoBtn"));
  14952. this.n10 = (this.getChild("n10"));
  14953. }
  14954. }
  14955. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14956. class ui_Component42 extends fgui.GComponent {
  14957. static createInstance() {
  14958. return (fgui.UIPackage.createObject("game", "Component42"));
  14959. }
  14960. onConstruct() {
  14961. this.c1 = this.getController("c1");
  14962. this.n1 = (this.getChild("n1"));
  14963. this.n2 = (this.getChild("n2"));
  14964. this.n3 = (this.getChild("n3"));
  14965. this.tipsTxt = (this.getChild("tipsTxt"));
  14966. this.cancelBtn = (this.getChild("cancelBtn"));
  14967. this.sureBtn = (this.getChild("sureBtn"));
  14968. this.n11 = (this.getChild("n11"));
  14969. this.n13 = (this.getChild("n13"));
  14970. this.n14 = (this.getChild("n14"));
  14971. this.womanTxt = (this.getChild("womanTxt"));
  14972. this.t0 = this.getTransition("t0");
  14973. }
  14974. }
  14975. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14976. class ui_dh_js_shengli extends fgui.GComponent {
  14977. static createInstance() {
  14978. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14979. }
  14980. onConstruct() {
  14981. this.n3 = (this.getChild("n3"));
  14982. this.n4 = (this.getChild("n4"));
  14983. this.n1 = (this.getChild("n1"));
  14984. this.n2 = (this.getChild("n2"));
  14985. this.n5 = (this.getChild("n5"));
  14986. this.n6 = (this.getChild("n6"));
  14987. this.n7 = (this.getChild("n7"));
  14988. this.n8 = (this.getChild("n8"));
  14989. this.attack = this.getTransition("attack");
  14990. this.idle = this.getTransition("idle");
  14991. }
  14992. }
  14993. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14994. class ui_dh_js_shengli_g extends fgui.GComponent {
  14995. static createInstance() {
  14996. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14997. }
  14998. onConstruct() {
  14999. this.n3 = (this.getChild("n3"));
  15000. this.n1 = (this.getChild("n1"));
  15001. this.t0 = this.getTransition("t0");
  15002. }
  15003. }
  15004. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15005. class ui_dh_js_shibai extends fgui.GComponent {
  15006. static createInstance() {
  15007. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15008. }
  15009. onConstruct() {
  15010. this.n0 = (this.getChild("n0"));
  15011. this.n1 = (this.getChild("n1"));
  15012. this.n2 = (this.getChild("n2"));
  15013. this.n3 = (this.getChild("n3"));
  15014. this.idle = this.getTransition("idle");
  15015. this.attack = this.getTransition("attack");
  15016. }
  15017. }
  15018. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15019. class ui_dh_zy_ganfa extends fgui.GButton {
  15020. static createInstance() {
  15021. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15022. }
  15023. onConstruct() {
  15024. this.n0 = (this.getChild("n0"));
  15025. }
  15026. }
  15027. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15028. class ui_dh_zy_sc_guang extends fgui.GButton {
  15029. static createInstance() {
  15030. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15031. }
  15032. onConstruct() {
  15033. this.n0 = (this.getChild("n0"));
  15034. this.n2 = (this.getChild("n2"));
  15035. }
  15036. }
  15037. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15038. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15039. static createInstance() {
  15040. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15041. }
  15042. onConstruct() {
  15043. this.n0 = (this.getChild("n0"));
  15044. this.n3 = (this.getChild("n3"));
  15045. this.t0 = this.getTransition("t0");
  15046. }
  15047. }
  15048. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15049. class ui_dh_zy_wanfa extends fgui.GButton {
  15050. static createInstance() {
  15051. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15052. }
  15053. onConstruct() {
  15054. this.n0 = (this.getChild("n0"));
  15055. }
  15056. }
  15057. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15058. class ui_Button_login extends fgui.GButton {
  15059. static createInstance() {
  15060. return (fgui.UIPackage.createObject("game", "Button_login"));
  15061. }
  15062. onConstruct() {
  15063. this.button = this.getController("button");
  15064. this.n5 = (this.getChild("n5"));
  15065. this.n3 = (this.getChild("n3"));
  15066. }
  15067. }
  15068. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15069. class ui_Component53_1 extends fgui.GComponent {
  15070. static createInstance() {
  15071. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15072. }
  15073. onConstruct() {
  15074. this.n0 = (this.getChild("n0"));
  15075. this.n1 = (this.getChild("n1"));
  15076. this.n2 = (this.getChild("n2"));
  15077. this.n3 = (this.getChild("n3"));
  15078. this.n4 = (this.getChild("n4"));
  15079. this.n5 = (this.getChild("n5"));
  15080. this.n6 = (this.getChild("n6"));
  15081. this.n7 = (this.getChild("n7"));
  15082. this.n8 = (this.getChild("n8"));
  15083. this.n9 = (this.getChild("n9"));
  15084. this.n10 = (this.getChild("n10"));
  15085. this.n11 = (this.getChild("n11"));
  15086. this.n12 = (this.getChild("n12"));
  15087. this.n13 = (this.getChild("n13"));
  15088. this.n14 = (this.getChild("n14"));
  15089. this.n15 = (this.getChild("n15"));
  15090. this.n16 = (this.getChild("n16"));
  15091. this.n19 = (this.getChild("n19"));
  15092. this.n20 = (this.getChild("n20"));
  15093. this.n21 = (this.getChild("n21"));
  15094. this.n22 = (this.getChild("n22"));
  15095. this.n23 = (this.getChild("n23"));
  15096. this.n24 = (this.getChild("n24"));
  15097. this.n25 = (this.getChild("n25"));
  15098. this.n26 = (this.getChild("n26"));
  15099. this.n27 = (this.getChild("n27"));
  15100. this.n28 = (this.getChild("n28"));
  15101. this.n29 = (this.getChild("n29"));
  15102. this.n30 = (this.getChild("n30"));
  15103. this.n31 = (this.getChild("n31"));
  15104. this.n32 = (this.getChild("n32"));
  15105. this.n33 = (this.getChild("n33"));
  15106. this.n34 = (this.getChild("n34"));
  15107. this.n35 = (this.getChild("n35"));
  15108. this.t0 = this.getTransition("t0");
  15109. }
  15110. }
  15111. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15112. class ui_Component30 extends fgui.GComponent {
  15113. static createInstance() {
  15114. return (fgui.UIPackage.createObject("game", "Component30"));
  15115. }
  15116. onConstruct() {
  15117. this.c1 = this.getController("c1");
  15118. this.n46 = (this.getChild("n46"));
  15119. this.n47 = (this.getChild("n47"));
  15120. this.numTxt = (this.getChild("numTxt"));
  15121. this.n50 = (this.getChild("n50"));
  15122. this.n53 = (this.getChild("n53"));
  15123. this.n54 = (this.getChild("n54"));
  15124. this.n55 = (this.getChild("n55"));
  15125. this.n56 = (this.getChild("n56"));
  15126. }
  15127. }
  15128. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15129. class ui_Component30_1 extends fgui.GComponent {
  15130. static createInstance() {
  15131. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15132. }
  15133. onConstruct() {
  15134. this.c1 = this.getController("c1");
  15135. this.n46 = (this.getChild("n46"));
  15136. this.n47 = (this.getChild("n47"));
  15137. this.numTxt = (this.getChild("numTxt"));
  15138. this.n50 = (this.getChild("n50"));
  15139. this.n51 = (this.getChild("n51"));
  15140. this.n52 = (this.getChild("n52"));
  15141. this.n53 = (this.getChild("n53"));
  15142. this.n54 = (this.getChild("n54"));
  15143. }
  15144. }
  15145. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15146. class ui_Component31 extends fgui.GComponent {
  15147. static createInstance() {
  15148. return (fgui.UIPackage.createObject("game", "Component31"));
  15149. }
  15150. onConstruct() {
  15151. this.n55 = (this.getChild("n55"));
  15152. this.n54 = (this.getChild("n54"));
  15153. this.conditionTxt = (this.getChild("conditionTxt"));
  15154. this.n57 = (this.getChild("n57"));
  15155. this.t0 = this.getTransition("t0");
  15156. }
  15157. }
  15158. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15159. class ui_Component32 extends fgui.GComponent {
  15160. static createInstance() {
  15161. return (fgui.UIPackage.createObject("game", "Component32"));
  15162. }
  15163. onConstruct() {
  15164. this.n5 = (this.getChild("n5"));
  15165. this.n6 = (this.getChild("n6"));
  15166. this.n7 = (this.getChild("n7"));
  15167. this.t0 = this.getTransition("t0");
  15168. }
  15169. }
  15170. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15171. class ui_AwardItem extends fgui.GComponent {
  15172. static createInstance() {
  15173. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15174. }
  15175. onConstruct() {
  15176. this.n9 = (this.getChild("n9"));
  15177. this.myIcon = (this.getChild("myIcon"));
  15178. this.numTxt = (this.getChild("numTxt"));
  15179. this.nameTxt = (this.getChild("nameTxt"));
  15180. this.n16 = (this.getChild("n16"));
  15181. this.n17 = (this.getChild("n17"));
  15182. }
  15183. }
  15184. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15185. class ui_ranking_com1 extends fgui.GButton {
  15186. static createInstance() {
  15187. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15188. }
  15189. onConstruct() {
  15190. this.c1 = this.getController("c1");
  15191. this.n49 = (this.getChild("n49"));
  15192. this.n18 = (this.getChild("n18"));
  15193. this.n46 = (this.getChild("n46"));
  15194. this.n48 = (this.getChild("n48"));
  15195. this.n50 = (this.getChild("n50"));
  15196. }
  15197. }
  15198. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15199. class ui_ranking_com2 extends fgui.GButton {
  15200. static createInstance() {
  15201. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15202. }
  15203. onConstruct() {
  15204. this.c1 = this.getController("c1");
  15205. this.n49 = (this.getChild("n49"));
  15206. this.n18 = (this.getChild("n18"));
  15207. this.n46 = (this.getChild("n46"));
  15208. this.n48 = (this.getChild("n48"));
  15209. this.n50 = (this.getChild("n50"));
  15210. }
  15211. }
  15212. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15213. class ui_ranking_com3 extends fgui.GComponent {
  15214. static createInstance() {
  15215. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15216. }
  15217. onConstruct() {
  15218. this.n17 = (this.getChild("n17"));
  15219. this.myIcon = (this.getChild("myIcon"));
  15220. }
  15221. }
  15222. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15223. class ui_ranking_com4 extends fgui.GComponent {
  15224. static createInstance() {
  15225. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15226. }
  15227. onConstruct() {
  15228. this.n16 = (this.getChild("n16"));
  15229. this.head = (this.getChild("head"));
  15230. }
  15231. }
  15232. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15233. class ui_ranking_com5 extends fgui.GComponent {
  15234. static createInstance() {
  15235. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15236. }
  15237. onConstruct() {
  15238. this.c1 = this.getController("c1");
  15239. this.c2 = this.getController("c2");
  15240. this.n2 = (this.getChild("n2"));
  15241. this.n3 = (this.getChild("n3"));
  15242. this.levelBtn = (this.getChild("levelBtn"));
  15243. this.starBtn = (this.getChild("starBtn"));
  15244. this.n23 = (this.getChild("n23"));
  15245. this.n24 = (this.getChild("n24"));
  15246. this.n25 = (this.getChild("n25"));
  15247. this.myList = (this.getChild("myList"));
  15248. this.selfNode = (this.getChild("selfNode"));
  15249. this.n9 = (this.getChild("n9"));
  15250. this.n12 = (this.getChild("n12"));
  15251. this.n13 = (this.getChild("n13"));
  15252. this.n14 = (this.getChild("n14"));
  15253. this.n39 = (this.getChild("n39"));
  15254. this.n41 = (this.getChild("n41"));
  15255. this.n42 = (this.getChild("n42"));
  15256. this.n45 = (this.getChild("n45"));
  15257. this.changeBtn = (this.getChild("changeBtn"));
  15258. this.closeBtn = (this.getChild("closeBtn"));
  15259. this.t0 = this.getTransition("t0");
  15260. }
  15261. }
  15262. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15263. class ui_RankItem extends fgui.GComponent {
  15264. static createInstance() {
  15265. return (fgui.UIPackage.createObject("game", "RankItem"));
  15266. }
  15267. onConstruct() {
  15268. this.n10 = (this.getChild("n10"));
  15269. this.n11 = (this.getChild("n11"));
  15270. this.rankTxt = (this.getChild("rankTxt"));
  15271. this.headNode = (this.getChild("headNode"));
  15272. this.nameTxt = (this.getChild("nameTxt"));
  15273. this.n19 = (this.getChild("n19"));
  15274. this.valueTxt = (this.getChild("valueTxt"));
  15275. this.img1 = (this.getChild("img1"));
  15276. this.img2 = (this.getChild("img2"));
  15277. this.img3 = (this.getChild("img3"));
  15278. }
  15279. }
  15280. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15281. class ui_ranking_com9 extends fgui.GComponent {
  15282. static createInstance() {
  15283. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15284. }
  15285. onConstruct() {
  15286. this.c1 = this.getController("c1");
  15287. this.n27 = (this.getChild("n27"));
  15288. this.n28 = (this.getChild("n28"));
  15289. this.headNode = (this.getChild("headNode"));
  15290. this.rankTxt = (this.getChild("rankTxt"));
  15291. this.nameTxt = (this.getChild("nameTxt"));
  15292. this.n34 = (this.getChild("n34"));
  15293. this.valueTxt = (this.getChild("valueTxt"));
  15294. this.n36 = (this.getChild("n36"));
  15295. this.n37 = (this.getChild("n37"));
  15296. this.n38 = (this.getChild("n38"));
  15297. this.n39 = (this.getChild("n39"));
  15298. this.n40 = (this.getChild("n40"));
  15299. }
  15300. }
  15301. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15302. class ui_ranking_com10 extends fgui.GComponent {
  15303. static createInstance() {
  15304. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15305. }
  15306. onConstruct() {
  15307. this.n23 = (this.getChild("n23"));
  15308. this.n24 = (this.getChild("n24"));
  15309. }
  15310. }
  15311. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15312. class ui_ranking_com11 extends fgui.GComponent {
  15313. static createInstance() {
  15314. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15315. }
  15316. onConstruct() {
  15317. this.n24 = (this.getChild("n24"));
  15318. this.n25 = (this.getChild("n25"));
  15319. this.t0 = this.getTransition("t0");
  15320. }
  15321. }
  15322. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15323. class ui_ranking_com13 extends fgui.GButton {
  15324. static createInstance() {
  15325. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15326. }
  15327. onConstruct() {
  15328. this.c1 = this.getController("c1");
  15329. this.n44 = (this.getChild("n44"));
  15330. this.n45 = (this.getChild("n45"));
  15331. this.n46 = (this.getChild("n46"));
  15332. }
  15333. }
  15334. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15335. class ui_Component_dl_zc extends fgui.GButton {
  15336. static createInstance() {
  15337. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  15338. }
  15339. onConstruct() {
  15340. this.c1 = this.getController("c1");
  15341. this.n0 = (this.getChild("n0"));
  15342. }
  15343. }
  15344. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  15345. class ui_Component122 extends fgui.GComponent {
  15346. static createInstance() {
  15347. return (fgui.UIPackage.createObject("game", "Component122"));
  15348. }
  15349. onConstruct() {
  15350. this.gameNode3 = (this.getChild("gameNode3"));
  15351. }
  15352. }
  15353. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15354. class ui_skillItem extends fgui.GComponent {
  15355. static createInstance() {
  15356. return (fgui.UIPackage.createObject("game", "skillItem"));
  15357. }
  15358. onConstruct() {
  15359. this.c1 = this.getController("c1");
  15360. this.n31 = (this.getChild("n31"));
  15361. this.n6 = (this.getChild("n6"));
  15362. this.skillImg = (this.getChild("skillImg"));
  15363. this.nameTxt = (this.getChild("nameTxt"));
  15364. this.levelTxt = (this.getChild("levelTxt"));
  15365. this.n28 = (this.getChild("n28"));
  15366. this.describeTxt = (this.getChild("describeTxt"));
  15367. this.n32 = (this.getChild("n32"));
  15368. this.mutiBtn = (this.getChild("mutiBtn"));
  15369. this.tryNode = (this.getChild("tryNode"));
  15370. this.normalBtn = (this.getChild("normalBtn"));
  15371. this.startBtn = (this.getChild("startBtn"));
  15372. this.n42 = (this.getChild("n42"));
  15373. this.n43 = (this.getChild("n43"));
  15374. this.n44 = (this.getChild("n44"));
  15375. }
  15376. }
  15377. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15378. class ui_Component26 extends fgui.GButton {
  15379. static createInstance() {
  15380. return (fgui.UIPackage.createObject("game", "Component26"));
  15381. }
  15382. onConstruct() {
  15383. this.n11 = (this.getChild("n11"));
  15384. this.n30 = (this.getChild("n30"));
  15385. this.n34 = (this.getChild("n34"));
  15386. }
  15387. }
  15388. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15389. class ui_Component28 extends fgui.GButton {
  15390. static createInstance() {
  15391. return (fgui.UIPackage.createObject("game", "Component28"));
  15392. }
  15393. onConstruct() {
  15394. this.n12 = (this.getChild("n12"));
  15395. this.n31 = (this.getChild("n31"));
  15396. this.curTxt = (this.getChild("curTxt"));
  15397. this.n33 = (this.getChild("n33"));
  15398. }
  15399. }
  15400. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15401. class ui_Component1302 extends fgui.GComponent {
  15402. static createInstance() {
  15403. return (fgui.UIPackage.createObject("game", "Component1302"));
  15404. }
  15405. onConstruct() {
  15406. this.n2 = (this.getChild("n2"));
  15407. this.n3 = (this.getChild("n3"));
  15408. }
  15409. }
  15410. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15411. class ui_Component113 extends fgui.GComponent {
  15412. static createInstance() {
  15413. return (fgui.UIPackage.createObject("game", "Component113"));
  15414. }
  15415. onConstruct() {
  15416. this.n85 = (this.getChild("n85"));
  15417. this.n86 = (this.getChild("n86"));
  15418. this.n77 = (this.getChild("n77"));
  15419. this.n79 = (this.getChild("n79"));
  15420. this.n80 = (this.getChild("n80"));
  15421. this.n81 = (this.getChild("n81"));
  15422. this.n82 = (this.getChild("n82"));
  15423. this.n84 = (this.getChild("n84"));
  15424. this.n87 = (this.getChild("n87"));
  15425. this.t0 = this.getTransition("t0");
  15426. }
  15427. }
  15428. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15429. class ui_Component114 extends fgui.GComponent {
  15430. static createInstance() {
  15431. return (fgui.UIPackage.createObject("game", "Component114"));
  15432. }
  15433. onConstruct() {
  15434. this.n77 = (this.getChild("n77"));
  15435. this.t0 = this.getTransition("t0");
  15436. }
  15437. }
  15438. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15439. class ui_Component115 extends fgui.GComponent {
  15440. static createInstance() {
  15441. return (fgui.UIPackage.createObject("game", "Component115"));
  15442. }
  15443. onConstruct() {
  15444. this.n83 = (this.getChild("n83"));
  15445. this.fingerNode = (this.getChild("fingerNode"));
  15446. this.n84 = (this.getChild("n84"));
  15447. }
  15448. }
  15449. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15450. class ui_Component117 extends fgui.GComponent {
  15451. static createInstance() {
  15452. return (fgui.UIPackage.createObject("game", "Component117"));
  15453. }
  15454. onConstruct() {
  15455. this.n87 = (this.getChild("n87"));
  15456. this.n88 = (this.getChild("n88"));
  15457. this.n84 = (this.getChild("n84"));
  15458. this.n85 = (this.getChild("n85"));
  15459. this.n86 = (this.getChild("n86"));
  15460. this.t0 = this.getTransition("t0");
  15461. }
  15462. }
  15463. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15464. class ui_Component98_1 extends fgui.GButton {
  15465. static createInstance() {
  15466. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15467. }
  15468. onConstruct() {
  15469. this.c1 = this.getController("c1");
  15470. this.n8 = (this.getChild("n8"));
  15471. this.n41 = (this.getChild("n41"));
  15472. this.n40 = (this.getChild("n40"));
  15473. }
  15474. }
  15475. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15476. class ui_Component61 extends fgui.GComponent {
  15477. static createInstance() {
  15478. return (fgui.UIPackage.createObject("game", "Component61"));
  15479. }
  15480. onConstruct() {
  15481. this.n14 = (this.getChild("n14"));
  15482. this.n6 = (this.getChild("n6"));
  15483. this.t0 = this.getTransition("t0");
  15484. }
  15485. }
  15486. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15487. class ui_Component62 extends fgui.GComponent {
  15488. static createInstance() {
  15489. return (fgui.UIPackage.createObject("game", "Component62"));
  15490. }
  15491. onConstruct() {
  15492. this.n66 = (this.getChild("n66"));
  15493. this.n56 = (this.getChild("n56"));
  15494. this.n63 = (this.getChild("n63"));
  15495. this.n65 = (this.getChild("n65"));
  15496. this.t0 = this.getTransition("t0");
  15497. }
  15498. }
  15499. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15500. class ui_d3Root extends fgui.GComponent {
  15501. static createInstance() {
  15502. return (fgui.UIPackage.createObject("game", "d3Root"));
  15503. }
  15504. onConstruct() {
  15505. }
  15506. }
  15507. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15508. class ui_d2Root extends fgui.GComponent {
  15509. static createInstance() {
  15510. return (fgui.UIPackage.createObject("game", "d2Root"));
  15511. }
  15512. onConstruct() {
  15513. }
  15514. }
  15515. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15516. class ui_ballNode extends fgui.GComponent {
  15517. static createInstance() {
  15518. return (fgui.UIPackage.createObject("game", "ballNode"));
  15519. }
  15520. onConstruct() {
  15521. }
  15522. }
  15523. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15524. class ui_border extends fgui.GComponent {
  15525. static createInstance() {
  15526. return (fgui.UIPackage.createObject("game", "border"));
  15527. }
  15528. onConstruct() {
  15529. this.bar1 = (this.getChild("bar1"));
  15530. this.bar2 = (this.getChild("bar2"));
  15531. this.bar3 = (this.getChild("bar3"));
  15532. this.bar4 = (this.getChild("bar4"));
  15533. this.bar5 = (this.getChild("bar5"));
  15534. this.bar6 = (this.getChild("bar6"));
  15535. this.circle1 = (this.getChild("circle1"));
  15536. this.circle2 = (this.getChild("circle2"));
  15537. this.circle3 = (this.getChild("circle3"));
  15538. this.circle4 = (this.getChild("circle4"));
  15539. this.circle5 = (this.getChild("circle5"));
  15540. this.circle6 = (this.getChild("circle6"));
  15541. this.n28 = (this.getChild("n28"));
  15542. }
  15543. }
  15544. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15545. class ui_btn_buy extends fgui.GButton {
  15546. static createInstance() {
  15547. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15548. }
  15549. onConstruct() {
  15550. this.button = this.getController("button");
  15551. this.n0 = (this.getChild("n0"));
  15552. this.n1 = (this.getChild("n1"));
  15553. this.n2 = (this.getChild("n2"));
  15554. }
  15555. }
  15556. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15557. class ui_Component41_2 extends fgui.GComponent {
  15558. static createInstance() {
  15559. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15560. }
  15561. onConstruct() {
  15562. this.c1 = this.getController("c1");
  15563. this.n0 = (this.getChild("n0"));
  15564. this.n2 = (this.getChild("n2"));
  15565. this.n19 = (this.getChild("n19"));
  15566. this.cancelBtn = (this.getChild("cancelBtn"));
  15567. this.videoBtn = (this.getChild("videoBtn"));
  15568. this.n9 = (this.getChild("n9"));
  15569. this.n22 = (this.getChild("n22"));
  15570. this.tipsTxt = (this.getChild("tipsTxt"));
  15571. this.n23 = (this.getChild("n23"));
  15572. this.n24 = (this.getChild("n24"));
  15573. this.n26 = (this.getChild("n26"));
  15574. this.n27 = (this.getChild("n27"));
  15575. this.titleTxt = (this.getChild("titleTxt"));
  15576. }
  15577. }
  15578. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15579. class ui_Component41_1 extends fgui.GComponent {
  15580. static createInstance() {
  15581. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15582. }
  15583. onConstruct() {
  15584. this.c1 = this.getController("c1");
  15585. this.n0 = (this.getChild("n0"));
  15586. this.n2 = (this.getChild("n2"));
  15587. this.cancelBtn = (this.getChild("cancelBtn"));
  15588. this.videoBtn = (this.getChild("videoBtn"));
  15589. this.n27 = (this.getChild("n27"));
  15590. this.n30 = (this.getChild("n30"));
  15591. this.n31 = (this.getChild("n31"));
  15592. this.n32 = (this.getChild("n32"));
  15593. this.n33 = (this.getChild("n33"));
  15594. this.n34 = (this.getChild("n34"));
  15595. this.n35 = (this.getChild("n35"));
  15596. this.n36 = (this.getChild("n36"));
  15597. this.n1 = (this.getChild("n1"));
  15598. this.n37 = (this.getChild("n37"));
  15599. this.t0 = this.getTransition("t0");
  15600. this.t1 = this.getTransition("t1");
  15601. this.t2 = this.getTransition("t2");
  15602. this.t3 = this.getTransition("t3");
  15603. }
  15604. }
  15605. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15606. class ui_againBtn extends fgui.GButton {
  15607. static createInstance() {
  15608. return (fgui.UIPackage.createObject("game", "againBtn"));
  15609. }
  15610. onConstruct() {
  15611. this.n2 = (this.getChild("n2"));
  15612. this.n1 = (this.getChild("n1"));
  15613. this.n5 = (this.getChild("n5"));
  15614. }
  15615. }
  15616. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15617. class ui_Component118 extends fgui.GButton {
  15618. static createInstance() {
  15619. return (fgui.UIPackage.createObject("game", "Component118"));
  15620. }
  15621. onConstruct() {
  15622. this.c1 = this.getController("c1");
  15623. this.n14 = (this.getChild("n14"));
  15624. this.n9 = (this.getChild("n9"));
  15625. this.n10 = (this.getChild("n10"));
  15626. this.diamondTxt = (this.getChild("diamondTxt"));
  15627. this.n13 = (this.getChild("n13"));
  15628. this.n15 = (this.getChild("n15"));
  15629. }
  15630. }
  15631. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15632. class ui_Component119 extends fgui.GComponent {
  15633. static createInstance() {
  15634. return (fgui.UIPackage.createObject("game", "Component119"));
  15635. }
  15636. onConstruct() {
  15637. this.n1 = (this.getChild("n1"));
  15638. this.n2 = (this.getChild("n2"));
  15639. this.n13 = (this.getChild("n13"));
  15640. this.n6 = (this.getChild("n6"));
  15641. this.screenNode = (this.getChild("screenNode"));
  15642. this.n15 = (this.getChild("n15"));
  15643. this.closeBtn = (this.getChild("closeBtn"));
  15644. this.share2Btn = (this.getChild("share2Btn"));
  15645. this.shareBtn = (this.getChild("shareBtn"));
  15646. this.tipsNode = (this.getChild("tipsNode"));
  15647. this.awardNode = (this.getChild("awardNode"));
  15648. }
  15649. }
  15650. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15651. class ui_daoJuDisplay extends fgui.GComponent {
  15652. static createInstance() {
  15653. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15654. }
  15655. onConstruct() {
  15656. this.n6 = (this.getChild("n6"));
  15657. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15658. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15659. this.btn_buy = (this.getChild("btn_buy"));
  15660. this.nameTxt = (this.getChild("nameTxt"));
  15661. this.zsImg = (this.getChild("zsImg"));
  15662. }
  15663. }
  15664. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15665. class ui_Component132_1 extends fgui.GComponent {
  15666. static createInstance() {
  15667. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15668. }
  15669. onConstruct() {
  15670. this.n25 = (this.getChild("n25"));
  15671. this.n26 = (this.getChild("n26"));
  15672. this.n27 = (this.getChild("n27"));
  15673. this.t0 = this.getTransition("t0");
  15674. }
  15675. }
  15676. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15677. class ui_SecretaryDisplay extends fgui.GComponent {
  15678. static createInstance() {
  15679. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15680. }
  15681. onConstruct() {
  15682. this.n2 = (this.getChild("n2"));
  15683. this.levelTxt = (this.getChild("levelTxt"));
  15684. this.n4 = (this.getChild("n4"));
  15685. this.secretary = (this.getChild("secretary"));
  15686. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15687. this.n16 = (this.getChild("n16"));
  15688. this.n37 = (this.getChild("n37"));
  15689. this.n41 = (this.getChild("n41"));
  15690. this.n14 = (this.getChild("n14"));
  15691. this.n17 = (this.getChild("n17"));
  15692. this.heightTxt = (this.getChild("heightTxt"));
  15693. this.n46 = (this.getChild("n46"));
  15694. this.n36 = (this.getChild("n36"));
  15695. this.n38 = (this.getChild("n38"));
  15696. this.foodTxt = (this.getChild("foodTxt"));
  15697. this.n47 = (this.getChild("n47"));
  15698. this.n40 = (this.getChild("n40"));
  15699. this.n42 = (this.getChild("n42"));
  15700. this.historyTxt = (this.getChild("historyTxt"));
  15701. this.n48 = (this.getChild("n48"));
  15702. this.nameImg = (this.getChild("nameImg"));
  15703. this.n12 = (this.getChild("n12"));
  15704. this.n49 = (this.getChild("n49"));
  15705. this.t0 = this.getTransition("t0");
  15706. }
  15707. }
  15708. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15709. class ui_BallRodDisplay extends fgui.GComponent {
  15710. static createInstance() {
  15711. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15712. }
  15713. onConstruct() {
  15714. this.c1 = this.getController("c1");
  15715. this.n31 = (this.getChild("n31"));
  15716. this.n6 = (this.getChild("n6"));
  15717. this.nameTxt = (this.getChild("nameTxt"));
  15718. this.rodImg = (this.getChild("rodImg"));
  15719. this.eftRod = (this.getChild("eftRod"));
  15720. this.levelNode = (this.getChild("levelNode"));
  15721. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15722. }
  15723. }
  15724. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15725. class ui_Component111_11 extends fgui.GComponent {
  15726. static createInstance() {
  15727. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15728. }
  15729. onConstruct() {
  15730. this.n68 = (this.getChild("n68"));
  15731. this.n69 = (this.getChild("n69"));
  15732. }
  15733. }
  15734. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15735. class ui_Component112 extends fgui.GComponent {
  15736. static createInstance() {
  15737. return (fgui.UIPackage.createObject("game", "Component112"));
  15738. }
  15739. onConstruct() {
  15740. this.n68 = (this.getChild("n68"));
  15741. this.n70 = (this.getChild("n70"));
  15742. this.myMask = (this.getChild("myMask"));
  15743. }
  15744. }
  15745. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15746. class ui_Component111 extends fgui.GComponent {
  15747. static createInstance() {
  15748. return (fgui.UIPackage.createObject("game", "Component111"));
  15749. }
  15750. onConstruct() {
  15751. this.n68 = (this.getChild("n68"));
  15752. this.myMask = (this.getChild("myMask"));
  15753. }
  15754. }
  15755. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15756. class ui_Component144 extends fgui.GButton {
  15757. static createInstance() {
  15758. return (fgui.UIPackage.createObject("game", "Component144"));
  15759. }
  15760. onConstruct() {
  15761. this.n8 = (this.getChild("n8"));
  15762. }
  15763. }
  15764. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15765. class ui_Sign_com2 extends fgui.GComponent {
  15766. static createInstance() {
  15767. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15768. }
  15769. onConstruct() {
  15770. this.n0 = (this.getChild("n0"));
  15771. this.n1 = (this.getChild("n1"));
  15772. this.t0 = this.getTransition("t0");
  15773. }
  15774. }
  15775. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15776. class ui_Sign_guang extends fgui.GComponent {
  15777. static createInstance() {
  15778. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15779. }
  15780. onConstruct() {
  15781. this.n1 = (this.getChild("n1"));
  15782. this.n2 = (this.getChild("n2"));
  15783. this.n3 = (this.getChild("n3"));
  15784. this.n4 = (this.getChild("n4"));
  15785. this.n5 = (this.getChild("n5"));
  15786. this.n6 = (this.getChild("n6"));
  15787. this.n8 = (this.getChild("n8"));
  15788. }
  15789. }
  15790. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15791. class ui_SignMax extends fgui.GComponent {
  15792. static createInstance() {
  15793. return (fgui.UIPackage.createObject("game", "SignMax"));
  15794. }
  15795. onConstruct() {
  15796. this.c1 = this.getController("c1");
  15797. this.n7 = (this.getChild("n7"));
  15798. this.n15 = (this.getChild("n15"));
  15799. this.n8 = (this.getChild("n8"));
  15800. this.titleTxt = (this.getChild("titleTxt"));
  15801. this.myIcon1 = (this.getChild("myIcon1"));
  15802. this.numTxt1 = (this.getChild("numTxt1"));
  15803. this.myIcon2 = (this.getChild("myIcon2"));
  15804. this.n20 = (this.getChild("n20"));
  15805. this.n17 = (this.getChild("n17"));
  15806. this.numTxt2 = (this.getChild("numTxt2"));
  15807. this.n12 = (this.getChild("n12"));
  15808. this.n13 = (this.getChild("n13"));
  15809. this.n21 = (this.getChild("n21"));
  15810. this.n14 = (this.getChild("n14"));
  15811. }
  15812. }
  15813. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15814. class ui_Sign_com2_1 extends fgui.GComponent {
  15815. static createInstance() {
  15816. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15817. }
  15818. onConstruct() {
  15819. this.n0 = (this.getChild("n0"));
  15820. this.n1 = (this.getChild("n1"));
  15821. this.t0 = this.getTransition("t0");
  15822. }
  15823. }
  15824. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15825. class ui_Sign_com5 extends fgui.GComponent {
  15826. static createInstance() {
  15827. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15828. }
  15829. onConstruct() {
  15830. this.n3 = (this.getChild("n3"));
  15831. this.n29 = (this.getChild("n29"));
  15832. this.n4 = (this.getChild("n4"));
  15833. this.day1 = (this.getChild("day1"));
  15834. this.day2 = (this.getChild("day2"));
  15835. this.day3 = (this.getChild("day3"));
  15836. this.day4 = (this.getChild("day4"));
  15837. this.day5 = (this.getChild("day5"));
  15838. this.day6 = (this.getChild("day6"));
  15839. this.day7 = (this.getChild("day7"));
  15840. this.t0 = this.getTransition("t0");
  15841. }
  15842. }
  15843. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15844. class ui_Sign_com8 extends fgui.GComponent {
  15845. static createInstance() {
  15846. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15847. }
  15848. onConstruct() {
  15849. this.n48 = (this.getChild("n48"));
  15850. this.womanTxt = (this.getChild("womanTxt"));
  15851. this.t0 = this.getTransition("t0");
  15852. }
  15853. }
  15854. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15855. class ui_Sign_com6 extends fgui.GComponent {
  15856. static createInstance() {
  15857. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15858. }
  15859. onConstruct() {
  15860. this.n2 = (this.getChild("n2"));
  15861. this.n3 = (this.getChild("n3"));
  15862. this.t0 = this.getTransition("t0");
  15863. }
  15864. }
  15865. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15866. class ui_Sign_com7 extends fgui.GComponent {
  15867. static createInstance() {
  15868. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15869. }
  15870. onConstruct() {
  15871. this.n29 = (this.getChild("n29"));
  15872. this.n2 = (this.getChild("n2"));
  15873. }
  15874. }
  15875. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15876. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15877. static createInstance() {
  15878. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15879. }
  15880. onConstruct() {
  15881. this.n5 = (this.getChild("n5"));
  15882. this.n4 = (this.getChild("n4"));
  15883. this.t0 = this.getTransition("t0");
  15884. }
  15885. }
  15886. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15887. class ui_UITurntable_com2 extends fgui.GComponent {
  15888. static createInstance() {
  15889. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15890. }
  15891. onConstruct() {
  15892. this.c1 = this.getController("c1");
  15893. this.n4 = (this.getChild("n4"));
  15894. this.n6 = (this.getChild("n6"));
  15895. this.n10 = (this.getChild("n10"));
  15896. this.n11 = (this.getChild("n11"));
  15897. this.n12 = (this.getChild("n12"));
  15898. this.n13 = (this.getChild("n13"));
  15899. this.n14 = (this.getChild("n14"));
  15900. this.n15 = (this.getChild("n15"));
  15901. this.n16 = (this.getChild("n16"));
  15902. this.n17 = (this.getChild("n17"));
  15903. this.n18 = (this.getChild("n18"));
  15904. this.n19 = (this.getChild("n19"));
  15905. this.n20 = (this.getChild("n20"));
  15906. this.n21 = (this.getChild("n21"));
  15907. this.n22 = (this.getChild("n22"));
  15908. this.n23 = (this.getChild("n23"));
  15909. this.n24 = (this.getChild("n24"));
  15910. this.n25 = (this.getChild("n25"));
  15911. this.n26 = (this.getChild("n26"));
  15912. this.n27 = (this.getChild("n27"));
  15913. this.n28 = (this.getChild("n28"));
  15914. this.n29 = (this.getChild("n29"));
  15915. this.n30 = (this.getChild("n30"));
  15916. this.n31 = (this.getChild("n31"));
  15917. this.n32 = (this.getChild("n32"));
  15918. this.n33 = (this.getChild("n33"));
  15919. }
  15920. }
  15921. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15922. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15923. static createInstance() {
  15924. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15925. }
  15926. onConstruct() {
  15927. this.n5 = (this.getChild("n5"));
  15928. this.n4 = (this.getChild("n4"));
  15929. this.t0 = this.getTransition("t0");
  15930. }
  15931. }
  15932. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15933. class ui_UITurntable_com5 extends fgui.GComponent {
  15934. static createInstance() {
  15935. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15936. }
  15937. onConstruct() {
  15938. this.flashNode = (this.getChild("flashNode"));
  15939. this.rotNode = (this.getChild("rotNode"));
  15940. this.n3 = (this.getChild("n3"));
  15941. this.n21 = (this.getChild("n21"));
  15942. this.t0 = this.getTransition("t0");
  15943. }
  15944. }
  15945. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15946. class ui_UITurntable_com7 extends fgui.GComponent {
  15947. static createInstance() {
  15948. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15949. }
  15950. onConstruct() {
  15951. this.n2 = (this.getChild("n2"));
  15952. this.n35 = (this.getChild("n35"));
  15953. this.img1 = (this.getChild("img1"));
  15954. this.img2 = (this.getChild("img2"));
  15955. this.img3 = (this.getChild("img3"));
  15956. this.img4 = (this.getChild("img4"));
  15957. this.img6 = (this.getChild("img6"));
  15958. this.img5 = (this.getChild("img5"));
  15959. this.txt1 = (this.getChild("txt1"));
  15960. this.txt2 = (this.getChild("txt2"));
  15961. this.txt3 = (this.getChild("txt3"));
  15962. this.txt4 = (this.getChild("txt4"));
  15963. this.txt5 = (this.getChild("txt5"));
  15964. this.txt6 = (this.getChild("txt6"));
  15965. }
  15966. }
  15967. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15968. class ui_UITurntable_com9 extends fgui.GComponent {
  15969. static createInstance() {
  15970. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15971. }
  15972. onConstruct() {
  15973. this.n38 = (this.getChild("n38"));
  15974. this.n39 = (this.getChild("n39"));
  15975. }
  15976. }
  15977. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15978. class ui_UITurntable_com10 extends fgui.GComponent {
  15979. static createInstance() {
  15980. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15981. }
  15982. onConstruct() {
  15983. this.n39 = (this.getChild("n39"));
  15984. this.n40 = (this.getChild("n40"));
  15985. this.t0 = this.getTransition("t0");
  15986. }
  15987. }
  15988. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15989. class ui_UITurntable_com11 extends fgui.GComponent {
  15990. static createInstance() {
  15991. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15992. }
  15993. onConstruct() {
  15994. this.n38 = (this.getChild("n38"));
  15995. this.n39 = (this.getChild("n39"));
  15996. this.n40 = (this.getChild("n40"));
  15997. this.t0 = this.getTransition("t0");
  15998. }
  15999. }
  16000. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16001. class ui_UITurntable_com12 extends fgui.GComponent {
  16002. static createInstance() {
  16003. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16004. }
  16005. onConstruct() {
  16006. this.n43 = (this.getChild("n43"));
  16007. this.barNode = (this.getChild("barNode"));
  16008. this.tipsTxt = (this.getChild("tipsTxt"));
  16009. this.n45 = (this.getChild("n45"));
  16010. this.boxBtn = (this.getChild("boxBtn"));
  16011. }
  16012. }
  16013. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16014. class ui_UITurntable_com1 extends fgui.GButton {
  16015. static createInstance() {
  16016. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16017. }
  16018. onConstruct() {
  16019. this.n41 = (this.getChild("n41"));
  16020. this.n42 = (this.getChild("n42"));
  16021. this.t0 = this.getTransition("t0");
  16022. }
  16023. }
  16024. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16025. class ui_UITurntable_com3 extends fgui.GComponent {
  16026. static createInstance() {
  16027. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16028. }
  16029. onConstruct() {
  16030. this.n48 = (this.getChild("n48"));
  16031. this.womanTxt = (this.getChild("womanTxt"));
  16032. this.t0 = this.getTransition("t0");
  16033. }
  16034. }
  16035. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16036. class ui_cancelBtn2 extends fgui.GButton {
  16037. static createInstance() {
  16038. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16039. }
  16040. onConstruct() {
  16041. this.c1 = this.getController("c1");
  16042. this.n0 = (this.getChild("n0"));
  16043. this.n1 = (this.getChild("n1"));
  16044. this.n2 = (this.getChild("n2"));
  16045. this.n3 = (this.getChild("n3"));
  16046. this.n4 = (this.getChild("n4"));
  16047. this.n5 = (this.getChild("n5"));
  16048. this.n6 = (this.getChild("n6"));
  16049. this.n7 = (this.getChild("n7"));
  16050. this.n8 = (this.getChild("n8"));
  16051. this.powerEft = (this.getChild("powerEft"));
  16052. }
  16053. }
  16054. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16055. class ui_shareBtn2 extends fgui.GButton {
  16056. static createInstance() {
  16057. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16058. }
  16059. onConstruct() {
  16060. this.c1 = this.getController("c1");
  16061. this.n2 = (this.getChild("n2"));
  16062. this.n24 = (this.getChild("n24"));
  16063. this.n1 = (this.getChild("n1"));
  16064. this.n3 = (this.getChild("n3"));
  16065. this.n23 = (this.getChild("n23"));
  16066. this.n4 = (this.getChild("n4"));
  16067. this.n5 = (this.getChild("n5"));
  16068. this.n6 = (this.getChild("n6"));
  16069. this.n20 = (this.getChild("n20"));
  16070. this.n21 = (this.getChild("n21"));
  16071. this.n22 = (this.getChild("n22"));
  16072. this.powerEft = (this.getChild("powerEft"));
  16073. }
  16074. }
  16075. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16076. class ui_UIMoney extends fgui.GComponent {
  16077. static createInstance() {
  16078. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16079. }
  16080. onConstruct() {
  16081. this.c1 = this.getController("c1");
  16082. this.n4 = (this.getChild("n4"));
  16083. this.coinImg = (this.getChild("coinImg"));
  16084. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16085. this.coinTxt = (this.getChild("coinTxt"));
  16086. this.n7 = (this.getChild("n7"));
  16087. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16088. this.diamondTxt = (this.getChild("diamondTxt"));
  16089. this.diamondImg = (this.getChild("diamondImg"));
  16090. this.n12 = (this.getChild("n12"));
  16091. this.powerImg = (this.getChild("powerImg"));
  16092. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16093. this.powerTxt = (this.getChild("powerTxt"));
  16094. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16095. }
  16096. }
  16097. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16098. class ui_backBtn extends fgui.GButton {
  16099. static createInstance() {
  16100. return (fgui.UIPackage.createObject("game", "backBtn"));
  16101. }
  16102. onConstruct() {
  16103. this.n0 = (this.getChild("n0"));
  16104. this.t0 = this.getTransition("t0");
  16105. this.t1 = this.getTransition("t1");
  16106. }
  16107. }
  16108. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16109. class ui_MoneyBtn extends fgui.GButton {
  16110. static createInstance() {
  16111. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16112. }
  16113. onConstruct() {
  16114. this.button = this.getController("button");
  16115. this.n0 = (this.getChild("n0"));
  16116. }
  16117. }
  16118. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16119. class ui_UIMoneyBtn extends fgui.GComponent {
  16120. static createInstance() {
  16121. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16122. }
  16123. onConstruct() {
  16124. this.n1 = (this.getChild("n1"));
  16125. this.closeBtn = (this.getChild("closeBtn"));
  16126. }
  16127. }
  16128. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16129. class ui_Component64 extends fgui.GComponent {
  16130. static createInstance() {
  16131. return (fgui.UIPackage.createObject("game", "Component64"));
  16132. }
  16133. onConstruct() {
  16134. this.n57 = (this.getChild("n57"));
  16135. this.n54 = (this.getChild("n54"));
  16136. this.n55 = (this.getChild("n55"));
  16137. this.n56 = (this.getChild("n56"));
  16138. this.t1 = this.getTransition("t1");
  16139. }
  16140. }
  16141. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16142. class ui_Component41_3 extends fgui.GComponent {
  16143. static createInstance() {
  16144. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16145. }
  16146. onConstruct() {
  16147. this.c1 = this.getController("c1");
  16148. this.n0 = (this.getChild("n0"));
  16149. this.n2 = (this.getChild("n2"));
  16150. this.cancelBtn = (this.getChild("cancelBtn"));
  16151. this.videoBtn = (this.getChild("videoBtn"));
  16152. this.n9 = (this.getChild("n9"));
  16153. this.n24 = (this.getChild("n24"));
  16154. this.n27 = (this.getChild("n27"));
  16155. this.titleTxt = (this.getChild("titleTxt"));
  16156. this.n28 = (this.getChild("n28"));
  16157. this.t0 = this.getTransition("t0");
  16158. }
  16159. }
  16160. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16161. class ui_dh_zs_4 extends fgui.GComponent {
  16162. static createInstance() {
  16163. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16164. }
  16165. onConstruct() {
  16166. this.n1 = (this.getChild("n1"));
  16167. this.n2 = (this.getChild("n2"));
  16168. this.n3 = (this.getChild("n3"));
  16169. this.n4 = (this.getChild("n4"));
  16170. this.n5 = (this.getChild("n5"));
  16171. this.n6 = (this.getChild("n6"));
  16172. this.n8 = (this.getChild("n8"));
  16173. this.t0 = this.getTransition("t0");
  16174. }
  16175. }
  16176. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16177. class ui_Component71_1 extends fgui.GButton {
  16178. static createInstance() {
  16179. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16180. }
  16181. onConstruct() {
  16182. this.n17 = (this.getChild("n17"));
  16183. this.t0 = this.getTransition("t0");
  16184. }
  16185. }
  16186. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16187. class ui_Component83 extends fgui.GComponent {
  16188. static createInstance() {
  16189. return (fgui.UIPackage.createObject("game", "Component83"));
  16190. }
  16191. onConstruct() {
  16192. this.c1 = this.getController("c1");
  16193. this.n17 = (this.getChild("n17"));
  16194. this.n19 = (this.getChild("n19"));
  16195. this.n20 = (this.getChild("n20"));
  16196. }
  16197. }
  16198. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16199. class ui_Component84 extends fgui.GComponent {
  16200. static createInstance() {
  16201. return (fgui.UIPackage.createObject("game", "Component84"));
  16202. }
  16203. onConstruct() {
  16204. this.c1 = this.getController("c1");
  16205. this.n4 = (this.getChild("n4"));
  16206. this.n22 = (this.getChild("n22"));
  16207. this.n23 = (this.getChild("n23"));
  16208. this.numTxt = (this.getChild("numTxt"));
  16209. this.n25 = (this.getChild("n25"));
  16210. this.n26 = (this.getChild("n26"));
  16211. }
  16212. }
  16213. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16214. class ui_Component84_1 extends fgui.GComponent {
  16215. static createInstance() {
  16216. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16217. }
  16218. onConstruct() {
  16219. this.c1 = this.getController("c1");
  16220. this.n4 = (this.getChild("n4"));
  16221. this.n22 = (this.getChild("n22"));
  16222. this.n23 = (this.getChild("n23"));
  16223. this.numTxt = (this.getChild("numTxt"));
  16224. this.n25 = (this.getChild("n25"));
  16225. this.n26 = (this.getChild("n26"));
  16226. }
  16227. }
  16228. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16229. class ui_Component85 extends fgui.GComponent {
  16230. static createInstance() {
  16231. return (fgui.UIPackage.createObject("game", "Component85"));
  16232. }
  16233. onConstruct() {
  16234. this.n1 = (this.getChild("n1"));
  16235. this.n6 = (this.getChild("n6"));
  16236. this.n2 = (this.getChild("n2"));
  16237. this.n3 = (this.getChild("n3"));
  16238. this.levelTxt = (this.getChild("levelTxt"));
  16239. this.n10 = (this.getChild("n10"));
  16240. this.n11 = (this.getChild("n11"));
  16241. this.n12 = (this.getChild("n12"));
  16242. this.n13 = (this.getChild("n13"));
  16243. this.n14 = (this.getChild("n14"));
  16244. this.modeNode = (this.getChild("modeNode"));
  16245. this.n18 = (this.getChild("n18"));
  16246. this.conditionTxt = (this.getChild("conditionTxt"));
  16247. this.diamondNode = (this.getChild("diamondNode"));
  16248. this.coinNode = (this.getChild("coinNode"));
  16249. this.startBtn = (this.getChild("startBtn"));
  16250. this.n28 = (this.getChild("n28"));
  16251. this.displayRoot = (this.getChild("displayRoot"));
  16252. this.t0 = this.getTransition("t0");
  16253. }
  16254. }
  16255. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16256. class ui_Component86 extends fgui.GButton {
  16257. static createInstance() {
  16258. return (fgui.UIPackage.createObject("game", "Component86"));
  16259. }
  16260. onConstruct() {
  16261. this.n15 = (this.getChild("n15"));
  16262. this.t0 = this.getTransition("t0");
  16263. }
  16264. }
  16265. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16266. class ui_Component87 extends fgui.GComponent {
  16267. static createInstance() {
  16268. return (fgui.UIPackage.createObject("game", "Component87"));
  16269. }
  16270. onConstruct() {
  16271. this.n66 = (this.getChild("n66"));
  16272. this.myProgress = (this.getChild("myProgress"));
  16273. this.starAni = (this.getChild("starAni"));
  16274. this.hpTxt = (this.getChild("hpTxt"));
  16275. this.n74 = (this.getChild("n74"));
  16276. this.n73 = (this.getChild("n73"));
  16277. this.ballTxt = (this.getChild("ballTxt"));
  16278. this.n76 = (this.getChild("n76"));
  16279. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16280. this.levelTxt = (this.getChild("levelTxt"));
  16281. this.star1 = (this.getChild("star1"));
  16282. this.star2 = (this.getChild("star2"));
  16283. this.star3 = (this.getChild("star3"));
  16284. }
  16285. }
  16286. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16287. class ui_Component88 extends fgui.GProgressBar {
  16288. static createInstance() {
  16289. return (fgui.UIPackage.createObject("game", "Component88"));
  16290. }
  16291. onConstruct() {
  16292. this.n68 = (this.getChild("n68"));
  16293. this.bar = (this.getChild("bar"));
  16294. }
  16295. }
  16296. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16297. class ui_Component89 extends fgui.GComponent {
  16298. static createInstance() {
  16299. return (fgui.UIPackage.createObject("game", "Component89"));
  16300. }
  16301. onConstruct() {
  16302. this.c1 = this.getController("c1");
  16303. this.n71 = (this.getChild("n71"));
  16304. this.n72 = (this.getChild("n72"));
  16305. }
  16306. }
  16307. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16308. class ui_Component90 extends fgui.GComponent {
  16309. static createInstance() {
  16310. return (fgui.UIPackage.createObject("game", "Component90"));
  16311. }
  16312. onConstruct() {
  16313. this.c1 = this.getController("c1");
  16314. this.n64 = (this.getChild("n64"));
  16315. this.n65 = (this.getChild("n65"));
  16316. this.n66 = (this.getChild("n66"));
  16317. this.t0 = this.getTransition("t0");
  16318. }
  16319. }
  16320. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16321. class ui_Component127 extends fgui.GButton {
  16322. static createInstance() {
  16323. return (fgui.UIPackage.createObject("game", "Component127"));
  16324. }
  16325. onConstruct() {
  16326. this.n5 = (this.getChild("n5"));
  16327. }
  16328. }
  16329. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16330. class gameBinder {
  16331. static bindAll() {
  16332. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16333. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16334. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16335. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16336. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16337. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16338. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16339. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16340. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16341. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16342. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16343. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16344. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16345. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16346. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16347. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16348. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16349. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16350. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16351. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16352. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16353. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16354. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16355. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16356. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16357. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16358. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16359. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16360. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16361. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16362. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16363. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16364. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16365. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16366. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16367. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16368. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16369. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16370. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16371. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16372. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16373. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16374. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16375. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16376. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16377. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16378. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16379. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16380. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16381. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16382. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16383. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16384. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16385. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16386. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16387. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16388. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16389. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16390. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16391. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16392. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16393. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16394. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16395. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16396. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16397. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16398. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16399. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16400. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16401. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16402. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16403. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16404. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16405. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16406. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16407. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16408. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16409. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16410. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16411. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16412. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16413. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16414. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16415. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16416. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16417. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16418. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16419. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16420. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16421. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16422. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16423. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16424. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16425. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16426. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16427. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16428. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16429. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16430. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16431. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16432. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16433. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16434. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16435. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16436. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16437. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16438. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16439. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16440. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16441. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16442. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16443. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16444. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16445. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16446. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16447. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16448. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16449. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16450. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16451. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16452. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16453. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16454. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16455. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16456. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16457. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16458. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16459. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16460. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16461. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16462. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16463. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16464. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16465. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16466. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16467. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16468. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16469. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16470. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16471. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16472. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16473. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16474. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16475. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16476. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16477. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16478. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16479. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16480. fgui.UIObjectFactory.setExtension(ui_Component_fuli1.URL, ui_Component_fuli1);
  16481. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16482. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16483. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16484. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16485. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16486. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16487. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16488. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16489. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16490. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16491. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16492. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16493. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16494. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16495. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16496. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16497. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16498. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16499. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16500. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16501. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16502. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16503. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16504. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16505. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16506. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16507. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16508. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16509. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16510. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16511. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16512. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16513. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16514. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16515. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16516. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16517. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16518. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16519. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16520. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16521. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16522. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16523. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16524. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16525. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16526. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16527. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16528. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16529. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16530. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  16531. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16532. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16533. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16534. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16535. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16536. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16537. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16538. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16539. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16540. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16541. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16542. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16543. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16544. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16545. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16546. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16547. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16548. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16549. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16550. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16551. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16552. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16553. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16554. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16555. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16556. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16557. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16558. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16559. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16560. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16561. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16562. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16563. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16564. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16565. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16566. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16567. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16568. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16569. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16570. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16571. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16572. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16573. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16574. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16575. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16576. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16577. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16578. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16579. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16580. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16581. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16582. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16583. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16584. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16585. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16586. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16587. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16588. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16589. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16590. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16591. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16592. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16593. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16594. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16595. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16596. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16597. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16598. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16599. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16600. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16601. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16602. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16603. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16604. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16605. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16606. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16607. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16608. }
  16609. }
  16610. class ui_btn6 extends fgui.GButton {
  16611. static createInstance() {
  16612. return (fgui.UIPackage.createObject("loading", "btn6"));
  16613. }
  16614. onConstruct() {
  16615. this.n6 = (this.getChild("n6"));
  16616. this.n1 = (this.getChild("n1"));
  16617. }
  16618. }
  16619. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16620. class ui_xyItem extends fgui.GComponent {
  16621. static createInstance() {
  16622. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16623. }
  16624. onConstruct() {
  16625. this.xyItem = (this.getChild("xyItem"));
  16626. }
  16627. }
  16628. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16629. class ui_loadinfo extends fgui.GProgressBar {
  16630. static createInstance() {
  16631. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16632. }
  16633. onConstruct() {
  16634. this.bg = (this.getChild("bg"));
  16635. this.bar = (this.getChild("bar"));
  16636. this.title = (this.getChild("title"));
  16637. this.ani = (this.getChild("ani"));
  16638. }
  16639. }
  16640. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16641. class ui_xyNode extends fgui.GComponent {
  16642. static createInstance() {
  16643. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16644. }
  16645. onConstruct() {
  16646. this.n0 = (this.getChild("n0"));
  16647. this.btnYes = (this.getChild("btnYes"));
  16648. this.btnNo = (this.getChild("btnNo"));
  16649. this.btnKnown = (this.getChild("btnKnown"));
  16650. this.btnSure = (this.getChild("btnSure"));
  16651. this.txtWelcom = (this.getChild("txtWelcom"));
  16652. this.txtXy = (this.getChild("txtXy"));
  16653. this.n75 = (this.getChild("n75"));
  16654. this.btnXy1 = (this.getChild("btnXy1"));
  16655. this.btnXy3 = (this.getChild("btnXy3"));
  16656. this.btnXy2 = (this.getChild("btnXy2"));
  16657. this.n74 = (this.getChild("n74"));
  16658. this.xy1 = (this.getChild("xy1"));
  16659. this.txtTitle = (this.getChild("txtTitle"));
  16660. this.btnBack = (this.getChild("btnBack"));
  16661. this.xyList = (this.getChild("xyList"));
  16662. this.xy2 = (this.getChild("xy2"));
  16663. this.xyNode = (this.getChild("xyNode"));
  16664. }
  16665. }
  16666. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16667. class ui_ageNode extends fgui.GComponent {
  16668. static createInstance() {
  16669. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16670. }
  16671. onConstruct() {
  16672. this.n3 = (this.getChild("n3"));
  16673. this.n7 = (this.getChild("n7"));
  16674. this.n4 = (this.getChild("n4"));
  16675. this.btnAge = (this.getChild("btnAge"));
  16676. this.ageNode = (this.getChild("ageNode"));
  16677. }
  16678. }
  16679. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16680. class ui_rnNode extends fgui.GComponent {
  16681. static createInstance() {
  16682. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16683. }
  16684. onConstruct() {
  16685. this.n28 = (this.getChild("n28"));
  16686. this.n30 = (this.getChild("n30"));
  16687. this.n33 = (this.getChild("n33"));
  16688. this.rn1 = (this.getChild("rn1"));
  16689. this.n40 = (this.getChild("n40"));
  16690. this.n41 = (this.getChild("n41"));
  16691. this.rn3 = (this.getChild("rn3"));
  16692. this.n37 = (this.getChild("n37"));
  16693. this.n39 = (this.getChild("n39"));
  16694. this.rn2 = (this.getChild("rn2"));
  16695. this.n47 = (this.getChild("n47"));
  16696. this.n49 = (this.getChild("n49"));
  16697. this.n44 = (this.getChild("n44"));
  16698. this.inputCode = (this.getChild("inputCode"));
  16699. this.inputName = (this.getChild("inputName"));
  16700. this.n48 = (this.getChild("n48"));
  16701. this.n50 = (this.getChild("n50"));
  16702. this.rn4 = (this.getChild("rn4"));
  16703. this.btnCheck = (this.getChild("btnCheck"));
  16704. this.btnExit = (this.getChild("btnExit"));
  16705. this.btnDone = (this.getChild("btnDone"));
  16706. this.rnNode = (this.getChild("rnNode"));
  16707. }
  16708. }
  16709. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16710. class ui_tipNode extends fgui.GComponent {
  16711. static createInstance() {
  16712. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16713. }
  16714. onConstruct() {
  16715. this.bg = (this.getChild("bg"));
  16716. this.n55 = (this.getChild("n55"));
  16717. this.n56 = (this.getChild("n56"));
  16718. this.tipNode = (this.getChild("tipNode"));
  16719. }
  16720. }
  16721. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16722. class ui_fcmNode extends fgui.GComponent {
  16723. static createInstance() {
  16724. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16725. }
  16726. onConstruct() {
  16727. this.n63 = (this.getChild("n63"));
  16728. this.n62 = (this.getChild("n62"));
  16729. this.btnRn = (this.getChild("btnRn"));
  16730. this.n61 = (this.getChild("n61"));
  16731. this.n58 = (this.getChild("n58"));
  16732. this.fcmNode = (this.getChild("fcmNode"));
  16733. }
  16734. }
  16735. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16736. class ui_msgNode extends fgui.GComponent {
  16737. static createInstance() {
  16738. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16739. }
  16740. onConstruct() {
  16741. this.n69 = (this.getChild("n69"));
  16742. this.txtMsg = (this.getChild("txtMsg"));
  16743. this.msgNode = (this.getChild("msgNode"));
  16744. }
  16745. }
  16746. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16747. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16748. static createInstance() {
  16749. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16750. }
  16751. onConstruct() {
  16752. this.n1 = (this.getChild("n1"));
  16753. this.n13 = (this.getChild("n13"));
  16754. this.n14 = (this.getChild("n14"));
  16755. this.n15 = (this.getChild("n15"));
  16756. this.n3 = (this.getChild("n3"));
  16757. this.n4 = (this.getChild("n4"));
  16758. this.n5 = (this.getChild("n5"));
  16759. this.n6 = (this.getChild("n6"));
  16760. this.n7 = (this.getChild("n7"));
  16761. this.n8 = (this.getChild("n8"));
  16762. this.n9 = (this.getChild("n9"));
  16763. this.n10 = (this.getChild("n10"));
  16764. this.n12 = (this.getChild("n12"));
  16765. this.n11 = (this.getChild("n11"));
  16766. this.n16 = (this.getChild("n16"));
  16767. this.n17 = (this.getChild("n17"));
  16768. this.n18 = (this.getChild("n18"));
  16769. this.n20 = (this.getChild("n20"));
  16770. this.n21 = (this.getChild("n21"));
  16771. this.t0 = this.getTransition("t0");
  16772. }
  16773. }
  16774. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16775. class ui_btn5 extends fgui.GButton {
  16776. static createInstance() {
  16777. return (fgui.UIPackage.createObject("loading", "btn5"));
  16778. }
  16779. onConstruct() {
  16780. this.n9 = (this.getChild("n9"));
  16781. this.n1 = (this.getChild("n1"));
  16782. }
  16783. }
  16784. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16785. class ui_UILoading extends fgui.GComponent {
  16786. static createInstance() {
  16787. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16788. }
  16789. onConstruct() {
  16790. this.n12 = (this.getChild("n12"));
  16791. this.loadinfo = (this.getChild("loadinfo"));
  16792. this.n13 = (this.getChild("n13"));
  16793. this.txtLoad = (this.getChild("txtLoad"));
  16794. this.n18 = (this.getChild("n18"));
  16795. }
  16796. }
  16797. ui_UILoading.URL = "ui://37nctnhwphc33";
  16798. class ui_AgeItem extends fgui.GComponent {
  16799. static createInstance() {
  16800. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16801. }
  16802. onConstruct() {
  16803. this.txtAge = (this.getChild("txtAge"));
  16804. }
  16805. }
  16806. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16807. class ui_btn1 extends fgui.GButton {
  16808. static createInstance() {
  16809. return (fgui.UIPackage.createObject("loading", "btn1"));
  16810. }
  16811. onConstruct() {
  16812. this.n6 = (this.getChild("n6"));
  16813. this.n1 = (this.getChild("n1"));
  16814. }
  16815. }
  16816. ui_btn1.URL = "ui://37nctnhwxe622p";
  16817. class ui_btn3 extends fgui.GButton {
  16818. static createInstance() {
  16819. return (fgui.UIPackage.createObject("loading", "btn3"));
  16820. }
  16821. onConstruct() {
  16822. this.n9 = (this.getChild("n9"));
  16823. this.n1 = (this.getChild("n1"));
  16824. }
  16825. }
  16826. ui_btn3.URL = "ui://37nctnhwxe622s";
  16827. class ui_btn2 extends fgui.GButton {
  16828. static createInstance() {
  16829. return (fgui.UIPackage.createObject("loading", "btn2"));
  16830. }
  16831. onConstruct() {
  16832. this.n6 = (this.getChild("n6"));
  16833. this.n1 = (this.getChild("n1"));
  16834. }
  16835. }
  16836. ui_btn2.URL = "ui://37nctnhwxe622t";
  16837. class ui_btnBack extends fgui.GButton {
  16838. static createInstance() {
  16839. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16840. }
  16841. onConstruct() {
  16842. this.n6 = (this.getChild("n6"));
  16843. this.n7 = (this.getChild("n7"));
  16844. }
  16845. }
  16846. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16847. class ui_btnXy1 extends fgui.GButton {
  16848. static createInstance() {
  16849. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16850. }
  16851. onConstruct() {
  16852. this.n1 = (this.getChild("n1"));
  16853. }
  16854. }
  16855. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16856. class ui_btnXy2 extends fgui.GButton {
  16857. static createInstance() {
  16858. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16859. }
  16860. onConstruct() {
  16861. this.n1 = (this.getChild("n1"));
  16862. }
  16863. }
  16864. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16865. class ui_btnXy3 extends fgui.GButton {
  16866. static createInstance() {
  16867. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16868. }
  16869. onConstruct() {
  16870. this.n1 = (this.getChild("n1"));
  16871. }
  16872. }
  16873. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16874. class ui_btn4 extends fgui.GButton {
  16875. static createInstance() {
  16876. return (fgui.UIPackage.createObject("loading", "btn4"));
  16877. }
  16878. onConstruct() {
  16879. this.n9 = (this.getChild("n9"));
  16880. this.n1 = (this.getChild("n1"));
  16881. }
  16882. }
  16883. ui_btn4.URL = "ui://37nctnhwxe622z";
  16884. class loadingBinder {
  16885. static bindAll() {
  16886. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16887. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16888. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16889. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16890. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16891. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16892. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16893. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16894. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16895. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16896. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16897. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16898. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16899. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16900. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16901. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16902. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16903. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16904. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16905. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16906. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16907. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16908. }
  16909. }
  16910. class UIMgr {
  16911. constructor() {
  16912. this._stage = null;
  16913. this._uiList = [];
  16914. this._showList = [];
  16915. this._bindPkgList = [];
  16916. this.uiIndex = 0;
  16917. }
  16918. static get inst() {
  16919. if (UIMgr._inst == null) {
  16920. UIMgr._inst = new UIMgr();
  16921. }
  16922. return UIMgr._inst;
  16923. }
  16924. setStage(s) {
  16925. if (this._stage) {
  16926. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16927. return;
  16928. }
  16929. this._stage = s;
  16930. }
  16931. clearTempData() {
  16932. console.log('zh:clearTempData start');
  16933. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16934. console.log('zh:clearTempData end');
  16935. }
  16936. init() {
  16937. this.setStage(Laya.stage);
  16938. fairygui.UIConfig.defaultFont = "微软雅黑";
  16939. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16940. fairygui.UIConfig.packageFileExtension = "obj";
  16941. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16942. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16943. fairygui.GRoot.inst.width = Laya.stage.width;
  16944. fairygui.GRoot.inst.height = Laya.stage.height;
  16945. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16946. }
  16947. addAllUpdate() {
  16948. this.uiIndex = 0;
  16949. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16950. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16951. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16952. }
  16953. }
  16954. }
  16955. bindFUI(pkgname) {
  16956. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16957. return;
  16958. }
  16959. switch (pkgname) {
  16960. case fguiRes.loading:
  16961. fairygui.UIPackage.addPackage(pkgname);
  16962. loadingBinder.bindAll();
  16963. this._bindPkgList.push(pkgname);
  16964. break;
  16965. case fguiRes.game:
  16966. fairygui.UIPackage.addPackage(pkgname);
  16967. gameBinder.bindAll();
  16968. this._bindPkgList.push(pkgname);
  16969. break;
  16970. default:
  16971. break;
  16972. }
  16973. }
  16974. Show(cls, ...param) {
  16975. let nameStr = cls.uiName;
  16976. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16977. let temp = this._uiList[i];
  16978. let str = temp.className;
  16979. if (str == nameStr) {
  16980. if (temp.isMuti) {
  16981. if (temp.isHide) {
  16982. temp.show(...param);
  16983. this._uiList.splice(i, 1);
  16984. this._uiList.push(temp);
  16985. return temp;
  16986. }
  16987. }
  16988. else {
  16989. temp.show(...param);
  16990. this._uiList.splice(i, 1);
  16991. this._uiList.push(temp);
  16992. return temp;
  16993. }
  16994. }
  16995. }
  16996. let ui = new cls();
  16997. ui.className = nameStr;
  16998. this._showUI(ui, param);
  16999. return ui;
  17000. }
  17001. destroyUI(ui) {
  17002. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17003. let temp = this._uiList[i].className;
  17004. if (temp == ui.className) {
  17005. this._uiList.splice(i, 1);
  17006. break;
  17007. }
  17008. }
  17009. this.checkUIState();
  17010. }
  17011. _showUI(ui, param) {
  17012. this._uiList.push(ui);
  17013. ui.show(...param);
  17014. }
  17015. Hide(uiClass) {
  17016. let ui = this.getUI(uiClass);
  17017. if (ui && !ui.isHide) {
  17018. ui.hide();
  17019. }
  17020. }
  17021. getUI(ui) {
  17022. let nameStr = ui.uiName;
  17023. for (let index = 0; index < this._uiList.length; index++) {
  17024. let temp = this._uiList[index];
  17025. if (temp.className == nameStr) {
  17026. return temp;
  17027. }
  17028. }
  17029. return null;
  17030. }
  17031. isShow(cls) {
  17032. for (var i of this._uiList) {
  17033. if (i instanceof cls) {
  17034. return i.isShowing;
  17035. }
  17036. }
  17037. return false;
  17038. }
  17039. showUINum() {
  17040. let num = 0;
  17041. for (var i of this._uiList) {
  17042. if (i.isShowing) {
  17043. num++;
  17044. }
  17045. }
  17046. return num;
  17047. }
  17048. checkUIState() {
  17049. Laya.timer.clear(this, this._uiCheck);
  17050. Laya.timer.once(400, this, this._uiCheck);
  17051. }
  17052. _uiCheck() {
  17053. let showList = [];
  17054. for (var i of this._uiList) {
  17055. if (!i.isHide) {
  17056. showList.push(i);
  17057. }
  17058. }
  17059. for (let index = 0; index < showList.length; index++) {
  17060. if (index == showList.length - 1) {
  17061. showList[index].checkActive(true);
  17062. }
  17063. else {
  17064. showList[index].checkActive(false);
  17065. }
  17066. }
  17067. }
  17068. showTip(msg, time = 600, size = 30) {
  17069. }
  17070. }
  17071. class UIShowList {
  17072. }
  17073. class SoundMgr {
  17074. constructor() {
  17075. this.soundMax = 4;
  17076. this.isLoad = false;
  17077. this.soundMap = {};
  17078. this.isSound = true;
  17079. this.openShake = true;
  17080. SoundMgr._instance = this;
  17081. }
  17082. static getInstance() {
  17083. if (!this._instance) {
  17084. this._instance = new SoundMgr();
  17085. }
  17086. return this._instance;
  17087. }
  17088. init() {
  17089. console.log('zh:sm init 1');
  17090. Laya.SoundManager.autoReleaseSound = true;
  17091. Laya.SoundManager.autoStopMusic = true;
  17092. Laya.SoundManager.musicVolume = 0.3;
  17093. Laya.SoundManager.soundVolume = 0.5;
  17094. this.musicPlayed = false;
  17095. this.audioUrl = "asset/sound/ogg/";
  17096. console.log('zh:sm init 2');
  17097. console.log('zh:dev type ');
  17098. if (Laya.Browser.onAndroid) {
  17099. console.log('zh:dev type android');
  17100. this.audioUrl = "asset/sound/ogg/";
  17101. this.isLoad = true;
  17102. }
  17103. else {
  17104. console.log('zh:dev type not android');
  17105. this.audioUrl = "asset/sound/mp3/";
  17106. this.isLoad = true;
  17107. }
  17108. }
  17109. onSetting(isS) {
  17110. this.isSound = isS;
  17111. this.mute(!this.isSound);
  17112. }
  17113. clearCount() {
  17114. for (var key in this.soundMap) {
  17115. delete this.soundMap[key];
  17116. }
  17117. }
  17118. playMusic(path, loop = 0) {
  17119. console.log('zh:playMusic 1 PATH=' + path);
  17120. this.musicPath = path;
  17121. if (!this.isLoad) {
  17122. return;
  17123. }
  17124. if (!path || path == "") {
  17125. return;
  17126. }
  17127. if (!this.isSound) {
  17128. return;
  17129. }
  17130. this.musicPlayed = true;
  17131. let url = this.getUrl(path);
  17132. if (!Laya.Browser.onAndroid) {
  17133. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17134. this.play(url, loop);
  17135. }));
  17136. }
  17137. else {
  17138. this.play(url, loop);
  17139. }
  17140. }
  17141. play(url, loop) {
  17142. Laya.SoundManager.playMusic(url, loop);
  17143. }
  17144. getUrl(path) {
  17145. let url = this.audioUrl + path;
  17146. if (Laya.Browser.onAndroid) {
  17147. url += ".ogg";
  17148. }
  17149. else {
  17150. url += ".mp3";
  17151. }
  17152. return url;
  17153. }
  17154. pauseMusic(pause) {
  17155. if (pause) {
  17156. this.mute(true);
  17157. }
  17158. else if (this.isSound)
  17159. this.mute(false);
  17160. }
  17161. stopMusic() {
  17162. Laya.SoundManager.stopMusic();
  17163. if (Moyu.isNeedPlatAudio) {
  17164. Moyu.stopMusic();
  17165. }
  17166. }
  17167. mute(mute) {
  17168. if (Moyu.isNeedPlatAudio) {
  17169. Moyu.pauseMusic(mute);
  17170. }
  17171. else {
  17172. Laya.SoundManager.musicMuted = mute;
  17173. if (!mute && !this.musicPlayed && this.musicPath) {
  17174. this.playMusic(this.musicPath);
  17175. }
  17176. }
  17177. }
  17178. stopSound(path) {
  17179. let url = this.getUrl(path);
  17180. Laya.SoundManager.stopSound(url);
  17181. }
  17182. playSound(path, loop = 1, soundMax = this.soundMax) {
  17183. if (!this.isLoad)
  17184. return;
  17185. if (!this.isSound)
  17186. return;
  17187. if (!path || path == "")
  17188. return;
  17189. let url = this.getUrl(path);
  17190. if (Moyu.isNeedPlatAudio) {
  17191. Moyu.playSound(path, loop == 0);
  17192. }
  17193. else {
  17194. let count = 1;
  17195. if (this.soundMap[path])
  17196. count = this.soundMap[path] + 1;
  17197. if (count > soundMax)
  17198. return;
  17199. this.soundMap[path] = count;
  17200. Laya.SoundManager.playSound(url, loop);
  17201. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17202. }
  17203. }
  17204. removePath(path) {
  17205. if (this.soundMap[path]) {
  17206. let count = this.soundMap[path];
  17207. count--;
  17208. if (count < 1)
  17209. delete this.soundMap[path];
  17210. else
  17211. this.soundMap[path] = count;
  17212. }
  17213. }
  17214. playBtnSound() {
  17215. this.playSound("btn");
  17216. }
  17217. playGetSound() {
  17218. }
  17219. playCloseUISound() {
  17220. }
  17221. }
  17222. SoundMgr._instance = null;
  17223. var Handler$1 = Laya.Handler;
  17224. var EResType;
  17225. (function (EResType) {
  17226. EResType[EResType["none"] = 0] = "none";
  17227. EResType[EResType["nromal"] = 1] = "nromal";
  17228. EResType[EResType["td"] = 2] = "td";
  17229. EResType[EResType["sk"] = 3] = "sk";
  17230. })(EResType || (EResType = {}));
  17231. class CResLoader {
  17232. constructor(doneCall, proCall) {
  17233. this.completrCall = doneCall;
  17234. this.progressCall = proCall;
  17235. this.progressHander = new Handler$1(this, this.onProgress);
  17236. this.tdResMap = {};
  17237. }
  17238. load(resList) {
  17239. this.resCount = 0;
  17240. this.loadCount = 0;
  17241. for (let i = 0; i < resList.length; i++) {
  17242. let path = resList[i];
  17243. if (!path)
  17244. continue;
  17245. this.resCount++;
  17246. let type = this.getResType(path);
  17247. if (type == EResType.nromal)
  17248. this.loadNromal(path);
  17249. else if (type == EResType.td)
  17250. this.loadTd(path);
  17251. }
  17252. }
  17253. getRes(path) {
  17254. let type = this.getResType(path);
  17255. if (type == EResType.nromal)
  17256. return Laya.loader.getRes(path);
  17257. else if (type == EResType.td) {
  17258. let res = this.tdResMap[path];
  17259. if (res)
  17260. return res.clone();
  17261. return null;
  17262. }
  17263. }
  17264. destroy() {
  17265. this.progressHander.clear();
  17266. this.progressHander = null;
  17267. }
  17268. clearRes(path) {
  17269. let type = this.getResType(path);
  17270. if (type == EResType.nromal)
  17271. Laya.loader.clearRes(path);
  17272. else if (type == EResType.td) {
  17273. let obj = this.tdResMap[path];
  17274. if (obj)
  17275. obj.destroy();
  17276. delete this.tdResMap[path];
  17277. }
  17278. }
  17279. getResType(path) {
  17280. let exs = this.getExtension(path);
  17281. if (exs == "sk")
  17282. return EResType.sk;
  17283. if (exs == "ls" || exs == "lh" || exs == "lm")
  17284. return EResType.td;
  17285. else
  17286. return EResType.nromal;
  17287. }
  17288. getExtension(res) {
  17289. var index = res.lastIndexOf(".");
  17290. return res.substr(index + 1);
  17291. }
  17292. loadNromal(path) {
  17293. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17294. if (res) {
  17295. this.onLoad();
  17296. }
  17297. else
  17298. console.log("load res fail:" + path);
  17299. }), this.progressHander);
  17300. }
  17301. loadSk() {
  17302. }
  17303. loadTd(path) {
  17304. if (this.tdResMap[path]) {
  17305. this.onLoad();
  17306. return;
  17307. }
  17308. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17309. if (res) {
  17310. this.tdResMap[path] = res;
  17311. this.onLoad();
  17312. }
  17313. else
  17314. console.log("load res fail:" + path);
  17315. }));
  17316. }
  17317. onLoad() {
  17318. this.loadCount++;
  17319. this.onProgress(1);
  17320. if (this.loadCount >= this.resCount) {
  17321. this.completrCall.run();
  17322. }
  17323. }
  17324. onProgress(pro) {
  17325. let progress = (this.loadCount + pro) / this.resCount;
  17326. this.progressCall.runWith(progress);
  17327. }
  17328. }
  17329. var Handler$2 = Laya.Handler;
  17330. class ResInfo {
  17331. constructor() {
  17332. this.index = 0;
  17333. }
  17334. }
  17335. class ResMgr {
  17336. constructor() {
  17337. this.resList = [];
  17338. this.doneList = [];
  17339. this.resMap = {};
  17340. this.currentLoad = null;
  17341. this.completeHandler = new Handler$2(this, this.onComplete);
  17342. this.progressHandler = new Handler$2(this, this.onProgress);
  17343. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17344. }
  17345. static getInstance() {
  17346. if (ResMgr._instance == null) {
  17347. ResMgr._instance = new ResMgr();
  17348. }
  17349. return ResMgr._instance;
  17350. }
  17351. loadList(list, completeHandler, progressHandler) {
  17352. if (list.length < 1) {
  17353. completeHandler.run();
  17354. return;
  17355. }
  17356. let info = this.getResInfo();
  17357. info.resList = list;
  17358. info.completeHandler = completeHandler;
  17359. info.progressHandler = progressHandler;
  17360. this.resList.push(info);
  17361. this.startLoad();
  17362. }
  17363. loadFguiRes(list, completeHandler, progressHandler) {
  17364. Laya.loader.load(list, completeHandler, progressHandler);
  17365. }
  17366. loadAny(list, completeHandler, progressHandler) {
  17367. Laya.loader.load(list, completeHandler, progressHandler);
  17368. }
  17369. load(path, completeHandler, progressHandler) {
  17370. let count = this.resMap[path];
  17371. if (count && count > 0) {
  17372. if (completeHandler)
  17373. completeHandler.run();
  17374. }
  17375. else
  17376. this.loadList([path], completeHandler, progressHandler);
  17377. }
  17378. getRes(path) {
  17379. let res = this.resMap[path];
  17380. if (!res)
  17381. this.showLog("资源不存在:" + path);
  17382. else
  17383. return this.loader.getRes(path);
  17384. }
  17385. clearList(list, force = false) {
  17386. if (!list || list.length < 1)
  17387. return;
  17388. let cr = () => {
  17389. for (const k in list) {
  17390. let v = list[k];
  17391. if (!v)
  17392. continue;
  17393. if (force) {
  17394. this.loader.clearRes(v);
  17395. delete this.resMap[v];
  17396. }
  17397. else {
  17398. let count = this.resMap[v];
  17399. if (count && count > 1) {
  17400. count--;
  17401. this.resMap[v] = count;
  17402. }
  17403. else {
  17404. this.loader.clearRes(v);
  17405. delete this.resMap[v];
  17406. }
  17407. }
  17408. }
  17409. if (!window.hasOwnProperty("ks"))
  17410. Laya.Resource.destroyUnusedResources();
  17411. };
  17412. Laya.timer.clearAll(this);
  17413. Laya.timer.once(2000, this, cr);
  17414. }
  17415. clear3D() {
  17416. for (const k in this.loader.tdResMap) {
  17417. this.loader.clearRes(k);
  17418. if (this.resMap[k])
  17419. delete this.resMap[k];
  17420. }
  17421. if (!window.hasOwnProperty("ks"))
  17422. Laya.Resource.destroyUnusedResources();
  17423. }
  17424. clear(path, force = false) {
  17425. this.clearList([path], force);
  17426. }
  17427. getResInfo() {
  17428. if (this.doneList.length > 0)
  17429. return this.doneList.pop();
  17430. else
  17431. return new ResInfo();
  17432. }
  17433. startLoad() {
  17434. if (this.currentLoad)
  17435. return;
  17436. this.currentLoad = this.resList.pop();
  17437. if (this.currentLoad) {
  17438. this.loader.load(this.currentLoad.resList);
  17439. }
  17440. }
  17441. onComplete() {
  17442. if (!this.currentLoad)
  17443. return;
  17444. for (const k in this.currentLoad.resList) {
  17445. let v = this.currentLoad.resList[k];
  17446. let count = this.resMap[v];
  17447. if (count)
  17448. count++;
  17449. else
  17450. count = 1;
  17451. this.resMap[v] = count;
  17452. }
  17453. if (this.currentLoad.completeHandler)
  17454. this.currentLoad.completeHandler.run();
  17455. this.doneList.push(this.currentLoad);
  17456. this.currentLoad = null;
  17457. this.startLoad();
  17458. }
  17459. onProgress(pro) {
  17460. if (!this.currentLoad)
  17461. return;
  17462. if (this.currentLoad.progressHandler)
  17463. this.currentLoad.progressHandler.runWith(pro);
  17464. }
  17465. showLog(str, ...args) {
  17466. console.log("[ResLoader] " + str);
  17467. }
  17468. }
  17469. ResMgr._instance = null;
  17470. class EventMgr extends Laya.EventDispatcher {
  17471. }
  17472. let eventMgr = new EventMgr();
  17473. /*! *****************************************************************************
  17474. Copyright (c) Microsoft Corporation. All rights reserved.
  17475. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17476. this file except in compliance with the License. You may obtain a copy of the
  17477. License at http://www.apache.org/licenses/LICENSE-2.0
  17478. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17479. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17480. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17481. MERCHANTABLITY OR NON-INFRINGEMENT.
  17482. See the Apache Version 2.0 License for specific language governing permissions
  17483. and limitations under the License.
  17484. ***************************************************************************** */
  17485. /* global Reflect, Promise */
  17486. var extendStatics = function(d, b) {
  17487. extendStatics = Object.setPrototypeOf ||
  17488. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17489. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17490. return extendStatics(d, b);
  17491. };
  17492. function __extends(d, b) {
  17493. extendStatics(d, b);
  17494. function __() { this.constructor = d; }
  17495. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17496. }
  17497. var __assign = function() {
  17498. __assign = Object.assign || function __assign(t) {
  17499. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17500. s = arguments[i];
  17501. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17502. }
  17503. return t;
  17504. };
  17505. return __assign.apply(this, arguments);
  17506. };
  17507. function __rest(s, e) {
  17508. var t = {};
  17509. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17510. t[p] = s[p];
  17511. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17512. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17513. t[p[i]] = s[p[i]];
  17514. return t;
  17515. }
  17516. function __decorate(decorators, target, key, desc) {
  17517. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17518. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17519. 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;
  17520. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17521. }
  17522. function __param(paramIndex, decorator) {
  17523. return function (target, key) { decorator(target, key, paramIndex); }
  17524. }
  17525. function __metadata(metadataKey, metadataValue) {
  17526. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17527. }
  17528. function __awaiter(thisArg, _arguments, P, generator) {
  17529. return new (P || (P = Promise))(function (resolve, reject) {
  17530. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17531. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17532. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17533. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17534. });
  17535. }
  17536. function __generator(thisArg, body) {
  17537. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17538. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17539. function verb(n) { return function (v) { return step([n, v]); }; }
  17540. function step(op) {
  17541. if (f) throw new TypeError("Generator is already executing.");
  17542. while (_) try {
  17543. 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;
  17544. if (y = 0, t) op = [op[0] & 2, t.value];
  17545. switch (op[0]) {
  17546. case 0: case 1: t = op; break;
  17547. case 4: _.label++; return { value: op[1], done: false };
  17548. case 5: _.label++; y = op[1]; op = [0]; continue;
  17549. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17550. default:
  17551. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17552. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17553. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17554. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17555. if (t[2]) _.ops.pop();
  17556. _.trys.pop(); continue;
  17557. }
  17558. op = body.call(thisArg, _);
  17559. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17560. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17561. }
  17562. }
  17563. function __exportStar(m, exports) {
  17564. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17565. }
  17566. function __values(o) {
  17567. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17568. if (m) return m.call(o);
  17569. return {
  17570. next: function () {
  17571. if (o && i >= o.length) o = void 0;
  17572. return { value: o && o[i++], done: !o };
  17573. }
  17574. };
  17575. }
  17576. function __read(o, n) {
  17577. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17578. if (!m) return o;
  17579. var i = m.call(o), r, ar = [], e;
  17580. try {
  17581. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17582. }
  17583. catch (error) { e = { error: error }; }
  17584. finally {
  17585. try {
  17586. if (r && !r.done && (m = i["return"])) m.call(i);
  17587. }
  17588. finally { if (e) throw e.error; }
  17589. }
  17590. return ar;
  17591. }
  17592. function __spread() {
  17593. for (var ar = [], i = 0; i < arguments.length; i++)
  17594. ar = ar.concat(__read(arguments[i]));
  17595. return ar;
  17596. }
  17597. function __await(v) {
  17598. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17599. }
  17600. function __asyncGenerator(thisArg, _arguments, generator) {
  17601. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17602. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17603. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17604. 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); }); }; }
  17605. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17606. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17607. function fulfill(value) { resume("next", value); }
  17608. function reject(value) { resume("throw", value); }
  17609. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17610. }
  17611. function __asyncDelegator(o) {
  17612. var i, p;
  17613. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17614. 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; }
  17615. }
  17616. function __asyncValues(o) {
  17617. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17618. var m = o[Symbol.asyncIterator], i;
  17619. 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);
  17620. 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); }); }; }
  17621. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17622. }
  17623. function __makeTemplateObject(cooked, raw) {
  17624. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17625. return cooked;
  17626. };
  17627. function __importStar(mod) {
  17628. if (mod && mod.__esModule) return mod;
  17629. var result = {};
  17630. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17631. result.default = mod;
  17632. return result;
  17633. }
  17634. function __importDefault(mod) {
  17635. return (mod && mod.__esModule) ? mod : { default: mod };
  17636. }
  17637. class CustomAlert {
  17638. static show(title, content, buttons) {
  17639. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17640. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17641. return;
  17642. }
  17643. const bg = new Laya.Box();
  17644. bg.alpha = 0;
  17645. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17646. Laya.stage.addChild(bg);
  17647. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17648. const panel = new Laya.Box();
  17649. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17650. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17651. bg.addChild(panel);
  17652. const titleText = new Laya.Text();
  17653. titleText.text = title;
  17654. titleText.fontSize = 32;
  17655. titleText.color = "#333333";
  17656. titleText.bold = true;
  17657. titleText.pos(20, 20);
  17658. titleText.width = 360;
  17659. titleText.align = "center";
  17660. panel.addChild(titleText);
  17661. const contentText = new Laya.Text();
  17662. contentText.text = content;
  17663. contentText.fontSize = 21;
  17664. contentText.color = "#555555";
  17665. contentText.pos(20, 70);
  17666. contentText.width = 360;
  17667. contentText.wordWrap = true;
  17668. contentText.align = "center";
  17669. panel.addChild(contentText);
  17670. const buttonContainer = new Laya.Box();
  17671. buttonContainer.pos(20, 160);
  17672. panel.addChild(buttonContainer);
  17673. const btnWidth = 120;
  17674. const spacing = 30;
  17675. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17676. buttons.forEach((btn, index) => {
  17677. const button = new Laya.Button();
  17678. button.label = btn.label;
  17679. button.size(btnWidth, 40);
  17680. button.labelSize = 22;
  17681. button.pos(index * (btnWidth + spacing), 0);
  17682. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17683. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17684. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17685. button.alpha = 0.9;
  17686. });
  17687. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17688. button.alpha = 1;
  17689. });
  17690. button.on(Laya.Event.CLICK, this, () => {
  17691. btn.handler();
  17692. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17693. bg.removeSelf();
  17694. }));
  17695. });
  17696. buttonContainer.addChild(button);
  17697. });
  17698. buttonContainer.x = (panel.width - totalWidth) / 2;
  17699. }
  17700. }
  17701. class ConfigMgr {
  17702. constructor() {
  17703. this.httpReqCount = 4;
  17704. this.httpReqOkCount = 0;
  17705. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17706. try {
  17707. this.httpReqOkCount = 0;
  17708. let reqData = xGame.httpMgr.getReqData();
  17709. console.log('zh:第1个请求getClassicCfg');
  17710. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17711. this.classicCfg = classicCfg;
  17712. this.httpReqOkCount++;
  17713. console.log('zh:第2个请求getLevelCfg');
  17714. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17715. this.levelCfg = levelCfg;
  17716. this.httpReqOkCount++;
  17717. console.log('zh:第3个请求 getPlaceBallCfg');
  17718. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17719. this.placeBallCfg = placeBallCfg;
  17720. this.httpReqOkCount++;
  17721. console.log('zh:第4个请求 npc');
  17722. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17723. this.npcJson = npc.Data;
  17724. this.httpReqOkCount++;
  17725. console.log('zh:所有配置加载完成');
  17726. }
  17727. catch (error) {
  17728. console.error('❌请求失败:', error);
  17729. Laya.timer.once(5000, this, () => {
  17730. let retryCount = 0;
  17731. const maxRetries = 3;
  17732. const tryFetchConfig = () => {
  17733. try {
  17734. xGame.cfgMgr.getConfigFromServer();
  17735. }
  17736. catch (error) {
  17737. if (retryCount < maxRetries) {
  17738. retryCount++;
  17739. console.log(`🔄 第${retryCount}次重试获取配置...`);
  17740. Laya.timer.once(5000, this, tryFetchConfig);
  17741. }
  17742. else {
  17743. console.error("❌ 达到最大重试次数,配置获取失败");
  17744. }
  17745. }
  17746. };
  17747. tryFetchConfig();
  17748. });
  17749. }
  17750. finally {
  17751. if (this.httpReqCount > this.httpReqOkCount) {
  17752. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17753. {
  17754. label: "Okay", handler: () => {
  17755. console.log("zh:好的知道了");
  17756. JSBridgeUtils.instance.exitAndCloseGame();
  17757. }
  17758. }
  17759. ]);
  17760. }
  17761. }
  17762. });
  17763. this.sendPostAsync = (action, reqData) => {
  17764. return new Promise((resolve, reject) => {
  17765. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17766. try {
  17767. let code = res.code;
  17768. if (code == 200) {
  17769. const parsedData = JSON.parse(res.msg);
  17770. resolve(parsedData);
  17771. }
  17772. else {
  17773. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17774. reject(new Error(`Request failed with code: ${code}`));
  17775. }
  17776. }
  17777. catch (error) {
  17778. console.error(`ERROR=${error}`);
  17779. alert("Please check your network connection.");
  17780. reject(error);
  17781. }
  17782. finally {
  17783. console.log(`zh:${action}的请求处理完毕`);
  17784. }
  17785. });
  17786. });
  17787. };
  17788. }
  17789. static getInstance() {
  17790. if (!this._instance) {
  17791. this._instance = new ConfigMgr();
  17792. }
  17793. return this._instance;
  17794. }
  17795. init() {
  17796. this.getConfigFromServer();
  17797. }
  17798. test() {
  17799. let reqData = xGame.httpMgr.getReqData();
  17800. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17801. console.log('zh:1s');
  17802. try {
  17803. let code = res.code;
  17804. let data = res.data;
  17805. if (code == 200) {
  17806. const parsedData = JSON.parse(data);
  17807. this.classicCfg = parsedData;
  17808. }
  17809. else {
  17810. console.log('zh:res = ' + JSON.stringify(res));
  17811. }
  17812. }
  17813. catch (error) {
  17814. console.log('error=' + error);
  17815. alert("Please check your network connection.");
  17816. }
  17817. finally {
  17818. console.log('zh:1');
  17819. }
  17820. });
  17821. }
  17822. getUserInfoByIndex(index) {
  17823. return this.npcJson[index];
  17824. }
  17825. getRandomUserInfo() {
  17826. let index = xGame.tools.random(0, this.npcJson.length);
  17827. let rs = this.npcJson[index];
  17828. return rs;
  17829. }
  17830. getMaxBigMoveLength() {
  17831. return Object.keys(this.levelCfg).length;
  17832. }
  17833. getBigMoveLevelByIndex(index) {
  17834. let cfg = this.levelCfg;
  17835. cfg = cfg[index];
  17836. return cfg;
  17837. }
  17838. getRandomClassicLevel() {
  17839. let cfg = this.classicCfg;
  17840. let num = Object.keys(cfg).length;
  17841. let rand = xGame.common.randomNum(1, num);
  17842. return cfg[rand];
  17843. }
  17844. getPlaceBallByLevel(level) {
  17845. return this.placeBallCfg[level];
  17846. }
  17847. getMaxPlaceBall() {
  17848. return Object.keys(this.placeBallCfg).length;
  17849. }
  17850. }
  17851. class PoolD3Mgr {
  17852. constructor() {
  17853. this.pool = {};
  17854. }
  17855. static get ins() {
  17856. return this._ins || (this._ins = new PoolD3Mgr);
  17857. }
  17858. createList(key, prefab, parent) {
  17859. if (!this.pool[key]) {
  17860. this.pool[key] = {};
  17861. this.pool[key].prefab = prefab;
  17862. this.pool[key].list = [];
  17863. this.pool[key].parent = parent;
  17864. }
  17865. }
  17866. getItem(key) {
  17867. if (!this.pool[key]) {
  17868. return;
  17869. }
  17870. let temp;
  17871. if (this.pool[key].list.length > 0) {
  17872. temp = this.pool[key].list.pop();
  17873. }
  17874. else {
  17875. temp = this.pool[key].prefab.clone();
  17876. if (this.pool[key].parent) {
  17877. this.pool[key].parent.addChild(temp);
  17878. }
  17879. }
  17880. temp.active = true;
  17881. return temp;
  17882. }
  17883. putItem(key, obj) {
  17884. if (!this.pool[key]) {
  17885. return;
  17886. }
  17887. obj.active = false;
  17888. this.pool[key].list.push(obj);
  17889. }
  17890. }
  17891. let context$1 = context;
  17892. let uiMgr = UIMgr.inst;
  17893. let soundMgr = SoundMgr.getInstance();
  17894. let resMgr = ResMgr.getInstance();
  17895. let httpMgr = HttpMgr.getInstance();
  17896. let common = Common.getInstance();
  17897. let cfgMgr = ConfigMgr.getInstance();
  17898. let poolD3Mgr = PoolD3Mgr.ins;
  17899. let d3TexUrl = "res/d3Res/";
  17900. let d3ModeUrl = "res/unityRes/";
  17901. function setStageSize(view) {
  17902. if (view.width) {
  17903. view.width = Laya.stage.width;
  17904. view.height = Laya.stage.height;
  17905. }
  17906. }
  17907. function filledBg(view) {
  17908. let wh = Laya.stage.height / Laya.stage.width;
  17909. if (wh > 16 / 9) {
  17910. view.height = Laya.stage.height;
  17911. view.width = Laya.stage.height / 1334 * 750;
  17912. }
  17913. else {
  17914. view.width = Laya.stage.width;
  17915. view.height = Laya.stage.width / 750 * 1334;
  17916. }
  17917. }
  17918. function setNotch(view) {
  17919. if (view.height) {
  17920. view.y += context$1.notchHeight;
  17921. }
  17922. }
  17923. function showTip(str) {
  17924. uiMgr.Show(UIMsg, str);
  17925. }
  17926. function log(...args) {
  17927. console.log(args);
  17928. }
  17929. let xGame = {
  17930. context: context$1,
  17931. eventMgr,
  17932. resMgr,
  17933. uiMgr,
  17934. soundMgr,
  17935. define,
  17936. tools,
  17937. httpMgr,
  17938. d3TexUrl,
  17939. d3ModeUrl,
  17940. common,
  17941. cfgMgr,
  17942. poolD3Mgr,
  17943. setStageSize,
  17944. filledBg,
  17945. setNotch,
  17946. showTip,
  17947. log,
  17948. };
  17949. window["xGame"] = xGame;
  17950. let dataName = 'tBall_';
  17951. class UserData {
  17952. constructor() {
  17953. this.userId = "";
  17954. this.isAgree = false;
  17955. this.coinNum = 0;
  17956. this.gemNum = 0;
  17957. this.sound = true;
  17958. this.vibration = true;
  17959. this.currentDate = 0;
  17960. this.createTime = 0;
  17961. this.awardTime = 0;
  17962. this.roleId = 1;
  17963. this.roleList = [];
  17964. this.roleAds = [];
  17965. this.dressId = 101;
  17966. this.itemId = 201;
  17967. this.bigSkills = [1, 1, 1, 1, 1];
  17968. this.coin = 4000;
  17969. this.diamond = 0;
  17970. this.skillSuccessTimes = 0;
  17971. this.skillGuide = 0;
  17972. this.skillAccTimes = 0;
  17973. this.placeBallData = [];
  17974. this.shareDiamondTimes = 0;
  17975. this.dailyVideoShareTimes = 0;
  17976. this.secretary = [1, 0];
  17977. this.curSecretary = 0;
  17978. this.ballRod = [1, 0, 0, 0, 0, 1];
  17979. this.curBallRod = 5;
  17980. this.signData = 0;
  17981. this.signTime = 0;
  17982. this.drawTimes = 0;
  17983. this.drawAwardTimes = 0;
  17984. this.dailyfreeDrawTimes = 1;
  17985. this.power = 5;
  17986. this.powerTime = 0;
  17987. this.challengeTimes = 0;
  17988. this.extraSign = 0;
  17989. this.classicTimes = 0;
  17990. this.guideHelpLine = 0;
  17991. this.newUser = true;
  17992. this.rootBallFoul = 0;
  17993. this.timeoutFoul = 0;
  17994. this.roleList = [1];
  17995. }
  17996. saveData() {
  17997. let data = {};
  17998. for (let k in this) {
  17999. data[k.toString()] = this[k];
  18000. }
  18001. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18002. }
  18003. getData() {
  18004. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18005. if (ld) {
  18006. let localData = JSON.parse(ld);
  18007. if (localData) {
  18008. for (let k in this) {
  18009. let key = k.toString();
  18010. let data = localData[key];
  18011. if (data != undefined) {
  18012. this[k] = data;
  18013. }
  18014. }
  18015. }
  18016. }
  18017. }
  18018. }
  18019. class ItemData {
  18020. constructor() {
  18021. this.itemList = {};
  18022. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18023. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18024. }
  18025. saveData() {
  18026. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18027. }
  18028. getData() {
  18029. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18030. if (ld) {
  18031. let localData = JSON.parse(ld);
  18032. if (localData) {
  18033. this.itemList = localData;
  18034. }
  18035. }
  18036. }
  18037. }
  18038. class GameData {
  18039. constructor() {
  18040. this.curLevel = 0;
  18041. this.gameType = 1;
  18042. this.signIdx = 0;
  18043. this.signMax = 0;
  18044. this.rotaryTime = 0;
  18045. this.rotaryCount = 0;
  18046. this.rotaryList = [];
  18047. this.diyCount = 3;
  18048. this.awardIdx = 0;
  18049. this.shareNum = 2;
  18050. this.rankWeek = 0;
  18051. this.rankScore = 0;
  18052. this.gameCount = 0;
  18053. this.trySkill = -1;
  18054. this.tryTime = 0;
  18055. }
  18056. saveData() {
  18057. let data = {};
  18058. for (let k in this) {
  18059. data[k.toString()] = this[k];
  18060. }
  18061. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18062. }
  18063. getData() {
  18064. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18065. if (ld) {
  18066. let localData = JSON.parse(ld);
  18067. if (localData) {
  18068. for (let k in this) {
  18069. let key = k.toString();
  18070. let data = localData[key];
  18071. if (data != undefined) {
  18072. this[k] = data;
  18073. }
  18074. }
  18075. }
  18076. }
  18077. }
  18078. }
  18079. class Diy2025GameData {
  18080. constructor() {
  18081. this.challengeMode_overLev = 0;
  18082. this.xszyForClassic = false;
  18083. this.xszyForChallenge = false;
  18084. }
  18085. saveData() {
  18086. let data = {};
  18087. for (let k in this) {
  18088. data[k.toString()] = this[k];
  18089. }
  18090. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18091. }
  18092. getData() {
  18093. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18094. if (ld) {
  18095. let localData = JSON.parse(ld);
  18096. if (localData) {
  18097. for (let k in this) {
  18098. let key = k.toString();
  18099. let data = localData[key];
  18100. if (data != undefined) {
  18101. this[k] = data;
  18102. }
  18103. }
  18104. }
  18105. }
  18106. }
  18107. }
  18108. class DataMgr {
  18109. static Init() {
  18110. this.userData = new UserData();
  18111. this.gameData = new GameData();
  18112. this.itemData = new ItemData();
  18113. this.diyGameData = new Diy2025GameData();
  18114. this.userData.getData();
  18115. this.gameData.getData();
  18116. this.itemData.getData();
  18117. this.diyGameData.getData();
  18118. this.roleId = this.userData.roleId;
  18119. this.resetUse();
  18120. }
  18121. static isNewDay() {
  18122. Moyu.isNewDay(this, (isnew) => {
  18123. xGame.common.isNewDay = isnew;
  18124. if (!isnew)
  18125. return;
  18126. DataMgr.setShareDiamondTimes(0, false);
  18127. DataMgr.setDailyVideoShareTimes(0, false);
  18128. DataMgr.setDailyfreeDrawTimes(1);
  18129. DataMgr.setExtraSign(0);
  18130. });
  18131. }
  18132. static deletData() {
  18133. Laya.LocalStorage.clear();
  18134. }
  18135. static upRankData() {
  18136. let num = xGame.common.getAllStarNum();
  18137. if (num > 0)
  18138. Moyu.upRankData(xGame.common.curRankID, num);
  18139. }
  18140. static addItem(id, count = 1) {
  18141. let v = this.itemData.itemList[id];
  18142. if (!v)
  18143. v = { id: id, count: count, adnum: 0, active: true };
  18144. else {
  18145. if (v.active) {
  18146. v.count += count;
  18147. }
  18148. else {
  18149. v.count = count;
  18150. v.active = true;
  18151. }
  18152. }
  18153. this.itemData.itemList[id] = v;
  18154. xGame.soundMgr.playGetSound();
  18155. this.saveItemData();
  18156. }
  18157. static hasItem(id) {
  18158. let v = this.itemData.itemList[id];
  18159. if (v && v.active)
  18160. return true;
  18161. return false;
  18162. }
  18163. static getItem(id) {
  18164. let v = this.itemData.itemList[id];
  18165. return v;
  18166. }
  18167. static getItemCount(id) {
  18168. let v = this.itemData.itemList[id];
  18169. if (v && v.active)
  18170. return v.count;
  18171. return 0;
  18172. }
  18173. static getItemAd(id) {
  18174. let v = this.itemData.itemList[id];
  18175. if (v) {
  18176. return v.adnum;
  18177. }
  18178. return 0;
  18179. }
  18180. static onItemAd(id, num = 1) {
  18181. let v = this.itemData.itemList[id];
  18182. if (!v)
  18183. v = { id: id, count: 1, adnum: num, active: false };
  18184. else
  18185. v.adnum += num;
  18186. this.itemData.itemList[id] = v;
  18187. this.saveItemData();
  18188. }
  18189. static costItem(id, count) {
  18190. let v = this.itemData.itemList[id];
  18191. if (v && v.active) {
  18192. if (v.count < count)
  18193. return false;
  18194. else {
  18195. v.count -= count;
  18196. this.itemData.itemList[id] = v;
  18197. return true;
  18198. }
  18199. }
  18200. return false;
  18201. }
  18202. static resetUse() {
  18203. this.dressId = this.userData.dressId;
  18204. this.itemId = this.userData.itemId;
  18205. }
  18206. static passLevel() {
  18207. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18208. this.gameData.curLevel++;
  18209. this.curLevel = this.gameData.curLevel;
  18210. this.saveGameData();
  18211. }
  18212. static useRole(id) {
  18213. this.roleId = id;
  18214. if (this.hasRole(id)) {
  18215. this.userData.roleId = id;
  18216. this.saveUserData();
  18217. }
  18218. }
  18219. static addRole(id) {
  18220. if (this.hasRole(id))
  18221. return;
  18222. this.userData.roleList.push(id);
  18223. this.saveUserData();
  18224. }
  18225. static hasRole(id) {
  18226. return this.userData.roleList.indexOf(id) >= 0;
  18227. }
  18228. static gemEnough(num) {
  18229. return this.userData.gemNum >= num;
  18230. }
  18231. static roleHasAd(id) {
  18232. let count = this.userData.roleAds[id];
  18233. if (count != undefined && count >= 0)
  18234. return true;
  18235. else
  18236. return false;
  18237. }
  18238. static saveUserData(time = 500, event, arg) {
  18239. if (this.userSaving)
  18240. return;
  18241. this.userSaving = true;
  18242. Laya.timer.once(time, this, () => {
  18243. this.userSaving = false;
  18244. this.userData.saveData();
  18245. if (event)
  18246. xGame.eventMgr.event(event, arg);
  18247. });
  18248. }
  18249. static updateUserNickName(loginUserName) {
  18250. let kyeStr = 'moyudata_180';
  18251. console.log('zh:################### kyeStr=' + kyeStr);
  18252. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18253. if (moyudata) {
  18254. const obj = JSON.parse(moyudata);
  18255. obj.nickName = loginUserName;
  18256. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18257. console.log('zh:################### updateUserNickName');
  18258. }
  18259. }
  18260. static saveGameData() {
  18261. if (this.gameSaving)
  18262. return;
  18263. this.gameSaving = true;
  18264. Laya.timer.once(1000, this, () => {
  18265. this.gameSaving = false;
  18266. this.gameData.saveData();
  18267. });
  18268. }
  18269. static saveItemData() {
  18270. let fun = () => {
  18271. this.itemData.saveData();
  18272. };
  18273. Laya.timer.clear(this, fun);
  18274. Laya.timer.once(500, this, fun);
  18275. }
  18276. static saveData() {
  18277. this.saveUserData();
  18278. this.saveGameData();
  18279. }
  18280. static getBigSkillList() {
  18281. return this.userData.bigSkills;
  18282. }
  18283. static getBigSkillByIndex(index) {
  18284. return this.userData.bigSkills[index];
  18285. }
  18286. static setBigSkill(index, val, addUp = true) {
  18287. if (addUp) {
  18288. this.userData.bigSkills[index] += val;
  18289. }
  18290. else {
  18291. this.userData.bigSkills[index] = val;
  18292. }
  18293. this.saveUserData();
  18294. }
  18295. static coinEnough(need) {
  18296. if (typeof need != "number") {
  18297. console.error("金币格式错误");
  18298. return;
  18299. }
  18300. return this.userData.coin >= need;
  18301. }
  18302. static setCoin(val) {
  18303. if (typeof val != "number") {
  18304. return;
  18305. }
  18306. this.userData.coin += val;
  18307. this.saveUserData();
  18308. xGame.eventMgr.event(COIN_CHANGE);
  18309. this.updateUserInfo2Server("jb");
  18310. }
  18311. static setCoinFormServer(val) {
  18312. if (typeof val != "number") {
  18313. return;
  18314. }
  18315. this.userData.coin = val;
  18316. this.saveUserData();
  18317. xGame.eventMgr.event(COIN_CHANGE);
  18318. }
  18319. static getCoin() {
  18320. return this.userData.coin;
  18321. }
  18322. static diamondEnough(need) {
  18323. if (typeof need != "number") {
  18324. console.error("金币格式错误");
  18325. return;
  18326. }
  18327. return this.userData.diamond >= need;
  18328. }
  18329. static setDiamond(val) {
  18330. if (typeof val != "number") {
  18331. return;
  18332. }
  18333. this.userData.diamond += val;
  18334. this.saveUserData();
  18335. xGame.eventMgr.event(DIAMOND_CHANGE);
  18336. this.updateUserInfo2Server("zs");
  18337. }
  18338. static setDiamondFormServer(val) {
  18339. if (typeof val != "number") {
  18340. return;
  18341. }
  18342. this.userData.diamond = val;
  18343. this.saveUserData();
  18344. xGame.eventMgr.event(DIAMOND_CHANGE);
  18345. }
  18346. static getDiamond() {
  18347. return this.userData.diamond;
  18348. }
  18349. static getSkillSuccessTimes() {
  18350. return this.userData.skillSuccessTimes;
  18351. }
  18352. static setSkillSuccessTimes(val, addUp = true) {
  18353. if (addUp)
  18354. this.userData.skillSuccessTimes += val;
  18355. else
  18356. this.userData.skillSuccessTimes = val;
  18357. this.saveUserData();
  18358. }
  18359. static getSkillAccTimes() {
  18360. return this.userData.skillAccTimes;
  18361. }
  18362. static setSkillAccTimes(val) {
  18363. this.userData.skillAccTimes += val;
  18364. this.saveUserData();
  18365. }
  18366. static getSkillGuide() {
  18367. if (!xGame.common.openGuide) {
  18368. return 1;
  18369. }
  18370. return this.userData.skillGuide;
  18371. }
  18372. static setSkillGuide(val) {
  18373. this.userData.skillGuide = val;
  18374. this.saveUserData();
  18375. }
  18376. static getPlaceBallLevelList() {
  18377. return this.userData.placeBallData;
  18378. }
  18379. static getPlaceBallLevel(level) {
  18380. let arr = this.userData.placeBallData;
  18381. let index = level - 1;
  18382. let out;
  18383. if (arr[index]) {
  18384. out = arr[index];
  18385. }
  18386. else {
  18387. let max = arr.length;
  18388. if (max == index) {
  18389. out = {
  18390. star: 0,
  18391. play: true,
  18392. isCur: true,
  18393. getAward: false
  18394. };
  18395. }
  18396. else {
  18397. out = {
  18398. star: 0,
  18399. play: false,
  18400. getAward: false
  18401. };
  18402. }
  18403. }
  18404. return out;
  18405. }
  18406. static setPlaceBallLevel(level, star) {
  18407. let arr = this.userData.placeBallData;
  18408. let index = level - 1;
  18409. if (arr[index]) {
  18410. arr[index].star = Math.max(arr[index].star, star);
  18411. }
  18412. else {
  18413. let max = arr.length;
  18414. if (max == index) {
  18415. arr.push({
  18416. star: star,
  18417. play: true,
  18418. getAward: false
  18419. });
  18420. }
  18421. else {
  18422. console.error("关卡存储出错");
  18423. }
  18424. }
  18425. this.saveUserData();
  18426. }
  18427. static setPlaceBallAward(level) {
  18428. let arr = this.userData.placeBallData;
  18429. let index = level - 1;
  18430. if (arr[index]) {
  18431. arr[index].getAward = true;
  18432. }
  18433. this.saveUserData();
  18434. }
  18435. static getShareDiamondTimes() {
  18436. return this.userData.shareDiamondTimes;
  18437. }
  18438. static setShareDiamondTimes(val, addUp = true) {
  18439. if (addUp) {
  18440. this.userData.shareDiamondTimes += val;
  18441. }
  18442. else {
  18443. this.userData.shareDiamondTimes = val;
  18444. }
  18445. this.saveUserData();
  18446. }
  18447. static getDailyVideoShareTimes() {
  18448. return this.userData.dailyVideoShareTimes;
  18449. }
  18450. static setDailyVideoShareTimes(val, addUp = true) {
  18451. if (addUp) {
  18452. this.userData.dailyVideoShareTimes += val;
  18453. }
  18454. else {
  18455. this.userData.dailyVideoShareTimes = val;
  18456. }
  18457. this.saveUserData();
  18458. }
  18459. static getSecretary(index) {
  18460. return this.userData.secretary[index];
  18461. }
  18462. static setSecretary(index, val) {
  18463. this.userData.secretary[index] = val;
  18464. this.saveUserData();
  18465. }
  18466. static getCurSecretary() {
  18467. return this.userData.curSecretary;
  18468. }
  18469. static setCurSecretary(index) {
  18470. this.userData.curSecretary = index;
  18471. this.saveUserData();
  18472. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18473. }
  18474. static getBallRod(index) {
  18475. return this.userData.ballRod[index];
  18476. }
  18477. static setBallRod(index, val) {
  18478. this.userData.ballRod[index] = val;
  18479. this.saveUserData();
  18480. }
  18481. static setBallRodFormServer(haveQiuGanJsonStr) {
  18482. if (!haveQiuGanJsonStr) {
  18483. console.log("setBallRodFormServer数据为空或未定义");
  18484. return;
  18485. }
  18486. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18487. const keys = Object.keys(haveQiuGanJsonObj);
  18488. keys.forEach(key => {
  18489. let v = haveQiuGanJsonObj[key];
  18490. let k = parseInt(key);
  18491. let idx = k - 1;
  18492. console.log('zh:更新IDX = ' + idx);
  18493. console.log('this.userData.ballRod[idx]===' + this.userData.ballRod[idx]);
  18494. if (this.userData.ballRod[idx] === 0) {
  18495. console.log('zh: uuuuu ' + (k - 1));
  18496. this.userData.ballRod[k - 1] = 1;
  18497. this.saveUserData();
  18498. }
  18499. });
  18500. }
  18501. static getCurBallRod() {
  18502. return this.userData.curBallRod;
  18503. }
  18504. static setCurBallRod(index) {
  18505. this.userData.curBallRod = index;
  18506. this.saveUserData();
  18507. }
  18508. static setSignData(val) {
  18509. this.userData.signData = val;
  18510. this.saveUserData();
  18511. }
  18512. static getSignData() {
  18513. return this.userData.signData;
  18514. }
  18515. static setSignTime(val) {
  18516. this.userData.signTime = val;
  18517. this.saveUserData();
  18518. }
  18519. static getSignTime() {
  18520. return this.userData.signTime;
  18521. }
  18522. static getDrawTimes() {
  18523. return this.userData.drawTimes;
  18524. }
  18525. static setDrawTimes(val, addUp = true) {
  18526. if (addUp) {
  18527. this.userData.drawTimes += val;
  18528. }
  18529. else {
  18530. this.userData.drawTimes = val;
  18531. }
  18532. this.saveUserData();
  18533. }
  18534. static getDrawAwardTimes() {
  18535. return this.userData.drawAwardTimes;
  18536. }
  18537. static setDrawAwardTimes(val) {
  18538. this.userData.drawAwardTimes = val;
  18539. this.saveUserData();
  18540. }
  18541. static getDailyfreeDrawTimes() {
  18542. return this.userData.dailyfreeDrawTimes;
  18543. }
  18544. static setDailyfreeDrawTimes(val) {
  18545. this.userData.dailyfreeDrawTimes = val;
  18546. this.saveUserData();
  18547. }
  18548. static setPower(val, addUp = true) {
  18549. if (addUp)
  18550. this.userData.power += val;
  18551. else
  18552. this.userData.power = val;
  18553. if (this.userData.power >= xGame.common.maxPower) {
  18554. this.userData.power = xGame.common.maxPower;
  18555. }
  18556. xGame.eventMgr.event(POWER_CHANGE, val);
  18557. this.saveUserData();
  18558. }
  18559. static getPower() {
  18560. return this.userData.power;
  18561. }
  18562. static setPowerTime(val) {
  18563. this.userData.powerTime = val;
  18564. this.saveUserData();
  18565. }
  18566. static getPowerTime() {
  18567. return this.userData.powerTime;
  18568. }
  18569. static powerEnough() {
  18570. return this.getPower() > 0;
  18571. }
  18572. static getChallengeTimes() {
  18573. return this.userData.challengeTimes;
  18574. }
  18575. static setChallengeTimes(val) {
  18576. this.userData.challengeTimes += val;
  18577. this.saveUserData();
  18578. }
  18579. static getExtraSign() {
  18580. return this.userData.extraSign;
  18581. }
  18582. static setExtraSign(val) {
  18583. this.userData.extraSign = val;
  18584. this.saveUserData();
  18585. }
  18586. static getClassicTimes() {
  18587. return this.userData.classicTimes;
  18588. }
  18589. static setClassicTimes() {
  18590. this.userData.classicTimes += 1;
  18591. this.saveUserData();
  18592. }
  18593. static getGuideHelpLine() {
  18594. return this.userData.guideHelpLine;
  18595. }
  18596. static setGuideHelpLine() {
  18597. this.userData.guideHelpLine = 1;
  18598. this.saveUserData();
  18599. }
  18600. static getNewUser() {
  18601. return this.userData.newUser;
  18602. }
  18603. static setNewUser() {
  18604. this.userData.newUser = false;
  18605. this.saveUserData();
  18606. }
  18607. static getRootBallFoul() {
  18608. return this.userData.rootBallFoul;
  18609. }
  18610. static setRootBallFoul() {
  18611. this.userData.rootBallFoul = 1;
  18612. this.saveUserData();
  18613. }
  18614. static getTimeoutFoul() {
  18615. return this.userData.timeoutFoul;
  18616. }
  18617. static setTimeoutFoul() {
  18618. this.userData.timeoutFoul = 1;
  18619. this.saveUserData();
  18620. }
  18621. static saveDiyGameData() {
  18622. if (this.diyGameSaving)
  18623. return;
  18624. this.diyGameSaving = true;
  18625. Laya.timer.once(500, this, () => {
  18626. this.diyGameSaving = false;
  18627. this.diyGameData.saveData();
  18628. });
  18629. }
  18630. static getChallengeMode_overLev() {
  18631. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18632. return this.challengeMode_overLev;
  18633. }
  18634. static setChallengeMode_overLev(levNum) {
  18635. this.diyGameData.challengeMode_overLev = levNum;
  18636. this.saveDiyGameData();
  18637. }
  18638. static updateUserInfo2Server(type, count = 0) {
  18639. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18640. if (userInfoData == null) {
  18641. return;
  18642. }
  18643. let reqData = xGame.httpMgr.getReqData();
  18644. let rd = JSON.parse(reqData);
  18645. rd.dataType = type;
  18646. let dataValue = 0;
  18647. if (type == "zs") {
  18648. dataValue = this.getDiamond();
  18649. }
  18650. if (type == "jb") {
  18651. dataValue = this.getCoin();
  18652. }
  18653. rd.dataValue = dataValue;
  18654. reqData = JSON.stringify(rd);
  18655. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18656. try {
  18657. let code = res.code;
  18658. let data = res.data;
  18659. if (code == 401) {
  18660. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18661. console.log('zh:保存资产信息失败,请重新登录 ');
  18662. return;
  18663. }
  18664. if (code == 200) {
  18665. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18666. }
  18667. else {
  18668. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18669. }
  18670. }
  18671. catch (error) {
  18672. console.log('error=' + error);
  18673. alert("Please check your network connection.");
  18674. }
  18675. finally {
  18676. }
  18677. });
  18678. }
  18679. static getUserZiChanInfo() {
  18680. console.log('zh:开始获取用户资产信息');
  18681. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18682. if (userInfoData == null) {
  18683. return;
  18684. }
  18685. let reqData = xGame.httpMgr.getReqData();
  18686. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18687. try {
  18688. console.log('zh:buySp res = ' + JSON.stringify(res));
  18689. let code = res.code;
  18690. let msg = res.msg;
  18691. if (code == 401) {
  18692. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18693. alert(TIP_MSG_key.pleaseLoginIn);
  18694. return;
  18695. }
  18696. if (code == 200) {
  18697. let d = res.data;
  18698. let zuanShi = d.zuanShi;
  18699. let jinBi = d.jinBi;
  18700. let haveQiuGanJson = d.haveQiuGanJson;
  18701. DataMgr.setDiamondFormServer(zuanShi);
  18702. DataMgr.setCoinFormServer(jinBi);
  18703. console.log('zh:更新球杆信息');
  18704. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18705. }
  18706. else {
  18707. alert(msg);
  18708. }
  18709. }
  18710. catch (error) {
  18711. console.log('error=' + error);
  18712. alert(error);
  18713. }
  18714. finally {
  18715. }
  18716. });
  18717. }
  18718. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  18719. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18720. console.log('zh:updateLocalUserData=' + userInfo);
  18721. if (userInfo != null) {
  18722. if (!userInfo.buySpids) {
  18723. userInfo.buySpids = { 1: false, 7: false };
  18724. }
  18725. else {
  18726. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  18727. }
  18728. userInfo.buySpids[spid] = isBuyOk;
  18729. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  18730. }
  18731. else {
  18732. }
  18733. }
  18734. }
  18735. DataMgr.isNewUser = false;
  18736. DataMgr.fristEnter = true;
  18737. DataMgr.levelType = 0;
  18738. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18739. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18740. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18741. DataMgr.challengeMode_overLev = 0;
  18742. DataMgr.xszyForClassic = false;
  18743. DataMgr.xszyForChallenge = false;
  18744. DataMgr.awardId = 0;
  18745. DataMgr.awardCoin = 0;
  18746. DataMgr.sceneId = -1;
  18747. DataMgr.tryId = 0;
  18748. DataMgr.curLevel = 1;
  18749. DataMgr.vipLevel = 0;
  18750. DataMgr.maxLevel = 0;
  18751. DataMgr.awardRatio = 1;
  18752. DataMgr.gameList = [];
  18753. DataMgr.rankList = [];
  18754. DataMgr.recoverTime = 480000;
  18755. DataMgr.minScore = 0;
  18756. DataMgr.rankDis = 0;
  18757. DataMgr.userSaving = false;
  18758. DataMgr.gameSaving = false;
  18759. DataMgr.diyGameSaving = false;
  18760. class D3Tween extends Laya.Script3D {
  18761. constructor() {
  18762. super();
  18763. this.isInited = false;
  18764. }
  18765. ;
  18766. init() {
  18767. if (this.isInited)
  18768. return;
  18769. this.isInited = true;
  18770. this.gameObj = this.owner;
  18771. this.transform = this.gameObj.transform;
  18772. }
  18773. get rotX() {
  18774. return this.transform.localRotationEulerX;
  18775. }
  18776. set rotX(v) {
  18777. this.transform.localRotationEulerX = v;
  18778. }
  18779. get rotY() {
  18780. return this.transform.localRotationEulerY;
  18781. }
  18782. set rotY(v) {
  18783. this.transform.localRotationEulerY = v;
  18784. }
  18785. get rotZ() {
  18786. return this.transform.localRotationEulerZ;
  18787. }
  18788. set rotZ(v) {
  18789. this.transform.localRotationEulerZ = v;
  18790. }
  18791. get posX() {
  18792. return this.transform.localPositionX;
  18793. }
  18794. set posX(v) {
  18795. this.transform.localPositionX = v;
  18796. }
  18797. get posY() {
  18798. return this.transform.localPositionY;
  18799. }
  18800. set posY(v) {
  18801. this.transform.localPositionY = v;
  18802. }
  18803. get posZ() {
  18804. return this.transform.localPositionZ;
  18805. }
  18806. set posZ(v) {
  18807. this.transform.localPositionZ = v;
  18808. }
  18809. get rotation() {
  18810. return this.transform.localRotation;
  18811. }
  18812. set rotation(v) {
  18813. this.transform.localRotation = v;
  18814. }
  18815. }
  18816. class D2Hole extends Laya.Script {
  18817. constructor() { super(); }
  18818. onTriggerEnter(collider) {
  18819. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18820. return;
  18821. }
  18822. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18823. if (collider.owner["mySrc"].isRunSkillAni) {
  18824. return;
  18825. }
  18826. if (collider.owner["mySrc"].number != 0) {
  18827. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18828. }
  18829. xGame.common.ballColliHole(collider);
  18830. xGame.common.recoverCameraView();
  18831. }
  18832. }
  18833. }
  18834. class Table extends Laya.Script3D {
  18835. constructor() {
  18836. super();
  18837. this.isSetBorder = false;
  18838. this.inited = false;
  18839. }
  18840. ;
  18841. onAwake() {
  18842. this.init();
  18843. }
  18844. init() {
  18845. if (this.inited)
  18846. return;
  18847. this.inited = true;
  18848. this.gameObj = this.owner;
  18849. this.border = this.gameObj.getChildByName("border");
  18850. }
  18851. setBorderPos() {
  18852. if (this.isSetBorder)
  18853. return;
  18854. this.isSetBorder = true;
  18855. let ui = xGame.common.gameUI.ui;
  18856. let bar1 = this.border.getChildByName("bar1");
  18857. let bar2 = this.border.getChildByName("bar2");
  18858. let bar3 = this.border.getChildByName("bar3");
  18859. let bar4 = this.border.getChildByName("bar4");
  18860. let bar5 = this.border.getChildByName("bar5");
  18861. let bar6 = this.border.getChildByName("bar6");
  18862. this.setInfo(bar1, ui.border.bar1, "box");
  18863. this.setInfo(bar2, ui.border.bar2, "box");
  18864. this.setInfo(bar3, ui.border.bar3, "box");
  18865. this.setInfo(bar4, ui.border.bar4, "box");
  18866. this.setInfo(bar5, ui.border.bar5, "box");
  18867. this.setInfo(bar6, ui.border.bar6, "box");
  18868. let circle1 = this.border.getChildByName("circle1");
  18869. let circle2 = this.border.getChildByName("circle2");
  18870. let circle3 = this.border.getChildByName("circle3");
  18871. let circle4 = this.border.getChildByName("circle4");
  18872. let circle5 = this.border.getChildByName("circle5");
  18873. let circle6 = this.border.getChildByName("circle6");
  18874. this.setInfo(circle1, ui.border.circle1, "circle");
  18875. this.setInfo(circle2, ui.border.circle2, "circle");
  18876. this.setInfo(circle3, ui.border.circle3, "circle");
  18877. this.setInfo(circle4, ui.border.circle4, "circle");
  18878. this.setInfo(circle5, ui.border.circle5, "circle");
  18879. this.setInfo(circle6, ui.border.circle6, "circle");
  18880. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18881. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18882. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18883. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  18884. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  18885. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  18886. let arr = xGame.common.gameMgr.holePosList;
  18887. xGame.common.gameMgr.posObj = {
  18888. "1": arr[0],
  18889. "3": arr[2],
  18890. "4": arr[3],
  18891. "6": arr[5]
  18892. };
  18893. }
  18894. initHolePos(x, y) {
  18895. if (x < 300)
  18896. x += 25;
  18897. else if (x > 1000)
  18898. x -= 25;
  18899. else if (y > 200)
  18900. y -= 10;
  18901. else
  18902. y += 10;
  18903. if (y < 200)
  18904. y += 30;
  18905. else if (y > 500)
  18906. y -= 30;
  18907. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  18908. }
  18909. setInfo(d3Obj, d2Obj, type) {
  18910. let ui = xGame.common.gameUI.ui;
  18911. let sprite = new Laya.Sprite();
  18912. ui.border.displayObject.addChild(sprite);
  18913. let colli = xGame.common.getCollider(type);
  18914. sprite.addComponentIntance(colli);
  18915. let rigy = xGame.common.getRigbody();
  18916. rigy.type = "static";
  18917. sprite.addComponentIntance(rigy);
  18918. let d3Pos = d3Obj.transform.position;
  18919. xGame.common.pos3to2Convert(d3Pos);
  18920. let scaleX = d3Obj.transform.localScaleX;
  18921. let scaleZ = d3Obj.transform.localScaleZ;
  18922. let width = xGame.common.scale3to2Convert(scaleZ);
  18923. let height = xGame.common.scale3to2Convert(scaleX);
  18924. sprite.pivotX = width / 2;
  18925. sprite.pivotY = height / 2;
  18926. sprite.x = d3Pos.x;
  18927. sprite.y = d3Pos.y;
  18928. sprite.width = width;
  18929. sprite.height = height;
  18930. d2Obj.x = d3Pos.x;
  18931. d2Obj.y = d3Pos.y;
  18932. d2Obj.width = width;
  18933. d2Obj.height = height;
  18934. if (type == "box") {
  18935. colli.width = width;
  18936. colli.height = height;
  18937. colli.isSensor = false;
  18938. colli.label = "border";
  18939. }
  18940. else {
  18941. colli.radius = width / 2;
  18942. colli.isSensor = true;
  18943. colli.label = "hole";
  18944. sprite.addComponent(D2Hole);
  18945. }
  18946. }
  18947. }
  18948. class D3World extends Laya.Script3D {
  18949. constructor() {
  18950. super();
  18951. this.loadNum = 0;
  18952. this.setLoadNum = 7;
  18953. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  18954. }
  18955. onAwake() {
  18956. }
  18957. loadScene() {
  18958. this.scene = this.owner;
  18959. let url = `res/unityRes/root.lh`;
  18960. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  18961. this.scene.addChild(prefab);
  18962. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  18963. this.putCameraInfo();
  18964. this.camera.enableHDR = false;
  18965. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  18966. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  18967. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  18968. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  18969. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  18970. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  18971. this.knife.active = false;
  18972. this.loadD3Obj();
  18973. }));
  18974. }
  18975. putCameraInfo() {
  18976. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  18977. this.cameraObj = new cameraType();
  18978. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  18979. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  18980. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  18981. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  18982. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  18983. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  18984. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  18985. this.visitAngleChild.init();
  18986. this.visitRootObj.posX = this.visitAngleChild.posX;
  18987. this.visitRootObj.posY = this.visitAngleChild.posY;
  18988. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  18989. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  18990. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  18991. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  18992. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18993. xGame.common.showOneCamera("mainCamera");
  18994. }
  18995. loadD3Obj() {
  18996. this.loadTable();
  18997. this.loadRoom();
  18998. this.loadInHoleParticial();
  18999. this.loadIceParticial();
  19000. this.loadHitParticial();
  19001. this.loadFireworksParticial();
  19002. this.loadBall();
  19003. }
  19004. loadInHoleParticial() {
  19005. this.loadD3Res("inHoleEft", "", (prefab) => {
  19006. prefab.addComponent(Partical);
  19007. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19008. });
  19009. }
  19010. loadIceParticial() {
  19011. this.loadD3Res("iceEft", "", (prefab) => {
  19012. prefab.addComponent(Partical);
  19013. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19014. });
  19015. }
  19016. loadHitParticial() {
  19017. this.loadD3Res("hitEft", "", (prefab) => {
  19018. prefab.addComponent(Partical);
  19019. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19020. });
  19021. }
  19022. loadFireworksParticial() {
  19023. this.loadD3Res("fireworksEft", "", (prefab) => {
  19024. prefab.addComponent(Partical);
  19025. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19026. });
  19027. }
  19028. loadBall(index = 1) {
  19029. this.loadD3Res("ball", index, (prefab) => {
  19030. this.ballPrefab = prefab;
  19031. this.ballPrefab.addComponent(Ball);
  19032. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19033. });
  19034. }
  19035. loadTable(index = 1) {
  19036. this.loadD3Res("table", index, (prefab) => {
  19037. this.tableSrc = prefab.addComponent(Table);
  19038. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19039. this.d3Hand.init();
  19040. this.tableRoot.addChild(prefab);
  19041. });
  19042. }
  19043. loadRoom(index = 1) {
  19044. this.loadD3Res("room", index, (prefab) => {
  19045. this.roomRoot.addChild(prefab);
  19046. });
  19047. }
  19048. loadD3Res(type, index, callback) {
  19049. let url = `res/unityRes/${type}${index}.lh`;
  19050. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19051. callback && callback(prefab);
  19052. this.checkResLoad();
  19053. }));
  19054. }
  19055. checkResLoad() {
  19056. this.loadNum++;
  19057. if (this.loadNum >= this.setLoadNum) {
  19058. xGame.eventMgr.event(D3RES_LOADED);
  19059. }
  19060. }
  19061. prePlayEft() {
  19062. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19063. eft.transform.localPositionX = 0;
  19064. eft.transform.localPositionY = -5;
  19065. eft.transform.localPositionZ = 0;
  19066. eft.active = true;
  19067. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19068. ice.transform.localPositionX = 0;
  19069. ice.transform.localPositionY = -5;
  19070. ice.transform.localPositionZ = 0;
  19071. ice.active = true;
  19072. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19073. hit.transform.localPositionX = 0;
  19074. hit.transform.localPositionY = -5;
  19075. hit.transform.localPositionZ = 0;
  19076. hit.active = true;
  19077. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19078. fireworks.transform.localPositionX = 0;
  19079. fireworks.transform.localPositionY = -5;
  19080. fireworks.transform.localPositionZ = 0;
  19081. fireworks.active = true;
  19082. }
  19083. }
  19084. class cameraType {
  19085. }
  19086. class MoyuMgr$1 {
  19087. static initMoyu() {
  19088. this.moyuView = new MoyuView$1();
  19089. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19090. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19091. this.moyuView.ui.displayObject.zOrder = 1000;
  19092. this.moyuView.init();
  19093. this.moyuView.showTip(true);
  19094. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19095. window['XApk'] = this;
  19096. }
  19097. static showAge(show) {
  19098. if (this.moyuView)
  19099. this.moyuView.showAge(show);
  19100. }
  19101. static onPlatMsg(idx) {
  19102. if (!MoyuMgr$1.moyuView)
  19103. return;
  19104. if (idx == '0') {
  19105. MoyuMgr$1.moyuView.showTip(false);
  19106. }
  19107. }
  19108. static showAgree(call) {
  19109. if (this.moyuView)
  19110. this.moyuView.showAgree(call);
  19111. else
  19112. call && call();
  19113. }
  19114. static showXy(type = 1) {
  19115. if (this.moyuView)
  19116. this.moyuView.showXy(type);
  19117. }
  19118. }
  19119. MoyuMgr$1.isAdvise = false;
  19120. class MoyuView$1 {
  19121. constructor() {
  19122. this.ysxyNum = 1;
  19123. this.ysJson = null;
  19124. this.ui = ui_UIMoyu.createInstance();
  19125. }
  19126. init() {
  19127. this.ui.mainBg.visible = false;
  19128. this.ui.xyNode.visible = false;
  19129. this.ui.ageNode.visible = false;
  19130. this.ui.tipNode.visible = false;
  19131. this.ui.rnNode.visible = false;
  19132. this.ui.fcmNode.visible = false;
  19133. this.ui.ageTip.visible = false;
  19134. this.ui.msgNode.visible = false;
  19135. this.ui.visible = false;
  19136. this.ui.xyNode.xyList.setVirtual();
  19137. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19138. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19139. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19140. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19141. this.ui.xyNode.btnKnown.visible = false;
  19142. this.ui.xyNode.xy1.visible = false;
  19143. this.ui.xyNode.xy2.visible = false;
  19144. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19145. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19146. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19147. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19148. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19149. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19150. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19151. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19152. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19153. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19154. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19155. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19156. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19157. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19158. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19159. this.ysxyNum = 2;
  19160. }
  19161. }
  19162. onClick(obj) {
  19163. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19164. switch (obj) {
  19165. case this.ui.ageTip:
  19166. if (Moyu.isTTApk) {
  19167. this.ui.ageNode.visible = true;
  19168. this.ui.mainBg.visible = true;
  19169. }
  19170. break;
  19171. case this.ui.tipNode:
  19172. this.showTip(false);
  19173. break;
  19174. case this.ui.ageNode.btnAge:
  19175. this.ui.ageNode.visible = false;
  19176. this.ui.mainBg.visible = false;
  19177. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19178. this.ui.visible = false;
  19179. break;
  19180. case this.ui.xyNode.btnXy3:
  19181. case this.ui.xyNode.btnXy1:
  19182. this.loadXy(1);
  19183. break;
  19184. case this.ui.xyNode.btnXy2:
  19185. this.loadXy(2);
  19186. break;
  19187. case this.ui.xyNode.btnBack:
  19188. this.ui.xyNode.xy1.visible = true;
  19189. this.ui.xyNode.xy2.visible = false;
  19190. break;
  19191. case this.ui.xyNode.btnKnown:
  19192. this.ui.xyNode.visible = false;
  19193. this.ui.mainBg.visible = false;
  19194. this.ui.visible = false;
  19195. break;
  19196. case this.ui.rnNode.btnCheck:
  19197. this.check();
  19198. break;
  19199. case this.ui.rnNode.btnExit:
  19200. case this.ui.xyNode.btnNo:
  19201. this.ysxyNum--;
  19202. if (this.ysxyNum > 0)
  19203. this.showMsg("Refuse to quit the game once again");
  19204. else {
  19205. Moyu.userAgree(false);
  19206. Moyu.exit();
  19207. }
  19208. break;
  19209. case this.ui.xyNode.btnSure:
  19210. case this.ui.xyNode.btnYes:
  19211. DataMgr.userData.isAgree = true;
  19212. DataMgr.saveUserData();
  19213. this.onAgree();
  19214. break;
  19215. case this.ui.rnNode.btnDone:
  19216. this.ui.rnNode.visible = false;
  19217. this.ui.visible = false;
  19218. break;
  19219. case this.ui.fcmNode.btnRn:
  19220. this.showRn();
  19221. break;
  19222. }
  19223. }
  19224. showTip(show) {
  19225. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19226. return;
  19227. if (show) {
  19228. MoyuMgr$1.isAdvise = true;
  19229. this.ui.visible = true;
  19230. this.ui.tipNode.visible = true;
  19231. this.ui.tipNode.alpha = 1;
  19232. Laya.timer.once(1000, this, this.showTip, [false]);
  19233. }
  19234. else {
  19235. this.ui.tipNode.alpha = 1;
  19236. this.ui.tipNode.visible = true;
  19237. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19238. this.ui.tipNode.visible = false;
  19239. MoyuMgr$1.isAdvise = false;
  19240. }), 1000);
  19241. }
  19242. }
  19243. showAge(show, px = 0, py = 0) {
  19244. if (Moyu.platType > 10 && !Moyu.isIos) {
  19245. this.ui.ageTip.x = px;
  19246. this.ui.ageTip.y = py;
  19247. this.ui.ageTip.visible = show;
  19248. if (show)
  19249. this.ui.visible = true;
  19250. }
  19251. }
  19252. showAgree(call) {
  19253. this.agreeCall = call;
  19254. this.onAgree();
  19255. return;
  19256. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19257. this.showXy(0);
  19258. }
  19259. else
  19260. this.onAgree();
  19261. }
  19262. onAgree() {
  19263. if (!this.ui.ageNode.visible)
  19264. this.ui.visible = false;
  19265. this.ui.xyNode.visible = false;
  19266. Moyu.userAgree(true);
  19267. this.showAge(false);
  19268. this.agreeCall && this.agreeCall();
  19269. this.showRn();
  19270. }
  19271. showMsg(txt) {
  19272. this.ui.msgNode.txtMsg.text = txt;
  19273. this.ui.msgNode.visible = true;
  19274. this.ui.msgNode.alpha = 1;
  19275. this.ui.visible = true;
  19276. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19277. this.ui.msgNode.visible = false;
  19278. }), 2500, true);
  19279. }
  19280. showRn() {
  19281. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19282. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19283. this.ui.rnNode.rn1.visible = true;
  19284. this.ui.rnNode.rn2.visible = false;
  19285. this.ui.rnNode.rn3.visible = false;
  19286. this.ui.rnNode.rn4.visible = false;
  19287. this.ui.rnNode.visible = true;
  19288. this.ui.mainBg.visible = true;
  19289. this.ui.rnNode.btnDone.visible = false;
  19290. this.ui.rnNode.btnExit.visible = true;
  19291. this.ui.rnNode.btnCheck.visible = true;
  19292. this.ui.fcmNode.visible = false;
  19293. this.ui.visible = true;
  19294. return;
  19295. }
  19296. }
  19297. this.showFcm();
  19298. }
  19299. showFcm() {
  19300. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19301. Moyu.initFCM(true);
  19302. if (Moyu.gameTime < 1)
  19303. this.fcmLoop();
  19304. else if (Moyu.gameTime < 999)
  19305. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19306. }
  19307. }
  19308. fcmLoop() {
  19309. if (Moyu.gameTime < 1) {
  19310. this.ui.rnNode.visible = false;
  19311. this.ui.fcmNode.visible = true;
  19312. this.ui.mainBg.visible = true;
  19313. this.ui.visible = true;
  19314. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19315. Laya.timer.clear(this.ui, this.fcmLoop);
  19316. }
  19317. }
  19318. check() {
  19319. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19320. this.ui.rnNode.rn1.visible = false;
  19321. this.ui.rnNode.rn2.visible = false;
  19322. this.ui.rnNode.rn4.visible = true;
  19323. }
  19324. else if (this.ui.rnNode.rn4.visible) {
  19325. let name = this.ui.rnNode.inputName.text;
  19326. let code = this.ui.rnNode.inputCode.text;
  19327. if (code && code.length == 18) {
  19328. this.ui.rnNode.rn1.visible = false;
  19329. this.ui.rnNode.rn4.visible = false;
  19330. Moyu.authenticate(name, code, (res) => {
  19331. this.ui.rnNode.rn2.visible = !res;
  19332. this.ui.rnNode.rn3.visible = res;
  19333. this.ui.rnNode.btnDone.visible = res;
  19334. this.ui.rnNode.btnExit.visible = !res;
  19335. this.ui.rnNode.btnCheck.visible = !res;
  19336. if (res)
  19337. this.showFcm();
  19338. });
  19339. }
  19340. else
  19341. this.showMsg("信息填写不完整");
  19342. }
  19343. }
  19344. loadXy(type = 0) {
  19345. this.ui.xyNode.xy1.visible = false;
  19346. this.ui.xyNode.xy2.visible = true;
  19347. this.ui.xyNode.xyList.scrollToView(0);
  19348. if (type == 1) {
  19349. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19350. }
  19351. else if (type == 2) {
  19352. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19353. }
  19354. }
  19355. showXy(type = 0) {
  19356. this.xyBtn();
  19357. if (type == 0) {
  19358. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19359. this.ui.xyNode.btnSure.visible = true;
  19360. }
  19361. else {
  19362. this.ui.xyNode.btnYes.visible = true;
  19363. this.ui.xyNode.btnNo.visible = true;
  19364. }
  19365. }
  19366. else {
  19367. this.ui.xyNode.btnKnown.visible = true;
  19368. this.ui.mainBg.visible = true;
  19369. }
  19370. this.ui.xyNode.xy1.visible = true;
  19371. this.ui.xyNode.xy2.visible = false;
  19372. this.ui.xyNode.visible = true;
  19373. this.ui.visible = true;
  19374. }
  19375. xyBtn() {
  19376. this.ui.xyNode.btnSure.visible = false;
  19377. this.ui.xyNode.btnYes.visible = false;
  19378. this.ui.xyNode.btnNo.visible = false;
  19379. this.ui.xyNode.btnKnown.visible = false;
  19380. {
  19381. this.ui.xyNode.btnXy3.visible = false;
  19382. this.ui.xyNode.btnXy2.visible = true;
  19383. this.ui.xyNode.btnXy1.visible = true;
  19384. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19385. }
  19386. }
  19387. createXY(json) {
  19388. this.ysJson = json.content;
  19389. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19390. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19391. this.ui.xyNode.xy2.visible = true;
  19392. }
  19393. renderListItem(idx, cell) {
  19394. let xy = this.ysJson[idx];
  19395. cell.height = xy.line * 30;
  19396. cell.xyItem.text = xy.text;
  19397. }
  19398. onDestroy() {
  19399. this.agreeCall = null;
  19400. }
  19401. }
  19402. class UILoading extends UIBase {
  19403. constructor() {
  19404. super();
  19405. this.accTime = 0;
  19406. this.curNum = 0;
  19407. this.rate = 1;
  19408. this.loadSubOk = false;
  19409. this.loadResOK = false;
  19410. this.openLoading = true;
  19411. this.beginLoadRes = false;
  19412. this.finishD2 = false;
  19413. this.finishD3 = false;
  19414. }
  19415. onConstructor() {
  19416. this.ui = ui_UILoading.createInstance();
  19417. this.contentPane = this.ui;
  19418. this.isEject = false;
  19419. this._initUI();
  19420. this._addEvent();
  19421. }
  19422. _initUI() {
  19423. MoyuMgr$1.initMoyu();
  19424. }
  19425. _addEvent() {
  19426. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19427. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19428. }
  19429. show() {
  19430. super.show();
  19431. console.log('zh:加载分包资源');
  19432. loadSubRes(this.subResProgress.bind(this));
  19433. this.ui.txtLoad.text = "Loading...";
  19434. }
  19435. subResProgress(pro, finish) {
  19436. this.curNum = pro;
  19437. if (finish) {
  19438. this.curNum = 1;
  19439. this.loadSubOk = true;
  19440. }
  19441. }
  19442. laodD3Res() {
  19443. let scene3D = new Laya.Scene3D();
  19444. xGame.common.d3Scene = scene3D;
  19445. xGame.common.d3World = scene3D.addComponent(D3World);
  19446. xGame.common.d3World.loadScene();
  19447. }
  19448. loadD2Res() {
  19449. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19450. this.finishD2 = true;
  19451. this.checkLoadAll();
  19452. this.curNum = 1;
  19453. }), Laya.Handler.create(this, (pro) => {
  19454. this.curNum = pro;
  19455. }, null, false));
  19456. }
  19457. d3ResFinish() {
  19458. this.finishD3 = true;
  19459. this.checkLoadAll();
  19460. }
  19461. checkLoadAll() {
  19462. if (this.finishD2 && this.finishD3) {
  19463. this.loadResOK = true;
  19464. }
  19465. }
  19466. loadRes() {
  19467. this.laodD3Res();
  19468. this.loadD2Res();
  19469. }
  19470. myUpdate(dt) {
  19471. if (!this.openLoading)
  19472. return;
  19473. this.accTime += dt * this.rate;
  19474. if (this.accTime >= this.curNum)
  19475. this.accTime = this.curNum;
  19476. this.ui.loadinfo.value = this.accTime * 100;
  19477. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19478. if (!this.beginLoadRes) {
  19479. this.beginLoadRes = true;
  19480. this.ui.txtLoad.text = "Loading...";
  19481. this.curNum = 0;
  19482. this.accTime = 0;
  19483. this.loadRes();
  19484. }
  19485. if (this.loadResOK) {
  19486. this.openLoading = false;
  19487. Laya.timer.once(300, this, () => {
  19488. xGame.common.d3Scene.active = false;
  19489. MoyuMgr$1.showAgree(enterGame);
  19490. });
  19491. }
  19492. }
  19493. }
  19494. release() {
  19495. }
  19496. hide() {
  19497. super.hide();
  19498. this.release();
  19499. }
  19500. onClose() {
  19501. this.hide();
  19502. }
  19503. }
  19504. UILoading.uiName = "UILoading";
  19505. class UIRepentProp$1 extends UIBase {
  19506. constructor() {
  19507. super();
  19508. this.viewType = 0;
  19509. this.regretType = 0;
  19510. }
  19511. onConstructor() {
  19512. this.ui = ui_UIRepentProp.createInstance();
  19513. this.contentPane = this.ui;
  19514. this.isEject = false;
  19515. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19516. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19517. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19518. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19519. }
  19520. show(viewType, regretType, callback) {
  19521. PlatMgr.showInsert(true);
  19522. this.viewType = viewType;
  19523. this.regretType = regretType;
  19524. this.callback = callback;
  19525. super.show();
  19526. this.ui.t0.play();
  19527. this.ui.c1.selectedIndex = this.viewType;
  19528. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19529. if (this.viewType == 0) {
  19530. let guide = DataMgr.getGuideHelpLine();
  19531. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19532. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19533. }
  19534. xGame.common.gameMgr.gamePause = true;
  19535. }
  19536. hideSelf() {
  19537. xGame.common.gameMgr.gamePause = false;
  19538. this.callback && this.callback(false);
  19539. this.hide();
  19540. }
  19541. videoRegret() {
  19542. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19543. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19544. }
  19545. else {
  19546. console.log('zh:AD 失败,直接发放奖励');
  19547. this.qjff_AD_for_UIrepentProp_videoRegret();
  19548. }
  19549. }
  19550. qjff_AD_for_UIrepentProp_videoRegret() {
  19551. this.callback && this.callback(true);
  19552. this.hideSelf();
  19553. }
  19554. videoAddHelpLine() {
  19555. let guide = DataMgr.getGuideHelpLine();
  19556. if (guide == 0) {
  19557. this.callback && this.callback(true);
  19558. this.hideSelf();
  19559. DataMgr.setGuideHelpLine();
  19560. xGame.common.gameUI.ui.guideNode.visible = false;
  19561. }
  19562. else {
  19563. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19564. if (Laya.Browser.onAndroid) {
  19565. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19566. if (!boo) {
  19567. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19568. return;
  19569. }
  19570. }
  19571. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19572. }
  19573. else {
  19574. console.log('zh:AD 失败,直接发放奖励');
  19575. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19576. }
  19577. }
  19578. }
  19579. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19580. this.callback && this.callback(true);
  19581. this.hideSelf();
  19582. }
  19583. }
  19584. UIRepentProp$1.uiName = "UIRepentProp";
  19585. class UIRodMethod$1 extends UIBase {
  19586. constructor() {
  19587. super();
  19588. this.isPressd = false;
  19589. }
  19590. onConstructor() {
  19591. this.ui = ui_UIRodMethod.createInstance();
  19592. this.contentPane = this.ui;
  19593. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19594. this.moveDir = new Laya.Vector2();
  19595. this.moveDest = new Laya.Vector2();
  19596. this.centerPos = new Laya.Vector2();
  19597. xGame.common.uiRodMethod = this;
  19598. }
  19599. show() {
  19600. super.show();
  19601. xGame.common.gameMgr.gamePause = true;
  19602. this.openPressDotEvent();
  19603. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19604. this.centerPos.x = this.ui.white.x;
  19605. this.centerPos.y = this.ui.white.y;
  19606. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19607. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19608. this.setDot();
  19609. }
  19610. setDot() {
  19611. this.ui.dot.x = this.moveDest.x;
  19612. this.ui.dot.y = this.moveDest.y;
  19613. }
  19614. closeSelf() {
  19615. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19616. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19617. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19618. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19619. xGame.common.gameMgr.gamePause = false;
  19620. this.hide();
  19621. }
  19622. openPressDotEvent() {
  19623. this.closePressDotEvent();
  19624. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19625. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19626. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19627. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19628. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19629. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19630. }
  19631. closePressDotEvent() {
  19632. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19633. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19634. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19635. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19636. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19637. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19638. }
  19639. onDown(e) {
  19640. if (e.type == Laya.Event.MOUSE_DOWN)
  19641. this.isPressd = true;
  19642. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19643. this.isPressd = false;
  19644. if (!this.isPressd)
  19645. return;
  19646. this.moveDest.x = e.stageX;
  19647. this.moveDest.y = e.stageY;
  19648. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19649. if (dis > 6724) {
  19650. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19651. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19652. }
  19653. this.setDot();
  19654. }
  19655. resetRod() {
  19656. this.ui.dot.x = this.ui.white.x;
  19657. this.ui.dot.y = this.ui.white.y;
  19658. this.gameRod.dot.x = this.gameRod.bg.x;
  19659. this.gameRod.dot.y = this.gameRod.bg.y;
  19660. xGame.common.rodOffest.x = 0;
  19661. xGame.common.rodOffest.y = 0;
  19662. }
  19663. }
  19664. UIRodMethod$1.uiName = "UIRodMethod";
  19665. class UIMsg$1 extends UIBase {
  19666. constructor() {
  19667. super();
  19668. }
  19669. onConstructor() {
  19670. this.ui = ui_UIMsg.createInstance();
  19671. this.contentPane = this.ui;
  19672. this.isEject = false;
  19673. this.isMuti = true;
  19674. }
  19675. show(msg, callback) {
  19676. super.show();
  19677. this.ui.tipsNode.msgTxt.text = msg;
  19678. this.ui.alpha = 1;
  19679. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19680. this.hide();
  19681. callback && callback();
  19682. }), 1000);
  19683. }
  19684. }
  19685. UIMsg$1.uiName = "UIMsg";
  19686. class UITips$1 extends UIBase {
  19687. constructor() {
  19688. super();
  19689. this.type = 0;
  19690. }
  19691. onConstructor() {
  19692. this.ui = ui_UITips.createInstance();
  19693. this.contentPane = this.ui;
  19694. this.isEject = false;
  19695. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19696. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19697. }
  19698. show(tipsTxt, womanTxt, type) {
  19699. super.show();
  19700. this.ui.t0.play();
  19701. this.ui.myNode.tipsTxt.text = tipsTxt;
  19702. this.ui.myNode.womanTxt.text = womanTxt;
  19703. PlatMgr.showInsert(true);
  19704. this.ui.myNode.c1.selectedIndex = type;
  19705. this.type = type;
  19706. switch (this.type) {
  19707. case TipsType.exitGame:
  19708. xGame.common.gameMgr.gamePause = true;
  19709. break;
  19710. case TipsType.foul:
  19711. Laya.timer.once(200, this, () => {
  19712. xGame.common.gameMgr.gamePause = true;
  19713. });
  19714. break;
  19715. default:
  19716. break;
  19717. }
  19718. }
  19719. clickLeftBtn() {
  19720. this.hide();
  19721. xGame.common.gameMgr.gamePause = false;
  19722. switch (this.type) {
  19723. case TipsType.exitGame:
  19724. break;
  19725. case TipsType.foul:
  19726. break;
  19727. default:
  19728. break;
  19729. }
  19730. }
  19731. clickRightBtn() {
  19732. this.hide();
  19733. switch (this.type) {
  19734. case TipsType.exitGame:
  19735. xGame.eventMgr.event(RESET_GAME);
  19736. xGame.uiMgr.Show(UIMain$1);
  19737. Moyu.recordEnd(this, null);
  19738. xGame.common.longHelpLine = false;
  19739. break;
  19740. case TipsType.foul:
  19741. xGame.common.gameMgr.gamePause = false;
  19742. Laya.timer.clearAll(this);
  19743. break;
  19744. default:
  19745. break;
  19746. }
  19747. }
  19748. }
  19749. UITips$1.uiName = "UITips";
  19750. class UIGame$1 extends UIBase {
  19751. constructor() {
  19752. super();
  19753. this.powerNum = 0;
  19754. this.isD3Inited = false;
  19755. this.isPrePlay = false;
  19756. this.isMoveRod = false;
  19757. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19758. this.rulerDis = 20;
  19759. this.rulerOffset = 0;
  19760. }
  19761. onConstructor() {
  19762. this.ui = ui_UIGame.createInstance();
  19763. this.contentPane = this.ui;
  19764. this.ui.x += xGame.common.sysOffestNum;
  19765. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19766. this.isEject = false;
  19767. xGame.common.gameUI = this;
  19768. this.initSelf();
  19769. }
  19770. isTurnSelf() {
  19771. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19772. return true;
  19773. }
  19774. }
  19775. initSelf() {
  19776. let topUI = this.ui.topNode;
  19777. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19778. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19779. this.barInfo = {};
  19780. this.barInfo.curY = 0;
  19781. this.barInfo.height = this.ui.powerNode.height;
  19782. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19783. this.barInfo.powerStartY = this.ui.powerNode.y;
  19784. xGame.common.aiPlayer = new AIPlayer();
  19785. xGame.common.gameMgr = new GameMgr();
  19786. xGame.common.skillMgr = new SkillMgr();
  19787. xGame.common.wordsMgr = new WordsMgr();
  19788. xGame.common.talkMgr = new TalkMgr();
  19789. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19790. console.log("加载经典模式表情文件chenggon !");
  19791. });
  19792. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19793. console.log("挑战模式奖励模式spine加载成功!");
  19794. });
  19795. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19796. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19797. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19798. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19799. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19800. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19801. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19802. }
  19803. getGanZiImg() {
  19804. let index = DataMgr.getCurBallRod();
  19805. let data = cfgTable.ballrodData[index + 1];
  19806. let gan_url = xGame.common.getGameIconUrl(data.img);
  19807. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19808. this.ui.powerNode.showImg.url = gan_url;
  19809. console.log('zh:修改杆子图标O K');
  19810. }
  19811. returnHome() {
  19812. let tips = "Are you sure to exit the game?";
  19813. let woman = "Boss, why don't you play for a while longer?";
  19814. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19815. }
  19816. addRodMethodClick() {
  19817. if (this.isTurnSelf()) {
  19818. xGame.uiMgr.Show(UIRodMethod$1);
  19819. }
  19820. }
  19821. clickHelpLineBtn(force = false) {
  19822. if (!this.isTurnSelf())
  19823. return;
  19824. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19825. if (success) {
  19826. xGame.common.longHelpLine = true;
  19827. xGame.common.d2World.getHelpLine();
  19828. Moyu.sendDataEvent("guideNum");
  19829. }
  19830. else {
  19831. }
  19832. });
  19833. }
  19834. renderSelfDisplayBalls(index, target) {
  19835. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19836. target.myImg.url = xGame.common.getGameIconUrl(str);
  19837. }
  19838. renderAIDisplayBalls(index, target) {
  19839. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19840. target.myImg.url = xGame.common.getGameIconUrl(str);
  19841. ;
  19842. }
  19843. updateMode() {
  19844. if (xGame.common.gameMode == GameMode.classic) {
  19845. this.ui.topNode.scoreNode.visible = false;
  19846. }
  19847. else if (xGame.common.gameMode == GameMode.bigMove) {
  19848. this.ui.topNode.scoreNode.visible = true;
  19849. }
  19850. }
  19851. show() {
  19852. super.show();
  19853. console.log("zh:uigame show AADD");
  19854. this.ui.alpha = 0;
  19855. this.updateSelf();
  19856. xGame.common.gameMgr.gamePause = false;
  19857. xGame.common.gameUI.ui.blackAni.visible = false;
  19858. xGame.common.gameUI.ui.whiteAni.visible = false;
  19859. this.ui.powerEft.visible = false;
  19860. this.ui.colorNode.visible = false;
  19861. this.updateHead();
  19862. let curUse = DataMgr.getCurBallRod();
  19863. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19864. this.getGanZiImg();
  19865. }
  19866. updateSelf() {
  19867. if (xGame.common.gameMode == GameMode.classic) {
  19868. this.ui.c1.selectedIndex = 0;
  19869. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19870. this.ui.topNode.middleNode.visible = true;
  19871. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19872. }
  19873. else if (xGame.common.gameMode == GameMode.bigMove) {
  19874. this.ui.c1.selectedIndex = 0;
  19875. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19876. this.ui.topNode.middleNode.visible = false;
  19877. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19878. let rand = xGame.common.randomNum(1, max);
  19879. let guide = DataMgr.getSkillGuide();
  19880. if (guide == 0)
  19881. rand = 1;
  19882. xGame.common.bigMoveLevelIndex = rand;
  19883. }
  19884. else if (xGame.common.gameMode == GameMode.placeBall) {
  19885. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19886. this.ui.c1.selectedIndex = 1 + data.type;
  19887. this.ui.alpha = 1;
  19888. this.startGame();
  19889. }
  19890. this.updateMode();
  19891. this.initD3world();
  19892. this.initD2world();
  19893. }
  19894. startGame() {
  19895. this.ui.snowNode.visible = Math.random() <= 0.1;
  19896. this.ui.d2Node.visible = false;
  19897. xGame.common.d3World.d3Hand.gameObj.active = false;
  19898. xGame.common.d3World.tableSrc.init();
  19899. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19900. this.cameraViewChange(() => {
  19901. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  19902. switch (xGame.common.gameMode) {
  19903. case GameMode.classic:
  19904. xGame.common.d3World.d3Hand.gameObj.active = true;
  19905. this.playPutBallD3Ani();
  19906. break;
  19907. case GameMode.bigMove:
  19908. this.enterGame();
  19909. Laya.timer.once(500, this, () => {
  19910. this.ui.topNode.middleNode.visible = true;
  19911. this.ui.topNode.middleNode.t0.play();
  19912. });
  19913. break;
  19914. case GameMode.placeBall:
  19915. this.enterGame();
  19916. break;
  19917. default:
  19918. break;
  19919. }
  19920. });
  19921. PlatMgr.showBanner(false);
  19922. }
  19923. enterGame() {
  19924. this.ui.d2Node.visible = true;
  19925. xGame.common.d3World.d3Hand.gameObj.active = false;
  19926. xGame.common.showOneCamera("mainCamera");
  19927. Moyu.recordGame(30, true);
  19928. if (!this.isPrePlay) {
  19929. this.isPrePlay = true;
  19930. xGame.common.d3World.prePlayEft();
  19931. }
  19932. xGame.common.gameMgr.gameReady();
  19933. this.openAllEvent();
  19934. this.ui.snowNode.visible = false;
  19935. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  19936. this.ui.helpBtn.visible = condition;
  19937. }
  19938. showHelpLineGuide() {
  19939. let longGuide = DataMgr.getGuideHelpLine();
  19940. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  19941. this.ui.helpBtn.visible = true;
  19942. this.ui.guideNode.visible = true;
  19943. }
  19944. }
  19945. setTurnAlpha(alpha) {
  19946. this.ui.keduNode.alpha = alpha;
  19947. this.ui.ganNode.alpha = alpha;
  19948. this.ui.rodMethodNode.alpha = alpha;
  19949. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  19950. }
  19951. cameraViewChange(callback) {
  19952. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19953. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  19954. xGame.common.showOneCamera("visitAngle");
  19955. cameraSrc.localRotationEulerY = 180;
  19956. cameraSrc.localRotationEulerZ = 0;
  19957. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  19958. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  19959. callback && callback();
  19960. }));
  19961. }));
  19962. }
  19963. playPutBallD3Ani() {
  19964. xGame.common.showOneCamera("mainCamera");
  19965. let handSrc = xGame.common.d3World.d3Hand;
  19966. handSrc.gameObj.active = true;
  19967. handSrc.transform.localPositionZ = 3;
  19968. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  19969. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  19970. handSrc.gameObj.active = false;
  19971. this.enterGame();
  19972. }), 400);
  19973. }));
  19974. }
  19975. updateHead() {
  19976. let user = Moyu.getUserInfo();
  19977. this.ui.topNode.selfNameTxt.text = user.nickName;
  19978. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  19979. let aiData = xGame.cfgMgr.getRandomUserInfo();
  19980. if (DataMgr.getSkillGuide() < 1) {
  19981. this.ui.topNode.aiNameTxt.text = 'billiards';
  19982. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  19983. }
  19984. else {
  19985. this.ui.topNode.aiNameTxt.text = aiData.name;
  19986. let randNo = Math.floor(Math.random() * 10) + 1;
  19987. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  19988. }
  19989. }
  19990. initD2world() {
  19991. let node = this.ui.d2Root.displayObject;
  19992. let src = node.getComponent(D2World);
  19993. if (!src) {
  19994. xGame.common.d2World = node.addComponent(D2World);
  19995. }
  19996. xGame.common.d2World.initSelf();
  19997. }
  19998. initD3world() {
  19999. if (this.isD3Inited)
  20000. return;
  20001. this.isD3Inited = true;
  20002. let scene3D = xGame.common.d3Scene;
  20003. this.ui.d3Root.displayObject.addChild(scene3D);
  20004. scene3D.active = true;
  20005. xGame.common.d3World.tableSrc.setBorderPos();
  20006. }
  20007. onRootMove(e) {
  20008. let rootBall = xGame.common.d2World.rootBall;
  20009. this.ui.moveNode.x = e.x;
  20010. this.ui.moveNode.y = e.y;
  20011. rootBall.gameObj.x = e.x;
  20012. rootBall.gameObj.y = e.y;
  20013. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20014. }
  20015. aiRootMove(move) {
  20016. if (move)
  20017. this.hideBallUI();
  20018. else {
  20019. this.showBallUI();
  20020. xGame.common.d2World.getHelpLine();
  20021. }
  20022. }
  20023. aiForce(type, force = 0) {
  20024. this.pressTarget = PressType.powerNode;
  20025. if (type == 1)
  20026. this.onEventUp({ force: true });
  20027. else if (type == 2)
  20028. this.onEventMove({ stageY: force, force: true });
  20029. }
  20030. onEventPress(e) {
  20031. if (e.stopPropagation)
  20032. e.stopPropagation();
  20033. if (!this.isTurnSelf())
  20034. return;
  20035. let target = e.target;
  20036. switch (target) {
  20037. case this.ui.myPowerNode.displayObject:
  20038. this.pressTarget = PressType.powerNode;
  20039. this.barInfo.curY = e.stageY;
  20040. this.updateBarInfo();
  20041. break;
  20042. case this.ui.moveNode.displayObject:
  20043. this.pressTarget = PressType.moveNode;
  20044. this.hideBallUI();
  20045. this.eventObj.curX = this.ui.moveNode.x;
  20046. this.eventObj.curY = this.ui.moveNode.y;
  20047. this.ui.moveNode.finger.visible = false;
  20048. this.eventObj.lastX = e.stageX;
  20049. this.eventObj.lastY = e.stageY;
  20050. break;
  20051. case this.ui.rulerClickNode.displayObject:
  20052. this.pressTarget = PressType.rulerNode;
  20053. this.eventObj.lastY = e.stageY;
  20054. break;
  20055. case this.ui.d2Root.displayObject:
  20056. this.pressTarget = PressType.d2Root;
  20057. this.eventObj.lastX = e.stageX;
  20058. this.eventObj.lastY = e.stageY;
  20059. this.eventObj.starX = e.stageX;
  20060. this.eventObj.starY = e.stageY;
  20061. this.eventObj.curX = 0;
  20062. this.eventObj.curY = 0;
  20063. xGame.common.d2World.d2Gan.setGanLastInfo();
  20064. this.rulerOffset = 0;
  20065. break;
  20066. default:
  20067. break;
  20068. }
  20069. }
  20070. onEventMove(e) {
  20071. if (e.stopPropagation)
  20072. e.stopPropagation();
  20073. if (e && e.force) {
  20074. }
  20075. else {
  20076. if (!this.isTurnSelf())
  20077. return;
  20078. }
  20079. switch (this.pressTarget) {
  20080. case PressType.powerNode:
  20081. this.barInfo.curY = e.stageY;
  20082. this.updateBarInfo();
  20083. this.isMoveRod = true;
  20084. break;
  20085. case PressType.moveNode:
  20086. let rootBall = xGame.common.d2World.rootBall;
  20087. let radius = rootBall.gameObj.width / 2;
  20088. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20089. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20090. let border = xGame.common.d2World.borderRect;
  20091. if (curX <= border.x + radius)
  20092. curX = border.x + radius;
  20093. else if (curX >= border.x + border.width - radius)
  20094. curX = border.x + border.width - radius;
  20095. if (curY <= border.y + radius)
  20096. curY = border.y + radius;
  20097. else if (curY >= border.y + border.height - radius)
  20098. curY = border.y + border.height - radius;
  20099. if (xGame.common.gameMgr.isOpenBall) {
  20100. if (curX >= border.x + border.openBallW - radius)
  20101. curX = border.x + border.openBallW - radius;
  20102. }
  20103. this.ui.moveNode.x = curX;
  20104. this.ui.moveNode.y = curY;
  20105. rootBall.gameObj.x = curX;
  20106. rootBall.gameObj.y = curY;
  20107. rootBall.d3BallSrc.setTransPos(curX, curY);
  20108. this.isMoveRod = true;
  20109. break;
  20110. case PressType.rulerNode:
  20111. let yy = e.stageY - this.eventObj.lastY;
  20112. this.eventObj.lastY = e.stageY;
  20113. let ruler1 = this.ui.rulerNode.img1;
  20114. let ruler2 = this.ui.rulerNode.img2;
  20115. ruler1.y += yy;
  20116. ruler2.y += yy;
  20117. this.rulerOffset += yy;
  20118. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20119. this.rulerOffset = 0;
  20120. xGame.soundMgr.playSound("inch", 1, 10);
  20121. }
  20122. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20123. let h = ruler1.height;
  20124. this.checkGuide();
  20125. this.isMoveRod = true;
  20126. if (ruler1.y >= h) {
  20127. ruler1.y = -h;
  20128. ruler2.y = 0;
  20129. return;
  20130. }
  20131. else if (ruler1.y <= -h) {
  20132. ruler1.y = h;
  20133. ruler2.y = 0;
  20134. return;
  20135. }
  20136. if (ruler2.y >= h) {
  20137. ruler2.y = -h;
  20138. ruler1.y = 0;
  20139. return;
  20140. }
  20141. else if (ruler2.y <= -h) {
  20142. ruler2.y = h;
  20143. ruler1.y = 0;
  20144. return;
  20145. }
  20146. break;
  20147. case PressType.d2Root:
  20148. this.eventObj.curX = e.stageX;
  20149. this.eventObj.curY = e.stageY;
  20150. let offset = this.checkRodMoveDir();
  20151. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20152. this.eventObj.lastX = e.stageX;
  20153. this.eventObj.lastY = e.stageY;
  20154. break;
  20155. default:
  20156. break;
  20157. }
  20158. }
  20159. onEventUp(e) {
  20160. if (e.stopPropagation)
  20161. e.stopPropagation();
  20162. if (e && e.force) {
  20163. }
  20164. else {
  20165. if (!this.isTurnSelf())
  20166. return;
  20167. }
  20168. switch (this.pressTarget) {
  20169. case PressType.powerNode:
  20170. this.ui.powerNode.value = 0;
  20171. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20172. this.ui.powerTxt.text = "";
  20173. if (this.powerNum > 0) {
  20174. xGame.eventMgr.event(BALL_SHOOT);
  20175. xGame.common.d2World.shoot(this.powerNum);
  20176. xGame.common.d2World.d2Gan.shoot();
  20177. xGame.common.d2World.d2HelpLine.shoot();
  20178. this.finishGuide();
  20179. this.ui.powerEft.visible = false;
  20180. this.ui.colorNode.visible = false;
  20181. let ganStr = "";
  20182. if (this.powerNum <= 30) {
  20183. ganStr = "gan_30";
  20184. }
  20185. else if (this.powerNum <= 60) {
  20186. ganStr = "gan_50";
  20187. }
  20188. else {
  20189. ganStr = "gan_80";
  20190. }
  20191. xGame.soundMgr.playSound(ganStr);
  20192. }
  20193. break;
  20194. case PressType.moveNode:
  20195. let rootBall = xGame.common.d2World.rootBall;
  20196. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20197. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20198. let isIntersect = this.judgeBallIntersect();
  20199. if (isIntersect) {
  20200. this.ui.moveNode.x = lastX;
  20201. this.ui.moveNode.y = lastY;
  20202. rootBall.gameObj.x = lastX;
  20203. rootBall.gameObj.y = lastY;
  20204. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20205. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20206. }
  20207. else {
  20208. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20209. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20210. }
  20211. this.showBallUI();
  20212. this.ui.moveNode.finger.visible = true;
  20213. xGame.common.d2World.getHelpLine();
  20214. break;
  20215. case PressType.rulerNode:
  20216. break;
  20217. case PressType.d2Root:
  20218. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20219. if (dis <= 25) {
  20220. this.moveToClickDot(e);
  20221. }
  20222. break;
  20223. default:
  20224. break;
  20225. }
  20226. this.pressTarget = -1;
  20227. }
  20228. checkGuide() {
  20229. let guide = DataMgr.getSkillGuide();
  20230. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20231. xGame.common.guideStep++;
  20232. xGame.common.gameUI.ui.guide2.visible = false;
  20233. xGame.common.gameUI.ui.guide3.visible = true;
  20234. }
  20235. }
  20236. finishGuide() {
  20237. let guide = DataMgr.getSkillGuide();
  20238. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20239. xGame.common.guideStep = 10;
  20240. this.closeAllGuide();
  20241. console.log('zh: 新手引导完毕');
  20242. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20243. }
  20244. }
  20245. closeAllGuide() {
  20246. xGame.common.gameUI.ui.guide1.visible = false;
  20247. xGame.common.gameUI.ui.guide2.visible = false;
  20248. xGame.common.gameUI.ui.guide3.visible = false;
  20249. }
  20250. updateBarInfo() {
  20251. let star = this.ui.powerNode.y;
  20252. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20253. if (rate >= 1)
  20254. rate = 1;
  20255. if (rate <= 0)
  20256. rate = 0;
  20257. this.powerNum = Math.ceil(rate * 100);
  20258. this.ui.powerNode.value = this.powerNum;
  20259. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20260. this.ui.colorNode.value = this.powerNum;
  20261. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20262. this.ui.powerEft.visible = this.powerNum != 0;
  20263. this.ui.colorNode.visible = this.powerNum != 0;
  20264. this.ui.powerTxt.text = this.powerNum + "";
  20265. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20266. }
  20267. forceCancel() {
  20268. this.ui.powerNode.value = 0;
  20269. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20270. this.ui.powerTxt.text = "";
  20271. }
  20272. checkRodMoveDir() {
  20273. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20274. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20275. if (tempX >= 0 && tempY <= 0) {
  20276. return this.checkDir();
  20277. }
  20278. else if (tempX < 0 && tempY < 0) {
  20279. return this.checkDir(1, -1);
  20280. }
  20281. else if (tempX < 0 && tempY > 0) {
  20282. return this.checkDir(-1, -1);
  20283. }
  20284. else {
  20285. return this.checkDir(-1, 1);
  20286. }
  20287. }
  20288. checkDir(flagX = 1, flagY = 1) {
  20289. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20290. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20291. if (offsetY == 0) {
  20292. return offsetX * flagX;
  20293. }
  20294. if (offsetX == 0) {
  20295. return offsetY * flagY;
  20296. }
  20297. let angle = offsetY / offsetX;
  20298. if (Math.abs(angle) >= 1) {
  20299. return offsetY * flagY;
  20300. }
  20301. else {
  20302. return offsetX * flagX;
  20303. }
  20304. }
  20305. judgeBallIntersect() {
  20306. let rootBall = xGame.common.d2World.rootBall;
  20307. let ballArr = xGame.common.d2World.ballArr;
  20308. let radius = rootBall.gameObj.width / 2;
  20309. let temp;
  20310. let isIntersect = false;
  20311. for (let index = 0; index < ballArr.length; index++) {
  20312. temp = ballArr[index];
  20313. if (temp.number == rootBall.number)
  20314. continue;
  20315. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20316. if (isIntersect) {
  20317. break;
  20318. }
  20319. }
  20320. return isIntersect;
  20321. }
  20322. hideBallUI() {
  20323. let d2Gan = xGame.common.d2World.d2Gan;
  20324. if (!d2Gan.ui.isDisposed)
  20325. d2Gan.ui.visible = false;
  20326. let d2Help = xGame.common.d2World.d2HelpLine;
  20327. if (!d2Help.ui.isDisposed)
  20328. d2Help.ui.visible = false;
  20329. let rootBall = xGame.common.d2World.rootBall;
  20330. if (!rootBall.destroyed) {
  20331. rootBall.gameObj.active = false;
  20332. }
  20333. }
  20334. showBallUI() {
  20335. let d2Gan = xGame.common.d2World.d2Gan;
  20336. if (!d2Gan.ui.isDisposed)
  20337. d2Gan.ui.visible = true;
  20338. let d2Help = xGame.common.d2World.d2HelpLine;
  20339. if (!d2Help.ui.isDisposed)
  20340. d2Help.ui.visible = true;
  20341. let rootBall = xGame.common.d2World.rootBall;
  20342. if (!rootBall.destroyed) {
  20343. rootBall.gameObj.active = true;
  20344. }
  20345. }
  20346. moveToClickDot(e) {
  20347. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20348. let root = xGame.common.d2World.rootBall.gameObj;
  20349. let xx = e.stageX - xGame.common.sysOffestNum;
  20350. let yy = e.stageY;
  20351. let x = xx - root.x;
  20352. let y = yy - root.y;
  20353. let angle = xGame.common.getfguiRotation(x, y);
  20354. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20355. xGame.common.d2World.getHelpLine();
  20356. }
  20357. this.isMoveRod = false;
  20358. xGame.common.clickedBall = false;
  20359. }
  20360. openAllEvent() {
  20361. this.closeAllEvent();
  20362. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20363. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20364. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20365. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20366. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20367. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20368. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20369. }
  20370. closeAllEvent() {
  20371. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20372. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20373. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20374. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20375. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20376. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20377. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20378. }
  20379. resetGame() {
  20380. this.closeAllEvent();
  20381. this.hideBallUI();
  20382. xGame.common.gameMgr.gamePause = true;
  20383. }
  20384. }
  20385. UIGame$1.uiName = "UIGame";
  20386. class UIAddCoin$1 extends UIBase {
  20387. constructor() {
  20388. super();
  20389. this.coinNum = 2000;
  20390. }
  20391. onConstructor() {
  20392. this.ui = ui_UIAddCoin.createInstance();
  20393. this.contentPane = this.ui;
  20394. this.isEject = false;
  20395. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20396. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20397. }
  20398. show() {
  20399. super.show();
  20400. this.ui.t0.play();
  20401. }
  20402. videoAddCoin() {
  20403. console.log('zh:qjff_AD_for_UIAddCoin');
  20404. if (Laya.Browser.onAndroid) {
  20405. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20406. if (!boo) {
  20407. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20408. return;
  20409. }
  20410. }
  20411. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20412. }
  20413. else {
  20414. console.log('zh:AD 失败,直接发放奖励');
  20415. this.qjff_AD_for_UIAddCoin();
  20416. }
  20417. }
  20418. qjff_AD_for_UIAddCoin() {
  20419. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20420. this.hide();
  20421. }
  20422. }
  20423. UIAddCoin$1.uiName = "UIAddCoin";
  20424. class UIInvitation$1 extends UIBase {
  20425. constructor() {
  20426. super();
  20427. }
  20428. onConstructor() {
  20429. this.ui = ui_UIInvitation.createInstance();
  20430. this.contentPane = this.ui;
  20431. this.isEject = false;
  20432. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20433. }
  20434. show() {
  20435. super.show();
  20436. }
  20437. enterGame() {
  20438. xGame.common.gameMode = GameMode.classic;
  20439. DataMgr.setChallengeTimes(1);
  20440. xGame.common.passAwardCoin = 2000;
  20441. let need = xGame.common.classicNiceNeddCoin;
  20442. if (DataMgr.coinEnough(need)) {
  20443. DataMgr.setCoin(-need);
  20444. xGame.eventMgr.event(RESTART_GAME, true);
  20445. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20446. }
  20447. else {
  20448. xGame.eventMgr.event(RESTART_GAME, true);
  20449. }
  20450. this.hide();
  20451. }
  20452. hide() {
  20453. super.hide();
  20454. }
  20455. }
  20456. UIInvitation$1.uiName = "UIInvitation";
  20457. class UIPower$1 extends UIBase {
  20458. constructor() {
  20459. super();
  20460. }
  20461. onConstructor() {
  20462. this.ui = ui_UIPower.createInstance();
  20463. this.contentPane = this.ui;
  20464. this.isEject = false;
  20465. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20466. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20467. }
  20468. show() {
  20469. super.show();
  20470. this.ui.t0.play();
  20471. }
  20472. videoGetPower() {
  20473. console.log('zh:qjff_AD_for_uipower');
  20474. if (Laya.Browser.onAndroid) {
  20475. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20476. if (!boo) {
  20477. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20478. return;
  20479. }
  20480. }
  20481. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20482. }
  20483. else {
  20484. console.log('zh:AD 失败,直接发放奖励');
  20485. this.qjff_AD_for_uipower();
  20486. }
  20487. }
  20488. qjff_AD_for_uipower() {
  20489. DataMgr.setPower(xGame.common.videoPower, true);
  20490. xGame.eventMgr.event(POWER_TIME);
  20491. this.hide();
  20492. }
  20493. }
  20494. UIPower$1.uiName = "UIPower";
  20495. class UIGameEnd$1 extends UIBase {
  20496. constructor() {
  20497. super();
  20498. this.success = false;
  20499. this.awardCoinNum = 1000;
  20500. this.awardDiamondNum = 10;
  20501. }
  20502. onConstructor() {
  20503. this.ui = ui_UIGameEnd.createInstance();
  20504. this.contentPane = this.ui;
  20505. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20506. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20507. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20508. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20509. this.ui.talkNode.visible = false;
  20510. if (Moyu.isKs)
  20511. this.ui.closeNode.closeBtn.x += 100;
  20512. }
  20513. updateType() {
  20514. switch (xGame.common.gameMode) {
  20515. case GameMode.classic:
  20516. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20517. this.ui.coinNode.visible = this.success;
  20518. if (!this.success) {
  20519. Laya.timer.once(500, this, () => {
  20520. xGame.uiMgr.Show(UIAddCoin$1);
  20521. });
  20522. }
  20523. else {
  20524. this.logEventForClassic_win();
  20525. }
  20526. this.logEventForClassic_complete();
  20527. this.ui.isGetAward.visible = false;
  20528. this.ui.leftBtn.c1.selectedIndex = 3;
  20529. this.ui.rightBtn.c1.selectedIndex = 0;
  20530. this.moneyNode.ui.c1.selectedIndex = 1;
  20531. break;
  20532. case GameMode.bigMove:
  20533. console.log('zh:招法模式 aaaaaa bigMove');
  20534. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20535. this.ui.coinNode.visible = this.success;
  20536. if (xGame.common.gameMode == GameMode.bigMove) {
  20537. if (this.success) {
  20538. DataMgr.setSkillSuccessTimes(1, true);
  20539. DataMgr.setSkillAccTimes(1);
  20540. }
  20541. else {
  20542. DataMgr.setSkillSuccessTimes(0, false);
  20543. }
  20544. }
  20545. this.logEventForRod_complete_N();
  20546. if (!this.success) {
  20547. Laya.timer.once(500, this, () => {
  20548. xGame.uiMgr.Show(UIAddCoin$1);
  20549. });
  20550. }
  20551. else {
  20552. this.logEventForRod_win();
  20553. }
  20554. this.ui.isGetAward.visible = false;
  20555. this.ui.leftBtn.c1.selectedIndex = 3;
  20556. this.ui.rightBtn.c1.selectedIndex = 0;
  20557. this.moneyNode.ui.c1.selectedIndex = 1;
  20558. break;
  20559. case GameMode.placeBall:
  20560. this.ui.coinNode.visible = false;
  20561. if (this.success) {
  20562. if (xGame.common.placeBallStarNum == 3) {
  20563. this.ui.c1.selectedIndex = 2;
  20564. }
  20565. else {
  20566. this.ui.c1.selectedIndex = 3;
  20567. }
  20568. let level = xGame.common.placeBallCurLevel;
  20569. if (level > 59) {
  20570. this.logEventForChallenge_level_complete(level);
  20571. }
  20572. else {
  20573. this.logEventForChallenge_level_N(level);
  20574. }
  20575. }
  20576. else {
  20577. this.ui.c1.selectedIndex = 4;
  20578. }
  20579. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20580. if (cfg.type == PlaceBallType.challenge) {
  20581. this.ui.c1.selectedIndex = 2;
  20582. }
  20583. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20584. this.updatePlaceBallBtn();
  20585. this.updatePlaceBallStarNum();
  20586. this.updatePlaceBallAwardState();
  20587. this.moneyNode.ui.c1.selectedIndex = 2;
  20588. this.moneyNode.checkPowerTime();
  20589. this.moneyNode.powerChange();
  20590. DataMgr.upRankData();
  20591. break;
  20592. default:
  20593. break;
  20594. }
  20595. }
  20596. logEventForRod_complete_N() {
  20597. let gfmsIdx = xGame.common.curPlayerSkillType;
  20598. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20599. let gfmc = 'Skyfall Shot';
  20600. if (gfmsIdx == 0) {
  20601. gfmc = 'Skyfall Shot';
  20602. }
  20603. if (gfmsIdx == 1) {
  20604. gfmc = 'Surging break';
  20605. }
  20606. if (gfmsIdx == 2) {
  20607. gfmc = 'Frost Lock';
  20608. }
  20609. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20610. console.log('zh:logEventForRod_complete_N level = ' + level);
  20611. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20612. let jsonStr = {
  20613. "count": 0,
  20614. "name": gfmc
  20615. };
  20616. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20617. const d = LocalStorageManager.getItem(keyStr);
  20618. jsonStr.count = d.count + 1;
  20619. LocalStorageManager.setItem(keyStr, jsonStr);
  20620. }
  20621. else {
  20622. LocalStorageManager.setItem(keyStr, jsonStr);
  20623. }
  20624. const d2 = LocalStorageManager.getItem(keyStr);
  20625. let count = d2.count;
  20626. console.log('zh:logEventForRod_complete_N count = ' + count);
  20627. if (count % 5 == 0) {
  20628. const reqStr = JSON.stringify(jsonStr);
  20629. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20630. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20631. }
  20632. }
  20633. logEventForRod_win() {
  20634. console.log('zh:logEventForRod_win,胜利');
  20635. let gfmsIdx = xGame.common.curPlayerSkillType;
  20636. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20637. let gfmc = 'Skyfall Shot';
  20638. if (gfmsIdx == 0) {
  20639. gfmc = 'Skyfall Shot';
  20640. }
  20641. if (gfmsIdx == 1) {
  20642. gfmc = 'Surging break';
  20643. }
  20644. if (gfmsIdx == 2) {
  20645. gfmc = 'Frost Lock';
  20646. }
  20647. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20648. console.log('zh:logEventForRod_win level = ' + level);
  20649. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20650. let jsonStr = {
  20651. "count": 1,
  20652. "name": gfmc + ' Lev' + level
  20653. };
  20654. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20655. const d = LocalStorageManager.getItem(keyStr);
  20656. jsonStr.count = d.count + 1;
  20657. LocalStorageManager.setItem(keyStr, jsonStr);
  20658. }
  20659. else {
  20660. LocalStorageManager.setItem(keyStr, jsonStr);
  20661. }
  20662. const reqStr = JSON.stringify(jsonStr);
  20663. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20664. }
  20665. logEventForClassic_win() {
  20666. console.log('zh:logEventForClassic_win,胜利');
  20667. let rtype = xGame.common.classicRoomType;
  20668. let msmc = '';
  20669. if (rtype == 1) {
  20670. msmc = 'beginner';
  20671. }
  20672. if (rtype == 2) {
  20673. msmc = 'expert';
  20674. }
  20675. if (rtype == 3) {
  20676. msmc = 'master';
  20677. }
  20678. let keyStr = 'sjmd_classic_win_' + rtype;
  20679. let jsonStr = {
  20680. "difficulty": msmc,
  20681. "classic_count": 1,
  20682. "difficulty_count": 1
  20683. };
  20684. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20685. const d = LocalStorageManager.getItem(keyStr);
  20686. jsonStr.classic_count = d.classic_count + 1;
  20687. jsonStr.difficulty_count = d.difficulty_count + 1;
  20688. LocalStorageManager.setItem(keyStr, jsonStr);
  20689. }
  20690. else {
  20691. LocalStorageManager.setItem(keyStr, jsonStr);
  20692. }
  20693. const reqStr = JSON.stringify(jsonStr);
  20694. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20695. }
  20696. logEventForClassic_complete() {
  20697. console.log('zh:logEventForClassic_complete,胜利');
  20698. let rtype = xGame.common.classicRoomType;
  20699. let msmc = '';
  20700. if (rtype == 1) {
  20701. msmc = 'beginner';
  20702. }
  20703. if (rtype == 2) {
  20704. msmc = 'expert';
  20705. }
  20706. if (rtype == 3) {
  20707. msmc = 'master';
  20708. }
  20709. let keyStr = 'sjmd_classic_complete_' + rtype;
  20710. let jsonStr = {
  20711. "msmc": msmc,
  20712. "count": 0
  20713. };
  20714. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20715. const d = LocalStorageManager.getItem(keyStr);
  20716. jsonStr.count = d.count + 1;
  20717. LocalStorageManager.setItem(keyStr, jsonStr);
  20718. }
  20719. else {
  20720. LocalStorageManager.setItem(keyStr, jsonStr);
  20721. }
  20722. if (jsonStr.count % 5 == 0) {
  20723. const reqStr = JSON.stringify(jsonStr);
  20724. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20725. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20726. }
  20727. }
  20728. updatePlaceBallBtn() {
  20729. this.ui.leftBtn.c1.selectedIndex = 5;
  20730. if (this.success) {
  20731. this.ui.rightBtn.c1.selectedIndex = 14;
  20732. }
  20733. else {
  20734. if (xGame.common.placeBallStarNum == 3) {
  20735. this.ui.rightBtn.c1.selectedIndex = 14;
  20736. }
  20737. else {
  20738. this.ui.rightBtn.c1.selectedIndex = 1;
  20739. }
  20740. }
  20741. }
  20742. updatePlaceBallStarNum() {
  20743. let starNum = xGame.common.placeBallStarNum;
  20744. if (starNum == 0)
  20745. this.ui.starNumNode.c1.selectedIndex = 3;
  20746. else {
  20747. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20748. }
  20749. }
  20750. updatePlaceBallAwardState() {
  20751. let level = xGame.common.placeBallCurLevel;
  20752. let starNum = xGame.common.placeBallStarNum;
  20753. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20754. let data = cfgTable.placeballData[level].award;
  20755. let cfg = cfgTable.placeballData[level];
  20756. this.awardDiamondNum = data[1];
  20757. this.awardCoinNum = data[0];
  20758. if (cfg.type == PlaceBallType.challenge) {
  20759. this.awardDiamondNum = 0;
  20760. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20761. }
  20762. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20763. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20764. if (cfg.type == PlaceBallType.challenge) {
  20765. this.ui.awardNode.coinNode.visible = true;
  20766. }
  20767. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20768. this.ui.awardNode.diamondNode.x = 265;
  20769. this.ui.awardNode.coinNode.x = 354;
  20770. }
  20771. else {
  20772. this.ui.awardNode.diamondNode.x = 291;
  20773. this.ui.awardNode.coinNode.x = 291;
  20774. }
  20775. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20776. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20777. if (this.awardCoinNum == 0) {
  20778. this.ui.awardNode.coinNode.numTxt.text = "";
  20779. }
  20780. if (getAward) {
  20781. this.ui.isGetAward.visible = true;
  20782. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20783. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20784. }
  20785. else {
  20786. this.ui.isGetAward.visible = false;
  20787. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20788. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20789. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20790. }
  20791. else {
  20792. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20793. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20794. }
  20795. }
  20796. }
  20797. show(success) {
  20798. super.show();
  20799. xGame.eventMgr.event(RESET_GAME);
  20800. this.success = success;
  20801. Laya.timer.clearAll(this);
  20802. this.playSecretaryAni();
  20803. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20804. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20805. offsetTime = Math.floor(offsetTime / 1000);
  20806. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20807. this.updateType();
  20808. Laya.timer.once(200, this, () => {
  20809. this.addAward(() => {
  20810. this.updateType();
  20811. Laya.timer.once(500, this, () => {
  20812. this.showChallengeLevel();
  20813. });
  20814. });
  20815. });
  20816. if (this.success) {
  20817. JSBridgeUtils.instance.showInternAd('gameend_success');
  20818. console.log('zh:game end 成功');
  20819. xGame.soundMgr.playSound('slots_roll01');
  20820. xGame.soundMgr.playSound("s_win");
  20821. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20822. this.diyGameDataUtilForGameWin();
  20823. }
  20824. else {
  20825. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20826. console.log('zh:game end失败');
  20827. xGame.soundMgr.playSound('matchwin01');
  20828. xGame.soundMgr.playSound("s_lose");
  20829. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20830. }
  20831. let challengeNum = DataMgr.getChallengeTimes();
  20832. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20833. DataMgr.setChallengeTimes(1);
  20834. }
  20835. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20836. DataMgr.setClassicTimes();
  20837. }
  20838. }
  20839. diyGameDataUtilForGameWin() {
  20840. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20841. switch (xGame.common.gameMode) {
  20842. case GameMode.classic:
  20843. console.log('zh:DiyGameDataUtilForGameWin 111');
  20844. case GameMode.bigMove:
  20845. console.log('zh:DiyGameDataUtilForGameWin 222');
  20846. this.restartGame();
  20847. break;
  20848. case GameMode.placeBall:
  20849. console.log('zh:DiyGameDataUtilForGameWin 333');
  20850. var level = xGame.common.placeBallCurLevel;
  20851. console.log('zh:练习模式 联系了多少LEV=' + level);
  20852. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20853. if (level > db_over_lev) {
  20854. DataMgr.setChallengeMode_overLev(level);
  20855. }
  20856. break;
  20857. default:
  20858. console.log('zh:DiyGameDataUtilForGameWin 444');
  20859. break;
  20860. }
  20861. }
  20862. showChallengeLevel() {
  20863. if (DataMgr.getChallengeTimes() != 0)
  20864. return;
  20865. let skill = DataMgr.getSkillAccTimes();
  20866. let put = DataMgr.getPlaceBallLevelList().length;
  20867. if (skill >= 3 || put >= 5) {
  20868. xGame.uiMgr.Show(UIInvitation$1);
  20869. this.hide();
  20870. }
  20871. }
  20872. addAward(callback) {
  20873. if (!this.success) {
  20874. callback && callback();
  20875. return;
  20876. }
  20877. switch (xGame.common.gameMode) {
  20878. case GameMode.classic:
  20879. this.awardCoinNum = xGame.common.passAwardCoin;
  20880. this.awardDiamondNum = 0;
  20881. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20882. break;
  20883. case GameMode.bigMove:
  20884. this.awardCoinNum = xGame.common.passAwardCoin;
  20885. this.awardDiamondNum = 0;
  20886. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20887. callback && callback();
  20888. break;
  20889. case GameMode.placeBall:
  20890. let level = xGame.common.placeBallCurLevel;
  20891. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  20892. if (xGame.common.placeBallStarNum != 3) {
  20893. callback && callback();
  20894. return;
  20895. }
  20896. else {
  20897. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20898. if (getAward) {
  20899. callback && callback();
  20900. return;
  20901. }
  20902. }
  20903. let cfg = cfgTable.placeballData[level];
  20904. let data = cfgTable.placeballData[level].award;
  20905. this.awardCoinNum = data[0];
  20906. this.awardDiamondNum = data[1];
  20907. if (cfg.type == PlaceBallType.challenge) {
  20908. this.awardDiamondNum = 0;
  20909. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20910. }
  20911. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  20912. let diamondAward;
  20913. if (this.awardDiamondNum > 0) {
  20914. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  20915. xGame.common.getAward([diamondAward, coinAward], callback);
  20916. }
  20917. else {
  20918. xGame.common.getAward([coinAward], callback);
  20919. }
  20920. if (cfg.type == PlaceBallType.normal) {
  20921. DataMgr.setPlaceBallAward(level);
  20922. }
  20923. break;
  20924. default:
  20925. break;
  20926. }
  20927. }
  20928. playSecretaryAni_old() {
  20929. let parent = this.ui.secretary.displayObject;
  20930. parent.destroyChildren();
  20931. let xx = this.ui.secretary.width / 2;
  20932. let yy = this.ui.secretary.height;
  20933. let scale = xGame.common.getSecretaryScale();
  20934. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20935. if (this.success) {
  20936. let rand = Math.random() <= 0.5 ? 2 : 3;
  20937. xGame.common.secretary.play(data, rand, false, parent, () => {
  20938. xGame.common.secretary.play(data, 1, true, parent);
  20939. });
  20940. }
  20941. else {
  20942. xGame.common.secretary.play(data, 0, true, parent);
  20943. }
  20944. }
  20945. playSecretaryAni() {
  20946. let parent = this.ui.secretary.displayObject;
  20947. parent.destroyChildren();
  20948. let xx = this.ui.secretary.width / 2;
  20949. let yy = this.ui.secretary.height;
  20950. let scale = xGame.common.getSecretaryScale();
  20951. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20952. if (this.success) {
  20953. let rand = 0;
  20954. xGame.common.secretary.play(data, 0, true, parent);
  20955. }
  20956. else {
  20957. xGame.common.secretary.play(data, 0, true, parent);
  20958. }
  20959. }
  20960. restartGame() {
  20961. switch (xGame.common.gameMode) {
  20962. case GameMode.classic:
  20963. xGame.eventMgr.event(RESTART_GAME);
  20964. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20965. break;
  20966. case GameMode.bigMove:
  20967. this.hide();
  20968. xGame.eventMgr.event(RESTART_GAME);
  20969. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20970. break;
  20971. default:
  20972. break;
  20973. }
  20974. }
  20975. hide() {
  20976. super.hide();
  20977. xGame.common.stopGirlPop(this.ui.talkNode);
  20978. PlatMgr.showBanner(false);
  20979. }
  20980. returnHome() {
  20981. this.hide();
  20982. let showFailWords = !this.success;
  20983. xGame.uiMgr.Show(UIMain$1, showFailWords);
  20984. }
  20985. clickLeftBtn() {
  20986. switch (xGame.common.gameMode) {
  20987. case GameMode.classic:
  20988. case GameMode.bigMove:
  20989. this.returnHome();
  20990. break;
  20991. case GameMode.placeBall:
  20992. let level = xGame.common.placeBallCurLevel;
  20993. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  20994. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20995. break;
  20996. default:
  20997. break;
  20998. }
  20999. }
  21000. powerStartPlaceBallLevel(level, btn) {
  21001. if (DataMgr.powerEnough()) {
  21002. btn.touchable = false;
  21003. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21004. btn.touchable = true;
  21005. DataMgr.setPower(-1);
  21006. xGame.eventMgr.event(POWER_TIME);
  21007. this.startPlaceBallLevel(level);
  21008. this.logEventForChallenge_level_start(level);
  21009. }));
  21010. }
  21011. else {
  21012. xGame.uiMgr.Show(UIPower$1, 0);
  21013. }
  21014. }
  21015. clickRightBtn() {
  21016. switch (xGame.common.gameMode) {
  21017. case GameMode.classic:
  21018. console.log('zh:clickRightBtn 111');
  21019. case GameMode.bigMove:
  21020. console.log('zh:clickRightBtn 222');
  21021. this.restartGame();
  21022. break;
  21023. case GameMode.placeBall:
  21024. console.log('zh:clickRightBtn 333');
  21025. let level = xGame.common.placeBallCurLevel;
  21026. let data = DataMgr.getPlaceBallLevel(level);
  21027. let curPss = data.play && !data.isCur;
  21028. if (curPss) {
  21029. console.log('zh:clickRightBtn 333-111');
  21030. console.log('zh:当前LV=' + level);
  21031. if (level == 60) {
  21032. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21033. Laya.timer.once(3000, this, () => {
  21034. this.returnHome();
  21035. });
  21036. }
  21037. else {
  21038. let lev = level + 1;
  21039. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21040. }
  21041. }
  21042. else {
  21043. console.log('zh:clickRightBtn 333-000');
  21044. Moyu.sendDataEvent("placeBallNextLevel");
  21045. console.log('zh:qjff_AD_for_uiGameEnd');
  21046. if (Laya.Browser.onAndroid) {
  21047. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21048. if (!boo) {
  21049. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21050. return;
  21051. }
  21052. }
  21053. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21054. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21055. }
  21056. else {
  21057. console.log('zh:AD 失败,直接发放奖励');
  21058. this.qjff_AD_for_uiGameEnd(level);
  21059. }
  21060. }
  21061. break;
  21062. default:
  21063. console.log('zh:clickRightBtn 444');
  21064. break;
  21065. }
  21066. }
  21067. logEventForChallenge_level_start(level) {
  21068. let keyStr = 'sjmd_challenge_level_start';
  21069. let jsonStr = {
  21070. "count": 0,
  21071. "gold_balance ": DataMgr.getCoin(),
  21072. "level": level,
  21073. "diamond_balance ": DataMgr.getDiamond()
  21074. };
  21075. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21076. const d = LocalStorageManager.getItem(keyStr);
  21077. if (level > d.level) {
  21078. jsonStr.count = d.count + 1;
  21079. LocalStorageManager.setItem(keyStr, jsonStr);
  21080. }
  21081. else {
  21082. }
  21083. }
  21084. else {
  21085. LocalStorageManager.setItem(keyStr, jsonStr);
  21086. }
  21087. const reqStr = JSON.stringify(jsonStr);
  21088. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21089. }
  21090. qjff_AD_for_uiGameEnd(level) {
  21091. DataMgr.setPlaceBallLevel(level, 1);
  21092. this.startPlaceBallLevel(level + 1);
  21093. }
  21094. startPlaceBallLevel(level) {
  21095. xGame.common.gameMode = GameMode.placeBall;
  21096. xGame.common.placeBallCurLevel = level;
  21097. xGame.uiMgr.Show(UIGame$1);
  21098. this.hide();
  21099. }
  21100. logEventForChallenge_level_complete(level) {
  21101. let keyStr = 'sjmd_challenge_level_complete';
  21102. let jsonStr = {
  21103. "count": 1,
  21104. "gold_balance ": DataMgr.getCoin(),
  21105. "level": level,
  21106. "diamond_balance ": DataMgr.getDiamond()
  21107. };
  21108. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21109. const d = LocalStorageManager.getItem(keyStr);
  21110. jsonStr.count = d.count + 1;
  21111. LocalStorageManager.setItem(keyStr, jsonStr);
  21112. }
  21113. else {
  21114. LocalStorageManager.setItem(keyStr, jsonStr);
  21115. }
  21116. const reqStr = JSON.stringify(jsonStr);
  21117. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21118. }
  21119. logEventForChallenge_level_N(level) {
  21120. console.log('zh:logEventForChallenge_level_N ' + level);
  21121. let keyStr = 'sjmd_challenge_level_N';
  21122. if (LocalStorageManager.hasKey(keyStr)) {
  21123. let lev = LocalStorageManager.getItem(keyStr);
  21124. if (level > lev) {
  21125. LocalStorageManager.setItem(keyStr, level);
  21126. }
  21127. if ((level) % 5 == 0) {
  21128. console.log('zh:每5关上报1次');
  21129. let sjmc = 'challenge_level_' + level;
  21130. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21131. let sjmcForFirebase = 'challenge_level_' + level;
  21132. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21133. }
  21134. else {
  21135. console.log('zh:5 no 上报');
  21136. }
  21137. }
  21138. else {
  21139. LocalStorageManager.setItem(keyStr, level);
  21140. }
  21141. }
  21142. }
  21143. UIGameEnd$1.uiName = "UIGameEnd";
  21144. class ShowItem$1 {
  21145. constructor() {
  21146. this.ui = ui_ShowItem.createInstance();
  21147. }
  21148. destroySelf() {
  21149. if (!this.ui.isDisposed) {
  21150. this.ui.removeFromParent();
  21151. this.ui.dispose();
  21152. }
  21153. }
  21154. setParent(parent) {
  21155. parent.addChild(this.ui);
  21156. }
  21157. setPos(x, y) {
  21158. this.ui.x = x;
  21159. this.ui.y = y;
  21160. }
  21161. setUrl(index) {
  21162. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21163. }
  21164. }
  21165. class UILevelProp$1 extends UIBase {
  21166. constructor() {
  21167. super();
  21168. this.firstPos = 385;
  21169. this.secondPos = 467;
  21170. this.showItemArr = [];
  21171. }
  21172. onFontLoaded() {
  21173. try {
  21174. this.ui.myNode.conditionTxt.font = "arial";
  21175. console.log("zh: onFontLoaded 设置arial字体成功");
  21176. }
  21177. catch (error) {
  21178. console.log("zh: constructor onFontLoaded加载arial字体失败");
  21179. }
  21180. }
  21181. onConstructor() {
  21182. this.ui = ui_UILevelProp.createInstance();
  21183. this.contentPane = this.ui;
  21184. this.isEject = false;
  21185. this.addUIClick(this.ui.closeBtn, this.hide);
  21186. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21187. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21188. }
  21189. show(level) {
  21190. super.show();
  21191. this.ui.t1.play();
  21192. this.level = level;
  21193. this.data = cfgTable.placeballData[this.level];
  21194. this.updateSelf();
  21195. this.showPreView();
  21196. this.moneyNode.ui.c1.selectedIndex = 2;
  21197. this.moneyNode.checkPowerTime();
  21198. this.moneyNode.powerChange();
  21199. }
  21200. showPreView() {
  21201. let item;
  21202. let data;
  21203. for (let index = 0; index < this.showItemArr.length; index++) {
  21204. item = this.showItemArr[index];
  21205. item.destroySelf();
  21206. }
  21207. this.showItemArr = [];
  21208. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21209. for (const key in cfgData) {
  21210. data = cfgData[key];
  21211. item = new ShowItem$1();
  21212. item.setParent(this.ui.myNode.displayRoot);
  21213. item.setPos(data.x, data.y);
  21214. item.setUrl(data.value);
  21215. this.showItemArr.push(item);
  21216. }
  21217. }
  21218. updateSelf() {
  21219. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21220. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21221. if (this.data.ball == -1) {
  21222. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21223. }
  21224. else {
  21225. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21226. }
  21227. let localData = DataMgr.getPlaceBallLevel(this.level);
  21228. let getAward = localData.getAward;
  21229. let cfg = cfgTable.placeballData[this.level];
  21230. let coin = this.data.award[0];
  21231. let diamond = this.data.award[1];
  21232. if (cfg.type == PlaceBallType.challenge) {
  21233. diamond = 0;
  21234. coin = 100;
  21235. }
  21236. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21237. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21238. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21239. if (cfg.type == PlaceBallType.challenge) {
  21240. this.ui.myNode.coinNode.numTxt.text = "";
  21241. }
  21242. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21243. if (coin > 0 && diamond > 0) {
  21244. this.ui.myNode.diamondNode.x = 385;
  21245. this.ui.myNode.coinNode.x = 467;
  21246. }
  21247. else {
  21248. this.ui.myNode.diamondNode.x = 385;
  21249. this.ui.myNode.coinNode.x = 385;
  21250. }
  21251. if (!getAward) {
  21252. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21253. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21254. }
  21255. else {
  21256. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21257. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21258. }
  21259. }
  21260. startGame() {
  21261. if (DataMgr.powerEnough()) {
  21262. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21263. this.ui.myNode.startBtn.touchable = false;
  21264. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21265. console.log('zh:startGame ');
  21266. this.ui.myNode.startBtn.touchable = true;
  21267. DataMgr.setPower(-1);
  21268. xGame.eventMgr.event(POWER_TIME);
  21269. xGame.common.gameMode = GameMode.placeBall;
  21270. xGame.common.placeBallCurLevel = this.level;
  21271. xGame.uiMgr.Show(UIGame$1);
  21272. this.logEventForChallenge_level_start(this.level);
  21273. xGame.uiMgr.Hide(UILevelDisplay$1);
  21274. xGame.uiMgr.Hide(UIMain$1);
  21275. this.hide();
  21276. }));
  21277. }
  21278. else {
  21279. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21280. xGame.uiMgr.Show(UIPower$1);
  21281. }
  21282. }
  21283. logEventForChallenge_level_start(level) {
  21284. let keyStr = 'sjmd_challenge_level_start';
  21285. let jsonStr = {
  21286. "count": 1,
  21287. "gold_balance ": DataMgr.getCoin(),
  21288. "level": level,
  21289. "diamond_balance ": DataMgr.getDiamond()
  21290. };
  21291. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21292. const d = LocalStorageManager.getItem(keyStr);
  21293. if (level > d.level) {
  21294. jsonStr.count = d.count + 1;
  21295. LocalStorageManager.setItem(keyStr, jsonStr);
  21296. }
  21297. else {
  21298. }
  21299. }
  21300. else {
  21301. LocalStorageManager.setItem(keyStr, jsonStr);
  21302. }
  21303. const reqStr = JSON.stringify(jsonStr);
  21304. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21305. }
  21306. hide() {
  21307. super.hide();
  21308. }
  21309. }
  21310. UILevelProp$1.uiName = "UILevelProp";
  21311. class PutBallLevelDisplay$1 {
  21312. constructor(ui, index) {
  21313. this.index = 0;
  21314. this.ui = ui;
  21315. this.index = index;
  21316. this.ui.onClick(this, this.clickSelf);
  21317. this.updateSelf();
  21318. this.ui.levelTxt.text = (this.index + 1) + "";
  21319. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21320. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21321. }
  21322. updateSelf() {
  21323. let level = this.index + 1;
  21324. this.data = DataMgr.getPlaceBallLevel(level);
  21325. this.ui.starNode.c1.selectedIndex = this.data.star;
  21326. let isChallenge = cfgTable.placeballData[level].type;
  21327. if (this.data.isCur) {
  21328. if (isChallenge) {
  21329. this.ui.c1.selectedIndex = 5;
  21330. }
  21331. else {
  21332. this.ui.c1.selectedIndex = 2;
  21333. }
  21334. }
  21335. else {
  21336. if (this.data.play) {
  21337. if (this.data.star == 3) {
  21338. this.ui.c1.selectedIndex = 0;
  21339. }
  21340. else {
  21341. this.ui.c1.selectedIndex = 1;
  21342. }
  21343. }
  21344. else {
  21345. if (isChallenge) {
  21346. this.ui.c1.selectedIndex = 4;
  21347. }
  21348. else {
  21349. this.ui.c1.selectedIndex = 3;
  21350. }
  21351. }
  21352. }
  21353. }
  21354. clickSelf() {
  21355. if (!this.data.play)
  21356. return;
  21357. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21358. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21359. }
  21360. }
  21361. class UILevelDisplay$1 extends UIBase {
  21362. constructor() {
  21363. super();
  21364. }
  21365. onConstructor() {
  21366. this.ui = ui_UILevelDisplay.createInstance();
  21367. this.contentPane = this.ui;
  21368. this.isEject = false;
  21369. this.myList = this.ui.myNode.myList;
  21370. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21371. this.levelItemArr = [];
  21372. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21373. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21374. this.myList.numItems = levelNum;
  21375. if (Moyu.isKs)
  21376. this.ui.closeNode.closeBtn.x += 100;
  21377. }
  21378. levelItemRender(index, target) {
  21379. let item = new PutBallLevelDisplay$1(target, index);
  21380. this.levelItemArr.push(item);
  21381. }
  21382. show() {
  21383. super.show();
  21384. this.updateLevel();
  21385. this.scrollToPlace();
  21386. }
  21387. updateLevel() {
  21388. let temp;
  21389. for (let index = 0; index < this.levelItemArr.length; index++) {
  21390. temp = this.levelItemArr[index];
  21391. temp.updateSelf();
  21392. }
  21393. }
  21394. scrollToPlace() {
  21395. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21396. let passArr = DataMgr.getPlaceBallLevelList();
  21397. let offest = passArr.length;
  21398. if (offest >= maxNum - 1)
  21399. offest = maxNum - 1;
  21400. this.myList.scrollToView(offest, true, true);
  21401. }
  21402. hide() {
  21403. super.hide();
  21404. }
  21405. }
  21406. UILevelDisplay$1.uiName = "UILevelDisplay";
  21407. class UIMatching$1 extends UIBase {
  21408. constructor() {
  21409. super();
  21410. }
  21411. onConstructor() {
  21412. this.ui = ui_UIMatching.createInstance();
  21413. this.contentPane = this.ui;
  21414. this.isEject = false;
  21415. }
  21416. show(callback) {
  21417. super.show();
  21418. PlatMgr.showBanner(true);
  21419. this.callback = callback;
  21420. let user = Moyu.getUserInfo();
  21421. if (!this.selfPot) {
  21422. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21423. }
  21424. if (!this.aiPot) {
  21425. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21426. }
  21427. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21428. this.ui.selfHead.nameTxt.text = user.nickName;
  21429. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21430. this.ui.aiHead.nameTxt.text = "???";
  21431. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21432. this.ui.selfHead.c1.selectedIndex = 0;
  21433. this.ui.aiHead.c1.selectedIndex = 0;
  21434. this.ui.selfHead.x = this.selfPot.x;
  21435. this.ui.selfHead.y = this.selfPot.y;
  21436. this.ui.aiHead.x = this.aiPot.x;
  21437. this.ui.aiHead.y = this.aiPot.y;
  21438. switch (xGame.common.gameMode) {
  21439. case GameMode.classic:
  21440. break;
  21441. case GameMode.bigMove:
  21442. this.initSkillData();
  21443. break;
  21444. default:
  21445. break;
  21446. }
  21447. this.ui.t1.play(Laya.Handler.create(this, () => {
  21448. this.ui.t2.play(Laya.Handler.create(this, () => {
  21449. switch (xGame.common.gameMode) {
  21450. case GameMode.classic:
  21451. this.waitingPeople();
  21452. break;
  21453. case GameMode.bigMove:
  21454. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21455. break;
  21456. default:
  21457. break;
  21458. }
  21459. }));
  21460. }));
  21461. }
  21462. initSkillData() {
  21463. this.skillSelectData = [];
  21464. let skillUrl = xGame.common.skillIconList;
  21465. let skillName = xGame.common.skillNameList;
  21466. let skillLevel = DataMgr.getBigSkillList();
  21467. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21468. for (let index = 0; index < 5; index++) {
  21469. let obj = {};
  21470. obj.skillImg = skillUrl[index];
  21471. obj.skillName = skillName[index];
  21472. obj.skillType = skillType[index];
  21473. obj.skillLevel = skillLevel[index];
  21474. this.skillSelectData.push(obj);
  21475. }
  21476. }
  21477. getAISkillLevel(myLevel) {
  21478. let video = xGame.common.upSkillLevel;
  21479. let aiLevel;
  21480. let temp;
  21481. if (video) {
  21482. temp = xGame.common.randomNum(-2, -1);
  21483. }
  21484. else {
  21485. if (myLevel <= 5) {
  21486. temp = xGame.common.randomNum(1, 3);
  21487. }
  21488. else if (myLevel <= 9) {
  21489. temp = xGame.common.randomNum(-2, 1);
  21490. }
  21491. else {
  21492. temp = xGame.common.randomNum(-4, 0);
  21493. }
  21494. }
  21495. aiLevel = temp + myLevel;
  21496. if (aiLevel <= 1)
  21497. aiLevel = 1;
  21498. if (aiLevel >= 10)
  21499. aiLevel = 10;
  21500. return aiLevel;
  21501. }
  21502. getAISkillType() {
  21503. return xGame.common.randomNum(1, 4);
  21504. let successTimes = DataMgr.getSkillSuccessTimes();
  21505. let info = cfgTable.aiskillData[successTimes];
  21506. if (!info) {
  21507. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21508. info = cfgTable.aiskillData[max];
  21509. }
  21510. let dataArr = info.skillselect;
  21511. let myCfg = {};
  21512. for (let index = 0; index < dataArr.length; index++) {
  21513. let temp = dataArr[index].split('-');
  21514. myCfg[temp[0]] = {};
  21515. myCfg[temp[0]].id = parseInt(temp[0]);
  21516. myCfg[temp[0]].weight = parseInt(temp[1]);
  21517. }
  21518. let aiCfg = xGame.common.initWeight(myCfg);
  21519. let curData = xGame.common.getRandomWeightData(aiCfg);
  21520. return parseInt(curData.id);
  21521. }
  21522. getAISkillData(index) {
  21523. let myLevel = this.skillSelectData[index].skillLevel;
  21524. let aiLevel = this.getAISkillLevel(myLevel);
  21525. let aiType = this.getAISkillType() - 1;
  21526. return { aiLevel, aiType } = { aiLevel, aiType };
  21527. }
  21528. skillSelectFinish(index) {
  21529. let aiInfo = this.getAISkillData(index);
  21530. xGame.common.gameMgr.selfCurSkill = index;
  21531. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21532. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21533. this.ui.selfHead.c1.selectedIndex = 1;
  21534. this.ui.aiHead.c1.selectedIndex = 1;
  21535. let myData = this.skillSelectData[index];
  21536. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21537. let guide = DataMgr.getSkillGuide();
  21538. if (guide == 0) {
  21539. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21540. }
  21541. else {
  21542. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21543. }
  21544. let aiData = this.skillSelectData[aiInfo.aiType];
  21545. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21546. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21547. this.waitingPeople();
  21548. }
  21549. waitingPeople() {
  21550. let time = xGame.common.randomNum(1000, 3000);
  21551. time += 1000;
  21552. Laya.timer.once(time, this, () => {
  21553. this.matchingSuccess();
  21554. });
  21555. }
  21556. matchingSuccess() {
  21557. let gameUI = xGame.common.gameUI;
  21558. let name = gameUI.ui.topNode.aiNameTxt.text;
  21559. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21560. this.ui.aiHead.nameTxt.text = name;
  21561. this.ui.aiHead.headImg.url = url;
  21562. name = gameUI.ui.topNode.selfNameTxt.text;
  21563. url = gameUI.ui.topNode.selfHeadLoader.url;
  21564. this.ui.selfHead.nameTxt.text = name;
  21565. this.ui.selfHead.headImg.url = url;
  21566. this.ui.t3.play(Laya.Handler.create(this, () => {
  21567. this.callback && this.callback();
  21568. this.ui.t4.play(Laya.Handler.create(this, () => {
  21569. this.destroySelf();
  21570. }));
  21571. }));
  21572. }
  21573. destroySelf() {
  21574. this.callback = null;
  21575. this.skillSelectData = null;
  21576. this.selfPot = null;
  21577. this.aiPot = null;
  21578. if (!this.ui.isDisposed) {
  21579. this.ui.removeFromParent();
  21580. this.ui.dispose();
  21581. }
  21582. xGame.uiMgr.destroyUI(this);
  21583. }
  21584. }
  21585. UIMatching$1.uiName = "UIMatching";
  21586. class SkillDisplay$1 {
  21587. constructor(ui, data, uiIndex) {
  21588. this.starX = 0;
  21589. this.starY = 0;
  21590. this.index = 0;
  21591. this.ui = ui;
  21592. this.data = data;
  21593. this.index = uiIndex;
  21594. this.initSelf();
  21595. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21596. }
  21597. initSelf() {
  21598. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21599. this.ui.nameTxt.text = this.data.name;
  21600. this.ui.describeTxt.text = this.data.describe;
  21601. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21602. this.ui.startBtn.onClick(this, this.startGame);
  21603. this.updateSelf();
  21604. }
  21605. updateSelf() {
  21606. this.checkTry();
  21607. let level = DataMgr.getBigSkillByIndex(this.index);
  21608. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21609. }
  21610. checkTry() {
  21611. let index = this.index;
  21612. let level = DataMgr.getBigSkillByIndex(index);
  21613. if (level == null) {
  21614. DataMgr.setBigSkill(index, 1, false);
  21615. level = 1;
  21616. }
  21617. this.ui.levelTxt.text = "LV." + level;
  21618. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21619. this.ui.tryNode.visible = true;
  21620. else
  21621. this.ui.tryNode.visible = false;
  21622. }
  21623. clickAddLevel() {
  21624. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21625. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21626. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21627. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21628. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21629. }
  21630. else {
  21631. console.log('zh:AD 失败,直接发放奖励');
  21632. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21633. }
  21634. }
  21635. qjff_AD_for_skilldisplay_clickAddLevel() {
  21636. DataMgr.setBigSkill(this.data.index, 1);
  21637. this.updateSelf();
  21638. xGame.common.upSkillLevel = true;
  21639. }
  21640. startGame() {
  21641. console.log('zh:rod skill startgame');
  21642. if (this.data.index == 3) {
  21643. alert('Coming soon!');
  21644. return;
  21645. }
  21646. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21647. let needCoin = xGame.common.bigMoveNeedCoin;
  21648. xGame.common.passAwardCoin = 2000;
  21649. let guide = DataMgr.getSkillGuide();
  21650. console.log('zh:startGame guide=' + guide);
  21651. xGame.common.temSelfLevel = 0;
  21652. if (guide == 0) {
  21653. needCoin = 0;
  21654. xGame.common.temSelfLevel = 100;
  21655. }
  21656. if (DataMgr.coinEnough(needCoin)) {
  21657. DataMgr.setCoin(-needCoin);
  21658. xGame.common.curPlayerSkillType = this.index;
  21659. if (guide == 0)
  21660. xGame.common.curPlayerSkillType = 0;
  21661. console.log('zh: skilldisplay 1');
  21662. xGame.uiMgr.Show(UIGame$1);
  21663. xGame.uiMgr.Hide(UIMain$1);
  21664. xGame.uiMgr.Show(UIMatching$1, () => {
  21665. xGame.common.gameUI.ui.alpha = 1;
  21666. xGame.common.gameUI.startGame();
  21667. xGame.uiMgr.Hide(UISkill$1);
  21668. });
  21669. this.logEventForRod_start();
  21670. }
  21671. else {
  21672. console.log('zh: skilldisplay 2');
  21673. xGame.uiMgr.Show(UIAddProp$1, 0);
  21674. Moyu.sendDataEvent("AddCoinVideo");
  21675. }
  21676. }
  21677. logEventForRod_start() {
  21678. let gfmsIdx = xGame.common.curPlayerSkillType;
  21679. console.log('zh:选择的技能=' + gfmsIdx);
  21680. let gfmc = 'Skyfall Shot';
  21681. if (gfmsIdx == 0) {
  21682. gfmc = 'Skyfall Shot';
  21683. }
  21684. if (gfmsIdx == 1) {
  21685. gfmc = 'Surging break';
  21686. }
  21687. if (gfmsIdx == 2) {
  21688. gfmc = 'Frost Lock';
  21689. }
  21690. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21691. let jsonStr = {
  21692. "count": 0,
  21693. "name": gfmc
  21694. };
  21695. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21696. const d = LocalStorageManager.getItem(keyStr);
  21697. jsonStr.count = d.count + 1;
  21698. LocalStorageManager.setItem(keyStr, jsonStr);
  21699. }
  21700. else {
  21701. LocalStorageManager.setItem(keyStr, jsonStr);
  21702. }
  21703. const reqStr = JSON.stringify(jsonStr);
  21704. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21705. }
  21706. }
  21707. class UISkill$1 extends UIBase {
  21708. constructor() {
  21709. super();
  21710. this.skillData = [];
  21711. }
  21712. onConstructor() {
  21713. this.ui = ui_UISkill.createInstance();
  21714. this.contentPane = this.ui;
  21715. this.isEject = false;
  21716. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21717. this.initSkillData();
  21718. console.log('zh:aaaaaa1111111111');
  21719. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21720. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21721. console.log('zh:aaaaaa22222222');
  21722. this.displayList = [];
  21723. this.ui.skillNode.skillList.numItems = 3;
  21724. this.addUIClick(this.ui, this.interuptSecretary);
  21725. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21726. this.ui.talkNode.visible = false;
  21727. if (Moyu.isKs)
  21728. this.ui.closeNode.closeBtn.x += 100;
  21729. }
  21730. show() {
  21731. super.show();
  21732. this.playSecretaryIdle();
  21733. this.moneyNode.ui.c1.selectedIndex = 1;
  21734. Laya.timer.clearAll(this);
  21735. xGame.soundMgr.playSound("s_start");
  21736. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21737. let guide = DataMgr.getSkillGuide();
  21738. this.ui.guideNode.visible = guide == 0;
  21739. let item = this.getSkillItemByUIIndex(0);
  21740. if (guide == 0) {
  21741. item.ui.c1.selectedIndex = 1;
  21742. }
  21743. else {
  21744. item.ui.c1.selectedIndex = 0;
  21745. }
  21746. this.ui.guideNode.guideBtn.visible = guide == 0;
  21747. for (let index = 0; index < this.displayList.length; index++) {
  21748. this.displayList[index].checkTry();
  21749. }
  21750. }
  21751. getSkillItemByUIIndex(cur) {
  21752. for (let index = 0; index < this.displayList.length; index++) {
  21753. if (this.displayList[index].index == cur) {
  21754. return this.displayList[index];
  21755. }
  21756. }
  21757. }
  21758. enterGuideLevel() {
  21759. let item = this.getSkillItemByUIIndex(0);
  21760. item.startGame();
  21761. if (DataMgr.getNewUser())
  21762. Moyu.sendDataEvent("gameStart1");
  21763. }
  21764. initSkillData() {
  21765. this.skillData = [];
  21766. let nameList = xGame.common.skillNameList;
  21767. let iconList = xGame.common.skillIconList;
  21768. let describeList = [
  21769. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21770. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21771. "The power of frost descends—freezing the flow and taking full control of the game!"
  21772. ];
  21773. console.log('zh:initSkillData 111111111');
  21774. let data;
  21775. for (let index = 0; index < nameList.length; index++) {
  21776. data = {};
  21777. data.name = nameList[index];
  21778. data.icon = iconList[index];
  21779. data.describe = describeList[index];
  21780. data.index = index;
  21781. this.skillData.push(data);
  21782. }
  21783. }
  21784. updateSkillItem(index, target) {
  21785. if (this.displayList[index] == null) {
  21786. let uiIndex;
  21787. switch (index) {
  21788. case 0:
  21789. uiIndex = 1;
  21790. break;
  21791. case 1:
  21792. uiIndex = 0;
  21793. break;
  21794. case 2:
  21795. uiIndex = 2;
  21796. break;
  21797. case 3:
  21798. uiIndex = 3;
  21799. break;
  21800. default:
  21801. break;
  21802. }
  21803. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21804. this.displayList.push(temp);
  21805. }
  21806. }
  21807. playSecretaryIdle() {
  21808. let parent = this.ui.secretary.displayObject;
  21809. parent.destroyChildren();
  21810. let xx = this.ui.secretary.width / 2;
  21811. let yy = this.ui.secretary.height;
  21812. let scale = xGame.common.getSecretaryScale();
  21813. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21814. xGame.common.secretary.play(data, 0, true, parent);
  21815. }
  21816. returnUIMain() {
  21817. this.hide();
  21818. xGame.common.stopGirlPop(this.ui.talkNode);
  21819. xGame.uiMgr.Show(UIMain$1);
  21820. }
  21821. interuptSecretary() {
  21822. Laya.timer.clearAll(this);
  21823. this.playSecretaryRandomSound();
  21824. }
  21825. playSecretaryRandomSound() {
  21826. if (this.isHide)
  21827. return;
  21828. let time = xGame.common.randomNum(45000, 60000);
  21829. Laya.timer.once(time, this, () => {
  21830. if (this.isHide)
  21831. return;
  21832. let index = xGame.common.randomNum(4, 7);
  21833. xGame.soundMgr.playSound("s_main0" + index);
  21834. let words = 1;
  21835. switch (index) {
  21836. case 4:
  21837. words = 5;
  21838. break;
  21839. case 5:
  21840. words = 3;
  21841. break;
  21842. case 6:
  21843. words = 6;
  21844. break;
  21845. case 7:
  21846. words = 7;
  21847. break;
  21848. default:
  21849. break;
  21850. }
  21851. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21852. this.playSecretaryRandomSound();
  21853. });
  21854. }
  21855. }
  21856. UISkill$1.uiName = "UISkill";
  21857. class UIAddProp$1 extends UIBase {
  21858. constructor() {
  21859. super();
  21860. this.curType = "";
  21861. }
  21862. onConstructor() {
  21863. this.ui = ui_UIAddProp.createInstance();
  21864. this.contentPane = this.ui;
  21865. this.isEject = false;
  21866. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21867. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  21868. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  21869. this.updateUI();
  21870. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  21871. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  21872. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  21873. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  21874. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  21875. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  21876. }
  21877. show(type) {
  21878. super.show();
  21879. this.curType = type == 0 ? "coin" : "diamond";
  21880. this.switchBtn("");
  21881. this.ui.t0.play();
  21882. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  21883. PlatMgr.showInsert(true);
  21884. }
  21885. closeSelf() {
  21886. this.hide();
  21887. }
  21888. updateUI() {
  21889. let data = cfgTable.moneyData;
  21890. let temp;
  21891. let obj;
  21892. for (const key in data) {
  21893. temp = data[key];
  21894. obj = this.ui.myNode["node" + key];
  21895. if (parseInt(key) <= 2) {
  21896. obj.diamondTxt.text = "+" + temp.num;
  21897. }
  21898. else {
  21899. obj.coinTxt.text = temp.num;
  21900. obj.diamondTxt.text = temp.get.split('_')[1];
  21901. }
  21902. }
  21903. this.updateDiamondShare();
  21904. }
  21905. updateDiamondShare() {
  21906. let data = DataMgr.getShareDiamondTimes();
  21907. if (data >= xGame.common.maxShareDiamondTimes) {
  21908. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  21909. this.ui.myNode.node1.touchable = false;
  21910. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21911. }
  21912. else {
  21913. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  21914. this.ui.myNode.node1.touchable = true;
  21915. }
  21916. }
  21917. switchBtn(type) {
  21918. if (type == "")
  21919. type = this.curType;
  21920. else {
  21921. if (this.curType == type) {
  21922. return;
  21923. }
  21924. else {
  21925. this.curType = type;
  21926. }
  21927. }
  21928. if (type == "coin") {
  21929. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  21930. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  21931. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  21932. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  21933. this.ui.myNode.c1.selectedIndex = 0;
  21934. }
  21935. else {
  21936. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  21937. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  21938. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  21939. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  21940. this.ui.myNode.c1.selectedIndex = 1;
  21941. }
  21942. }
  21943. convertCoin(index) {
  21944. let data = cfgTable.moneyData[index];
  21945. let coinNum = data.num;
  21946. let str = data.get.split('_')[1];
  21947. let needDiamond = parseInt(str);
  21948. if (DataMgr.diamondEnough(needDiamond)) {
  21949. DataMgr.setDiamond(-needDiamond);
  21950. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  21951. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  21952. }
  21953. else {
  21954. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  21955. this.switchBtn("diamond");
  21956. }
  21957. }
  21958. videoGetDiamond() {
  21959. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  21960. if (Laya.Browser.onAndroid) {
  21961. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21962. if (!boo) {
  21963. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21964. return;
  21965. }
  21966. }
  21967. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  21968. }
  21969. else {
  21970. console.log('zh:AD 失败,直接发放奖励');
  21971. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  21972. }
  21973. }
  21974. qjff_AD_for_uiAddProp_videoGetDiamond() {
  21975. let num = cfgTable.moneyData[2].num;
  21976. xGame.common.playObjFlyAnim(num, Prop.diamond);
  21977. this.closeSelf();
  21978. }
  21979. videoGetCoin() {
  21980. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  21981. if (Laya.Browser.onAndroid) {
  21982. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21983. if (!boo) {
  21984. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21985. return;
  21986. }
  21987. }
  21988. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  21989. }
  21990. else {
  21991. console.log('zh:AD 失败,直接发放奖励');
  21992. this.qjff_AD_for_uiAddProp_videoGetCoin();
  21993. }
  21994. }
  21995. qjff_AD_for_uiAddProp_videoGetCoin() {
  21996. xGame.common.playObjFlyAnim(2000, Prop.coin);
  21997. this.closeSelf();
  21998. }
  21999. shareGetDiamond() {
  22000. let times = DataMgr.getShareDiamondTimes();
  22001. if (times >= xGame.common.maxShareDiamondTimes) {
  22002. console.log('zh: 233333333333 maxShareDiamondTimes');
  22003. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22004. }
  22005. else {
  22006. console.log('zh:33333333333333ad');
  22007. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22008. if (Laya.Browser.onAndroid) {
  22009. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22010. if (!boo) {
  22011. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22012. return;
  22013. }
  22014. }
  22015. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22016. }
  22017. else {
  22018. console.log('zh:AD 失败,直接发放奖励');
  22019. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22020. }
  22021. }
  22022. }
  22023. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22024. let diamond = xGame.common.randomNum(50, 100);
  22025. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22026. DataMgr.setShareDiamondTimes(1);
  22027. this.updateDiamondShare();
  22028. }
  22029. openPutBallView() {
  22030. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22031. let skill = xGame.uiMgr.getUI(UISkill$1);
  22032. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22033. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22034. if (end && !end.isHide) {
  22035. xGame.uiMgr.Hide(UIGameEnd$1);
  22036. xGame.uiMgr.Show(UIMain$1);
  22037. }
  22038. if (skill && !skill.isHide)
  22039. xGame.uiMgr.Hide(UISkill$1);
  22040. if (uigame && !uigame.isHide)
  22041. xGame.uiMgr.Hide(UIGame$1);
  22042. if (level && !level.isHide) {
  22043. }
  22044. else {
  22045. xGame.uiMgr.Show(UILevelDisplay$1);
  22046. }
  22047. this.closeSelf();
  22048. }
  22049. }
  22050. UIAddProp$1.uiName = "UIAddProp";
  22051. class MoneyNode$1 {
  22052. constructor(ui) {
  22053. this.leftTime = 0;
  22054. this.ui = ui;
  22055. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22056. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22057. this.ui.addPowerBtn.onClick(this, this.addPower);
  22058. this.ui.c1.selectedIndex = 1;
  22059. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22060. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22061. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22062. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22063. this.coinChange();
  22064. this.diamondChange();
  22065. this.powerChange();
  22066. }
  22067. addPower() {
  22068. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22069. xGame.uiMgr.Show(UIPower$1);
  22070. }
  22071. powerChange() {
  22072. let powerNum = DataMgr.getPower();
  22073. this.ui.powerTxt.text = powerNum + "";
  22074. }
  22075. checkPowerTime() {
  22076. let cur = new Date().getTime();
  22077. let last = DataMgr.getPowerTime();
  22078. if (last == 0) {
  22079. last = cur;
  22080. DataMgr.setPowerTime(cur);
  22081. }
  22082. let power = DataMgr.getPower();
  22083. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22084. Laya.timer.clearAll(this);
  22085. if (power >= xGame.common.natureMaxPower) {
  22086. this.ui.powerTimeTxt.text = "";
  22087. DataMgr.setPowerTime(cur);
  22088. return;
  22089. }
  22090. if (power + offset >= xGame.common.natureMaxPower) {
  22091. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22092. this.ui.powerTimeTxt.text = "";
  22093. DataMgr.setPowerTime(cur);
  22094. }
  22095. else {
  22096. if (offset > 0) {
  22097. DataMgr.setPower(offset);
  22098. DataMgr.setPowerTime(cur);
  22099. }
  22100. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22101. this.leftTime = xGame.common.powerRecoverNum - time;
  22102. if (this.leftTime <= 0)
  22103. this.leftTime = 0;
  22104. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22105. Laya.timer.loop(1000, this, this.updatePowerTime);
  22106. }
  22107. }
  22108. updatePowerTime() {
  22109. this.leftTime -= 1;
  22110. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22111. if (this.leftTime <= 0) {
  22112. this.checkPowerTime();
  22113. }
  22114. }
  22115. coinChange() {
  22116. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22117. }
  22118. diamondChange() {
  22119. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22120. }
  22121. addCoin() {
  22122. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22123. Moyu.sendDataEvent("AddCoinBtn");
  22124. xGame.uiMgr.Show(UIAddProp$1, 0);
  22125. }
  22126. addDiamond() {
  22127. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22128. Moyu.sendDataEvent("AddDiamondBtn");
  22129. xGame.uiMgr.Show(UIAddProp$1, 1);
  22130. }
  22131. }
  22132. class SettingNode$1 {
  22133. constructor(ui) {
  22134. this.showSetting = false;
  22135. this.openSound = true;
  22136. this.openShake = true;
  22137. this.ui = ui;
  22138. this.ui.soundBtn.onClick(this, this.switchSound);
  22139. this.ui.shakeBtn.onClick(this, this.switchShake);
  22140. this.ui.xyBtn.onClick(this, this.onXy);
  22141. this.ui.clickNode.onClick(this, this.changeSetting);
  22142. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22143. this.ui.xyBtn.visible = false;
  22144. this.ui.shakeBtn.visible = false;
  22145. }
  22146. changeSetting() {
  22147. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22148. this.showSetting = !this.showSetting;
  22149. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22150. }
  22151. switchSound() {
  22152. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22153. this.openSound = !this.openSound;
  22154. Moyu.onSetting(this.openSound, this.openShake);
  22155. xGame.soundMgr.onSetting(this.openSound);
  22156. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22157. }
  22158. switchShake() {
  22159. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22160. this.openShake = !this.openShake;
  22161. Moyu.onSetting(this.openSound, this.openShake);
  22162. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22163. }
  22164. onXy() {
  22165. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22166. MoyuMgr$1.showXy(1);
  22167. }
  22168. }
  22169. class UIDraw$1 extends UIBase {
  22170. constructor() {
  22171. super();
  22172. this.curKey = 0;
  22173. }
  22174. onConstructor() {
  22175. this.ui = ui_UIDraw.createInstance();
  22176. this.contentPane = this.ui;
  22177. this.isEject = false;
  22178. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22179. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22180. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22181. this.initDraw();
  22182. this.initUI();
  22183. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22184. }
  22185. show() {
  22186. super.show();
  22187. this.ui.t0.play();
  22188. this.playSecretaryIdle();
  22189. this.updateDraw();
  22190. this.checkFree();
  22191. if (PlatMgr.bannerDelay > 0) {
  22192. this.ui.closeNode.closeBtn.visible = false;
  22193. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22194. this.ui.closeNode.closeBtn.visible = true;
  22195. });
  22196. }
  22197. PlatMgr.showRateBanner();
  22198. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22199. }
  22200. hide() {
  22201. Laya.timer.clearAll(this);
  22202. super.hide();
  22203. }
  22204. checkFree() {
  22205. let isFree = DataMgr.getDailyfreeDrawTimes();
  22206. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22207. }
  22208. initDraw() {
  22209. this.drawObj = [];
  22210. let data = cfgTable.drawData;
  22211. let temp;
  22212. let weight = 0;
  22213. for (const key in data) {
  22214. temp = data[key];
  22215. weight += temp.weight;
  22216. this.drawObj.push(weight);
  22217. }
  22218. this.allWeight = weight;
  22219. }
  22220. initUI() {
  22221. let data = cfgTable.drawData;
  22222. let temp;
  22223. let img;
  22224. let txt;
  22225. for (const key in data) {
  22226. temp = data[key];
  22227. img = this.ui.myNode.rotNode["img" + key];
  22228. txt = this.ui.myNode.rotNode["txt" + key];
  22229. img.url = xGame.common.getGameIconUrl(temp.icon);
  22230. txt.visible = true;
  22231. if (temp.award > 2) {
  22232. img.rotation = 0;
  22233. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22234. }
  22235. else {
  22236. img.rotation = temp.rotation;
  22237. txt.text = temp.num;
  22238. }
  22239. }
  22240. }
  22241. getCurkey() {
  22242. let rand = Math.random() * this.allWeight;
  22243. let temp;
  22244. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22245. temp = this.drawObj[index];
  22246. if (index == 0) {
  22247. if (rand < temp) {
  22248. return index + 1;
  22249. }
  22250. }
  22251. else {
  22252. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22253. return index + 1;
  22254. }
  22255. }
  22256. }
  22257. return 2;
  22258. }
  22259. startDraw() {
  22260. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22261. if (freeTimes > 0) {
  22262. this.beginDraw();
  22263. DataMgr.setDailyfreeDrawTimes(0);
  22264. this.checkFree();
  22265. }
  22266. else {
  22267. if (Laya.Browser.onAndroid) {
  22268. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22269. if (!boo) {
  22270. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22271. return;
  22272. }
  22273. }
  22274. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22275. }
  22276. else {
  22277. console.log('zh:AD 失败,直接发放奖励');
  22278. this.qjff_chouJiang();
  22279. }
  22280. }
  22281. }
  22282. qjff_chouJiang() {
  22283. this.beginDraw();
  22284. }
  22285. beginDraw() {
  22286. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22287. this.ui.drawBtn.touchable = false;
  22288. this.curKey = this.getCurkey();
  22289. console.log("当前key", this.curKey);
  22290. let cell = 60;
  22291. let lap = 3;
  22292. let angle = cell * (this.curKey - 1) + lap * 360;
  22293. let target = this.ui.myNode.rotNode;
  22294. target.rotation = 0;
  22295. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22296. console.log("旋转完成");
  22297. this.ui.drawBtn.touchable = true;
  22298. this.getAward();
  22299. }));
  22300. }
  22301. getAward() {
  22302. let data = cfgTable.drawData[this.curKey];
  22303. let temp = new AwardType();
  22304. temp.type = data.award;
  22305. temp.num = data.num;
  22306. xGame.common.getAward([temp], () => {
  22307. DataMgr.setDrawTimes(1);
  22308. this.updateDraw();
  22309. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22310. });
  22311. }
  22312. updateDraw() {
  22313. let drawTimes = DataMgr.getDrawTimes();
  22314. let awardTimes = DataMgr.getDrawAwardTimes();
  22315. if (Math.floor(drawTimes / 3) > awardTimes) {
  22316. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22317. this.ui.extraNode.boxBtn.touchable = true;
  22318. this.ui.extraNode.tipsTxt.text = "3/3";
  22319. this.ui.extraNode.barNode.width = 265;
  22320. this.getExtraAward();
  22321. }
  22322. else {
  22323. this.ui.extraNode.boxBtn.t0.stop();
  22324. this.ui.extraNode.boxBtn.touchable = false;
  22325. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22326. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22327. }
  22328. let data = cfgTable.drawData[1];
  22329. if (awardTimes == 0) {
  22330. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22331. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22332. this.ui.myNode.rotNode.img1.rotation = 0;
  22333. }
  22334. else {
  22335. let award = data.nextid;
  22336. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22337. this.ui.myNode.rotNode.txt1.text = award[1];
  22338. this.ui.myNode.rotNode.img1.rotation = 0;
  22339. }
  22340. }
  22341. getExtraAward() {
  22342. let drawTimes = DataMgr.getDrawTimes();
  22343. let awardTimes = DataMgr.getDrawAwardTimes();
  22344. let data = cfgTable.drawData[1];
  22345. let award = new AwardType();
  22346. if (awardTimes == 0) {
  22347. award.num = data.num;
  22348. award.type = data.award;
  22349. xGame.common.getAward([award], () => {
  22350. let all = Math.floor(drawTimes / 3);
  22351. DataMgr.setDrawAwardTimes(all);
  22352. this.updateDraw();
  22353. });
  22354. }
  22355. else {
  22356. award.num = parseInt(data.nextid[1]);
  22357. award.type = parseInt(data.nextid[0]);
  22358. xGame.common.getAward([award], () => {
  22359. let all = Math.floor(drawTimes / 3);
  22360. DataMgr.setDrawAwardTimes(all);
  22361. this.updateDraw();
  22362. });
  22363. }
  22364. }
  22365. closeSelf() {
  22366. this.hide();
  22367. }
  22368. playSecretaryIdle() {
  22369. let parent = this.ui.secretary.displayObject;
  22370. parent.destroyChildren();
  22371. let xx = this.ui.secretary.width / 2;
  22372. let yy = this.ui.secretary.height;
  22373. let scale = xGame.common.getSecretaryScale();
  22374. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22375. xGame.common.secretary.play(data, 0, true, parent);
  22376. }
  22377. }
  22378. UIDraw$1.uiName = "UIDraw";
  22379. class UIRanking$1 extends UIBase {
  22380. constructor() {
  22381. super();
  22382. this.showSelf = true;
  22383. this.rankType = 1;
  22384. this.rankList = [];
  22385. this.topX = 10;
  22386. this.myIndex = this.topX + 1;
  22387. this.myStar = 0;
  22388. }
  22389. onConstructor() {
  22390. this.ui = ui_UIRanking.createInstance();
  22391. this.contentPane = this.ui;
  22392. this.isEject = false;
  22393. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22394. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22395. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22396. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22397. this.ui.myNode.myList.setVirtual();
  22398. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22399. }
  22400. show() {
  22401. super.show();
  22402. this.getPaiHangBangDataFormJosnFile();
  22403. this.updateSelf();
  22404. let self = Moyu.getUserInfo();
  22405. if (!self.isAuth) {
  22406. Moyu.initUser(this, () => {
  22407. DataMgr.upRankData();
  22408. });
  22409. }
  22410. }
  22411. getPaiHangBangDataFormJosnFile() {
  22412. const rankingList = cfgTable.paiHangBangData.list;
  22413. this.updateItemData(rankingList);
  22414. }
  22415. updateSelfItem() {
  22416. console.log('zh:Moyu.platType =' + Moyu.platType);
  22417. let self = Moyu.getUserInfo();
  22418. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22419. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22420. if (this.myIndex > this.topX) {
  22421. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22422. }
  22423. else {
  22424. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22425. }
  22426. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22427. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22428. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22429. }
  22430. updateItemData(data) {
  22431. this.myStar = xGame.common.getAllStarNum();
  22432. if (this.rankList.length < 2) {
  22433. this.rankList = data;
  22434. let self = Moyu.getUserInfo();
  22435. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22436. self.headIcon = self.headIcon;
  22437. for (let i = 0; i < data.length; i++) {
  22438. let data = this.rankList[i];
  22439. if (data.userId == self.userId) {
  22440. this.rankList.splice(i, 1);
  22441. break;
  22442. }
  22443. }
  22444. for (let i = 0; i < data.length; i++) {
  22445. let data = this.rankList[i];
  22446. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22447. this.myIndex = i + 1;
  22448. let user = { headIcon: self.headIcon, nickName: "myself" };
  22449. let ud = { user: user, data: {} };
  22450. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22451. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22452. if (Moyu.platType < 11) {
  22453. user.headIcon = self.headIcon;
  22454. user.nickName = self.nickName;
  22455. }
  22456. this.rankList.splice(i, 0, md);
  22457. break;
  22458. }
  22459. }
  22460. }
  22461. this.updateSelfItem();
  22462. this.ui.myNode.myList.numItems = this.rankList.length;
  22463. }
  22464. updateItemUI(index, obj) {
  22465. let data = this.rankList[index];
  22466. let userData = JSON.parse(data.userData).user;
  22467. obj.nameTxt.text = userData.nickName.toString();
  22468. obj.valueTxt.text = data.rankScore;
  22469. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22470. obj.rankTxt.text = index + 1;
  22471. switch (index) {
  22472. case 0:
  22473. this.setImg(obj, 1, 0, 0);
  22474. obj.rankTxt.color = "#FFC047";
  22475. break;
  22476. case 1:
  22477. this.setImg(obj, 0, 1, 0);
  22478. obj.rankTxt.color = "#ACACAC";
  22479. break;
  22480. case 2:
  22481. this.setImg(obj, 0, 0, 1);
  22482. obj.rankTxt.color = "#D09672";
  22483. break;
  22484. default:
  22485. this.setImg(obj, 0, 0, 0);
  22486. obj.rankTxt.color = "#496FAB";
  22487. break;
  22488. }
  22489. }
  22490. setImg(obj, a, b, c) {
  22491. obj.img1.visible = a ? true : false;
  22492. obj.img2.visible = b ? true : false;
  22493. obj.img3.visible = c ? true : false;
  22494. }
  22495. changeList(type) {
  22496. this.rankType = type;
  22497. this.updateSelf();
  22498. }
  22499. changeSelfNode() {
  22500. this.showSelf = !this.showSelf;
  22501. this.updateSelf();
  22502. }
  22503. updateSelf() {
  22504. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22505. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22506. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22507. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22508. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22509. }
  22510. }
  22511. UIRanking$1.uiName = "UIRanking";
  22512. class UISecretary$1 extends UIBase {
  22513. constructor() {
  22514. super();
  22515. this.curIndex = 1;
  22516. }
  22517. onConstructor() {
  22518. this.ui = ui_UISecretary.createInstance();
  22519. this.contentPane = this.ui;
  22520. this.isEject = false;
  22521. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22522. this.nodeObj = { left: null, right: null, cur: null };
  22523. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22524. }
  22525. show() {
  22526. super.show();
  22527. this.ui.t0.play();
  22528. this.updateData();
  22529. }
  22530. addSecretarySpine(node, spineName) {
  22531. if (spineName == "mishu") {
  22532. if (this.secretarySpine1) {
  22533. node.displayObject.destroyChildren();
  22534. this.playWoman(this.secretarySpine1, node.displayObject);
  22535. }
  22536. else {
  22537. let spine1 = new SpineMgr("mishu", () => {
  22538. this.secretarySpine1 = spine1;
  22539. this.playWoman(this.secretarySpine1, node.displayObject);
  22540. });
  22541. }
  22542. }
  22543. else {
  22544. if (this.secretarySpine2) {
  22545. node.displayObject.destroyChildren();
  22546. this.playWoman(this.secretarySpine2, node.displayObject);
  22547. }
  22548. else {
  22549. let spine2 = new SpineMgr("xiaomishu2", () => {
  22550. this.secretarySpine2 = spine2;
  22551. this.playWoman(this.secretarySpine2, node.displayObject);
  22552. });
  22553. }
  22554. }
  22555. }
  22556. playWoman(node, parent) {
  22557. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22558. let yy = this.ui.myNode.gameNode3.secretary.height;
  22559. let scale = 1.5;
  22560. if (node == this.secretarySpine2) {
  22561. scale = 1.2;
  22562. }
  22563. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22564. node.play(data, 0, true, parent);
  22565. }
  22566. turnLeft() {
  22567. this.curIndex--;
  22568. if (this.curIndex < 1) {
  22569. this.curIndex = 2;
  22570. }
  22571. let left = this.nodeObj.left;
  22572. let right = this.nodeObj.right;
  22573. let cur = this.nodeObj.cur;
  22574. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22575. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22576. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22577. this.updateData();
  22578. }));
  22579. this.ui.myNode.setChildIndex(right, 2);
  22580. this.nodeObj.left = cur;
  22581. this.nodeObj.right = left;
  22582. this.nodeObj.cur = right;
  22583. }
  22584. turnRight() {
  22585. this.curIndex++;
  22586. if (this.curIndex > 2) {
  22587. this.curIndex = 1;
  22588. }
  22589. let left = this.nodeObj.left;
  22590. let right = this.nodeObj.right;
  22591. let cur = this.nodeObj.cur;
  22592. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22593. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22594. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22595. this.updateData();
  22596. }));
  22597. this.ui.myNode.setChildIndex(left, 2);
  22598. this.nodeObj.left = right;
  22599. this.nodeObj.right = cur;
  22600. this.nodeObj.cur = left;
  22601. }
  22602. updateData() {
  22603. console.log('zh: updateData FFFFFFFFFF');
  22604. let data = cfgTable.secretaryshopData;
  22605. let children = this.ui.myNode._children;
  22606. let temp;
  22607. let curData;
  22608. for (let index = 0; index < children.length; index++) {
  22609. temp = children[index];
  22610. curData = data[1];
  22611. temp.heightTxt.text = curData.height;
  22612. temp.foodTxt.text = curData.food;
  22613. temp.historyTxt.text = curData.history;
  22614. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22615. this.addSecretarySpine(temp.secretary, curData.spine);
  22616. let womanIndex = curData.id - 1;
  22617. let getWoman = DataMgr.getSecretary(womanIndex);
  22618. let curUse = DataMgr.getCurSecretary();
  22619. if (getWoman) {
  22620. if (curUse == womanIndex) {
  22621. temp.purchaseBtn.c1.selectedIndex = 1;
  22622. }
  22623. else {
  22624. temp.purchaseBtn.c1.selectedIndex = 2;
  22625. }
  22626. }
  22627. else {
  22628. temp.purchaseBtn.c1.selectedIndex = 0;
  22629. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22630. }
  22631. temp.purchaseBtn.visible = false;
  22632. }
  22633. }
  22634. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22635. console.log('zh: 点击了clickSecretary ');
  22636. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22637. if (getWoman) {
  22638. if (curUse != womanIndex) {
  22639. console.log();
  22640. DataMgr.setCurSecretary(womanIndex);
  22641. this.updateData();
  22642. }
  22643. }
  22644. else {
  22645. console.log('zh:点击购买了');
  22646. let need = needDiamond;
  22647. if (DataMgr.diamondEnough(need)) {
  22648. DataMgr.setDiamond(-need);
  22649. DataMgr.setSecretary(womanIndex, 1);
  22650. DataMgr.setCurSecretary(womanIndex);
  22651. this.updateData();
  22652. }
  22653. else {
  22654. xGame.uiMgr.Show(UIAddProp$1, 1);
  22655. }
  22656. }
  22657. }
  22658. closeSelf() {
  22659. this.hide();
  22660. }
  22661. }
  22662. UISecretary$1.uiName = "UISecretary";
  22663. class BallRodDisplay$1 {
  22664. constructor(ui, index) {
  22665. this.index = 0;
  22666. this.uiIndex = 0;
  22667. this.ui = ui;
  22668. this.index = index;
  22669. this.initData();
  22670. }
  22671. initData() {
  22672. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22673. let data = cfgTable.ballrodData[this.index + 1];
  22674. this.ui.nameTxt.text = data.name;
  22675. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22676. this.ui.levelNode.c1.selectedIndex = data.quality;
  22677. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22678. if (data.spine) {
  22679. this.mySpine = new SpineMgr(data.spine, () => {
  22680. let xx = 150;
  22681. let yy = 70;
  22682. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22683. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22684. });
  22685. }
  22686. }
  22687. updateSelf() {
  22688. console.log('zh:updateSelf -------------- ');
  22689. let get = DataMgr.getBallRod(this.index);
  22690. if (get == null)
  22691. get = 1;
  22692. let curUse = DataMgr.getCurBallRod();
  22693. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22694. if (get) {
  22695. if (curUse == this.index) {
  22696. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22697. }
  22698. else {
  22699. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22700. }
  22701. }
  22702. else {
  22703. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22704. }
  22705. }
  22706. buyBallRod() {
  22707. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22708. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22709. switch (selectedIndex) {
  22710. case 0:
  22711. break;
  22712. case 1:
  22713. console.log('zh:点击了 USE THIS');
  22714. DataMgr.setCurBallRod(this.index);
  22715. let curUse = DataMgr.getCurBallRod();
  22716. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22717. let ui = xGame.uiMgr.getUI(UIShop$1);
  22718. ui.updateBallRod();
  22719. break;
  22720. case 2:
  22721. let data = cfgTable.ballrodData[this.index + 1];
  22722. let need = data.price;
  22723. if (DataMgr.diamondEnough(need)) {
  22724. this.buyQiuGan(data);
  22725. DataMgr.setDiamond(-need);
  22726. DataMgr.setBallRod(this.index, 1);
  22727. DataMgr.setCurBallRod(this.index);
  22728. let ui = xGame.uiMgr.getUI(UIShop$1);
  22729. ui.updateBallRod();
  22730. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22731. }
  22732. else {
  22733. xGame.uiMgr.Show(UIAddProp$1, 1);
  22734. }
  22735. break;
  22736. default:
  22737. break;
  22738. }
  22739. }
  22740. buyQiuGan(qgItem) {
  22741. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  22742. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22743. if (userInfo == null) {
  22744. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22745. return;
  22746. }
  22747. let reqData = xGame.httpMgr.getReqData();
  22748. let pd = JSON.parse(reqData);
  22749. pd.qiuGanData = qgItem;
  22750. reqData = JSON.stringify(pd);
  22751. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  22752. try {
  22753. console.log('zh:buySp res = ' + JSON.stringify(res));
  22754. let code = res.code;
  22755. let msg = res.msg;
  22756. if (code == 401) {
  22757. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22758. alert(TIP_MSG_key.loginTimeOut);
  22759. xGame.uiMgr.Show(UIMsg$1, msg);
  22760. return;
  22761. }
  22762. if (code == 200) {
  22763. xGame.uiMgr.Show(UIMsg$1, msg);
  22764. DataMgr.getUserZiChanInfo();
  22765. }
  22766. else {
  22767. xGame.uiMgr.Show(UIMsg$1, msg);
  22768. }
  22769. }
  22770. catch (error) {
  22771. console.log('error=' + error);
  22772. alert(error);
  22773. }
  22774. finally {
  22775. }
  22776. });
  22777. }
  22778. logEventForGouMaiGan(qiuGanName) {
  22779. const ev = {
  22780. value: qiuGanName
  22781. };
  22782. const jsonStr = JSON.stringify(ev);
  22783. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22784. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22785. }
  22786. }
  22787. class DaoJuDisplay$1 {
  22788. constructor(ui, index) {
  22789. this.index = 0;
  22790. this.uiIndex = 0;
  22791. this.ggSpid = "";
  22792. this.spid = 0;
  22793. this.ui = ui;
  22794. this.index = index;
  22795. this.initData();
  22796. }
  22797. initData() {
  22798. this.ui.btn_buy.onClick(this, this.gotoBuy);
  22799. let data = cfgTable.daoJuData[this.index + 1];
  22800. console.log('zh:' + JSON.stringify(data));
  22801. this.ui.nameTxt.text = data.spbt;
  22802. this.ui.n_jiaGe.text = data.spjg + "";
  22803. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22804. this.ggSpid = data.ggSpid;
  22805. this.spid = data.spid;
  22806. let baseUrl = "asset/sound/ogg/";
  22807. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  22808. }
  22809. gotoBuy() {
  22810. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22811. if (userInfo != null) {
  22812. let token = userInfo.token;
  22813. let ggSpid = this.ggSpid;
  22814. let spid = this.spid;
  22815. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  22816. console.log('zh:gotoBuy1 spid =' + spid);
  22817. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  22818. return;
  22819. }
  22820. else {
  22821. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22822. }
  22823. }
  22824. gotoBuy1() {
  22825. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22826. let djItem = cfgTable.daoJuData[this.index + 1];
  22827. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  22828. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22829. if (userInfo == null) {
  22830. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22831. return;
  22832. }
  22833. let reqData = xGame.httpMgr.getReqData();
  22834. let pd = JSON.parse(reqData);
  22835. pd.spItem = djItem;
  22836. reqData = JSON.stringify(pd);
  22837. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  22838. try {
  22839. console.log('zh:buySp res = ' + JSON.stringify(res));
  22840. let code = res.code;
  22841. let msg = res.msg;
  22842. if (code == 401) {
  22843. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22844. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22845. return;
  22846. }
  22847. if (code == 200) {
  22848. xGame.uiMgr.Show(UIMsg$1, msg);
  22849. DataMgr.getUserZiChanInfo();
  22850. }
  22851. else {
  22852. xGame.uiMgr.Show(UIMsg$1, msg);
  22853. }
  22854. }
  22855. catch (error) {
  22856. console.log('error=' + error);
  22857. alert(error);
  22858. }
  22859. finally {
  22860. }
  22861. });
  22862. }
  22863. }
  22864. class UIShop$1 extends UIBase {
  22865. constructor() {
  22866. super();
  22867. this.itemNums = 0;
  22868. this.itemNumsForDj = 0;
  22869. this.curType = "";
  22870. }
  22871. onConstructor() {
  22872. this.ui = ui_UIShop.createInstance();
  22873. this.contentPane = this.ui;
  22874. this.isEject = false;
  22875. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22876. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22877. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  22878. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  22879. this.addUIClick(this.ui, this.interuptSecretary);
  22880. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  22881. this.ballRodArr = [];
  22882. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  22883. this.ui.myNode.myList.numItems = this.itemNums;
  22884. this.loadDjdata_old();
  22885. }
  22886. loadDjdata_old() {
  22887. let fff = cfgTable.daoJuData;
  22888. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  22889. this.daoJuArr = [];
  22890. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  22891. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  22892. }
  22893. getProductList() {
  22894. let reqData = xGame.httpMgr.getReqData();
  22895. let pd = JSON.parse(reqData);
  22896. pd.splx = "Consumable";
  22897. reqData = JSON.stringify(pd);
  22898. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  22899. try {
  22900. let code = res.code;
  22901. let msg = res.msg;
  22902. if (code == 401) {
  22903. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22904. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  22905. return;
  22906. }
  22907. if (code == 200) {
  22908. let data = res.data;
  22909. for (let index = 0; index < data.length; index++) {
  22910. let element = data[index];
  22911. cfgTable.daoJuData[element.spid] = element;
  22912. }
  22913. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  22914. }
  22915. else {
  22916. xGame.uiMgr.Show(UIMsg, msg);
  22917. }
  22918. }
  22919. catch (error) {
  22920. console.log('error=' + error);
  22921. alert(error);
  22922. }
  22923. finally {
  22924. }
  22925. });
  22926. }
  22927. show(type) {
  22928. super.show();
  22929. this.curType = type == 0 ? "qiugan" : "daoju";
  22930. this.switchBtn("qiugan");
  22931. this.playSecretaryIdle();
  22932. this.updateBallRod();
  22933. }
  22934. test123() {
  22935. console.log('zh:test123 ');
  22936. }
  22937. switchBtn(type) {
  22938. console.log('zh:1111切換 sel type=' + type);
  22939. if (type == "") {
  22940. type = this.curType;
  22941. }
  22942. else {
  22943. if (this.curType == type) {
  22944. return;
  22945. }
  22946. else {
  22947. this.curType = type;
  22948. }
  22949. }
  22950. if (type == "qiugan") {
  22951. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  22952. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  22953. this.ui.myNode.c1.selectedIndex = 0;
  22954. this.ui.myNode.myList.visible = true;
  22955. this.ui.myNode.djList.visible = false;
  22956. }
  22957. else {
  22958. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  22959. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  22960. this.ui.myNode.c1.selectedIndex = 1;
  22961. this.ui.myNode.myList.visible = false;
  22962. this.ui.myNode.djList.visible = true;
  22963. }
  22964. }
  22965. updateBallRod() {
  22966. for (let index = 0; index < this.ballRodArr.length; index++) {
  22967. this.ballRodArr[index].updateSelf();
  22968. }
  22969. }
  22970. renderBallRod(sort, obj) {
  22971. let index = this.getIndexBySort(sort + 1) - 1;
  22972. let ballRod = new BallRodDisplay$1(obj, index);
  22973. this.ballRodArr.push(ballRod);
  22974. }
  22975. renderDaoJu(idx, obj) {
  22976. let index = this.getIndexBySortForDj(idx + 1) - 1;
  22977. let b = new DaoJuDisplay$1(obj, index);
  22978. this.daoJuArr.push(b);
  22979. }
  22980. getIndexBySort(sort) {
  22981. let object = cfgTable.ballrodData;
  22982. for (const key in object) {
  22983. if (object[key].sort == sort) {
  22984. return parseInt(key);
  22985. }
  22986. }
  22987. }
  22988. getIndexBySortForDj(idx) {
  22989. let object = cfgTable.daoJuData;
  22990. for (const key in object) {
  22991. if (object[key].idx == idx) {
  22992. return parseInt(key);
  22993. }
  22994. }
  22995. }
  22996. playSecretaryIdle() {
  22997. let parent = this.ui.secretary.displayObject;
  22998. parent.destroyChildren();
  22999. let xx = this.ui.secretary.width / 2;
  23000. let yy = this.ui.secretary.height;
  23001. let scale = xGame.common.getSecretaryScale();
  23002. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23003. xGame.common.secretary.play(data, 0, true, parent);
  23004. }
  23005. interuptSecretary() {
  23006. Laya.timer.clearAll(this);
  23007. this.playSecretaryRandomSound();
  23008. }
  23009. playSecretaryRandomSound() {
  23010. if (this.isHide)
  23011. return;
  23012. let time = xGame.common.randomNum(45000, 60000);
  23013. Laya.timer.once(time, this, () => {
  23014. if (this.isHide)
  23015. return;
  23016. let index = xGame.common.randomNum(4, 7);
  23017. xGame.soundMgr.playSound("s_main0" + index);
  23018. let words = 1;
  23019. switch (index) {
  23020. case 4:
  23021. words = 5;
  23022. break;
  23023. case 5:
  23024. words = 3;
  23025. break;
  23026. case 6:
  23027. words = 6;
  23028. break;
  23029. case 7:
  23030. words = 7;
  23031. break;
  23032. default:
  23033. break;
  23034. }
  23035. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23036. this.playSecretaryRandomSound();
  23037. });
  23038. }
  23039. closeSelf() {
  23040. this.hide();
  23041. }
  23042. }
  23043. UIShop$1.uiName = "UIShop";
  23044. class SignMax$1 {
  23045. constructor(ui) {
  23046. this.ui = ui;
  23047. }
  23048. updateSelf(index, sameDay, curDayIndex) {
  23049. let data = cfgTable.signData[index + 1];
  23050. this.ui.titleTxt.text = data.title;
  23051. let arr1 = data.award[0].split('-');
  23052. let arr2 = data.award[1].split('-');
  23053. let num1 = parseInt(arr1[1]);
  23054. let num2 = parseInt(arr2[1]);
  23055. this.ui.numTxt1.text = num1 + "";
  23056. this.ui.numTxt2.text = num2 + "";
  23057. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23058. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23059. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23060. this.ui.numTxt1.visible = false;
  23061. }
  23062. else {
  23063. this.ui.numTxt1.visible = true;
  23064. }
  23065. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23066. this.ui.numTxt2.visible = false;
  23067. }
  23068. else {
  23069. this.ui.numTxt2.visible = true;
  23070. }
  23071. if (index < curDayIndex) {
  23072. this.ui.c1.selectedIndex = 1;
  23073. }
  23074. else if (index == curDayIndex) {
  23075. if (sameDay) {
  23076. this.ui.c1.selectedIndex = 2;
  23077. }
  23078. else {
  23079. this.ui.c1.selectedIndex = 2;
  23080. }
  23081. }
  23082. else {
  23083. this.ui.c1.selectedIndex = 0;
  23084. }
  23085. }
  23086. }
  23087. class SignNormal$1 {
  23088. constructor(ui) {
  23089. this.ui = ui;
  23090. }
  23091. updateSelf(index, sameDay, curDayIndex) {
  23092. let data = cfgTable.signData[index + 1];
  23093. this.ui.titleTxt.text = data.title;
  23094. let arr = data.award[0].split('-');
  23095. let type = parseInt(arr[0]);
  23096. let num = parseInt(arr[1]);
  23097. this.ui.numTxt.text = num + "";
  23098. if (type > 2) {
  23099. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23100. this.ui.myIcon.rotation = 0;
  23101. }
  23102. else {
  23103. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23104. this.ui.myIcon.rotation = 0;
  23105. }
  23106. if (xGame.common.signAwardContainsRod(data.award)) {
  23107. this.ui.numTxt.visible = false;
  23108. }
  23109. else {
  23110. this.ui.numTxt.visible = true;
  23111. }
  23112. if (index < curDayIndex) {
  23113. this.ui.c1.selectedIndex = 1;
  23114. }
  23115. else if (index == curDayIndex) {
  23116. if (sameDay) {
  23117. this.ui.c1.selectedIndex = 2;
  23118. }
  23119. else {
  23120. this.ui.c1.selectedIndex = 2;
  23121. }
  23122. }
  23123. else {
  23124. this.ui.c1.selectedIndex = 0;
  23125. }
  23126. }
  23127. }
  23128. class UISign$1 extends UIBase {
  23129. constructor() {
  23130. super();
  23131. this.curDayIndex = 0;
  23132. this.starX = 0;
  23133. }
  23134. onConstructor() {
  23135. this.ui = ui_UISign.createInstance();
  23136. this.contentPane = this.ui;
  23137. this.isEject = false;
  23138. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23139. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23140. this.initSignItem();
  23141. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23142. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23143. }
  23144. show() {
  23145. super.show();
  23146. this.ui.t0.play();
  23147. this.playSecretaryIdle();
  23148. this.updateSign();
  23149. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23150. }
  23151. initSignItem() {
  23152. this.signArr = [];
  23153. for (let index = 0; index < 6; index++) {
  23154. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23155. this.signArr.push(temp);
  23156. }
  23157. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23158. if (Moyu.isKs)
  23159. this.ui.closeNode.closeBtn.x += 100;
  23160. }
  23161. updateSign() {
  23162. let sameDay = xGame.common.judgeSameDay();
  23163. let max = 7;
  23164. this.curDayIndex = DataMgr.getSignData();
  23165. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23166. this.curDayIndex = 0;
  23167. if (!sameDay) {
  23168. this.ui.normalBtn.visible = true;
  23169. this.ui.tipsNode.visible = false;
  23170. this.ui.againBtn.visible = false;
  23171. }
  23172. else {
  23173. this.ui.normalBtn.visible = false;
  23174. let again = DataMgr.getExtraSign();
  23175. let isCurrency = false;
  23176. let index = this.curDayIndex;
  23177. if (index == 0)
  23178. index = 7;
  23179. let award = cfgTable.signData[index].award;
  23180. let num = award[0].split("-")[0];
  23181. if (num == "1" || num == "2")
  23182. isCurrency = true;
  23183. let showAgain = again == 0 && isCurrency;
  23184. this.ui.againBtn.visible = showAgain;
  23185. this.ui.tipsNode.visible = !showAgain;
  23186. }
  23187. for (let index = 0; index < this.signArr.length; index++) {
  23188. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23189. }
  23190. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23191. }
  23192. playSecretaryIdle() {
  23193. let parent = this.ui.secretary.displayObject;
  23194. parent.destroyChildren();
  23195. let xx = this.ui.secretary.width / 2;
  23196. let yy = this.ui.secretary.height;
  23197. let scale = xGame.common.getSecretaryScale();
  23198. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23199. xGame.common.secretary.play(data, 0, true, parent);
  23200. }
  23201. closeSelf() {
  23202. this.hide();
  23203. }
  23204. normalGetAward() {
  23205. let sameDay = xGame.common.judgeSameDay();
  23206. if (!sameDay) {
  23207. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23208. let temp;
  23209. let type;
  23210. let num;
  23211. let arr = [];
  23212. for (let index = 0; index < award.length; index++) {
  23213. temp = award[index].split("-");
  23214. type = parseInt(temp[0]);
  23215. num = parseInt(temp[1]);
  23216. let awardType = new AwardType();
  23217. awardType.num = num;
  23218. awardType.type = type;
  23219. arr.push(awardType);
  23220. }
  23221. xGame.common.getAward(arr, (watchVideo) => {
  23222. this.curDayIndex++;
  23223. if (this.curDayIndex > 7)
  23224. this.curDayIndex = 0;
  23225. DataMgr.setSignData(this.curDayIndex);
  23226. DataMgr.setSignTime(new Date().getTime());
  23227. if (watchVideo) {
  23228. DataMgr.setExtraSign(1);
  23229. Moyu.sendDataEvent("signIn1");
  23230. }
  23231. this.updateSign();
  23232. });
  23233. }
  23234. }
  23235. againGetAward() {
  23236. Moyu.sendDataEvent("signIn2");
  23237. console.log('zh:qjff_AD_for_uisign');
  23238. if (Laya.Browser.onAndroid) {
  23239. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23240. if (!boo) {
  23241. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23242. return;
  23243. }
  23244. }
  23245. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23246. }
  23247. else {
  23248. console.log('zh:AD 失败,直接发放奖励');
  23249. this.qjff_AD_for_uisign();
  23250. }
  23251. }
  23252. qjff_AD_for_uisign() {
  23253. let index = this.curDayIndex;
  23254. if (index == 0)
  23255. index = 7;
  23256. let award = cfgTable.signData[index].award;
  23257. let temp;
  23258. let type;
  23259. let num;
  23260. for (let index = 0; index < award.length; index++) {
  23261. temp = award[index].split("-");
  23262. type = parseInt(temp[0]);
  23263. num = parseInt(temp[1]) * 3;
  23264. xGame.common.playObjFlyAnim(num, type);
  23265. }
  23266. DataMgr.setExtraSign(1);
  23267. this.updateSign();
  23268. }
  23269. }
  23270. UISign$1.uiName = "UISign";
  23271. class UIModeSelection$1 extends UIBase {
  23272. constructor() {
  23273. super();
  23274. }
  23275. onConstructor() {
  23276. this.ui = ui_UIModeSelection.createInstance();
  23277. this.contentPane = this.ui;
  23278. this.isEject = false;
  23279. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23280. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23281. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23282. this.addUIClick(this.ui.closeBtn, this.hide);
  23283. this.peopleArr = [65, 990, 580];
  23284. this.peopleOffest = [5, 10, 10];
  23285. }
  23286. show(callback) {
  23287. this.updateSelf();
  23288. super.show();
  23289. this.ui.t0.play();
  23290. this.callback = callback;
  23291. }
  23292. updateSelf() {
  23293. let cfg = cfgTable.modeselectData;
  23294. for (let index = 1; index <= 3; index++) {
  23295. let node = this.ui.myNode["type" + index];
  23296. node.need.text = cfg[index].need;
  23297. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23298. node.peopleTxt.text = this.getRandPeople(index - 1);
  23299. }
  23300. }
  23301. enterGame(type) {
  23302. console.log('zh: 进入经典模式 type: ' + type);
  23303. xGame.common.classicRoomType = type;
  23304. let cfg = cfgTable.modeselectData[type];
  23305. let need = cfg.need;
  23306. xGame.common.passAwardCoin = cfg.award;
  23307. if (DataMgr.coinEnough(need)) {
  23308. DataMgr.setCoin(-need);
  23309. this.ui.myNode["type" + type].t0.play();
  23310. Laya.timer.once(200, this, () => {
  23311. this.callback && this.callback();
  23312. });
  23313. this.logEventForClassic_start();
  23314. }
  23315. else {
  23316. Moyu.sendDataEvent("AddCoinVideo");
  23317. xGame.uiMgr.Show(UIAddProp$1, 0);
  23318. }
  23319. }
  23320. getRandPeople(index) {
  23321. let rand = this.peopleOffest[index];
  23322. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23323. }
  23324. logEventForClassic_start() {
  23325. let rtype = xGame.common.classicRoomType;
  23326. let msmc = '';
  23327. if (rtype == 1) {
  23328. msmc = 'beginner';
  23329. }
  23330. if (rtype == 2) {
  23331. msmc = 'expert';
  23332. }
  23333. if (rtype == 3) {
  23334. msmc = 'master';
  23335. }
  23336. let keyStr = 'sjmd_classic_start_' + rtype;
  23337. let jsonStr = {
  23338. "difficulty": msmc,
  23339. "classic_count": 1,
  23340. "difficulty_count": 1
  23341. };
  23342. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23343. const d = LocalStorageManager.getItem(keyStr);
  23344. jsonStr.classic_count = d.classic_count + 1;
  23345. jsonStr.difficulty_count = d.difficulty_count + 1;
  23346. LocalStorageManager.setItem(keyStr, jsonStr);
  23347. }
  23348. else {
  23349. LocalStorageManager.setItem(keyStr, jsonStr);
  23350. }
  23351. const reqStr = JSON.stringify(jsonStr);
  23352. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23353. }
  23354. }
  23355. UIModeSelection$1.uiName = "UIModeSelection";
  23356. class UILogin$1 extends UIBase {
  23357. constructor() {
  23358. super();
  23359. }
  23360. onConstructor() {
  23361. this.ui = ui_UILogin.createInstance();
  23362. this.contentPane = this.ui;
  23363. this.isEject = false;
  23364. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23365. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23366. this.addUIClick(this.ui.btn_login, this.userLogin);
  23367. }
  23368. show() {
  23369. super.show();
  23370. this.x = (Laya.stage.width - this.width) / 2;
  23371. this.y = (Laya.stage.height - this.height) / 2;
  23372. }
  23373. closeSelf() {
  23374. this.hide();
  23375. }
  23376. userLogin() {
  23377. let ua = this.ui.txt_ua.text;
  23378. let up = this.ui.txt_up.text;
  23379. if (ua && up) {
  23380. let reqData = JSON.stringify({
  23381. username: ua.trim(),
  23382. password: up.trim(),
  23383. fromMark: 'app_game'
  23384. });
  23385. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23386. try {
  23387. console.log('zh:res = ' + JSON.stringify(res));
  23388. let code = res.code;
  23389. let msg = res.msg;
  23390. if (code == 200) {
  23391. let keyStr = keyForLoginInfo;
  23392. let jsonStr = {
  23393. "username": res.username,
  23394. "token": res.token,
  23395. "buySpids": { 1: false, 7: false }
  23396. };
  23397. LocalStorageManager.setItem(keyStr, jsonStr);
  23398. let myu = Moyu.getUserInfo();
  23399. console.log('zh:myu = ' + JSON.stringify(myu));
  23400. DataMgr.updateUserNickName(res.username);
  23401. Moyu.updateUserInfo(res.username);
  23402. xGame.uiMgr.Show(UIMsg$1, msg);
  23403. DataMgr.getUserZiChanInfo();
  23404. xGame.eventMgr.event(LOGIN_IN);
  23405. this.closeSelf();
  23406. }
  23407. else {
  23408. xGame.uiMgr.Show(UIMsg$1, msg);
  23409. }
  23410. }
  23411. catch (error) {
  23412. console.log('error=' + error);
  23413. alert(error);
  23414. }
  23415. finally {
  23416. }
  23417. });
  23418. }
  23419. else {
  23420. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23421. }
  23422. }
  23423. gotoRegPage() {
  23424. this.closeSelf();
  23425. xGame.uiMgr.Show(UIReg$1);
  23426. }
  23427. }
  23428. UILogin$1.uiName = "UILogin";
  23429. class UIReg$1 extends UIBase {
  23430. constructor() {
  23431. super();
  23432. }
  23433. onConstructor() {
  23434. this.ui = ui_UIReg.createInstance();
  23435. this.contentPane = this.ui;
  23436. this.isEject = false;
  23437. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23438. this.addUIClick(this.ui.btn_reg, this.regUser);
  23439. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23440. }
  23441. show() {
  23442. super.show();
  23443. this.x = (Laya.stage.width - this.width) / 2;
  23444. this.y = (Laya.stage.height - this.height) / 2;
  23445. }
  23446. closeSelf() {
  23447. this.hide();
  23448. }
  23449. regUser() {
  23450. this.ui.lab_tip.visible = false;
  23451. let ua = this.ui.txt_ua.text;
  23452. let up1 = this.ui.txt_up1.text;
  23453. let up2 = this.ui.txt_up2.text;
  23454. if (ua && up1 && up2 && up1 == up2) {
  23455. let reqData = JSON.stringify({
  23456. username: ua.trim(),
  23457. password: up1.trim(),
  23458. fromMark: 'app_game'
  23459. });
  23460. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23461. try {
  23462. console.log('zh:res = ' + JSON.stringify(res));
  23463. let code = res.code;
  23464. let msg = res.msg;
  23465. xGame.uiMgr.Show(UIMsg$1, msg);
  23466. if (code == 200) {
  23467. this.ui.lab_tip.color = "#FFFFFF";
  23468. xGame.uiMgr.Show(UIMsg$1, msg);
  23469. this.closeSelf();
  23470. }
  23471. else {
  23472. this.ui.lab_tip.color = "#FF0000";
  23473. xGame.uiMgr.Show(UIMsg$1, msg);
  23474. }
  23475. }
  23476. catch (error) {
  23477. console.log('error=' + error);
  23478. alert(error);
  23479. }
  23480. finally {
  23481. }
  23482. });
  23483. }
  23484. else {
  23485. if (up1 != up2) {
  23486. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23487. }
  23488. else {
  23489. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23490. }
  23491. }
  23492. }
  23493. gotoLogin() {
  23494. this.closeSelf();
  23495. xGame.uiMgr.Show(UILogin$1);
  23496. }
  23497. }
  23498. UIReg$1.uiName = "UIReg";
  23499. class UIFuli1$1 extends UIBase {
  23500. constructor() {
  23501. super();
  23502. }
  23503. onConstructor() {
  23504. this.ui = ui_UIFuli1.createInstance();
  23505. this.contentPane = this.ui;
  23506. this.isEject = false;
  23507. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23508. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23509. }
  23510. show() {
  23511. super.show();
  23512. this.x = (Laya.stage.width - this.width) / 2;
  23513. this.y = (Laya.stage.height - this.height) / 2;
  23514. }
  23515. closeSelf() {
  23516. this.hide();
  23517. }
  23518. gotoBuy() {
  23519. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23520. if (userInfo != null) {
  23521. let token = userInfo.token;
  23522. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  23523. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  23524. return;
  23525. }
  23526. else {
  23527. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23528. }
  23529. }
  23530. gotoBuy2() {
  23531. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23532. if (userInfo == null) {
  23533. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23534. return;
  23535. }
  23536. let reqData = xGame.httpMgr.getReqData();
  23537. let pd = JSON.parse(reqData);
  23538. pd.productId = 1;
  23539. reqData = JSON.stringify(pd);
  23540. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23541. try {
  23542. console.log('zh:buySp res = ' + JSON.stringify(res));
  23543. let code = res.code;
  23544. let msg = res.msg;
  23545. if (code == 401) {
  23546. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23547. alert(TIP_MSG_key.loginTimeOut);
  23548. xGame.uiMgr.Show(UIMsg$1, msg);
  23549. return;
  23550. }
  23551. if (code == 200) {
  23552. xGame.uiMgr.Show(UIMsg$1, msg);
  23553. DataMgr.getUserZiChanInfo();
  23554. this.closeSelf();
  23555. }
  23556. else {
  23557. xGame.uiMgr.Show(UIMsg$1, msg);
  23558. }
  23559. }
  23560. catch (error) {
  23561. console.log('error=' + error);
  23562. alert(error);
  23563. }
  23564. finally {
  23565. }
  23566. });
  23567. }
  23568. }
  23569. UIFuli1$1.uiName = "UIFuli1";
  23570. class UIFuli2$1 extends UIBase {
  23571. constructor() {
  23572. super();
  23573. }
  23574. onConstructor() {
  23575. this.ui = ui_UIFuli2.createInstance();
  23576. this.contentPane = this.ui;
  23577. this.isEject = false;
  23578. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  23579. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  23580. }
  23581. show() {
  23582. super.show();
  23583. this.x = (Laya.stage.width - this.width) / 2;
  23584. this.y = (Laya.stage.height - this.height) / 2;
  23585. }
  23586. closeSelf() {
  23587. this.hide();
  23588. }
  23589. gotoBuy() {
  23590. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23591. if (userInfo != null) {
  23592. let token = userInfo.token;
  23593. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  23594. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  23595. return;
  23596. }
  23597. else {
  23598. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23599. }
  23600. }
  23601. gotoBuy1() {
  23602. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23603. if (userInfo == null) {
  23604. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23605. return;
  23606. }
  23607. let reqData = xGame.httpMgr.getReqData();
  23608. let pd = JSON.parse(reqData);
  23609. pd.productId = 2;
  23610. reqData = JSON.stringify(pd);
  23611. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23612. try {
  23613. console.log('zh:buySp res = ' + JSON.stringify(res));
  23614. let code = res.code;
  23615. let msg = res.msg;
  23616. if (code == 401) {
  23617. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23618. alert(TIP_MSG_key.loginTimeOut);
  23619. xGame.uiMgr.Show(UIMsg$1, msg);
  23620. return;
  23621. }
  23622. if (code == 200) {
  23623. xGame.uiMgr.Show(UIMsg$1, msg);
  23624. DataMgr.getUserZiChanInfo();
  23625. this.closeSelf();
  23626. }
  23627. else {
  23628. xGame.uiMgr.Show(UIMsg$1, msg);
  23629. }
  23630. }
  23631. catch (error) {
  23632. console.log('error=' + error);
  23633. alert(error);
  23634. }
  23635. finally {
  23636. }
  23637. });
  23638. }
  23639. }
  23640. UIFuli2$1.uiName = "UIFuli2";
  23641. class UITry$1 extends UIBase {
  23642. constructor() {
  23643. super();
  23644. this.closeTime = 0;
  23645. this.closeNum = 0;
  23646. this.skillUrl = xGame.common.skillIconList;
  23647. }
  23648. onConstructor() {
  23649. this.ui = ui_UITry.createInstance();
  23650. this.contentPane = this.ui;
  23651. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23652. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23653. }
  23654. show() {
  23655. super.show();
  23656. this.closeNum = 0;
  23657. this.closeTime = 15;
  23658. this.ui.t0.play();
  23659. PlatMgr.showRateBanner();
  23660. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23661. Laya.timer.loop(1000, this, this.updateTime);
  23662. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23663. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23664. xGame.common.gameMgr.gamePause = true;
  23665. }
  23666. updateTime() {
  23667. if (this.closeTime > 1) {
  23668. this.closeTime--;
  23669. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23670. }
  23671. else
  23672. this.hide();
  23673. }
  23674. hide() {
  23675. Laya.timer.clearAll(this);
  23676. Moyu.showBannerAd(false);
  23677. super.hide();
  23678. xGame.common.gameMgr.gamePause = false;
  23679. }
  23680. onTry() {
  23681. console.log('zh:qjff_AD_for_uitry');
  23682. if (Laya.Browser.onAndroid) {
  23683. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23684. if (!boo) {
  23685. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23686. return;
  23687. }
  23688. }
  23689. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  23690. }
  23691. else {
  23692. console.log('zh:AD 失败,直接发放奖励');
  23693. this.qjff_AD_for_uitry();
  23694. }
  23695. }
  23696. qjff_AD_for_uitry() {
  23697. let select = xGame.common.curPlayerSkillType;
  23698. DataMgr.gameData.trySkill = select;
  23699. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  23700. DataMgr.saveGameData();
  23701. DataMgr.setBigSkill(select, 1);
  23702. xGame.showTip("Trial Successful");
  23703. this.hide();
  23704. }
  23705. onCancel() {
  23706. if (this.closeNum > 0) {
  23707. this.closeNum--;
  23708. if (this.closeNum < 2)
  23709. this.hide();
  23710. return;
  23711. }
  23712. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  23713. this.onTry();
  23714. }
  23715. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  23716. this.closeNum = 3;
  23717. }
  23718. else
  23719. this.hide();
  23720. }
  23721. }
  23722. UITry$1.uiName = "UITry";
  23723. class UIGetAward$1 extends UIBase {
  23724. constructor() {
  23725. super();
  23726. this.showTriple = true;
  23727. }
  23728. onConstructor() {
  23729. this.ui = ui_UIGetAward.createInstance();
  23730. this.contentPane = this.ui;
  23731. this.isEject = false;
  23732. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  23733. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  23734. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  23735. }
  23736. show(arr, showTriple, callback) {
  23737. super.show();
  23738. this.ui.t0.play();
  23739. this.ui.eftNode.visible = true;
  23740. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  23741. this.ui.eftNode.visible = false;
  23742. }), 1, 0, 0, 0.9);
  23743. this.awardArr = arr;
  23744. this.showTriple = showTriple;
  23745. this.callback = callback;
  23746. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  23747. this.ui.myList.numItems = arr.length;
  23748. xGame.soundMgr.playSound("getaward");
  23749. }
  23750. updateSelf(index, obj) {
  23751. let temp = this.awardArr[index];
  23752. let icon = this.getIcon(temp.type);
  23753. let str = icon;
  23754. if (temp.type > 2) {
  23755. str = "s" + icon;
  23756. }
  23757. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  23758. obj.myIcon.rotation = 0;
  23759. obj.numTxt.text = temp.num + "";
  23760. obj.numTxt.visible = temp.type > 2 ? false : true;
  23761. obj.nameTxt.text = this.getNameStr(temp.type);
  23762. }
  23763. renderItem(index, obj) {
  23764. this.updateSelf(index, obj);
  23765. }
  23766. tripleGetAward() {
  23767. console.log('zh:qjff_AD_for_uigetAward');
  23768. if (Laya.Browser.onAndroid) {
  23769. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23770. if (!boo) {
  23771. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23772. return;
  23773. }
  23774. }
  23775. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  23776. }
  23777. else {
  23778. console.log('zh:AD 失败,直接发放奖励');
  23779. this.qjff_AD_for_uigetAward();
  23780. }
  23781. }
  23782. qjff_AD_for_uigetAward() {
  23783. this.getAward(3);
  23784. }
  23785. normalGetAward() {
  23786. if (PlatMgr.isMisVideo())
  23787. this.tripleGetAward();
  23788. else
  23789. this.getAward();
  23790. }
  23791. getAward(times = 1) {
  23792. this.hide();
  23793. for (let index = 0; index < this.awardArr.length; index++) {
  23794. this.awardArr[index].num *= times;
  23795. }
  23796. this.callback && this.callback(times != 1);
  23797. }
  23798. getIcon(type) {
  23799. switch (type) {
  23800. case Prop.diamond:
  23801. return "ty_zs";
  23802. case Prop.coin:
  23803. return "ty_jb";
  23804. case Prop.gan1:
  23805. return "qg1";
  23806. case Prop.gan2:
  23807. return "qg2";
  23808. case Prop.gan3:
  23809. return "qg3";
  23810. case Prop.gan4:
  23811. return "qg4";
  23812. default:
  23813. break;
  23814. }
  23815. }
  23816. getNameStr(type) {
  23817. switch (type) {
  23818. case Prop.diamond:
  23819. return "Diamond";
  23820. case Prop.coin:
  23821. return "Coins";
  23822. case Prop.gan1:
  23823. case Prop.gan2:
  23824. case Prop.gan3:
  23825. case Prop.gan4:
  23826. return cfgTable.ballrodData[type - 1].name;
  23827. default:
  23828. break;
  23829. }
  23830. }
  23831. }
  23832. UIGetAward$1.uiName = "UIGetAward";
  23833. class UIBox$1 extends UIBase {
  23834. constructor() {
  23835. super();
  23836. this.boxNum = 0;
  23837. this.boxMax = 10;
  23838. this.inAd = false;
  23839. this.isClose = false;
  23840. }
  23841. onConstructor() {
  23842. this.ui = ui_UIBox.createInstance();
  23843. this.contentPane = this.ui;
  23844. this.isEject = false;
  23845. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  23846. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  23847. Laya.timer.loop(1000, this, this.update);
  23848. }
  23849. update() {
  23850. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  23851. this.boxNum -= 1;
  23852. this.upBar();
  23853. }
  23854. }
  23855. upBar() {
  23856. if (this.boxNum > this.boxMax)
  23857. this.boxNum = this.boxMax;
  23858. this.ui.bar.value = this.boxNum * 10;
  23859. }
  23860. show() {
  23861. super.show();
  23862. this.isClose = false;
  23863. this.boxNum = 0;
  23864. this.inAd = false;
  23865. this.upBar();
  23866. this.ui.t0.play();
  23867. this.ui.closeBtn.visible = false;
  23868. Laya.timer.once(3000, this, () => {
  23869. this.ui.closeBtn.visible = true;
  23870. this.ui.bar.alpha = 1;
  23871. });
  23872. Laya.timer.once(500, this, () => {
  23873. this.ui.t1.play();
  23874. });
  23875. }
  23876. hide() {
  23877. Laya.timer.clearAll(this);
  23878. Moyu.showBannerAd(false);
  23879. super.hide();
  23880. }
  23881. onOpenBox() {
  23882. this.boxNum++;
  23883. if (this.boxNum < this.boxMax) {
  23884. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  23885. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  23886. }
  23887. }
  23888. else if (this.boxNum == this.boxMax) {
  23889. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  23890. this.ui.openBtn.c1.selectedIndex = 13;
  23891. this.inAd = true;
  23892. }
  23893. else
  23894. this.getAward();
  23895. }
  23896. else if (this.inAd) {
  23897. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  23898. if (Laya.Browser.onAndroid) {
  23899. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23900. if (!boo) {
  23901. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23902. return;
  23903. }
  23904. }
  23905. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  23906. }
  23907. else {
  23908. console.log('zh:AD 失败,直接发放奖励');
  23909. this.qjff_AD_for_UIBOX_onOpenBox();
  23910. }
  23911. }
  23912. this.upBar();
  23913. }
  23914. qjff_AD_for_UIBOX_onOpenBox() {
  23915. this.getAward();
  23916. }
  23917. onCloseBox() {
  23918. if (this.isClose)
  23919. this.hide();
  23920. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  23921. this.isClose = true;
  23922. PlatMgr.showBanner(true, 0, 3000);
  23923. }
  23924. else
  23925. this.hide();
  23926. }
  23927. getAward() {
  23928. let str = "";
  23929. if (Math.random() < 0.5) {
  23930. let max = Moyu.isLegal ? 500 : 2500;
  23931. let num = xGame.tools.random(max, 500 + max);
  23932. DataMgr.setCoin(num);
  23933. str = "金币x" + num;
  23934. }
  23935. else {
  23936. let max = Moyu.isLegal ? 10 : 30;
  23937. let num = xGame.tools.random(max, 30 + max);
  23938. DataMgr.setDiamond(num);
  23939. str = "钻石x" + num;
  23940. }
  23941. xGame.showTip("恭喜获得-" + str);
  23942. this.hide();
  23943. }
  23944. }
  23945. UIBox$1.uiName = "UIBox";
  23946. class UIMain$1 extends UIBase {
  23947. constructor() {
  23948. super();
  23949. this.firstEnter = true;
  23950. }
  23951. nativeCallJs(msg) {
  23952. let t = msg;
  23953. console.log("zh: nativeCallJs 奖励开始发放:", t);
  23954. switch (t) {
  23955. case 'qjff_chouJiang':
  23956. let dui = xGame.uiMgr.getUI(UIDraw$1);
  23957. dui.qjff_chouJiang();
  23958. break;
  23959. case 'qjff_AD_for_uisign':
  23960. let dui2 = xGame.uiMgr.getUI(UISign$1);
  23961. dui2.qjff_AD_for_uisign();
  23962. break;
  23963. case 'qjff_AD_for_uitry':
  23964. let dui3 = xGame.uiMgr.getUI(UITry$1);
  23965. dui3.qjff_AD_for_uitry();
  23966. break;
  23967. case 'qjff_AD_for_uipower':
  23968. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  23969. dui4.qjff_AD_for_uipower();
  23970. break;
  23971. case 'qjff_AD_for_uigetAward':
  23972. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  23973. dui5.qjff_AD_for_uigetAward();
  23974. break;
  23975. case 'qjff_AD_for_uiGameEnd':
  23976. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  23977. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  23978. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  23979. break;
  23980. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  23981. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  23982. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  23983. break;
  23984. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  23985. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  23986. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  23987. break;
  23988. case 'qjff_AD_for_UIrepentProp_videoRegret':
  23989. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  23990. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  23991. break;
  23992. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  23993. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  23994. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  23995. break;
  23996. case 'qjff_AD_for_UIBOX_onOpenBox':
  23997. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  23998. dui11.qjff_AD_for_UIBOX_onOpenBox();
  23999. break;
  24000. case 'qjff_AD_for_UIAddCoin':
  24001. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24002. dui12.qjff_AD_for_UIAddCoin();
  24003. break;
  24004. case '111a':
  24005. let dui14 = xGame.uiMgr.getUI(UISign$1);
  24006. dui14.qjff_AD_for_uisign();
  24007. break;
  24008. case '222a':
  24009. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24010. dui15.qjff_AD_for_uisign();
  24011. break;
  24012. case '333a':
  24013. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24014. dui16.qjff_AD_for_uisign();
  24015. break;
  24016. default:
  24017. console.log('zh:未知的方法名字' + t);
  24018. break;
  24019. }
  24020. }
  24021. onConstructor() {
  24022. console.log('zh: UIMain onConstructor');
  24023. this.ui = ui_UIMain.createInstance();
  24024. this.contentPane = this.ui;
  24025. this.isEject = false;
  24026. this.addEvent();
  24027. this.addClickSpine();
  24028. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24029. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24030. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24031. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24032. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24033. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24034. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24035. let curUse = DataMgr.getCurSecretary();
  24036. this.changeSecretary(curUse);
  24037. this.ui.talkNode.visible = false;
  24038. let guide = DataMgr.getSkillGuide();
  24039. if (xGame.common.isNewDay && guide == 1) {
  24040. xGame.common.isNewDay = false;
  24041. xGame.soundMgr.playSound("s_main01");
  24042. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24043. console.log("zh:播放小秘书每天语音");
  24044. }
  24045. this.onGetUserInfo();
  24046. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24047. DataMgr.getUserZiChanInfo();
  24048. }
  24049. this.ui.n83.visible = false;
  24050. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24051. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24052. let ua = d.username;
  24053. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24054. }
  24055. this.c_btn_for_user();
  24056. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24057. this.loadUserSpOrderForAd();
  24058. this.ui.n_fuli.visible = false;
  24059. }
  24060. Logout() {
  24061. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24062. LocalStorageManager.removeItem(keyForLoginInfo);
  24063. this.freshUser();
  24064. }
  24065. JSBridgeUtils.instance.loginOutForApp();
  24066. this.setUserDefaultNickname();
  24067. }
  24068. setUserDefaultNickname() {
  24069. let defUsername = "player";
  24070. this.ui.headNode.nameTxt.text = defUsername;
  24071. DataMgr.updateUserNickName(defUsername);
  24072. Moyu.updateUserInfo(defUsername);
  24073. }
  24074. gotoLogin() {
  24075. xGame.uiMgr.Show(UILogin$1);
  24076. }
  24077. gotoRegUser() {
  24078. xGame.uiMgr.Show(UIReg$1);
  24079. }
  24080. showFuLiSp1() {
  24081. console.log('zh:福利1');
  24082. this.checkForShowFuLi17(1);
  24083. }
  24084. showFuLiSp7() {
  24085. console.log('zh:福利7');
  24086. this.checkForShowFuLi17(7);
  24087. }
  24088. loadUserSpOrderForAd() {
  24089. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24090. if (userInfo == null) {
  24091. return;
  24092. }
  24093. let reqData = xGame.httpMgr.getReqData();
  24094. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  24095. try {
  24096. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  24097. let code = res.code;
  24098. let msg = res.msg;
  24099. if (code == 401) {
  24100. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  24101. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24102. return;
  24103. }
  24104. if (code == 200) {
  24105. let data = res.data;
  24106. let buy_spid1 = false;
  24107. let buy_spid7 = false;
  24108. for (let index = 0; index < data.length; index++) {
  24109. let element = data[index];
  24110. console.log('zh:list element.spid = ' + element.spid);
  24111. if (element.spid == 1) {
  24112. buy_spid1 = true;
  24113. }
  24114. if (element.spid == 7) {
  24115. buy_spid7 = true;
  24116. }
  24117. }
  24118. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  24119. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  24120. }
  24121. else {
  24122. xGame.uiMgr.Show(UIMsg$1, msg);
  24123. }
  24124. }
  24125. catch (error) {
  24126. console.log('error=' + error);
  24127. alert(error);
  24128. }
  24129. finally {
  24130. }
  24131. });
  24132. }
  24133. checkForShowFuLi17(spid) {
  24134. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24135. if (userInfo == null) {
  24136. if (spid === 1) {
  24137. xGame.uiMgr.Show(UIFuli1$1);
  24138. }
  24139. if (spid === 7) {
  24140. xGame.uiMgr.Show(UIFuli2$1);
  24141. }
  24142. return;
  24143. }
  24144. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  24145. let reqData = xGame.httpMgr.getReqData();
  24146. let pd = JSON.parse(reqData);
  24147. pd.productId = spid;
  24148. reqData = JSON.stringify(pd);
  24149. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  24150. try {
  24151. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  24152. let code = res.code;
  24153. let msg = res.msg;
  24154. if (code == 401) {
  24155. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  24156. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24157. return;
  24158. }
  24159. if (code == 200) {
  24160. let isBuyOk = res.data;
  24161. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  24162. if (isBuyOk === false) {
  24163. if (spid === 1) {
  24164. xGame.uiMgr.Show(UIFuli1$1);
  24165. }
  24166. if (spid === 7) {
  24167. xGame.uiMgr.Show(UIFuli2$1);
  24168. }
  24169. }
  24170. else {
  24171. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  24172. }
  24173. }
  24174. else {
  24175. xGame.uiMgr.Show(UIMsg$1, msg);
  24176. }
  24177. }
  24178. catch (error) {
  24179. console.log('error=' + error);
  24180. alert(error);
  24181. }
  24182. finally {
  24183. }
  24184. });
  24185. }
  24186. c_btn_for_user() {
  24187. this.ui.n_Logout.visible = false;
  24188. this.ui.n_dengLu.visible = false;
  24189. this.ui.n_zhuCe.visible = false;
  24190. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24191. this.ui.n_Logout.visible = true;
  24192. }
  24193. else {
  24194. this.ui.n_dengLu.visible = true;
  24195. }
  24196. }
  24197. changeSecretary(curUse) {
  24198. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24199. xGame.common.secretary && xGame.common.secretary.dispose();
  24200. this.addSecretarySpine(name);
  24201. }
  24202. addSecretarySpine(name) {
  24203. let spine = new SpineMgr(name, () => {
  24204. this.playSecretaryIdle();
  24205. });
  24206. xGame.common.secretary = spine;
  24207. }
  24208. addClickSpine() {
  24209. let clickSpine = new SpineMgr("dianji", () => {
  24210. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24211. let parent = Laya.stage;
  24212. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24213. clickSpine.play(data, 0, false, parent, (spine) => {
  24214. spine.destroy(true);
  24215. });
  24216. });
  24217. });
  24218. }
  24219. addEvent() {
  24220. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24221. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24222. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  24223. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24224. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24225. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24226. this.addUIClick(this.ui, this.interuptSecretary);
  24227. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24228. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24229. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24230. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24231. this.addUIClick(this.ui.signBtn, this.openSignView);
  24232. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24233. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24234. this.addUIClick(this.ui.n_Logout, this.Logout);
  24235. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24236. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  24237. this.addUIClick(this.ui.n_fuli, this.showFuLiSp7);
  24238. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24239. }
  24240. show(showFailWords) {
  24241. super.show();
  24242. this.loadUserSpOrderForAd();
  24243. this.moneyNode.ui.c1.selectedIndex = 1;
  24244. this.playSecretaryIdle();
  24245. xGame.soundMgr.playMusic("caromhall01", 0);
  24246. Laya.timer.clearAll(this);
  24247. this.playSecretaryRandomSound();
  24248. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24249. if (showFailWords) {
  24250. console.log('zh:uimain.ts ');
  24251. setTimeout(() => {
  24252. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24253. let words = -1;
  24254. if (str == "s_main02") {
  24255. words = 2;
  24256. }
  24257. else {
  24258. words = 3;
  24259. }
  24260. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24261. xGame.soundMgr.playSound(str);
  24262. }, 300);
  24263. }
  24264. this.showGuide();
  24265. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24266. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24267. let guide = DataMgr.getSkillGuide();
  24268. if (guide == 1) {
  24269. let randTime = xGame.common.randomNum(300, 800);
  24270. if (this.firstEnter) {
  24271. console.log("zh: firstEnter");
  24272. this.firstEnter = false;
  24273. randTime += 900;
  24274. }
  24275. else {
  24276. console.log("zh: no firstEnter");
  24277. }
  24278. Laya.timer.once(randTime, this, () => {
  24279. });
  24280. Laya.timer.once(1000, this, () => {
  24281. console.log('zh: 1秒后 showFuLiSp1');
  24282. this.showFuLiSp1();
  24283. });
  24284. Laya.timer.once(10000, this, () => {
  24285. console.log('zh: 10秒后 showFuLiSp1');
  24286. this.showFuLiSp7();
  24287. });
  24288. }
  24289. }
  24290. checkActive(show) {
  24291. }
  24292. showGuide() {
  24293. let guide = DataMgr.getSkillGuide();
  24294. this.ui.guideBtn.visible = guide == 0;
  24295. this.ui.enterGuide.visible = false;
  24296. this.ui.secretaryGuide.visible = guide == 0;
  24297. if (guide == 0) {
  24298. console.log("zh:显示引导");
  24299. xGame.soundMgr.playSound("s_guide");
  24300. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24301. }
  24302. else {
  24303. console.log("zh:不需要显示引导");
  24304. }
  24305. }
  24306. ensureSecretary() {
  24307. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  24308. this.ui.secretaryGuide.visible = false;
  24309. this.ui.enterGuide.visible = true;
  24310. this.ui.wordsNode.t0.play();
  24311. if (DataMgr.getNewUser())
  24312. Moyu.sendDataEvent("gameReady");
  24313. }
  24314. playSecretaryIdle() {
  24315. let parent = this.ui.secretary.displayObject;
  24316. parent.destroyChildren();
  24317. let xx = this.ui.secretary.width / 2;
  24318. let yy = this.ui.secretary.height;
  24319. let scale = xGame.common.getSecretaryScale();
  24320. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24321. xGame.common.secretary.play(data, 0, true, parent);
  24322. }
  24323. startGame(type) {
  24324. if (!this.isReadyForLoadNetSource()) {
  24325. return;
  24326. }
  24327. xGame.common.gameMode = type;
  24328. Moyu.sendDataEvent("PlayGame", { type: type });
  24329. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  24330. switch (xGame.common.gameMode) {
  24331. case GameMode.classic:
  24332. console.log('zh:进入经典模式111111111');
  24333. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24334. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24335. console.log('zh:classic db_over_lev=', db_over_lev);
  24336. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24337. console.log('zh:判断是否可以玩该模式classic =NO');
  24338. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24339. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24340. return;
  24341. }
  24342. else {
  24343. console.log('zh:可以玩该模式classic 66666666666666');
  24344. this.beginGame();
  24345. }
  24346. }
  24347. else {
  24348. console.log('zh:不需要判断是否可以玩该classic');
  24349. let challengeTimes = DataMgr.getChallengeTimes();
  24350. if (challengeTimes == 0) {
  24351. xGame.uiMgr.Show(UIInvitation$1);
  24352. }
  24353. else {
  24354. this.beginGame();
  24355. }
  24356. break;
  24357. }
  24358. case GameMode.bigMove:
  24359. console.error('zh:bigMove check');
  24360. let guide = DataMgr.getSkillGuide();
  24361. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24362. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24363. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24364. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24365. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24366. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24367. return;
  24368. }
  24369. else {
  24370. console.log('zh:可以玩该模式 bigMove');
  24371. this.beginGame();
  24372. if (DataMgr.getNewUser())
  24373. Moyu.sendDataEvent("gameStart0");
  24374. }
  24375. }
  24376. else {
  24377. this.beginGame();
  24378. if (DataMgr.getNewUser())
  24379. Moyu.sendDataEvent("gameStart0");
  24380. }
  24381. break;
  24382. default:
  24383. console.error('zh:未知错误!!!!');
  24384. break;
  24385. }
  24386. }
  24387. beginGame(isNice = false) {
  24388. console.log('zh:beginGame ');
  24389. let guide = DataMgr.getSkillGuide();
  24390. if (guide == 1) {
  24391. console.log('zh:非新手引导,showInternAd ');
  24392. JSBridgeUtils.instance.showInternAd('beginGame');
  24393. }
  24394. else {
  24395. console.log('zh:新手引导,不显示AD ');
  24396. }
  24397. console.log('zh:beginGame 2 go');
  24398. if (xGame.common.gameMode == GameMode.classic) {
  24399. if (isNice) {
  24400. this.enterClassic();
  24401. }
  24402. else {
  24403. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24404. console.log('zh:BBBBBBBBBBBBBBB');
  24405. this.enterClassic();
  24406. });
  24407. }
  24408. }
  24409. else if (xGame.common.gameMode == GameMode.bigMove) {
  24410. this.ui.enterGuide.visible = false;
  24411. xGame.uiMgr.Show(UISkill$1);
  24412. }
  24413. }
  24414. enterClassic() {
  24415. xGame.uiMgr.Show(UIGame$1);
  24416. xGame.uiMgr.Show(UIMatching$1, () => {
  24417. if (!this.isHide)
  24418. this.hide();
  24419. xGame.common.gameUI.ui.alpha = 1;
  24420. xGame.common.gameUI.startGame();
  24421. xGame.uiMgr.Hide(UIGameEnd$1);
  24422. });
  24423. }
  24424. start_debug_for_moni_payOk() {
  24425. console.log('zh:start_debug_for_moni_payOk');
  24426. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24427. if (userInfo != null) {
  24428. let token = userInfo.token;
  24429. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24430. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  24431. alert('模拟支付OK');
  24432. return;
  24433. }
  24434. else {
  24435. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24436. }
  24437. }
  24438. startGlobal() {
  24439. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24440. }
  24441. startWeekly() {
  24442. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24443. }
  24444. zhouSaiMonth() {
  24445. console.log('zh: zhouSaiMonth 被调用');
  24446. }
  24447. isReadyForLoadNetSource() {
  24448. let reqCount = xGame.cfgMgr.httpReqCount;
  24449. let ok = xGame.cfgMgr.httpReqOkCount;
  24450. if (reqCount > ok) {
  24451. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24452. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24453. Laya.timer.once(5000, this, () => {
  24454. let retryCount = 0;
  24455. const maxRetries = 3;
  24456. const tryFetchConfig = () => {
  24457. try {
  24458. xGame.cfgMgr.getConfigFromServer();
  24459. }
  24460. catch (error) {
  24461. if (retryCount < maxRetries) {
  24462. retryCount++;
  24463. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24464. Laya.timer.once(5000, this, tryFetchConfig);
  24465. }
  24466. else {
  24467. console.error("❌ 达到最大重试次数,配置获取失败");
  24468. }
  24469. }
  24470. };
  24471. tryFetchConfig();
  24472. });
  24473. return false;
  24474. }
  24475. return true;
  24476. }
  24477. startPlaceBall() {
  24478. if (!this.isReadyForLoadNetSource()) {
  24479. return;
  24480. }
  24481. xGame.uiMgr.Show(UILevelDisplay$1);
  24482. }
  24483. hide() {
  24484. console.log('zh:uimain hide ...');
  24485. super.hide();
  24486. xGame.common.stopGirlPop(this.ui.talkNode);
  24487. }
  24488. onGetUserInfo(force = false) {
  24489. if (Moyu.isWx) {
  24490. let info = Moyu.getSystemInfo();
  24491. if (info)
  24492. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24493. }
  24494. else {
  24495. Moyu.initUser(this, this.freshUser, force);
  24496. }
  24497. this.freshUser();
  24498. }
  24499. event_login_in() {
  24500. console.log("zh:event_login_in被触发");
  24501. this.freshUser();
  24502. }
  24503. freshUser() {
  24504. let user = Moyu.getUserInfo();
  24505. if (!user.isAuth) {
  24506. user.headIcon = 'res/ty_touxiang.png';
  24507. }
  24508. else {
  24509. DataMgr.upRankData();
  24510. }
  24511. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24512. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24513. let keyStr = keyForLoginInfo;
  24514. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24515. const d = LocalStorageManager.getItem(keyStr);
  24516. let ua = d.username;
  24517. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24518. }
  24519. else {
  24520. }
  24521. this.c_btn_for_user();
  24522. }
  24523. interuptSecretary() {
  24524. Laya.timer.clearAll(this);
  24525. this.playSecretaryRandomSound();
  24526. }
  24527. playSecretaryRandomSound() {
  24528. if (this.isHide)
  24529. return;
  24530. let time = xGame.common.randomNum(45000, 60000);
  24531. Laya.timer.once(time, this, () => {
  24532. if (this.isHide)
  24533. return;
  24534. let index = xGame.common.randomNum(4, 7);
  24535. xGame.soundMgr.playSound("s_main0" + index);
  24536. let words = 1;
  24537. switch (index) {
  24538. case 4:
  24539. words = 5;
  24540. break;
  24541. case 5:
  24542. words = 3;
  24543. break;
  24544. case 6:
  24545. words = 6;
  24546. break;
  24547. case 7:
  24548. words = 7;
  24549. break;
  24550. default:
  24551. break;
  24552. }
  24553. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24554. this.playSecretaryRandomSound();
  24555. });
  24556. }
  24557. openSecretaryView() {
  24558. xGame.uiMgr.Show(UISecretary$1);
  24559. Moyu.sendDataEvent("secretary");
  24560. }
  24561. openShopView() {
  24562. xGame.uiMgr.Show(UIShop$1, 0);
  24563. }
  24564. openSignView() {
  24565. xGame.uiMgr.Show(UISign$1);
  24566. }
  24567. openDrawView() {
  24568. xGame.uiMgr.Show(UIDraw$1);
  24569. }
  24570. openRanking() {
  24571. console.log('zh:phb openRanking');
  24572. xGame.uiMgr.Show(UIRanking$1);
  24573. Moyu.sendDataEvent("rankingList");
  24574. }
  24575. }
  24576. UIMain$1.uiName = "UIMain";
  24577. function InitShader() {
  24578. }
  24579. function appInit() {
  24580. xGame.context.init(getLoadingResList(), initCallback);
  24581. }
  24582. function getLoadingResList() {
  24583. return [
  24584. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24585. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24586. ];
  24587. }
  24588. function getGameResList() {
  24589. return [
  24590. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24591. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24592. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24593. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24594. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24595. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24596. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24597. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24598. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24599. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24600. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24601. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24602. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24603. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24604. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24605. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24606. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24607. ];
  24608. }
  24609. function initCallback() {
  24610. window["DataMgr"] = DataMgr;
  24611. DataMgr.Init();
  24612. Moyu.init(getPlat(), this, () => {
  24613. DataMgr.isNewDay();
  24614. PlatMgr.initConfig();
  24615. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24616. }, true);
  24617. console.log('zh:开始sm init1 start');
  24618. xGame.soundMgr.init();
  24619. console.log('zh:开始sm init1 end');
  24620. xGame.uiMgr.init();
  24621. xGame.uiMgr.clearTempData();
  24622. xGame.uiMgr.bindFUI(fguiRes.loading);
  24623. xGame.uiMgr.Show(UILoading);
  24624. }
  24625. function loadSubRes(callback) {
  24626. var tab = ["asset", "res", "spine"];
  24627. let subDone = 0;
  24628. for (var i = 0; i < tab.length; i++) {
  24629. let sub = tab[i];
  24630. Moyu.loadSubRes(sub, (pro) => {
  24631. callback && callback(pro, false);
  24632. }).then(() => {
  24633. subDone++;
  24634. if (subDone >= tab.length)
  24635. callback && callback(1, true);
  24636. });
  24637. }
  24638. }
  24639. function enterGame() {
  24640. xGame.cfgMgr.init();
  24641. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24642. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24643. xGame.uiMgr.Hide(UILoading);
  24644. fgui.UIPackage.removePackage(fguiRes.loading);
  24645. xGame.uiMgr.bindFUI(fguiRes.game);
  24646. xGame.uiMgr.Show(UIMain$1);
  24647. if (DataMgr.getNewUser())
  24648. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24649. }
  24650. function getPlat() {
  24651. let cfg = new MoyuCfg();
  24652. cfg.plat = MoyuPlat.web;
  24653. cfg.myId = 180;
  24654. cfg.myKey = '8848a885774230a4';
  24655. cfg.version = 0;
  24656. if (window.hasOwnProperty("gamebox")) {
  24657. cfg.plat = MoyuPlat.f399;
  24658. cfg.version = 0;
  24659. }
  24660. else if (window.hasOwnProperty("ks")) {
  24661. cfg.plat = MoyuPlat.ks;
  24662. cfg.version = 0;
  24663. cfg.ads.ksVideoId = '2300002254_01';
  24664. cfg.ads.ksInsertId = '2300002254_02';
  24665. }
  24666. else if (Laya.Browser.onTTMiniGame) {
  24667. cfg.plat = MoyuPlat.tt;
  24668. cfg.version = 0;
  24669. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  24670. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  24671. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  24672. }
  24673. else if (Laya.Browser.onMiniGame) {
  24674. cfg.plat = MoyuPlat.wx;
  24675. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  24676. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  24677. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  24678. }
  24679. else if (Laya.Browser.onQQMiniGame) {
  24680. cfg.plat = MoyuPlat.qq;
  24681. }
  24682. else if (Laya.Browser.onQGMiniGame) {
  24683. cfg.plat = MoyuPlat.op;
  24684. cfg.ads.opVideoId = '455502';
  24685. cfg.ads.opBannerId = '455507';
  24686. }
  24687. else if (Laya.Browser.onVVMiniGame) {
  24688. cfg.plat = MoyuPlat.vv;
  24689. cfg.version = 0;
  24690. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  24691. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  24692. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  24693. }
  24694. else if (Laya.Browser.onHWMiniGame) {
  24695. cfg.plat = MoyuPlat.hw;
  24696. }
  24697. else if (window["mz"]) {
  24698. cfg.plat = MoyuPlat.mz;
  24699. }
  24700. else {
  24701. let cfg = window['conchConfig'];
  24702. if (cfg) {
  24703. var os = cfg.getOS();
  24704. if (os == "Conch-ios") {
  24705. cfg.plat = MoyuPlat.ios;
  24706. }
  24707. else if (os == "Conch-android") {
  24708. }
  24709. }
  24710. }
  24711. return cfg;
  24712. }
  24713. class Main {
  24714. constructor() {
  24715. if (window["Laya3D"])
  24716. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  24717. else {
  24718. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  24719. this.initMain();
  24720. }
  24721. }
  24722. initMain() {
  24723. Laya["Physics"] && Laya["Physics"].enable();
  24724. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  24725. Laya.stage.scaleMode = GameConfig.scaleMode;
  24726. Laya.stage.screenMode = GameConfig.screenMode;
  24727. Laya.stage.alignV = GameConfig.alignV;
  24728. Laya.stage.alignH = GameConfig.alignH;
  24729. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  24730. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  24731. Laya.enableDebugPanel();
  24732. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  24733. Laya["PhysicsDebugDraw"].enable();
  24734. if (GameConfig.stat)
  24735. Laya.Stat.show();
  24736. Laya.alertGlobalError(true);
  24737. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  24738. }
  24739. onVersionLoaded() {
  24740. appInit();
  24741. }
  24742. }
  24743. new Main();
  24744. }());
  24745. //# sourceMappingURL=bundle.js.map