bundle.js 973 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let LOGIN_OUT = "LOGIN_OUT";
  52. let LOGIN_IN = "LOGIN_IN";
  53. let keyForLoginInfo = "userInfo";
  54. let TIP_MSG_key = {
  55. loginTimeOut: "Login timed out, please log in again.",
  56. pleaseLoginIn: "Please log in."
  57. };
  58. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  59. let poolKey = {
  60. inHoleEft: "inHoleEft",
  61. d3ball: "d3ball",
  62. iceEft: "iceEft",
  63. hitEft: "hitEft",
  64. fireworksEft: "fireworksEft",
  65. };
  66. var GameMode;
  67. (function (GameMode) {
  68. GameMode[GameMode["classic"] = 0] = "classic";
  69. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  70. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  71. })(GameMode || (GameMode = {}));
  72. var SkillType;
  73. (function (SkillType) {
  74. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  75. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  76. SkillType[SkillType["ice"] = 2] = "ice";
  77. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  78. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  79. })(SkillType || (SkillType = {}));
  80. var ClassicWordsType;
  81. (function (ClassicWordsType) {
  82. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  83. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  84. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  85. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  86. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  87. })(ClassicWordsType || (ClassicWordsType = {}));
  88. var PressType;
  89. (function (PressType) {
  90. PressType[PressType["powerNode"] = 0] = "powerNode";
  91. PressType[PressType["d2Root"] = 1] = "d2Root";
  92. PressType[PressType["moveNode"] = 2] = "moveNode";
  93. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  94. })(PressType || (PressType = {}));
  95. var PlaceBallType;
  96. (function (PlaceBallType) {
  97. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  98. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  99. })(PlaceBallType || (PlaceBallType = {}));
  100. var EAdType;
  101. (function (EAdType) {
  102. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  103. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  104. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  105. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  106. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  107. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  108. EAdType[EAdType["sign"] = 6] = "sign";
  109. EAdType[EAdType["draw"] = 7] = "draw";
  110. EAdType[EAdType["triple"] = 8] = "triple";
  111. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  112. EAdType[EAdType["getPower"] = 10] = "getPower";
  113. EAdType[EAdType["box"] = 11] = "box";
  114. EAdType[EAdType["try"] = 12] = "try";
  115. EAdType[EAdType["againSign"] = 13] = "againSign";
  116. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  117. })(EAdType || (EAdType = {}));
  118. var Prop;
  119. (function (Prop) {
  120. Prop[Prop["diamond"] = 1] = "diamond";
  121. Prop[Prop["coin"] = 2] = "coin";
  122. Prop[Prop["gan1"] = 3] = "gan1";
  123. Prop[Prop["gan2"] = 4] = "gan2";
  124. Prop[Prop["gan3"] = 5] = "gan3";
  125. Prop[Prop["gan4"] = 6] = "gan4";
  126. })(Prop || (Prop = {}));
  127. var TipsType;
  128. (function (TipsType) {
  129. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  130. TipsType[TipsType["foul"] = 1] = "foul";
  131. })(TipsType || (TipsType = {}));
  132. class AwardType {
  133. constructor(type, num) {
  134. this.type = type;
  135. this.num = num;
  136. }
  137. }
  138. var define = /*#__PURE__*/Object.freeze({
  139. fguiRes: fguiRes,
  140. ballCamp: ballCamp,
  141. FoulType: FoulType,
  142. ALL_BALL_STOP: ALL_BALL_STOP,
  143. WAIT_SHOOT: WAIT_SHOOT,
  144. D3RES_LOADED: D3RES_LOADED,
  145. BALL_SHOOT: BALL_SHOOT,
  146. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  147. RESET_GAME: RESET_GAME,
  148. COIN_CHANGE: COIN_CHANGE,
  149. DIAMOND_CHANGE: DIAMOND_CHANGE,
  150. RESTART_GAME: RESTART_GAME,
  151. GET_USER_INFO: GET_USER_INFO,
  152. CHANGE_SECRETARY: CHANGE_SECRETARY,
  153. POWER_CHANGE: POWER_CHANGE,
  154. POWER_TIME: POWER_TIME,
  155. LOGIN_OUT: LOGIN_OUT,
  156. LOGIN_IN: LOGIN_IN,
  157. keyForLoginInfo: keyForLoginInfo,
  158. TIP_MSG_key: TIP_MSG_key,
  159. baseHeadUrl: baseHeadUrl,
  160. poolKey: poolKey,
  161. get GameMode () { return GameMode; },
  162. get SkillType () { return SkillType; },
  163. get ClassicWordsType () { return ClassicWordsType; },
  164. get PressType () { return PressType; },
  165. get PlaceBallType () { return PlaceBallType; },
  166. get EAdType () { return EAdType; },
  167. get Prop () { return Prop; },
  168. get TipsType () { return TipsType; },
  169. AwardType: AwardType
  170. });
  171. class CContext {
  172. constructor() {
  173. this.winSize = { width: 0, height: 0 };
  174. this.notchHeight = 0;
  175. this.bannerHeight = 0;
  176. }
  177. init(resList, callback) {
  178. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  179. this.notchHeight = this.getNotchHeight();
  180. this.bannerHeight = this.getBannerHeight();
  181. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  182. callback && callback();
  183. }));
  184. }
  185. getNotchHeight() {
  186. let notchHeight = 50;
  187. if (Laya.Browser.onMiniGame) {
  188. let deviceInfo = wx.getSystemInfoSync();
  189. if (Laya.Browser.onIOS) {
  190. if (deviceInfo.model.search('iPhone X') != -1) {
  191. notchHeight = deviceInfo.statusBarHeight - 10;
  192. }
  193. else {
  194. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  195. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  196. notchHeight = deviceInfo.statusBarHeight - 10;
  197. }
  198. }
  199. }
  200. else if (Laya.Browser.onAndroid) {
  201. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  202. notchHeight = deviceInfo.statusBarHeight;
  203. }
  204. }
  205. }
  206. return notchHeight;
  207. }
  208. getBannerHeight() {
  209. return 0;
  210. }
  211. }
  212. let context = new CContext();
  213. var Handler = Laya.Handler;
  214. var Tween = Laya.Tween;
  215. function playClickEffect(btn) {
  216. if (!btn)
  217. return;
  218. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  219. if (!btn)
  220. return;
  221. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  222. if (!btn)
  223. return;
  224. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  225. }), 0, true);
  226. }), 0, true);
  227. }
  228. function getNumList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split(',');
  233. for (var v in array) {
  234. dataList.push(Number(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getStrList(strList) {
  240. let dataList = [];
  241. if (strList) {
  242. let list = strList;
  243. let array = list.split('|');
  244. for (var v in array) {
  245. dataList.push(String(array[v]));
  246. }
  247. }
  248. return dataList;
  249. }
  250. function getRandStr(len) {
  251. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  252. let str = "";
  253. for (let i = 0; i < len; i++) {
  254. let rand = random(0, list.length);
  255. str += list[rand];
  256. }
  257. return str;
  258. }
  259. function getUserId() {
  260. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  261. return str;
  262. }
  263. function formatPos(pos, len = 2) {
  264. let v = Math.pow(10, len);
  265. pos.x = Math.floor(pos.x * v) / v;
  266. pos.y = Math.floor(pos.y * v) / v;
  267. if (pos.z)
  268. pos.z = Math.floor(pos.z * v) / v;
  269. return pos;
  270. }
  271. function setPosInt(pos) {
  272. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  273. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  274. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  275. return pos;
  276. }
  277. function random(min, max) {
  278. var rang = max - min;
  279. var rand = Math.random() * rang;
  280. return Math.floor(rand) + min;
  281. }
  282. function randomList(list, num) {
  283. if (list.length <= num)
  284. return list;
  285. let arry = [];
  286. list.forEach(item => {
  287. arry.push(item);
  288. });
  289. let nums = [];
  290. for (let i = 0; i < num; i++) {
  291. let rand = random(0, arry.length);
  292. let v = arry[rand];
  293. nums.push(v);
  294. arry.splice(rand, 1);
  295. }
  296. return nums;
  297. }
  298. function worldToScreen(camera, point, pos) {
  299. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  300. pos.x = pos.x / Laya.stage.clientScaleX;
  301. pos.y = pos.y / Laya.stage.clientScaleY;
  302. }
  303. function getStringLenght(str) {
  304. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. function reviseString(str, len) {
  307. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  308. if (ld > len) {
  309. let sl = Math.floor(len / 2);
  310. let rs = str.substring(0, sl);
  311. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  312. while (d + 2 < len) {
  313. sl++;
  314. rs = str.substring(0, sl);
  315. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  316. }
  317. return rs + "...";
  318. }
  319. return str;
  320. }
  321. function getCoinString(coin) {
  322. if (coin < 10000)
  323. return coin.toString();
  324. else if (coin < 1000000) {
  325. let vh = Math.ceil(coin / 100);
  326. return (vh / 10) + "k";
  327. }
  328. else if (coin < 1000000000) {
  329. var vh = Math.ceil(coin / 100000);
  330. return (vh / 10) + "m";
  331. }
  332. else if (coin < 1000000000000) {
  333. var vh = Math.ceil(coin / 100000000);
  334. return (vh / 10) + "b";
  335. }
  336. else if (coin < 1000000000000000) {
  337. var vh = Math.ceil(coin / 100000000000);
  338. return (vh / 10) + "t";
  339. }
  340. }
  341. function getV3Dest(pos, dir, dis, dest) {
  342. dir.x *= dis;
  343. dir.y *= dis;
  344. dir.z *= dis;
  345. Laya.Vector3.add(pos, dir, dest);
  346. return dest;
  347. }
  348. function getV2Dest(x1, y1, dir, dis, dest) {
  349. dest.x = x1 + dir.x * dis;
  350. dest.y = y1 + dir.y * dis;
  351. return dest;
  352. }
  353. function getV2Dir(x1, y1, x2, y2, dir) {
  354. dir.x = x2 - x1;
  355. dir.y = y2 - y1;
  356. Laya.Vector2.normalize(dir, dir);
  357. return dir;
  358. }
  359. function getV3Dir(p1, p2, dir) {
  360. Laya.Vector3.subtract(p1, p2, dir);
  361. Laya.Vector3.normalize(dir, dir);
  362. return dir;
  363. }
  364. function copyPos(ip, op) {
  365. op.x = ip.x;
  366. op.y = ip.y;
  367. if (ip.z)
  368. op.z = ip.z;
  369. return op;
  370. }
  371. function getScreenImg() {
  372. let gl = Laya.WebGLContext.mainContext;
  373. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  374. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  375. let w = gl.drawingBufferWidth;
  376. let h = gl.drawingBufferHeight;
  377. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  378. texture2d.setPixels(pixels);
  379. return new Laya.Texture(texture2d);
  380. }
  381. function playMoveByPositions(sp, positions, v, completeCallback) {
  382. let p;
  383. let play = () => {
  384. if (positions.length == 0) {
  385. completeCallback();
  386. return;
  387. }
  388. p = positions[0];
  389. positions.splice(0, 1);
  390. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  391. play();
  392. }));
  393. };
  394. play();
  395. }
  396. function setStarPos(node, num, max) {
  397. for (let i = 1; i <= 5; i++) {
  398. let img = node.getChildAt(i - 1);
  399. img.width = img.height = 30;
  400. img.pivotX = img.pivotY = 0.5;
  401. img.gray = i > num;
  402. img.visible = i <= max;
  403. if (max == 3) {
  404. img.x = node.width / 2 + (i - 2) * 30 - 15;
  405. img.y = node.height - 40;
  406. if (i == 2)
  407. img.y = node.height - 30;
  408. }
  409. else if (max == 5) {
  410. let ly = Math.abs(i - 3);
  411. img.x = node.width / 2 + (i - 3) * 20 - 15;
  412. img.y = node.height - ly * 8 - 30;
  413. }
  414. }
  415. }
  416. function playLoopAnimRotate(sp, time, clockwise = true) {
  417. let rotation;
  418. sp.rotation = sp.rotation % 360;
  419. if (clockwise) {
  420. rotation = -360;
  421. }
  422. else {
  423. rotation = 360;
  424. }
  425. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  426. this.playLoopAnimRotate(sp, time, clockwise);
  427. }));
  428. }
  429. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  430. let x, y;
  431. if (isBig) {
  432. x = valueXMin;
  433. y = valueYMin;
  434. }
  435. else {
  436. x = valueXMax;
  437. y = valueYMax;
  438. }
  439. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  440. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  441. }));
  442. }
  443. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  444. let scale;
  445. if (isBig) {
  446. scale = valueMin;
  447. }
  448. else {
  449. scale = valueMax;
  450. }
  451. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  452. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  453. }));
  454. }
  455. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  456. let value;
  457. if (isBig) {
  458. value = valueMin;
  459. }
  460. else {
  461. value = valueMax;
  462. }
  463. if (count) {
  464. count--;
  465. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  466. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  467. }));
  468. }
  469. else {
  470. sp.rotation = 0;
  471. }
  472. }
  473. function inRect(rect, p) {
  474. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  475. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  476. return true;
  477. }
  478. }
  479. return false;
  480. }
  481. function getNumberK(number) {
  482. if (number < 1000) {
  483. return number.toString();
  484. }
  485. else {
  486. return (number / 1000).toFixed(1) + "k";
  487. }
  488. }
  489. function pointInsideCircle(point, circle, r) {
  490. if (r === 0)
  491. return false;
  492. var dx = circle.x - point.x;
  493. var dy = circle.y - point.y;
  494. return dx * dx + dy * dy <= r * r;
  495. }
  496. function formatString(str, data) {
  497. if (!str || data == undefined) {
  498. return str;
  499. }
  500. if (typeof data === "object") {
  501. for (var key in data) {
  502. if (data.hasOwnProperty(key)) {
  503. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  504. }
  505. }
  506. }
  507. else {
  508. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  509. return str.replace(reg, function (match, index) {
  510. return args[index - (-1)];
  511. });
  512. }
  513. return str;
  514. }
  515. function getIntersection(a, b) {
  516. let t = [];
  517. for (var i = 0; i < a.length; i++) {
  518. for (var j = 0; j < b.length; j++) {
  519. if (a[i] == b[j]) {
  520. t.push(a[i]);
  521. }
  522. }
  523. }
  524. return t;
  525. }
  526. function getComplement(a, b) {
  527. let t = [];
  528. let count = false;
  529. for (var i = 0; i < a.length; i++) {
  530. count = false;
  531. for (var j = 0; j < b.length; j++) {
  532. if (a[i] == b[j]) {
  533. count = true;
  534. break;
  535. }
  536. }
  537. if (!count) {
  538. t.push(a[i]);
  539. }
  540. }
  541. return t;
  542. }
  543. function geSpriteStageRect(sp) {
  544. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  545. let rect = {
  546. x: point.x,
  547. y: point.y,
  548. width: sp.width * sp.globalScaleX,
  549. height: sp.height * sp.globalScaleY
  550. };
  551. return rect;
  552. }
  553. function touchButton(button) {
  554. let event = new Laya.Event();
  555. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  556. }
  557. function setColor(sprite, r, g, b) {
  558. var redMat = [
  559. r / 255, 0, 0, 0, 0,
  560. g / 255, 0, 0, 0, 0,
  561. b / 255, 0, 0, 0, 0,
  562. 0, 0, 0, 1, 0,
  563. ];
  564. var filter = new Laya.ColorFilter(redMat);
  565. sprite.filters = [filter];
  566. }
  567. function clone(obj, newobj = {}) {
  568. for (var attr in obj) {
  569. if (typeof obj[attr] == "object") {
  570. newobj[attr] = clone(obj[attr], newobj[attr]);
  571. }
  572. else {
  573. newobj[attr] = obj[attr];
  574. }
  575. }
  576. return newobj;
  577. }
  578. function _ms(arr, compare, begin, end) {
  579. const size = end - begin;
  580. if (size <= 1) {
  581. return;
  582. }
  583. const middle = (end + begin) >> 1;
  584. _ms(arr, compare, begin, middle);
  585. _ms(arr, compare, middle, end);
  586. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  587. return;
  588. }
  589. const merged = [];
  590. let leftIndex = begin, rightIndex = middle;
  591. while (merged.length < size) {
  592. if (leftIndex === middle) {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. else if (rightIndex === end) {
  596. merged.push(arr[leftIndex++]);
  597. }
  598. else {
  599. const c = compare(arr[leftIndex], arr[rightIndex]);
  600. if (c <= 0) {
  601. merged.push(arr[leftIndex++]);
  602. }
  603. else {
  604. merged.push(arr[rightIndex++]);
  605. }
  606. }
  607. }
  608. arr.splice(begin, size, ...merged);
  609. }
  610. function sort(arr, compare) {
  611. if (!Array.isArray(arr)) {
  612. throw new Error('sort的参数必须为数组');
  613. }
  614. _ms(arr, compare, 0, arr.length);
  615. return arr;
  616. }
  617. function getLanguage(id) {
  618. }
  619. function getLanguageByTip(id) {
  620. }
  621. function toWeights(array) {
  622. let max = 0;
  623. for (var i = 0; i < array.length; i++) {
  624. max = max + array[i];
  625. if (array[i] == 0) {
  626. array[i] = 0;
  627. }
  628. else {
  629. array[i] = max;
  630. }
  631. }
  632. return array;
  633. }
  634. function unique(array) {
  635. var n = {}, r = [], len = array.length, val, type;
  636. for (var i = 0; i < array.length; i++) {
  637. val = array[i];
  638. type = typeof val;
  639. if (!n[val]) {
  640. n[val] = [type];
  641. r.push(val);
  642. }
  643. else if (n[val].indexOf(type) < 0) {
  644. n[val].push(type);
  645. r.push(val);
  646. }
  647. }
  648. return r;
  649. }
  650. function unique1(array) {
  651. var r = [];
  652. for (var i = 0, l = array.length; i < l; i++) {
  653. for (var j = i + 1; j < l; j++)
  654. if (array[i] == array[j])
  655. j == ++i;
  656. r.push(array[i]);
  657. }
  658. return r;
  659. }
  660. function getDistance(x1, y1, x2, y2) {
  661. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  662. }
  663. function getV2Dis(pos1, pos2) {
  664. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  665. }
  666. function getV2SqDis(pos1, pos2) {
  667. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  668. }
  669. function getDis(x1, y1, x2, y2) {
  670. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  671. }
  672. function getDeltaxy(x1, y1, x2, y2) {
  673. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  674. }
  675. function getSymbolNumber(num) {
  676. if (num > 0) {
  677. return "+" + num;
  678. }
  679. else if (num < 0) {
  680. return num.toString();
  681. }
  682. return num.toString();
  683. }
  684. function fixNumber(num, length) {
  685. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  686. }
  687. function toThousands(num) {
  688. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  689. }
  690. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  691. function fmtMoney(money) {
  692. money = toThousands(money.replace(/^0+/, ''));
  693. if (money.length == 0) {
  694. money = "0";
  695. }
  696. let unit = 0;
  697. for (var i = 0; i < money.length; i++) {
  698. if (money.charAt(i) == ",") {
  699. unit++;
  700. }
  701. }
  702. if (unit == 0) {
  703. return money;
  704. }
  705. else {
  706. let idx = money.indexOf(",");
  707. if (idx) {
  708. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  709. }
  710. return money.replace(",", ".");
  711. }
  712. }
  713. function flatten(arr) {
  714. while (arr.some(item => Array.isArray(item))) {
  715. arr = [].concat(...arr);
  716. }
  717. return arr;
  718. }
  719. function getDistanceByPoint(p1, p2) {
  720. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  721. }
  722. function getAngleByPoint(p1, p2) {
  723. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  724. }
  725. function toIntByArray(array) {
  726. for (var index = 0; index < array.length; index++) {
  727. array[index] = parseInt(array[index]);
  728. }
  729. return array;
  730. }
  731. function getAngle0To360(angle) {
  732. while (angle < 0) {
  733. angle += 360;
  734. }
  735. while (angle >= 360) {
  736. angle -= 360;
  737. }
  738. return angle;
  739. }
  740. function toAngle(radian) {
  741. return radian * 180 / Math.PI;
  742. }
  743. function toRadian(angle) {
  744. return angle * Math.PI / 180;
  745. }
  746. function getArrayValueRandom(array) {
  747. return array[random(0, array.length - 1)];
  748. }
  749. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  750. }
  751. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  752. }
  753. function fmtTimeMMSS(time) {
  754. if (time < 0) {
  755. time = 0;
  756. }
  757. else
  758. time = Math.floor(time);
  759. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  760. }
  761. function fmtTimeMS(time) {
  762. if (time < 0) {
  763. time = 0;
  764. }
  765. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  766. }
  767. function fmtTimeHHMM(time) {
  768. if (time < 0) {
  769. time = 0;
  770. }
  771. time = Math.floor(time / 1000);
  772. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  773. }
  774. let severTime = 0;
  775. function getServerTime() {
  776. return new Date(new Date().getTime() - severTime);
  777. }
  778. function setServerTime(data) {
  779. severTime = (new Date().getTime() - data);
  780. }
  781. var tools = /*#__PURE__*/Object.freeze({
  782. playClickEffect: playClickEffect,
  783. getNumList: getNumList,
  784. getStrList: getStrList,
  785. getRandStr: getRandStr,
  786. getUserId: getUserId,
  787. formatPos: formatPos,
  788. setPosInt: setPosInt,
  789. random: random,
  790. randomList: randomList,
  791. worldToScreen: worldToScreen,
  792. getStringLenght: getStringLenght,
  793. reviseString: reviseString,
  794. getCoinString: getCoinString,
  795. getV3Dest: getV3Dest,
  796. getV2Dest: getV2Dest,
  797. getV2Dir: getV2Dir,
  798. getV3Dir: getV3Dir,
  799. copyPos: copyPos,
  800. getScreenImg: getScreenImg,
  801. playMoveByPositions: playMoveByPositions,
  802. setStarPos: setStarPos,
  803. playLoopAnimRotate: playLoopAnimRotate,
  804. playLoopAnimPosition: playLoopAnimPosition,
  805. playLoopAnimScale: playLoopAnimScale,
  806. playLoopAnimRotation: playLoopAnimRotation,
  807. inRect: inRect,
  808. getNumberK: getNumberK,
  809. pointInsideCircle: pointInsideCircle,
  810. formatString: formatString,
  811. getIntersection: getIntersection,
  812. getComplement: getComplement,
  813. geSpriteStageRect: geSpriteStageRect,
  814. touchButton: touchButton,
  815. setColor: setColor,
  816. clone: clone,
  817. sort: sort,
  818. getLanguage: getLanguage,
  819. getLanguageByTip: getLanguageByTip,
  820. toWeights: toWeights,
  821. unique: unique,
  822. unique1: unique1,
  823. getDistance: getDistance,
  824. getV2Dis: getV2Dis,
  825. getV2SqDis: getV2SqDis,
  826. getDis: getDis,
  827. getDeltaxy: getDeltaxy,
  828. getSymbolNumber: getSymbolNumber,
  829. fixNumber: fixNumber,
  830. toThousands: toThousands,
  831. fmtMoney: fmtMoney,
  832. flatten: flatten,
  833. getDistanceByPoint: getDistanceByPoint,
  834. getAngleByPoint: getAngleByPoint,
  835. toIntByArray: toIntByArray,
  836. getAngle0To360: getAngle0To360,
  837. toAngle: toAngle,
  838. toRadian: toRadian,
  839. getArrayValueRandom: getArrayValueRandom,
  840. promptByTip: promptByTip,
  841. promptByErrorCode: promptByErrorCode,
  842. fmtTimeMMSS: fmtTimeMMSS,
  843. fmtTimeMS: fmtTimeMS,
  844. fmtTimeHHMM: fmtTimeHHMM,
  845. getServerTime: getServerTime,
  846. setServerTime: setServerTime
  847. });
  848. class HttpMgr {
  849. constructor() {
  850. this.isDev = false;
  851. HttpMgr._instance = this;
  852. }
  853. static getInstance() {
  854. if (!this._instance) {
  855. this._instance = new HttpMgr();
  856. }
  857. return this._instance;
  858. }
  859. sendPost(url, data, call) {
  860. let httpObj = new Laya.HttpRequest();
  861. httpObj.http.timeout = 5000;
  862. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  863. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  864. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  865. function errorHandler(error) {
  866. console.log("errorHandler:" + error);
  867. alert("Please check your network connection.");
  868. }
  869. function completeHandler(data) {
  870. if (data && data.length > 0) {
  871. let jsonData = JSON.parse(data);
  872. if (call)
  873. call(jsonData);
  874. }
  875. }
  876. }
  877. getReqData() {
  878. let reqData = JSON.stringify({
  879. gameName: "TQ",
  880. gameUserName: "zhangSan",
  881. isDev: this.isDev
  882. });
  883. return reqData;
  884. }
  885. sendPost2025(reqUrl, data, call) {
  886. let isDev = this.isDev;
  887. let urlTop = "https://api.kessongame.site/";
  888. let urlMid = urlTop + "prod-api/api/";
  889. if (isDev) {
  890. urlTop = "http://192.168.1.13:8090/";
  891. urlMid = urlTop + "api/";
  892. }
  893. let url = urlMid + reqUrl;
  894. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  895. if (isDev) {
  896. url = urlTop + reqUrl;
  897. }
  898. else {
  899. url = urlTop + "prod-api/" + reqUrl;
  900. }
  901. }
  902. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  903. if (reqUrl.indexOf("/api/game/") >= 0) {
  904. }
  905. const keyForLoginInfo = "userInfo";
  906. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  907. if (userInfoData != null) {
  908. try {
  909. let bb = JSON.parse(userInfoData);
  910. if (bb) {
  911. let token = bb.token;
  912. headers.push("Authorization");
  913. headers.push(`Bearer ${token}`);
  914. }
  915. }
  916. catch (e) {
  917. }
  918. }
  919. let httpObj = new Laya.HttpRequest();
  920. httpObj.http.timeout = 5000;
  921. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  922. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  923. httpObj.send(url, data, 'post', 'text', headers);
  924. console.log('zh: http url = ' + url);
  925. function errorHandler(error) {
  926. if (call) {
  927. call("{'msg':'Network exception','code':500}");
  928. }
  929. else {
  930. alert("Tip:Please check your network connection.");
  931. }
  932. }
  933. function completeHandler(data) {
  934. if (data && data.length > 0) {
  935. let jsonData = JSON.parse(data);
  936. if (call)
  937. call(jsonData);
  938. }
  939. }
  940. }
  941. sendGet(url, call) {
  942. let httpObj = new Laya.HttpRequest();
  943. httpObj.http.timeout = 5000;
  944. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  945. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  946. httpObj.send(url, '', 'get');
  947. function errorHandler(error) {
  948. console.log("errorHandler:" + error);
  949. }
  950. function completeHandler(data) {
  951. if (data && data.length > 0) {
  952. if (call)
  953. call(data);
  954. }
  955. }
  956. }
  957. }
  958. HttpMgr._instance = null;
  959. class LightShader extends Laya.Sprite {
  960. constructor() {
  961. super();
  962. this._time = 0;
  963. this._sin = 0;
  964. this.initShader();
  965. }
  966. initShader() {
  967. var vs = `
  968. #define FSHIGHPRECISION
  969. attribute vec4 posuv;
  970. uniform vec2 size;
  971. varying vec4 v_texcoord;
  972. void main() {
  973. vec4 pos = vec4(posuv.xy,0.,1.);
  974. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  975. gl_Position=pos1;
  976. v_texcoord.xy = posuv.xy;
  977. }
  978. `;
  979. var ps = `
  980. #define FSHIGHPRECISION
  981. precision highp float;
  982. varying vec4 v_texcoord;
  983. uniform vec2 size;
  984. uniform sampler2D texture;
  985. uniform float u_Time;
  986. void main() {
  987. vec4 color= texture2D(texture, v_texcoord.xy);
  988. float width = 0.2;
  989. float start = u_Time;
  990. float offset = 1.0;
  991. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  992. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  993. {
  994. color.r=1.1;
  995. color.g=1.1;
  996. color.b=1.1;
  997. gl_FragColor = color;
  998. } else {
  999. gl_FragColor = color;
  1000. }
  1001. }
  1002. `;
  1003. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  1004. this.customRenderEnable = true;
  1005. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1006. }
  1007. customRender(context, x, y) {
  1008. this.onUpdate();
  1009. if (!this.texture)
  1010. return;
  1011. let xx = x - this.pivotX;
  1012. let yy = y - this.pivotY;
  1013. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1014. }
  1015. onUpdate() {
  1016. this._time += 2 * Laya.timer.delta * 0.001;
  1017. this._sin = Math.sin(this._time);
  1018. if (this._sin > 0.99) {
  1019. this._sin = 0;
  1020. this._time = 0;
  1021. }
  1022. this.shaderValue['u_Time'] = this._sin;
  1023. }
  1024. }
  1025. LightShader.DissolveSurfaceSaveName = 9997;
  1026. class UIBase extends fairygui.Window {
  1027. constructor() {
  1028. super();
  1029. this.isEject = true;
  1030. this.isHide = true;
  1031. this.showbanner = true;
  1032. this.className = "";
  1033. this.isMuti = false;
  1034. this.showbanner = false;
  1035. this.onConstructor();
  1036. }
  1037. checkActive(show) {
  1038. }
  1039. getUIName() {
  1040. return UIBase.uiName;
  1041. }
  1042. onConstructor() {
  1043. }
  1044. onInit() {
  1045. if (!!this.contentPane) {
  1046. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1047. }
  1048. this.setPivot(0.5, 0.5, false);
  1049. }
  1050. doShowAnimation() {
  1051. if (!this.isEject)
  1052. return;
  1053. super.doShowAnimation();
  1054. Laya.Tween.clearTween(this);
  1055. this.scaleX = this.scaleY = 0.8;
  1056. let tweenFunc1 = (func) => {
  1057. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1058. };
  1059. let tweenFunc2 = (func) => {
  1060. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1061. };
  1062. tweenFunc1(tweenFunc2);
  1063. }
  1064. show(...args) {
  1065. super.show();
  1066. this._openParam = args;
  1067. this.isHide = false;
  1068. xGame.uiMgr.checkUIState();
  1069. }
  1070. moveBannerButton() {
  1071. }
  1072. showBannerButton() {
  1073. this.bannerButton.visible = true;
  1074. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1075. this.bannerButton.touchable = true;
  1076. }));
  1077. }
  1078. hide() {
  1079. super.hide();
  1080. this.isHide = true;
  1081. xGame.uiMgr.checkUIState();
  1082. }
  1083. Dispose() {
  1084. super.dispose();
  1085. }
  1086. myUpdate(delay) {
  1087. }
  1088. refresh() { }
  1089. addUIClick(obj, func, arr = null) {
  1090. obj.onClick(this, func, arr);
  1091. obj.onClick(this, this.playBtnSound);
  1092. }
  1093. offUIClick(obj, func) {
  1094. obj.offClick(this, func);
  1095. }
  1096. playBtnSound() {
  1097. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1098. }
  1099. }
  1100. UIBase.lastShowBanner = 0;
  1101. UIBase.showBannerNum = 0;
  1102. UIBase.uiName = "";
  1103. class ui_UIDraw extends fgui.GComponent {
  1104. static createInstance() {
  1105. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1106. }
  1107. onConstruct() {
  1108. this.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.n_dengLu = (this.getChild("n_dengLu"));
  4513. this.settingNode = (this.getChild("settingNode"));
  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_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4534. }
  4535. }
  4536. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4537. class ui_UIMoyu extends fgui.GComponent {
  4538. static createInstance() {
  4539. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4540. }
  4541. onConstruct() {
  4542. this.ageTip = (this.getChild("ageTip"));
  4543. this.mainBg = (this.getChild("mainBg"));
  4544. this.xyNode = (this.getChild("xyNode"));
  4545. this.rnNode = (this.getChild("rnNode"));
  4546. this.fcmNode = (this.getChild("fcmNode"));
  4547. this.ageNode = (this.getChild("ageNode"));
  4548. this.tipNode = (this.getChild("tipNode"));
  4549. this.msgNode = (this.getChild("msgNode"));
  4550. }
  4551. }
  4552. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4553. class MoyuMgr {
  4554. static initMoyu() {
  4555. this.moyuView = new MoyuView();
  4556. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4557. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4558. this.moyuView.ui.displayObject.zOrder = 1000;
  4559. this.moyuView.init();
  4560. this.moyuView.showTip(true);
  4561. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4562. window['XApk'] = this;
  4563. }
  4564. static showAge(show) {
  4565. if (this.moyuView)
  4566. this.moyuView.showAge(show);
  4567. }
  4568. static onPlatMsg(idx) {
  4569. if (!MoyuMgr.moyuView)
  4570. return;
  4571. if (idx == '0') {
  4572. MoyuMgr.moyuView.showTip(false);
  4573. }
  4574. }
  4575. static showAgree(call) {
  4576. if (this.moyuView)
  4577. this.moyuView.showAgree(call);
  4578. else
  4579. call && call();
  4580. }
  4581. static showXy(type = 1) {
  4582. if (this.moyuView)
  4583. this.moyuView.showXy(type);
  4584. }
  4585. }
  4586. MoyuMgr.isAdvise = false;
  4587. class MoyuView {
  4588. constructor() {
  4589. this.ysxyNum = 1;
  4590. this.ysJson = null;
  4591. this.ui = ui_UIMoyu.createInstance();
  4592. }
  4593. init() {
  4594. this.ui.mainBg.visible = false;
  4595. this.ui.xyNode.visible = false;
  4596. this.ui.ageNode.visible = false;
  4597. this.ui.tipNode.visible = false;
  4598. this.ui.rnNode.visible = false;
  4599. this.ui.fcmNode.visible = false;
  4600. this.ui.ageTip.visible = false;
  4601. this.ui.msgNode.visible = false;
  4602. this.ui.visible = false;
  4603. this.ui.xyNode.xyList.setVirtual();
  4604. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4605. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4606. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4607. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4608. this.ui.xyNode.btnKnown.visible = false;
  4609. this.ui.xyNode.xy1.visible = false;
  4610. this.ui.xyNode.xy2.visible = false;
  4611. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4612. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4613. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4614. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4615. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4616. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4617. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4618. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4619. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4620. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4621. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4622. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4623. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4624. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4625. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4626. this.ysxyNum = 2;
  4627. }
  4628. }
  4629. onClick(obj) {
  4630. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4631. switch (obj) {
  4632. case this.ui.ageTip:
  4633. if (Moyu.isTTApk) {
  4634. this.ui.ageNode.visible = true;
  4635. this.ui.mainBg.visible = true;
  4636. }
  4637. break;
  4638. case this.ui.tipNode:
  4639. this.showTip(false);
  4640. break;
  4641. case this.ui.ageNode.btnAge:
  4642. this.ui.ageNode.visible = false;
  4643. this.ui.mainBg.visible = false;
  4644. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4645. this.ui.visible = false;
  4646. break;
  4647. case this.ui.xyNode.btnXy3:
  4648. case this.ui.xyNode.btnXy1:
  4649. this.loadXy(1);
  4650. break;
  4651. case this.ui.xyNode.btnXy2:
  4652. this.loadXy(2);
  4653. break;
  4654. case this.ui.xyNode.btnBack:
  4655. this.ui.xyNode.xy1.visible = true;
  4656. this.ui.xyNode.xy2.visible = false;
  4657. break;
  4658. case this.ui.xyNode.btnKnown:
  4659. this.ui.xyNode.visible = false;
  4660. this.ui.mainBg.visible = false;
  4661. this.ui.visible = false;
  4662. break;
  4663. case this.ui.rnNode.btnCheck:
  4664. this.check();
  4665. break;
  4666. case this.ui.rnNode.btnExit:
  4667. case this.ui.xyNode.btnNo:
  4668. this.ysxyNum--;
  4669. if (this.ysxyNum > 0)
  4670. this.showMsg("Refuse to quit the game once again");
  4671. else {
  4672. Moyu.userAgree(false);
  4673. Moyu.exit();
  4674. }
  4675. break;
  4676. case this.ui.xyNode.btnSure:
  4677. case this.ui.xyNode.btnYes:
  4678. DataMgr.userData.isAgree = true;
  4679. DataMgr.saveUserData();
  4680. this.onAgree();
  4681. break;
  4682. case this.ui.rnNode.btnDone:
  4683. this.ui.rnNode.visible = false;
  4684. this.ui.visible = false;
  4685. break;
  4686. case this.ui.fcmNode.btnRn:
  4687. this.showRn();
  4688. break;
  4689. }
  4690. }
  4691. showTip(show) {
  4692. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4693. return;
  4694. if (show) {
  4695. MoyuMgr.isAdvise = true;
  4696. this.ui.visible = true;
  4697. this.ui.tipNode.visible = true;
  4698. this.ui.tipNode.alpha = 1;
  4699. Laya.timer.once(1000, this, this.showTip, [false]);
  4700. }
  4701. else {
  4702. this.ui.tipNode.alpha = 1;
  4703. this.ui.tipNode.visible = true;
  4704. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4705. this.ui.tipNode.visible = false;
  4706. MoyuMgr.isAdvise = false;
  4707. }), 1000);
  4708. }
  4709. }
  4710. showAge(show, px = 0, py = 0) {
  4711. if (Moyu.platType > 10 && !Moyu.isIos) {
  4712. this.ui.ageTip.x = px;
  4713. this.ui.ageTip.y = py;
  4714. this.ui.ageTip.visible = show;
  4715. if (show)
  4716. this.ui.visible = true;
  4717. }
  4718. }
  4719. showAgree(call) {
  4720. this.agreeCall = call;
  4721. this.onAgree();
  4722. return;
  4723. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4724. this.showXy(0);
  4725. }
  4726. else
  4727. this.onAgree();
  4728. }
  4729. onAgree() {
  4730. if (!this.ui.ageNode.visible)
  4731. this.ui.visible = false;
  4732. this.ui.xyNode.visible = false;
  4733. Moyu.userAgree(true);
  4734. this.showAge(false);
  4735. this.agreeCall && this.agreeCall();
  4736. this.showRn();
  4737. }
  4738. showMsg(txt) {
  4739. this.ui.msgNode.txtMsg.text = txt;
  4740. this.ui.msgNode.visible = true;
  4741. this.ui.msgNode.alpha = 1;
  4742. this.ui.visible = true;
  4743. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4744. this.ui.msgNode.visible = false;
  4745. }), 2500, true);
  4746. }
  4747. showRn() {
  4748. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4749. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4750. this.ui.rnNode.rn1.visible = true;
  4751. this.ui.rnNode.rn2.visible = false;
  4752. this.ui.rnNode.rn3.visible = false;
  4753. this.ui.rnNode.rn4.visible = false;
  4754. this.ui.rnNode.visible = true;
  4755. this.ui.mainBg.visible = true;
  4756. this.ui.rnNode.btnDone.visible = false;
  4757. this.ui.rnNode.btnExit.visible = true;
  4758. this.ui.rnNode.btnCheck.visible = true;
  4759. this.ui.fcmNode.visible = false;
  4760. this.ui.visible = true;
  4761. return;
  4762. }
  4763. }
  4764. this.showFcm();
  4765. }
  4766. showFcm() {
  4767. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4768. Moyu.initFCM(true);
  4769. if (Moyu.gameTime < 1)
  4770. this.fcmLoop();
  4771. else if (Moyu.gameTime < 999)
  4772. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4773. }
  4774. }
  4775. fcmLoop() {
  4776. if (Moyu.gameTime < 1) {
  4777. this.ui.rnNode.visible = false;
  4778. this.ui.fcmNode.visible = true;
  4779. this.ui.mainBg.visible = true;
  4780. this.ui.visible = true;
  4781. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4782. Laya.timer.clear(this.ui, this.fcmLoop);
  4783. }
  4784. }
  4785. check() {
  4786. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4787. this.ui.rnNode.rn1.visible = false;
  4788. this.ui.rnNode.rn2.visible = false;
  4789. this.ui.rnNode.rn4.visible = true;
  4790. }
  4791. else if (this.ui.rnNode.rn4.visible) {
  4792. let name = this.ui.rnNode.inputName.text;
  4793. let code = this.ui.rnNode.inputCode.text;
  4794. if (code && code.length == 18) {
  4795. this.ui.rnNode.rn1.visible = false;
  4796. this.ui.rnNode.rn4.visible = false;
  4797. Moyu.authenticate(name, code, (res) => {
  4798. this.ui.rnNode.rn2.visible = !res;
  4799. this.ui.rnNode.rn3.visible = res;
  4800. this.ui.rnNode.btnDone.visible = res;
  4801. this.ui.rnNode.btnExit.visible = !res;
  4802. this.ui.rnNode.btnCheck.visible = !res;
  4803. if (res)
  4804. this.showFcm();
  4805. });
  4806. }
  4807. else
  4808. this.showMsg("信息填写不完整");
  4809. }
  4810. }
  4811. loadXy(type = 0) {
  4812. this.ui.xyNode.xy1.visible = false;
  4813. this.ui.xyNode.xy2.visible = true;
  4814. this.ui.xyNode.xyList.scrollToView(0);
  4815. if (type == 1) {
  4816. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4817. }
  4818. else if (type == 2) {
  4819. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4820. }
  4821. }
  4822. showXy(type = 0) {
  4823. this.xyBtn();
  4824. if (type == 0) {
  4825. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4826. this.ui.xyNode.btnSure.visible = true;
  4827. }
  4828. else {
  4829. this.ui.xyNode.btnYes.visible = true;
  4830. this.ui.xyNode.btnNo.visible = true;
  4831. }
  4832. }
  4833. else {
  4834. this.ui.xyNode.btnKnown.visible = true;
  4835. this.ui.mainBg.visible = true;
  4836. }
  4837. this.ui.xyNode.xy1.visible = true;
  4838. this.ui.xyNode.xy2.visible = false;
  4839. this.ui.xyNode.visible = true;
  4840. this.ui.visible = true;
  4841. }
  4842. xyBtn() {
  4843. this.ui.xyNode.btnSure.visible = false;
  4844. this.ui.xyNode.btnYes.visible = false;
  4845. this.ui.xyNode.btnNo.visible = false;
  4846. this.ui.xyNode.btnKnown.visible = false;
  4847. {
  4848. this.ui.xyNode.btnXy3.visible = false;
  4849. this.ui.xyNode.btnXy2.visible = true;
  4850. this.ui.xyNode.btnXy1.visible = true;
  4851. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4852. }
  4853. }
  4854. createXY(json) {
  4855. this.ysJson = json.content;
  4856. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4857. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4858. this.ui.xyNode.xy2.visible = true;
  4859. }
  4860. renderListItem(idx, cell) {
  4861. let xy = this.ysJson[idx];
  4862. cell.height = xy.line * 30;
  4863. cell.xyItem.text = xy.text;
  4864. }
  4865. onDestroy() {
  4866. this.agreeCall = null;
  4867. }
  4868. }
  4869. class SettingNode {
  4870. constructor(ui) {
  4871. this.showSetting = false;
  4872. this.openSound = true;
  4873. this.openShake = true;
  4874. this.ui = ui;
  4875. this.ui.soundBtn.onClick(this, this.switchSound);
  4876. this.ui.shakeBtn.onClick(this, this.switchShake);
  4877. this.ui.xyBtn.onClick(this, this.onXy);
  4878. this.ui.clickNode.onClick(this, this.changeSetting);
  4879. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4880. this.ui.xyBtn.visible = false;
  4881. this.ui.shakeBtn.visible = false;
  4882. }
  4883. changeSetting() {
  4884. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4885. this.showSetting = !this.showSetting;
  4886. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4887. }
  4888. switchSound() {
  4889. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4890. this.openSound = !this.openSound;
  4891. Moyu.onSetting(this.openSound, this.openShake);
  4892. xGame.soundMgr.onSetting(this.openSound);
  4893. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4894. }
  4895. switchShake() {
  4896. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4897. this.openShake = !this.openShake;
  4898. Moyu.onSetting(this.openSound, this.openShake);
  4899. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4900. }
  4901. onXy() {
  4902. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4903. MoyuMgr.showXy(1);
  4904. }
  4905. }
  4906. class ui_UILevelDisplay extends fgui.GComponent {
  4907. static createInstance() {
  4908. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4909. }
  4910. onConstruct() {
  4911. this.n9 = (this.getChild("n9"));
  4912. this.myNode = (this.getChild("myNode"));
  4913. this.closeNode = (this.getChild("closeNode"));
  4914. }
  4915. }
  4916. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4917. class ui_UILevelProp extends fgui.GComponent {
  4918. static createInstance() {
  4919. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4920. }
  4921. onConstruct() {
  4922. this.n16 = (this.getChild("n16"));
  4923. this.myNode = (this.getChild("myNode"));
  4924. this.closeBtn = (this.getChild("closeBtn"));
  4925. this.moneyNode = (this.getChild("moneyNode"));
  4926. this.t1 = this.getTransition("t1");
  4927. }
  4928. }
  4929. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4930. class ui_ShowItem extends fgui.GComponent {
  4931. static createInstance() {
  4932. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4933. }
  4934. onConstruct() {
  4935. this.myImg = (this.getChild("myImg"));
  4936. }
  4937. }
  4938. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4939. class ShowItem {
  4940. constructor() {
  4941. this.ui = ui_ShowItem.createInstance();
  4942. }
  4943. destroySelf() {
  4944. if (!this.ui.isDisposed) {
  4945. this.ui.removeFromParent();
  4946. this.ui.dispose();
  4947. }
  4948. }
  4949. setParent(parent) {
  4950. parent.addChild(this.ui);
  4951. }
  4952. setPos(x, y) {
  4953. this.ui.x = x;
  4954. this.ui.y = y;
  4955. }
  4956. setUrl(index) {
  4957. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4958. }
  4959. }
  4960. class ui_UIPower extends fgui.GComponent {
  4961. static createInstance() {
  4962. return (fgui.UIPackage.createObject("game", "UIPower"));
  4963. }
  4964. onConstruct() {
  4965. this.n11 = (this.getChild("n11"));
  4966. this.myNode = (this.getChild("myNode"));
  4967. this.t0 = this.getTransition("t0");
  4968. }
  4969. }
  4970. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4971. class UIPower extends UIBase {
  4972. constructor() {
  4973. super();
  4974. }
  4975. onConstructor() {
  4976. this.ui = ui_UIPower.createInstance();
  4977. this.contentPane = this.ui;
  4978. this.isEject = false;
  4979. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4980. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4981. }
  4982. show() {
  4983. super.show();
  4984. this.ui.t0.play();
  4985. }
  4986. videoGetPower() {
  4987. console.log('zh:qjff_AD_for_uipower');
  4988. if (Laya.Browser.onAndroid) {
  4989. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4990. if (!boo) {
  4991. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4992. return;
  4993. }
  4994. }
  4995. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4996. }
  4997. else {
  4998. console.log('zh:AD 失败,直接发放奖励');
  4999. this.qjff_AD_for_uipower();
  5000. }
  5001. }
  5002. qjff_AD_for_uipower() {
  5003. DataMgr.setPower(xGame.common.videoPower, true);
  5004. xGame.eventMgr.event(POWER_TIME);
  5005. this.hide();
  5006. }
  5007. }
  5008. UIPower.uiName = "UIPower";
  5009. class UILevelProp extends UIBase {
  5010. constructor() {
  5011. super();
  5012. this.firstPos = 385;
  5013. this.secondPos = 467;
  5014. this.showItemArr = [];
  5015. }
  5016. onFontLoaded() {
  5017. try {
  5018. this.ui.myNode.conditionTxt.font = "arial";
  5019. console.log("zh: onFontLoaded 设置arial字体成功");
  5020. }
  5021. catch (error) {
  5022. console.log("zh: constructor onFontLoaded加载arial字体失败");
  5023. }
  5024. }
  5025. onConstructor() {
  5026. this.ui = ui_UILevelProp.createInstance();
  5027. this.contentPane = this.ui;
  5028. this.isEject = false;
  5029. this.addUIClick(this.ui.closeBtn, this.hide);
  5030. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5031. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5032. }
  5033. show(level) {
  5034. super.show();
  5035. this.ui.t1.play();
  5036. this.level = level;
  5037. this.data = cfgTable.placeballData[this.level];
  5038. this.updateSelf();
  5039. this.showPreView();
  5040. this.moneyNode.ui.c1.selectedIndex = 2;
  5041. this.moneyNode.checkPowerTime();
  5042. this.moneyNode.powerChange();
  5043. }
  5044. showPreView() {
  5045. let item;
  5046. let data;
  5047. for (let index = 0; index < this.showItemArr.length; index++) {
  5048. item = this.showItemArr[index];
  5049. item.destroySelf();
  5050. }
  5051. this.showItemArr = [];
  5052. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5053. for (const key in cfgData) {
  5054. data = cfgData[key];
  5055. item = new ShowItem();
  5056. item.setParent(this.ui.myNode.displayRoot);
  5057. item.setPos(data.x, data.y);
  5058. item.setUrl(data.value);
  5059. this.showItemArr.push(item);
  5060. }
  5061. }
  5062. updateSelf() {
  5063. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5064. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5065. if (this.data.ball == -1) {
  5066. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5067. }
  5068. else {
  5069. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5070. }
  5071. let localData = DataMgr.getPlaceBallLevel(this.level);
  5072. let getAward = localData.getAward;
  5073. let cfg = cfgTable.placeballData[this.level];
  5074. let coin = this.data.award[0];
  5075. let diamond = this.data.award[1];
  5076. if (cfg.type == PlaceBallType.challenge) {
  5077. diamond = 0;
  5078. coin = 100;
  5079. }
  5080. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5081. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5082. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5083. if (cfg.type == PlaceBallType.challenge) {
  5084. this.ui.myNode.coinNode.numTxt.text = "";
  5085. }
  5086. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5087. if (coin > 0 && diamond > 0) {
  5088. this.ui.myNode.diamondNode.x = 385;
  5089. this.ui.myNode.coinNode.x = 467;
  5090. }
  5091. else {
  5092. this.ui.myNode.diamondNode.x = 385;
  5093. this.ui.myNode.coinNode.x = 385;
  5094. }
  5095. if (!getAward) {
  5096. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5097. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5098. }
  5099. else {
  5100. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5101. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5102. }
  5103. }
  5104. startGame() {
  5105. if (DataMgr.powerEnough()) {
  5106. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5107. this.ui.myNode.startBtn.touchable = false;
  5108. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5109. console.log('zh:startGame ');
  5110. this.ui.myNode.startBtn.touchable = true;
  5111. DataMgr.setPower(-1);
  5112. xGame.eventMgr.event(POWER_TIME);
  5113. xGame.common.gameMode = GameMode.placeBall;
  5114. xGame.common.placeBallCurLevel = this.level;
  5115. xGame.uiMgr.Show(UIGame);
  5116. this.logEventForChallenge_level_start(this.level);
  5117. xGame.uiMgr.Hide(UILevelDisplay);
  5118. xGame.uiMgr.Hide(UIMain);
  5119. this.hide();
  5120. }));
  5121. }
  5122. else {
  5123. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5124. xGame.uiMgr.Show(UIPower);
  5125. }
  5126. }
  5127. logEventForChallenge_level_start(level) {
  5128. let keyStr = 'sjmd_challenge_level_start';
  5129. let jsonStr = {
  5130. "count": 1,
  5131. "gold_balance ": DataMgr.getCoin(),
  5132. "level": level,
  5133. "diamond_balance ": DataMgr.getDiamond()
  5134. };
  5135. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5136. const d = LocalStorageManager.getItem(keyStr);
  5137. if (level > d.level) {
  5138. jsonStr.count = d.count + 1;
  5139. LocalStorageManager.setItem(keyStr, jsonStr);
  5140. }
  5141. else {
  5142. }
  5143. }
  5144. else {
  5145. LocalStorageManager.setItem(keyStr, jsonStr);
  5146. }
  5147. const reqStr = JSON.stringify(jsonStr);
  5148. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5149. }
  5150. hide() {
  5151. super.hide();
  5152. }
  5153. }
  5154. UILevelProp.uiName = "UILevelProp";
  5155. class PutBallLevelDisplay {
  5156. constructor(ui, index) {
  5157. this.index = 0;
  5158. this.ui = ui;
  5159. this.index = index;
  5160. this.ui.onClick(this, this.clickSelf);
  5161. this.updateSelf();
  5162. this.ui.levelTxt.text = (this.index + 1) + "";
  5163. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5164. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5165. }
  5166. updateSelf() {
  5167. let level = this.index + 1;
  5168. this.data = DataMgr.getPlaceBallLevel(level);
  5169. this.ui.starNode.c1.selectedIndex = this.data.star;
  5170. let isChallenge = cfgTable.placeballData[level].type;
  5171. if (this.data.isCur) {
  5172. if (isChallenge) {
  5173. this.ui.c1.selectedIndex = 5;
  5174. }
  5175. else {
  5176. this.ui.c1.selectedIndex = 2;
  5177. }
  5178. }
  5179. else {
  5180. if (this.data.play) {
  5181. if (this.data.star == 3) {
  5182. this.ui.c1.selectedIndex = 0;
  5183. }
  5184. else {
  5185. this.ui.c1.selectedIndex = 1;
  5186. }
  5187. }
  5188. else {
  5189. if (isChallenge) {
  5190. this.ui.c1.selectedIndex = 4;
  5191. }
  5192. else {
  5193. this.ui.c1.selectedIndex = 3;
  5194. }
  5195. }
  5196. }
  5197. }
  5198. clickSelf() {
  5199. if (!this.data.play)
  5200. return;
  5201. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5202. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5203. }
  5204. }
  5205. class UILevelDisplay extends UIBase {
  5206. constructor() {
  5207. super();
  5208. }
  5209. onConstructor() {
  5210. this.ui = ui_UILevelDisplay.createInstance();
  5211. this.contentPane = this.ui;
  5212. this.isEject = false;
  5213. this.myList = this.ui.myNode.myList;
  5214. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5215. this.levelItemArr = [];
  5216. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5217. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5218. this.myList.numItems = levelNum;
  5219. }
  5220. levelItemRender(index, target) {
  5221. let item = new PutBallLevelDisplay(target, index);
  5222. this.levelItemArr.push(item);
  5223. }
  5224. show() {
  5225. super.show();
  5226. this.updateLevel();
  5227. this.scrollToPlace();
  5228. }
  5229. updateLevel() {
  5230. let temp;
  5231. for (let index = 0; index < this.levelItemArr.length; index++) {
  5232. temp = this.levelItemArr[index];
  5233. temp.updateSelf();
  5234. }
  5235. }
  5236. scrollToPlace() {
  5237. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5238. let passArr = DataMgr.getPlaceBallLevelList();
  5239. let offest = passArr.length;
  5240. if (offest >= maxNum - 1)
  5241. offest = maxNum - 1;
  5242. this.myList.scrollToView(offest, true, true);
  5243. }
  5244. hide() {
  5245. super.hide();
  5246. }
  5247. }
  5248. UILevelDisplay.uiName = "UILevelDisplay";
  5249. class ui_UIMatching extends fgui.GComponent {
  5250. static createInstance() {
  5251. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5252. }
  5253. onConstruct() {
  5254. this.n5 = (this.getChild("n5"));
  5255. this.n49 = (this.getChild("n49"));
  5256. this.n51 = (this.getChild("n51"));
  5257. this.n64 = (this.getChild("n64"));
  5258. this.n2 = (this.getChild("n2"));
  5259. this.n53 = (this.getChild("n53"));
  5260. this.n54 = (this.getChild("n54"));
  5261. this.n56 = (this.getChild("n56"));
  5262. this.n58 = (this.getChild("n58"));
  5263. this.n59 = (this.getChild("n59"));
  5264. this.n57 = (this.getChild("n57"));
  5265. this.n60 = (this.getChild("n60"));
  5266. this.n62 = (this.getChild("n62"));
  5267. this.awardTxt = (this.getChild("awardTxt"));
  5268. this.n61 = (this.getChild("n61"));
  5269. this.selfHead = (this.getChild("selfHead"));
  5270. this.aiHead = (this.getChild("aiHead"));
  5271. this.n82 = (this.getChild("n82"));
  5272. this.n84 = (this.getChild("n84"));
  5273. this.n83 = (this.getChild("n83"));
  5274. this.t1 = this.getTransition("t1");
  5275. this.t2 = this.getTransition("t2");
  5276. this.t3 = this.getTransition("t3");
  5277. this.t4 = this.getTransition("t4");
  5278. }
  5279. }
  5280. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5281. class UIMatching extends UIBase {
  5282. constructor() {
  5283. super();
  5284. }
  5285. onConstructor() {
  5286. this.ui = ui_UIMatching.createInstance();
  5287. this.contentPane = this.ui;
  5288. this.isEject = false;
  5289. }
  5290. show(callback) {
  5291. super.show();
  5292. PlatMgr.showBanner(true);
  5293. this.callback = callback;
  5294. let user = Moyu.getUserInfo();
  5295. if (!this.selfPot) {
  5296. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5297. }
  5298. if (!this.aiPot) {
  5299. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5300. }
  5301. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5302. this.ui.selfHead.nameTxt.text = user.nickName;
  5303. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5304. this.ui.aiHead.nameTxt.text = "???";
  5305. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5306. this.ui.selfHead.c1.selectedIndex = 0;
  5307. this.ui.aiHead.c1.selectedIndex = 0;
  5308. this.ui.selfHead.x = this.selfPot.x;
  5309. this.ui.selfHead.y = this.selfPot.y;
  5310. this.ui.aiHead.x = this.aiPot.x;
  5311. this.ui.aiHead.y = this.aiPot.y;
  5312. switch (xGame.common.gameMode) {
  5313. case GameMode.classic:
  5314. break;
  5315. case GameMode.bigMove:
  5316. this.initSkillData();
  5317. break;
  5318. default:
  5319. break;
  5320. }
  5321. this.ui.t1.play(Laya.Handler.create(this, () => {
  5322. this.ui.t2.play(Laya.Handler.create(this, () => {
  5323. switch (xGame.common.gameMode) {
  5324. case GameMode.classic:
  5325. this.waitingPeople();
  5326. break;
  5327. case GameMode.bigMove:
  5328. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5329. break;
  5330. default:
  5331. break;
  5332. }
  5333. }));
  5334. }));
  5335. }
  5336. initSkillData() {
  5337. this.skillSelectData = [];
  5338. let skillUrl = xGame.common.skillIconList;
  5339. let skillName = xGame.common.skillNameList;
  5340. let skillLevel = DataMgr.getBigSkillList();
  5341. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5342. for (let index = 0; index < 5; index++) {
  5343. let obj = {};
  5344. obj.skillImg = skillUrl[index];
  5345. obj.skillName = skillName[index];
  5346. obj.skillType = skillType[index];
  5347. obj.skillLevel = skillLevel[index];
  5348. this.skillSelectData.push(obj);
  5349. }
  5350. }
  5351. getAISkillLevel(myLevel) {
  5352. let video = xGame.common.upSkillLevel;
  5353. let aiLevel;
  5354. let temp;
  5355. if (video) {
  5356. temp = xGame.common.randomNum(-2, -1);
  5357. }
  5358. else {
  5359. if (myLevel <= 5) {
  5360. temp = xGame.common.randomNum(1, 3);
  5361. }
  5362. else if (myLevel <= 9) {
  5363. temp = xGame.common.randomNum(-2, 1);
  5364. }
  5365. else {
  5366. temp = xGame.common.randomNum(-4, 0);
  5367. }
  5368. }
  5369. aiLevel = temp + myLevel;
  5370. if (aiLevel <= 1)
  5371. aiLevel = 1;
  5372. if (aiLevel >= 10)
  5373. aiLevel = 10;
  5374. return aiLevel;
  5375. }
  5376. getAISkillType() {
  5377. return xGame.common.randomNum(1, 4);
  5378. let successTimes = DataMgr.getSkillSuccessTimes();
  5379. let info = cfgTable.aiskillData[successTimes];
  5380. if (!info) {
  5381. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5382. info = cfgTable.aiskillData[max];
  5383. }
  5384. let dataArr = info.skillselect;
  5385. let myCfg = {};
  5386. for (let index = 0; index < dataArr.length; index++) {
  5387. let temp = dataArr[index].split('-');
  5388. myCfg[temp[0]] = {};
  5389. myCfg[temp[0]].id = parseInt(temp[0]);
  5390. myCfg[temp[0]].weight = parseInt(temp[1]);
  5391. }
  5392. let aiCfg = xGame.common.initWeight(myCfg);
  5393. let curData = xGame.common.getRandomWeightData(aiCfg);
  5394. return parseInt(curData.id);
  5395. }
  5396. getAISkillData(index) {
  5397. let myLevel = this.skillSelectData[index].skillLevel;
  5398. let aiLevel = this.getAISkillLevel(myLevel);
  5399. let aiType = this.getAISkillType() - 1;
  5400. return { aiLevel, aiType } = { aiLevel, aiType };
  5401. }
  5402. skillSelectFinish(index) {
  5403. let aiInfo = this.getAISkillData(index);
  5404. xGame.common.gameMgr.selfCurSkill = index;
  5405. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5406. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5407. this.ui.selfHead.c1.selectedIndex = 1;
  5408. this.ui.aiHead.c1.selectedIndex = 1;
  5409. let myData = this.skillSelectData[index];
  5410. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5411. let guide = DataMgr.getSkillGuide();
  5412. if (guide == 0) {
  5413. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5414. }
  5415. else {
  5416. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5417. }
  5418. let aiData = this.skillSelectData[aiInfo.aiType];
  5419. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5420. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5421. this.waitingPeople();
  5422. }
  5423. waitingPeople() {
  5424. let time = xGame.common.randomNum(1000, 3000);
  5425. time += 1000;
  5426. Laya.timer.once(time, this, () => {
  5427. this.matchingSuccess();
  5428. });
  5429. }
  5430. matchingSuccess() {
  5431. let gameUI = xGame.common.gameUI;
  5432. let name = gameUI.ui.topNode.aiNameTxt.text;
  5433. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5434. this.ui.aiHead.nameTxt.text = name;
  5435. this.ui.aiHead.headImg.url = url;
  5436. name = gameUI.ui.topNode.selfNameTxt.text;
  5437. url = gameUI.ui.topNode.selfHeadLoader.url;
  5438. this.ui.selfHead.nameTxt.text = name;
  5439. this.ui.selfHead.headImg.url = url;
  5440. this.ui.t3.play(Laya.Handler.create(this, () => {
  5441. this.callback && this.callback();
  5442. this.ui.t4.play(Laya.Handler.create(this, () => {
  5443. this.destroySelf();
  5444. }));
  5445. }));
  5446. }
  5447. destroySelf() {
  5448. this.callback = null;
  5449. this.skillSelectData = null;
  5450. this.selfPot = null;
  5451. this.aiPot = null;
  5452. if (!this.ui.isDisposed) {
  5453. this.ui.removeFromParent();
  5454. this.ui.dispose();
  5455. }
  5456. xGame.uiMgr.destroyUI(this);
  5457. }
  5458. }
  5459. UIMatching.uiName = "UIMatching";
  5460. class ui_UIRanking extends fgui.GComponent {
  5461. static createInstance() {
  5462. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5463. }
  5464. onConstruct() {
  5465. this.n26 = (this.getChild("n26"));
  5466. this.myNode = (this.getChild("myNode"));
  5467. }
  5468. }
  5469. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5470. class UIRanking extends UIBase {
  5471. constructor() {
  5472. super();
  5473. this.showSelf = true;
  5474. this.rankType = 1;
  5475. this.rankList = [];
  5476. this.topX = 10;
  5477. this.myIndex = this.topX + 1;
  5478. this.myStar = 0;
  5479. }
  5480. onConstructor() {
  5481. this.ui = ui_UIRanking.createInstance();
  5482. this.contentPane = this.ui;
  5483. this.isEject = false;
  5484. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5485. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5486. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5487. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5488. this.ui.myNode.myList.setVirtual();
  5489. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5490. }
  5491. show() {
  5492. super.show();
  5493. this.getPaiHangBangDataFormJosnFile();
  5494. this.updateSelf();
  5495. let self = Moyu.getUserInfo();
  5496. if (!self.isAuth) {
  5497. Moyu.initUser(this, () => {
  5498. DataMgr.upRankData();
  5499. });
  5500. }
  5501. }
  5502. getPaiHangBangDataFormJosnFile() {
  5503. const rankingList = cfgTable.paiHangBangData.list;
  5504. this.updateItemData(rankingList);
  5505. }
  5506. updateSelfItem() {
  5507. console.log('zh:Moyu.platType =' + Moyu.platType);
  5508. let self = Moyu.getUserInfo();
  5509. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5510. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5511. if (this.myIndex > this.topX) {
  5512. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5513. }
  5514. else {
  5515. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5516. }
  5517. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5518. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5519. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5520. }
  5521. updateItemData(data) {
  5522. this.myStar = xGame.common.getAllStarNum();
  5523. if (this.rankList.length < 2) {
  5524. this.rankList = data;
  5525. let self = Moyu.getUserInfo();
  5526. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5527. self.headIcon = self.headIcon;
  5528. for (let i = 0; i < data.length; i++) {
  5529. let data = this.rankList[i];
  5530. if (data.userId == self.userId) {
  5531. this.rankList.splice(i, 1);
  5532. break;
  5533. }
  5534. }
  5535. for (let i = 0; i < data.length; i++) {
  5536. let data = this.rankList[i];
  5537. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5538. this.myIndex = i + 1;
  5539. let user = { headIcon: self.headIcon, nickName: "myself" };
  5540. let ud = { user: user, data: {} };
  5541. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5542. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5543. if (Moyu.platType < 11) {
  5544. user.headIcon = self.headIcon;
  5545. user.nickName = self.nickName;
  5546. }
  5547. this.rankList.splice(i, 0, md);
  5548. break;
  5549. }
  5550. }
  5551. }
  5552. this.updateSelfItem();
  5553. this.ui.myNode.myList.numItems = this.rankList.length;
  5554. }
  5555. updateItemUI(index, obj) {
  5556. let data = this.rankList[index];
  5557. let userData = JSON.parse(data.userData).user;
  5558. obj.nameTxt.text = userData.nickName.toString();
  5559. obj.valueTxt.text = data.rankScore;
  5560. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5561. obj.rankTxt.text = index + 1;
  5562. switch (index) {
  5563. case 0:
  5564. this.setImg(obj, 1, 0, 0);
  5565. obj.rankTxt.color = "#FFC047";
  5566. break;
  5567. case 1:
  5568. this.setImg(obj, 0, 1, 0);
  5569. obj.rankTxt.color = "#ACACAC";
  5570. break;
  5571. case 2:
  5572. this.setImg(obj, 0, 0, 1);
  5573. obj.rankTxt.color = "#D09672";
  5574. break;
  5575. default:
  5576. this.setImg(obj, 0, 0, 0);
  5577. obj.rankTxt.color = "#496FAB";
  5578. break;
  5579. }
  5580. }
  5581. setImg(obj, a, b, c) {
  5582. obj.img1.visible = a ? true : false;
  5583. obj.img2.visible = b ? true : false;
  5584. obj.img3.visible = c ? true : false;
  5585. }
  5586. changeList(type) {
  5587. this.rankType = type;
  5588. this.updateSelf();
  5589. }
  5590. changeSelfNode() {
  5591. this.showSelf = !this.showSelf;
  5592. this.updateSelf();
  5593. }
  5594. updateSelf() {
  5595. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5596. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5597. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5598. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5599. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5600. }
  5601. }
  5602. UIRanking.uiName = "UIRanking";
  5603. class ui_UISecretary extends fgui.GComponent {
  5604. static createInstance() {
  5605. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5606. }
  5607. onConstruct() {
  5608. this.n0 = (this.getChild("n0"));
  5609. this.myNode = (this.getChild("myNode"));
  5610. this.closeBtn = (this.getChild("closeBtn"));
  5611. this.t0 = this.getTransition("t0");
  5612. }
  5613. }
  5614. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5615. class UISecretary extends UIBase {
  5616. constructor() {
  5617. super();
  5618. this.curIndex = 1;
  5619. }
  5620. onConstructor() {
  5621. this.ui = ui_UISecretary.createInstance();
  5622. this.contentPane = this.ui;
  5623. this.isEject = false;
  5624. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5625. this.nodeObj = { left: null, right: null, cur: null };
  5626. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5627. }
  5628. show() {
  5629. super.show();
  5630. this.ui.t0.play();
  5631. this.updateData();
  5632. }
  5633. addSecretarySpine(node, spineName) {
  5634. if (spineName == "mishu") {
  5635. if (this.secretarySpine1) {
  5636. node.displayObject.destroyChildren();
  5637. this.playWoman(this.secretarySpine1, node.displayObject);
  5638. }
  5639. else {
  5640. let spine1 = new SpineMgr("mishu", () => {
  5641. this.secretarySpine1 = spine1;
  5642. this.playWoman(this.secretarySpine1, node.displayObject);
  5643. });
  5644. }
  5645. }
  5646. else {
  5647. if (this.secretarySpine2) {
  5648. node.displayObject.destroyChildren();
  5649. this.playWoman(this.secretarySpine2, node.displayObject);
  5650. }
  5651. else {
  5652. let spine2 = new SpineMgr("xiaomishu2", () => {
  5653. this.secretarySpine2 = spine2;
  5654. this.playWoman(this.secretarySpine2, node.displayObject);
  5655. });
  5656. }
  5657. }
  5658. }
  5659. playWoman(node, parent) {
  5660. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5661. let yy = this.ui.myNode.gameNode3.secretary.height;
  5662. let scale = 1.5;
  5663. if (node == this.secretarySpine2) {
  5664. scale = 1.2;
  5665. }
  5666. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5667. node.play(data, 0, true, parent);
  5668. }
  5669. turnLeft() {
  5670. this.curIndex--;
  5671. if (this.curIndex < 1) {
  5672. this.curIndex = 2;
  5673. }
  5674. let left = this.nodeObj.left;
  5675. let right = this.nodeObj.right;
  5676. let cur = this.nodeObj.cur;
  5677. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5678. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5679. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5680. this.updateData();
  5681. }));
  5682. this.ui.myNode.setChildIndex(right, 2);
  5683. this.nodeObj.left = cur;
  5684. this.nodeObj.right = left;
  5685. this.nodeObj.cur = right;
  5686. }
  5687. turnRight() {
  5688. this.curIndex++;
  5689. if (this.curIndex > 2) {
  5690. this.curIndex = 1;
  5691. }
  5692. let left = this.nodeObj.left;
  5693. let right = this.nodeObj.right;
  5694. let cur = this.nodeObj.cur;
  5695. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5696. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5697. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5698. this.updateData();
  5699. }));
  5700. this.ui.myNode.setChildIndex(left, 2);
  5701. this.nodeObj.left = right;
  5702. this.nodeObj.right = cur;
  5703. this.nodeObj.cur = left;
  5704. }
  5705. updateData() {
  5706. console.log('zh: updateData FFFFFFFFFF');
  5707. let data = cfgTable.secretaryshopData;
  5708. let children = this.ui.myNode._children;
  5709. let temp;
  5710. let curData;
  5711. for (let index = 0; index < children.length; index++) {
  5712. temp = children[index];
  5713. curData = data[1];
  5714. temp.heightTxt.text = curData.height;
  5715. temp.foodTxt.text = curData.food;
  5716. temp.historyTxt.text = curData.history;
  5717. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5718. this.addSecretarySpine(temp.secretary, curData.spine);
  5719. let womanIndex = curData.id - 1;
  5720. let getWoman = DataMgr.getSecretary(womanIndex);
  5721. let curUse = DataMgr.getCurSecretary();
  5722. if (getWoman) {
  5723. if (curUse == womanIndex) {
  5724. temp.purchaseBtn.c1.selectedIndex = 1;
  5725. }
  5726. else {
  5727. temp.purchaseBtn.c1.selectedIndex = 2;
  5728. }
  5729. }
  5730. else {
  5731. temp.purchaseBtn.c1.selectedIndex = 0;
  5732. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5733. }
  5734. temp.purchaseBtn.visible = false;
  5735. }
  5736. }
  5737. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5738. console.log('zh: 点击了clickSecretary ');
  5739. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5740. if (getWoman) {
  5741. if (curUse != womanIndex) {
  5742. console.log();
  5743. DataMgr.setCurSecretary(womanIndex);
  5744. this.updateData();
  5745. }
  5746. }
  5747. else {
  5748. console.log('zh:点击购买了');
  5749. let need = needDiamond;
  5750. if (DataMgr.diamondEnough(need)) {
  5751. DataMgr.setDiamond(-need);
  5752. DataMgr.setSecretary(womanIndex, 1);
  5753. DataMgr.setCurSecretary(womanIndex);
  5754. this.updateData();
  5755. }
  5756. else {
  5757. xGame.uiMgr.Show(UIAddProp, 1);
  5758. }
  5759. }
  5760. }
  5761. closeSelf() {
  5762. this.hide();
  5763. }
  5764. }
  5765. UISecretary.uiName = "UISecretary";
  5766. class ui_UIShop extends fgui.GComponent {
  5767. static createInstance() {
  5768. return (fgui.UIPackage.createObject("game", "UIShop"));
  5769. }
  5770. onConstruct() {
  5771. this.n48 = (this.getChild("n48"));
  5772. this.n0 = (this.getChild("n0"));
  5773. this.secretary = (this.getChild("secretary"));
  5774. this.talkNode = (this.getChild("talkNode"));
  5775. this.closeNode = (this.getChild("closeNode"));
  5776. this.moneyNode = (this.getChild("moneyNode"));
  5777. this.myNode = (this.getChild("myNode"));
  5778. }
  5779. }
  5780. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5781. class ui_UIMsg extends fgui.GComponent {
  5782. static createInstance() {
  5783. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5784. }
  5785. onConstruct() {
  5786. this.tipsNode = (this.getChild("tipsNode"));
  5787. }
  5788. }
  5789. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5790. class UIMsg extends UIBase {
  5791. constructor() {
  5792. super();
  5793. }
  5794. onConstructor() {
  5795. this.ui = ui_UIMsg.createInstance();
  5796. this.contentPane = this.ui;
  5797. this.isEject = false;
  5798. this.isMuti = true;
  5799. }
  5800. show(msg, callback) {
  5801. super.show();
  5802. this.ui.tipsNode.msgTxt.text = msg;
  5803. this.ui.alpha = 1;
  5804. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5805. this.hide();
  5806. callback && callback();
  5807. }), 1000);
  5808. }
  5809. }
  5810. UIMsg.uiName = "UIMsg";
  5811. class BallRodDisplay {
  5812. constructor(ui, index) {
  5813. this.index = 0;
  5814. this.uiIndex = 0;
  5815. this.ui = ui;
  5816. this.index = index;
  5817. this.initData();
  5818. }
  5819. initData() {
  5820. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5821. let data = cfgTable.ballrodData[this.index + 1];
  5822. this.ui.nameTxt.text = data.name;
  5823. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5824. this.ui.levelNode.c1.selectedIndex = data.quality;
  5825. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5826. if (data.spine) {
  5827. this.mySpine = new SpineMgr(data.spine, () => {
  5828. let xx = 150;
  5829. let yy = 70;
  5830. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5831. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5832. });
  5833. }
  5834. }
  5835. updateSelf() {
  5836. console.log('zh:updateSelf -------------- ');
  5837. let get = DataMgr.getBallRod(this.index);
  5838. if (get == null)
  5839. get = 1;
  5840. let curUse = DataMgr.getCurBallRod();
  5841. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5842. if (get) {
  5843. if (curUse == this.index) {
  5844. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5845. }
  5846. else {
  5847. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5848. }
  5849. }
  5850. else {
  5851. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5852. }
  5853. }
  5854. buyBallRod() {
  5855. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5856. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5857. switch (selectedIndex) {
  5858. case 0:
  5859. break;
  5860. case 1:
  5861. console.log('zh:点击了 USE THIS');
  5862. DataMgr.setCurBallRod(this.index);
  5863. let curUse = DataMgr.getCurBallRod();
  5864. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5865. let ui = xGame.uiMgr.getUI(UIShop);
  5866. ui.updateBallRod();
  5867. break;
  5868. case 2:
  5869. let data = cfgTable.ballrodData[this.index + 1];
  5870. let need = data.price;
  5871. if (DataMgr.diamondEnough(need)) {
  5872. this.buyQiuGan(data);
  5873. DataMgr.setDiamond(-need);
  5874. DataMgr.setBallRod(this.index, 1);
  5875. DataMgr.setCurBallRod(this.index);
  5876. let ui = xGame.uiMgr.getUI(UIShop);
  5877. ui.updateBallRod();
  5878. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5879. }
  5880. else {
  5881. xGame.uiMgr.Show(UIAddProp, 1);
  5882. }
  5883. break;
  5884. default:
  5885. break;
  5886. }
  5887. }
  5888. buyQiuGan(qgItem) {
  5889. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5890. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5891. if (userInfo == null) {
  5892. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5893. return;
  5894. }
  5895. let reqData = xGame.httpMgr.getReqData();
  5896. let pd = JSON.parse(reqData);
  5897. pd.qiuGanData = qgItem;
  5898. reqData = JSON.stringify(pd);
  5899. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5900. try {
  5901. console.log('zh:buySp res = ' + JSON.stringify(res));
  5902. let code = res.code;
  5903. let msg = res.msg;
  5904. if (code == 401) {
  5905. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5906. alert(TIP_MSG_key.loginTimeOut);
  5907. xGame.uiMgr.Show(UIMsg, msg);
  5908. return;
  5909. }
  5910. if (code == 200) {
  5911. xGame.uiMgr.Show(UIMsg, msg);
  5912. DataMgr.getUserZiChanInfo();
  5913. }
  5914. else {
  5915. xGame.uiMgr.Show(UIMsg, msg);
  5916. }
  5917. }
  5918. catch (error) {
  5919. console.log('error=' + error);
  5920. alert(error);
  5921. }
  5922. finally {
  5923. }
  5924. });
  5925. }
  5926. logEventForGouMaiGan(qiuGanName) {
  5927. const ev = {
  5928. value: qiuGanName
  5929. };
  5930. const jsonStr = JSON.stringify(ev);
  5931. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5932. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5933. }
  5934. }
  5935. class DaoJuDisplay {
  5936. constructor(ui, index) {
  5937. this.index = 0;
  5938. this.uiIndex = 0;
  5939. this.ggSpid = "";
  5940. this.spid = 0;
  5941. this.ui = ui;
  5942. this.index = index;
  5943. this.initData();
  5944. }
  5945. initData() {
  5946. this.ui.btn_buy.onClick(this, this.gotoBuy);
  5947. let data = cfgTable.daoJuData[this.index + 1];
  5948. console.log('zh:' + JSON.stringify(data));
  5949. this.ui.nameTxt.text = data.spbt;
  5950. this.ui.n_jiaGe.text = data.spjg + "";
  5951. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5952. this.ggSpid = data.ggSpid;
  5953. this.spid = data.spid;
  5954. let baseUrl = "asset/sound/ogg/";
  5955. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5956. }
  5957. gotoBuy() {
  5958. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5959. if (userInfo != null) {
  5960. let token = userInfo.token;
  5961. let ggSpid = this.ggSpid;
  5962. let spid = this.spid;
  5963. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  5964. console.log('zh:gotoBuy1 spid =' + spid);
  5965. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  5966. return;
  5967. }
  5968. else {
  5969. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5970. }
  5971. }
  5972. gotoBuy1() {
  5973. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5974. let djItem = cfgTable.daoJuData[this.index + 1];
  5975. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  5976. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5977. if (userInfo == null) {
  5978. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5979. return;
  5980. }
  5981. let reqData = xGame.httpMgr.getReqData();
  5982. let pd = JSON.parse(reqData);
  5983. pd.spItem = djItem;
  5984. reqData = JSON.stringify(pd);
  5985. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  5986. try {
  5987. console.log('zh:buySp res = ' + JSON.stringify(res));
  5988. let code = res.code;
  5989. let msg = res.msg;
  5990. if (code == 401) {
  5991. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5992. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5993. return;
  5994. }
  5995. if (code == 200) {
  5996. xGame.uiMgr.Show(UIMsg, msg);
  5997. DataMgr.getUserZiChanInfo();
  5998. }
  5999. else {
  6000. xGame.uiMgr.Show(UIMsg, msg);
  6001. }
  6002. }
  6003. catch (error) {
  6004. console.log('error=' + error);
  6005. alert(error);
  6006. }
  6007. finally {
  6008. }
  6009. });
  6010. }
  6011. }
  6012. class UIShop extends UIBase {
  6013. constructor() {
  6014. super();
  6015. this.itemNums = 0;
  6016. this.itemNumsForDj = 0;
  6017. this.curType = "";
  6018. }
  6019. onConstructor() {
  6020. this.ui = ui_UIShop.createInstance();
  6021. this.contentPane = this.ui;
  6022. this.isEject = false;
  6023. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6024. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6025. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6026. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6027. this.addUIClick(this.ui, this.interuptSecretary);
  6028. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6029. this.ballRodArr = [];
  6030. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6031. this.ui.myNode.myList.numItems = this.itemNums;
  6032. this.loadDjdata_old();
  6033. }
  6034. loadDjdata_old() {
  6035. let fff = cfgTable.daoJuData;
  6036. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6037. this.daoJuArr = [];
  6038. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6039. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6040. }
  6041. getProductList() {
  6042. let reqData = xGame.httpMgr.getReqData();
  6043. let pd = JSON.parse(reqData);
  6044. pd.splx = "Consumable";
  6045. reqData = JSON.stringify(pd);
  6046. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6047. try {
  6048. let code = res.code;
  6049. let msg = res.msg;
  6050. if (code == 401) {
  6051. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6052. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6053. return;
  6054. }
  6055. if (code == 200) {
  6056. let data = res.data;
  6057. for (let index = 0; index < data.length; index++) {
  6058. let element = data[index];
  6059. cfgTable.daoJuData[element.spid] = element;
  6060. }
  6061. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6062. }
  6063. else {
  6064. xGame.uiMgr.Show(UIMsg, msg);
  6065. }
  6066. }
  6067. catch (error) {
  6068. console.log('error=' + error);
  6069. alert(error);
  6070. }
  6071. finally {
  6072. }
  6073. });
  6074. }
  6075. show(type) {
  6076. super.show();
  6077. this.curType = type == 0 ? "qiugan" : "daoju";
  6078. this.switchBtn("");
  6079. this.playSecretaryIdle();
  6080. this.updateBallRod();
  6081. }
  6082. test123() {
  6083. console.log('zh:test123 ');
  6084. }
  6085. switchBtn(type) {
  6086. console.log('zh:1111切換 sel type=' + type);
  6087. if (type == "") {
  6088. type = this.curType;
  6089. }
  6090. else {
  6091. if (this.curType == type) {
  6092. return;
  6093. }
  6094. else {
  6095. this.curType = type;
  6096. }
  6097. }
  6098. if (type == "qiugan") {
  6099. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6100. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6101. this.ui.myNode.c1.selectedIndex = 0;
  6102. this.ui.myNode.myList.visible = true;
  6103. this.ui.myNode.djList.visible = false;
  6104. }
  6105. else {
  6106. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6107. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6108. this.ui.myNode.c1.selectedIndex = 1;
  6109. this.ui.myNode.myList.visible = false;
  6110. this.ui.myNode.djList.visible = true;
  6111. }
  6112. }
  6113. updateBallRod() {
  6114. for (let index = 0; index < this.ballRodArr.length; index++) {
  6115. this.ballRodArr[index].updateSelf();
  6116. }
  6117. }
  6118. renderBallRod(sort, obj) {
  6119. let index = this.getIndexBySort(sort + 1) - 1;
  6120. let ballRod = new BallRodDisplay(obj, index);
  6121. this.ballRodArr.push(ballRod);
  6122. }
  6123. renderDaoJu(idx, obj) {
  6124. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6125. let b = new DaoJuDisplay(obj, index);
  6126. this.daoJuArr.push(b);
  6127. }
  6128. getIndexBySort(sort) {
  6129. let object = cfgTable.ballrodData;
  6130. for (const key in object) {
  6131. if (object[key].sort == sort) {
  6132. return parseInt(key);
  6133. }
  6134. }
  6135. }
  6136. getIndexBySortForDj(idx) {
  6137. let object = cfgTable.daoJuData;
  6138. for (const key in object) {
  6139. if (object[key].idx == idx) {
  6140. return parseInt(key);
  6141. }
  6142. }
  6143. }
  6144. playSecretaryIdle() {
  6145. let parent = this.ui.secretary.displayObject;
  6146. parent.destroyChildren();
  6147. let xx = this.ui.secretary.width / 2;
  6148. let yy = this.ui.secretary.height;
  6149. let scale = xGame.common.getSecretaryScale();
  6150. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6151. xGame.common.secretary.play(data, 0, true, parent);
  6152. }
  6153. interuptSecretary() {
  6154. Laya.timer.clearAll(this);
  6155. this.playSecretaryRandomSound();
  6156. }
  6157. playSecretaryRandomSound() {
  6158. if (this.isHide)
  6159. return;
  6160. let time = xGame.common.randomNum(45000, 60000);
  6161. Laya.timer.once(time, this, () => {
  6162. if (this.isHide)
  6163. return;
  6164. let index = xGame.common.randomNum(4, 7);
  6165. xGame.soundMgr.playSound("s_main0" + index);
  6166. let words = 1;
  6167. switch (index) {
  6168. case 4:
  6169. words = 5;
  6170. break;
  6171. case 5:
  6172. words = 3;
  6173. break;
  6174. case 6:
  6175. words = 6;
  6176. break;
  6177. case 7:
  6178. words = 7;
  6179. break;
  6180. default:
  6181. break;
  6182. }
  6183. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6184. this.playSecretaryRandomSound();
  6185. });
  6186. }
  6187. closeSelf() {
  6188. this.hide();
  6189. }
  6190. }
  6191. UIShop.uiName = "UIShop";
  6192. class ui_UISign extends fgui.GComponent {
  6193. static createInstance() {
  6194. return (fgui.UIPackage.createObject("game", "UISign"));
  6195. }
  6196. onConstruct() {
  6197. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6198. this.n6 = (this.getChild("n6"));
  6199. this.closeNode = (this.getChild("closeNode"));
  6200. this.myNode = (this.getChild("myNode"));
  6201. this.moneyNode = (this.getChild("moneyNode"));
  6202. this.secretary = (this.getChild("secretary"));
  6203. this.talkNode = (this.getChild("talkNode"));
  6204. this.tripleBtn = (this.getChild("tripleBtn"));
  6205. this.normalBtn = (this.getChild("normalBtn"));
  6206. this.tipsNode = (this.getChild("tipsNode"));
  6207. this.againBtn = (this.getChild("againBtn"));
  6208. this.t0 = this.getTransition("t0");
  6209. }
  6210. }
  6211. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6212. class SignMax {
  6213. constructor(ui) {
  6214. this.ui = ui;
  6215. }
  6216. updateSelf(index, sameDay, curDayIndex) {
  6217. let data = cfgTable.signData[index + 1];
  6218. this.ui.titleTxt.text = data.title;
  6219. let arr1 = data.award[0].split('-');
  6220. let arr2 = data.award[1].split('-');
  6221. let num1 = parseInt(arr1[1]);
  6222. let num2 = parseInt(arr2[1]);
  6223. this.ui.numTxt1.text = num1 + "";
  6224. this.ui.numTxt2.text = num2 + "";
  6225. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6226. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6227. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6228. this.ui.numTxt1.visible = false;
  6229. }
  6230. else {
  6231. this.ui.numTxt1.visible = true;
  6232. }
  6233. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6234. this.ui.numTxt2.visible = false;
  6235. }
  6236. else {
  6237. this.ui.numTxt2.visible = true;
  6238. }
  6239. if (index < curDayIndex) {
  6240. this.ui.c1.selectedIndex = 1;
  6241. }
  6242. else if (index == curDayIndex) {
  6243. if (sameDay) {
  6244. this.ui.c1.selectedIndex = 2;
  6245. }
  6246. else {
  6247. this.ui.c1.selectedIndex = 2;
  6248. }
  6249. }
  6250. else {
  6251. this.ui.c1.selectedIndex = 0;
  6252. }
  6253. }
  6254. }
  6255. class SignNormal {
  6256. constructor(ui) {
  6257. this.ui = ui;
  6258. }
  6259. updateSelf(index, sameDay, curDayIndex) {
  6260. let data = cfgTable.signData[index + 1];
  6261. this.ui.titleTxt.text = data.title;
  6262. let arr = data.award[0].split('-');
  6263. let type = parseInt(arr[0]);
  6264. let num = parseInt(arr[1]);
  6265. this.ui.numTxt.text = num + "";
  6266. if (type > 2) {
  6267. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6268. this.ui.myIcon.rotation = 0;
  6269. }
  6270. else {
  6271. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6272. this.ui.myIcon.rotation = 0;
  6273. }
  6274. if (xGame.common.signAwardContainsRod(data.award)) {
  6275. this.ui.numTxt.visible = false;
  6276. }
  6277. else {
  6278. this.ui.numTxt.visible = true;
  6279. }
  6280. if (index < curDayIndex) {
  6281. this.ui.c1.selectedIndex = 1;
  6282. }
  6283. else if (index == curDayIndex) {
  6284. if (sameDay) {
  6285. this.ui.c1.selectedIndex = 2;
  6286. }
  6287. else {
  6288. this.ui.c1.selectedIndex = 2;
  6289. }
  6290. }
  6291. else {
  6292. this.ui.c1.selectedIndex = 0;
  6293. }
  6294. }
  6295. }
  6296. class UISign extends UIBase {
  6297. constructor() {
  6298. super();
  6299. this.curDayIndex = 0;
  6300. this.starX = 0;
  6301. }
  6302. onConstructor() {
  6303. this.ui = ui_UISign.createInstance();
  6304. this.contentPane = this.ui;
  6305. this.isEject = false;
  6306. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6307. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6308. this.initSignItem();
  6309. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6310. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6311. }
  6312. show() {
  6313. super.show();
  6314. this.ui.t0.play();
  6315. this.playSecretaryIdle();
  6316. this.updateSign();
  6317. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6318. }
  6319. initSignItem() {
  6320. this.signArr = [];
  6321. for (let index = 0; index < 6; index++) {
  6322. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6323. this.signArr.push(temp);
  6324. }
  6325. this.signMax = new SignMax(this.ui.myNode.day7);
  6326. if (Moyu.isKs)
  6327. this.ui.closeNode.closeBtn.x += 100;
  6328. }
  6329. updateSign() {
  6330. let sameDay = xGame.common.judgeSameDay();
  6331. let max = 7;
  6332. this.curDayIndex = DataMgr.getSignData();
  6333. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6334. this.curDayIndex = 0;
  6335. if (!sameDay) {
  6336. this.ui.normalBtn.visible = true;
  6337. this.ui.tipsNode.visible = false;
  6338. this.ui.againBtn.visible = false;
  6339. }
  6340. else {
  6341. this.ui.normalBtn.visible = false;
  6342. let again = DataMgr.getExtraSign();
  6343. let isCurrency = false;
  6344. let index = this.curDayIndex;
  6345. if (index == 0)
  6346. index = 7;
  6347. let award = cfgTable.signData[index].award;
  6348. let num = award[0].split("-")[0];
  6349. if (num == "1" || num == "2")
  6350. isCurrency = true;
  6351. let showAgain = again == 0 && isCurrency;
  6352. this.ui.againBtn.visible = showAgain;
  6353. this.ui.tipsNode.visible = !showAgain;
  6354. }
  6355. for (let index = 0; index < this.signArr.length; index++) {
  6356. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6357. }
  6358. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6359. }
  6360. playSecretaryIdle() {
  6361. let parent = this.ui.secretary.displayObject;
  6362. parent.destroyChildren();
  6363. let xx = this.ui.secretary.width / 2;
  6364. let yy = this.ui.secretary.height;
  6365. let scale = xGame.common.getSecretaryScale();
  6366. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6367. xGame.common.secretary.play(data, 0, true, parent);
  6368. }
  6369. closeSelf() {
  6370. this.hide();
  6371. }
  6372. normalGetAward() {
  6373. let sameDay = xGame.common.judgeSameDay();
  6374. if (!sameDay) {
  6375. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6376. let temp;
  6377. let type;
  6378. let num;
  6379. let arr = [];
  6380. for (let index = 0; index < award.length; index++) {
  6381. temp = award[index].split("-");
  6382. type = parseInt(temp[0]);
  6383. num = parseInt(temp[1]);
  6384. let awardType = new AwardType();
  6385. awardType.num = num;
  6386. awardType.type = type;
  6387. arr.push(awardType);
  6388. }
  6389. xGame.common.getAward(arr, (watchVideo) => {
  6390. this.curDayIndex++;
  6391. if (this.curDayIndex > 7)
  6392. this.curDayIndex = 0;
  6393. DataMgr.setSignData(this.curDayIndex);
  6394. this.updateSignData2Server(this.curDayIndex);
  6395. DataMgr.setSignTime(new Date().getTime());
  6396. if (watchVideo) {
  6397. DataMgr.setExtraSign(1);
  6398. Moyu.sendDataEvent("signIn1");
  6399. }
  6400. this.updateSign();
  6401. });
  6402. }
  6403. }
  6404. againGetAward() {
  6405. Moyu.sendDataEvent("signIn2");
  6406. console.log('zh:qjff_AD_for_uisign');
  6407. if (Laya.Browser.onAndroid) {
  6408. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6409. if (!boo) {
  6410. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6411. return;
  6412. }
  6413. }
  6414. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6415. }
  6416. else {
  6417. console.log('zh:AD 失败,直接发放奖励');
  6418. this.qjff_AD_for_uisign();
  6419. }
  6420. }
  6421. qjff_AD_for_uisign() {
  6422. let index = this.curDayIndex;
  6423. if (index == 0)
  6424. index = 7;
  6425. let award = cfgTable.signData[index].award;
  6426. let temp;
  6427. let type;
  6428. let num;
  6429. for (let index = 0; index < award.length; index++) {
  6430. temp = award[index].split("-");
  6431. type = parseInt(temp[0]);
  6432. num = parseInt(temp[1]) * 3;
  6433. xGame.common.playObjFlyAnim(num, type);
  6434. }
  6435. DataMgr.setExtraSign(1);
  6436. this.updateSign();
  6437. }
  6438. updateSignData2Server(day) {
  6439. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6440. if (userInfo == null) {
  6441. return;
  6442. }
  6443. let reqData = xGame.httpMgr.getReqData();
  6444. let pd = JSON.parse(reqData);
  6445. pd.signData = day;
  6446. reqData = JSON.stringify(pd);
  6447. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6448. try {
  6449. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6450. let code = res.code;
  6451. let msg = res.msg;
  6452. if (code == 401) {
  6453. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6454. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6455. return;
  6456. }
  6457. if (code == 200) {
  6458. let data = res.data;
  6459. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6460. }
  6461. else {
  6462. xGame.uiMgr.Show(UIMsg, msg);
  6463. }
  6464. }
  6465. catch (error) {
  6466. console.log('error=' + error);
  6467. alert(error);
  6468. }
  6469. finally {
  6470. }
  6471. });
  6472. }
  6473. }
  6474. UISign.uiName = "UISign";
  6475. class ui_UISkill extends fgui.GComponent {
  6476. static createInstance() {
  6477. return (fgui.UIPackage.createObject("game", "UISkill"));
  6478. }
  6479. onConstruct() {
  6480. this.n48 = (this.getChild("n48"));
  6481. this.n0 = (this.getChild("n0"));
  6482. this.secretary = (this.getChild("secretary"));
  6483. this.talkNode = (this.getChild("talkNode"));
  6484. this.closeNode = (this.getChild("closeNode"));
  6485. this.moneyNode = (this.getChild("moneyNode"));
  6486. this.skillNode = (this.getChild("skillNode"));
  6487. this.guideNode = (this.getChild("guideNode"));
  6488. }
  6489. }
  6490. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6491. class SkillDisplay {
  6492. constructor(ui, data, uiIndex) {
  6493. this.starX = 0;
  6494. this.starY = 0;
  6495. this.index = 0;
  6496. this.ui = ui;
  6497. this.data = data;
  6498. this.index = uiIndex;
  6499. this.initSelf();
  6500. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6501. }
  6502. initSelf() {
  6503. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6504. this.ui.nameTxt.text = this.data.name;
  6505. this.ui.describeTxt.text = this.data.describe;
  6506. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6507. this.ui.startBtn.onClick(this, this.startGame);
  6508. this.updateSelf();
  6509. }
  6510. updateSelf() {
  6511. this.checkTry();
  6512. let level = DataMgr.getBigSkillByIndex(this.index);
  6513. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6514. }
  6515. checkTry() {
  6516. let index = this.index;
  6517. let level = DataMgr.getBigSkillByIndex(index);
  6518. if (level == null) {
  6519. DataMgr.setBigSkill(index, 1, false);
  6520. level = 1;
  6521. }
  6522. this.ui.levelTxt.text = "LV." + level;
  6523. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6524. this.ui.tryNode.visible = true;
  6525. else
  6526. this.ui.tryNode.visible = false;
  6527. }
  6528. clickAddLevel() {
  6529. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6530. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6531. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6532. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6533. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6534. }
  6535. else {
  6536. console.log('zh:AD 失败,直接发放奖励');
  6537. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6538. }
  6539. }
  6540. qjff_AD_for_skilldisplay_clickAddLevel() {
  6541. DataMgr.setBigSkill(this.data.index, 1);
  6542. this.updateSelf();
  6543. xGame.common.upSkillLevel = true;
  6544. }
  6545. startGame() {
  6546. console.log('zh:rod skill startgame');
  6547. if (this.data.index == 3) {
  6548. alert('Coming soon!');
  6549. return;
  6550. }
  6551. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6552. let needCoin = xGame.common.bigMoveNeedCoin;
  6553. xGame.common.passAwardCoin = 2000;
  6554. let guide = DataMgr.getSkillGuide();
  6555. console.log('zh:startGame guide=' + guide);
  6556. xGame.common.temSelfLevel = 0;
  6557. if (guide == 0) {
  6558. needCoin = 0;
  6559. xGame.common.temSelfLevel = 100;
  6560. }
  6561. if (DataMgr.coinEnough(needCoin)) {
  6562. DataMgr.setCoin(-needCoin);
  6563. xGame.common.curPlayerSkillType = this.index;
  6564. if (guide == 0)
  6565. xGame.common.curPlayerSkillType = 0;
  6566. console.log('zh: skilldisplay 1');
  6567. xGame.uiMgr.Show(UIGame);
  6568. xGame.uiMgr.Hide(UIMain);
  6569. xGame.uiMgr.Show(UIMatching, () => {
  6570. xGame.common.gameUI.ui.alpha = 1;
  6571. xGame.common.gameUI.startGame();
  6572. xGame.uiMgr.Hide(UISkill);
  6573. });
  6574. this.logEventForRod_start();
  6575. }
  6576. else {
  6577. console.log('zh: skilldisplay 2');
  6578. xGame.uiMgr.Show(UIAddProp, 0);
  6579. Moyu.sendDataEvent("AddCoinVideo");
  6580. }
  6581. }
  6582. logEventForRod_start() {
  6583. let gfmsIdx = xGame.common.curPlayerSkillType;
  6584. console.log('zh:选择的技能=' + gfmsIdx);
  6585. let gfmc = 'Skyfall Shot';
  6586. if (gfmsIdx == 0) {
  6587. gfmc = 'Skyfall Shot';
  6588. }
  6589. if (gfmsIdx == 1) {
  6590. gfmc = 'Surging break';
  6591. }
  6592. if (gfmsIdx == 2) {
  6593. gfmc = 'Frost Lock';
  6594. }
  6595. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6596. let jsonStr = {
  6597. "count": 0,
  6598. "name": gfmc
  6599. };
  6600. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6601. const d = LocalStorageManager.getItem(keyStr);
  6602. jsonStr.count = d.count + 1;
  6603. LocalStorageManager.setItem(keyStr, jsonStr);
  6604. }
  6605. else {
  6606. LocalStorageManager.setItem(keyStr, jsonStr);
  6607. }
  6608. const reqStr = JSON.stringify(jsonStr);
  6609. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6610. }
  6611. }
  6612. class UISkill extends UIBase {
  6613. constructor() {
  6614. super();
  6615. this.skillData = [];
  6616. }
  6617. onConstructor() {
  6618. this.ui = ui_UISkill.createInstance();
  6619. this.contentPane = this.ui;
  6620. this.isEject = false;
  6621. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6622. this.initSkillData();
  6623. console.log('zh:aaaaaa1111111111');
  6624. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6625. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6626. console.log('zh:aaaaaa22222222');
  6627. this.displayList = [];
  6628. this.ui.skillNode.skillList.numItems = 3;
  6629. this.addUIClick(this.ui, this.interuptSecretary);
  6630. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6631. this.ui.talkNode.visible = false;
  6632. if (Moyu.isKs)
  6633. this.ui.closeNode.closeBtn.x += 100;
  6634. }
  6635. show() {
  6636. super.show();
  6637. this.playSecretaryIdle();
  6638. this.moneyNode.ui.c1.selectedIndex = 1;
  6639. Laya.timer.clearAll(this);
  6640. xGame.soundMgr.playSound("s_start");
  6641. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6642. let guide = DataMgr.getSkillGuide();
  6643. this.ui.guideNode.visible = guide == 0;
  6644. let item = this.getSkillItemByUIIndex(0);
  6645. if (guide == 0) {
  6646. item.ui.c1.selectedIndex = 1;
  6647. }
  6648. else {
  6649. item.ui.c1.selectedIndex = 0;
  6650. }
  6651. this.ui.guideNode.guideBtn.visible = guide == 0;
  6652. for (let index = 0; index < this.displayList.length; index++) {
  6653. this.displayList[index].checkTry();
  6654. }
  6655. }
  6656. getSkillItemByUIIndex(cur) {
  6657. for (let index = 0; index < this.displayList.length; index++) {
  6658. if (this.displayList[index].index == cur) {
  6659. return this.displayList[index];
  6660. }
  6661. }
  6662. }
  6663. enterGuideLevel() {
  6664. let item = this.getSkillItemByUIIndex(0);
  6665. item.startGame();
  6666. if (DataMgr.getNewUser())
  6667. Moyu.sendDataEvent("gameStart1");
  6668. }
  6669. initSkillData() {
  6670. this.skillData = [];
  6671. let nameList = xGame.common.skillNameList;
  6672. let iconList = xGame.common.skillIconList;
  6673. let describeList = [
  6674. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6675. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6676. "The power of frost descends—freezing the flow and taking full control of the game!"
  6677. ];
  6678. console.log('zh:initSkillData 111111111');
  6679. let data;
  6680. for (let index = 0; index < nameList.length; index++) {
  6681. data = {};
  6682. data.name = nameList[index];
  6683. data.icon = iconList[index];
  6684. data.describe = describeList[index];
  6685. data.index = index;
  6686. this.skillData.push(data);
  6687. }
  6688. }
  6689. updateSkillItem(index, target) {
  6690. if (this.displayList[index] == null) {
  6691. let uiIndex;
  6692. switch (index) {
  6693. case 0:
  6694. uiIndex = 1;
  6695. break;
  6696. case 1:
  6697. uiIndex = 0;
  6698. break;
  6699. case 2:
  6700. uiIndex = 2;
  6701. break;
  6702. case 3:
  6703. uiIndex = 3;
  6704. break;
  6705. default:
  6706. break;
  6707. }
  6708. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6709. this.displayList.push(temp);
  6710. }
  6711. }
  6712. playSecretaryIdle() {
  6713. let parent = this.ui.secretary.displayObject;
  6714. parent.destroyChildren();
  6715. let xx = this.ui.secretary.width / 2;
  6716. let yy = this.ui.secretary.height;
  6717. let scale = xGame.common.getSecretaryScale();
  6718. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6719. xGame.common.secretary.play(data, 0, true, parent);
  6720. }
  6721. returnUIMain() {
  6722. this.hide();
  6723. xGame.common.stopGirlPop(this.ui.talkNode);
  6724. xGame.uiMgr.Show(UIMain);
  6725. }
  6726. interuptSecretary() {
  6727. Laya.timer.clearAll(this);
  6728. this.playSecretaryRandomSound();
  6729. }
  6730. playSecretaryRandomSound() {
  6731. if (this.isHide)
  6732. return;
  6733. let time = xGame.common.randomNum(45000, 60000);
  6734. Laya.timer.once(time, this, () => {
  6735. if (this.isHide)
  6736. return;
  6737. let index = xGame.common.randomNum(4, 7);
  6738. xGame.soundMgr.playSound("s_main0" + index);
  6739. let words = 1;
  6740. switch (index) {
  6741. case 4:
  6742. words = 5;
  6743. break;
  6744. case 5:
  6745. words = 3;
  6746. break;
  6747. case 6:
  6748. words = 6;
  6749. break;
  6750. case 7:
  6751. words = 7;
  6752. break;
  6753. default:
  6754. break;
  6755. }
  6756. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6757. this.playSecretaryRandomSound();
  6758. });
  6759. }
  6760. }
  6761. UISkill.uiName = "UISkill";
  6762. class ui_UIModeSelection extends fgui.GComponent {
  6763. static createInstance() {
  6764. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6765. }
  6766. onConstruct() {
  6767. this.n19 = (this.getChild("n19"));
  6768. this.closeBtn = (this.getChild("closeBtn"));
  6769. this.myNode = (this.getChild("myNode"));
  6770. this.t0 = this.getTransition("t0");
  6771. }
  6772. }
  6773. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6774. class UIModeSelection extends UIBase {
  6775. constructor() {
  6776. super();
  6777. }
  6778. onConstructor() {
  6779. this.ui = ui_UIModeSelection.createInstance();
  6780. this.contentPane = this.ui;
  6781. this.isEject = false;
  6782. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6783. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6784. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6785. this.addUIClick(this.ui.closeBtn, this.hide);
  6786. this.peopleArr = [65, 990, 580];
  6787. this.peopleOffest = [5, 10, 10];
  6788. }
  6789. show(callback) {
  6790. this.updateSelf();
  6791. super.show();
  6792. this.ui.t0.play();
  6793. this.callback = callback;
  6794. }
  6795. updateSelf() {
  6796. let cfg = cfgTable.modeselectData;
  6797. for (let index = 1; index <= 3; index++) {
  6798. let node = this.ui.myNode["type" + index];
  6799. node.need.text = cfg[index].need;
  6800. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6801. node.peopleTxt.text = this.getRandPeople(index - 1);
  6802. }
  6803. }
  6804. enterGame(type) {
  6805. console.log('zh: 进入经典模式 type: ' + type);
  6806. xGame.common.classicRoomType = type;
  6807. let cfg = cfgTable.modeselectData[type];
  6808. let need = cfg.need;
  6809. xGame.common.passAwardCoin = cfg.award;
  6810. if (DataMgr.coinEnough(need)) {
  6811. DataMgr.setCoin(-need);
  6812. this.ui.myNode["type" + type].t0.play();
  6813. Laya.timer.once(200, this, () => {
  6814. this.callback && this.callback();
  6815. });
  6816. this.logEventForClassic_start();
  6817. }
  6818. else {
  6819. Moyu.sendDataEvent("AddCoinVideo");
  6820. xGame.uiMgr.Show(UIAddProp, 0);
  6821. }
  6822. }
  6823. getRandPeople(index) {
  6824. let rand = this.peopleOffest[index];
  6825. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6826. }
  6827. logEventForClassic_start() {
  6828. let rtype = xGame.common.classicRoomType;
  6829. let msmc = '';
  6830. if (rtype == 1) {
  6831. msmc = 'beginner';
  6832. }
  6833. if (rtype == 2) {
  6834. msmc = 'expert';
  6835. }
  6836. if (rtype == 3) {
  6837. msmc = 'master';
  6838. }
  6839. let keyStr = 'sjmd_classic_start_' + rtype;
  6840. let jsonStr = {
  6841. "difficulty": msmc,
  6842. "classic_count": 1,
  6843. "difficulty_count": 1
  6844. };
  6845. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6846. const d = LocalStorageManager.getItem(keyStr);
  6847. jsonStr.classic_count = d.classic_count + 1;
  6848. jsonStr.difficulty_count = d.difficulty_count + 1;
  6849. LocalStorageManager.setItem(keyStr, jsonStr);
  6850. }
  6851. else {
  6852. LocalStorageManager.setItem(keyStr, jsonStr);
  6853. }
  6854. const reqStr = JSON.stringify(jsonStr);
  6855. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6856. }
  6857. }
  6858. UIModeSelection.uiName = "UIModeSelection";
  6859. class ui_UIReg extends fgui.GComponent {
  6860. static createInstance() {
  6861. return (fgui.UIPackage.createObject("game", "UIReg"));
  6862. }
  6863. onConstruct() {
  6864. this.n38 = (this.getChild("n38"));
  6865. this.n9 = (this.getChild("n9"));
  6866. this.n14 = (this.getChild("n14"));
  6867. this.n15 = (this.getChild("n15"));
  6868. this.n34 = (this.getChild("n34"));
  6869. this.closeBtn = (this.getChild("closeBtn"));
  6870. this.lab_tip = (this.getChild("lab_tip"));
  6871. this.n43 = (this.getChild("n43"));
  6872. this.txt_ua = (this.getChild("txt_ua"));
  6873. this.n44 = (this.getChild("n44"));
  6874. this.txt_up1 = (this.getChild("txt_up1"));
  6875. this.n45 = (this.getChild("n45"));
  6876. this.txt_up2 = (this.getChild("txt_up2"));
  6877. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6878. this.btn_reg = (this.getChild("btn_reg"));
  6879. this.n50 = (this.getChild("n50"));
  6880. }
  6881. }
  6882. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6883. class ui_UILogin extends fgui.GComponent {
  6884. static createInstance() {
  6885. return (fgui.UIPackage.createObject("game", "UILogin"));
  6886. }
  6887. onConstruct() {
  6888. this.c1 = this.getController("c1");
  6889. this.n18 = (this.getChild("n18"));
  6890. this.n7 = (this.getChild("n7"));
  6891. this.n5 = (this.getChild("n5"));
  6892. this.n6 = (this.getChild("n6"));
  6893. this.closeBtn = (this.getChild("closeBtn"));
  6894. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6895. this.btn_login = (this.getChild("btn_login"));
  6896. this.n30 = (this.getChild("n30"));
  6897. this.n31 = (this.getChild("n31"));
  6898. this.txt_up = (this.getChild("txt_up"));
  6899. this.n32 = (this.getChild("n32"));
  6900. this.txt_ua = (this.getChild("txt_ua"));
  6901. }
  6902. }
  6903. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6904. class UILogin extends UIBase {
  6905. constructor() {
  6906. super();
  6907. }
  6908. onConstructor() {
  6909. this.ui = ui_UILogin.createInstance();
  6910. this.contentPane = this.ui;
  6911. this.isEject = false;
  6912. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6913. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6914. this.addUIClick(this.ui.btn_login, this.userLogin);
  6915. }
  6916. show() {
  6917. super.show();
  6918. this.x = (Laya.stage.width - this.width) / 2;
  6919. this.y = (Laya.stage.height - this.height) / 2;
  6920. }
  6921. closeSelf() {
  6922. this.hide();
  6923. }
  6924. userLogin() {
  6925. let ua = this.ui.txt_ua.text;
  6926. let up = this.ui.txt_up.text;
  6927. if (ua && up) {
  6928. let reqData = JSON.stringify({
  6929. username: ua.trim(),
  6930. password: up.trim(),
  6931. fromMark: 'app_game'
  6932. });
  6933. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6934. try {
  6935. console.log('zh:res = ' + JSON.stringify(res));
  6936. let code = res.code;
  6937. let msg = res.msg;
  6938. if (code == 200) {
  6939. let keyStr = keyForLoginInfo;
  6940. let jsonStr = {
  6941. "username": res.username,
  6942. "token": res.token,
  6943. "buySpids": { 1: false, 7: false }
  6944. };
  6945. LocalStorageManager.setItem(keyStr, jsonStr);
  6946. let myu = Moyu.getUserInfo();
  6947. console.log('zh:myu = ' + JSON.stringify(myu));
  6948. DataMgr.updateUserNickName(res.username);
  6949. Moyu.updateUserInfo(res.username);
  6950. xGame.uiMgr.Show(UIMsg, msg);
  6951. DataMgr.loadUserSpOrderForAd();
  6952. DataMgr.getUserZiChanInfo();
  6953. xGame.eventMgr.event(LOGIN_IN);
  6954. this.closeSelf();
  6955. }
  6956. else {
  6957. xGame.uiMgr.Show(UIMsg, msg);
  6958. }
  6959. }
  6960. catch (error) {
  6961. console.log('error=' + error);
  6962. alert(error);
  6963. }
  6964. finally {
  6965. }
  6966. });
  6967. }
  6968. else {
  6969. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6970. }
  6971. }
  6972. gotoRegPage() {
  6973. this.closeSelf();
  6974. xGame.uiMgr.Show(UIReg);
  6975. }
  6976. }
  6977. UILogin.uiName = "UILogin";
  6978. class UIReg extends UIBase {
  6979. constructor() {
  6980. super();
  6981. }
  6982. onConstructor() {
  6983. this.ui = ui_UIReg.createInstance();
  6984. this.contentPane = this.ui;
  6985. this.isEject = false;
  6986. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6987. this.addUIClick(this.ui.btn_reg, this.regUser);
  6988. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6989. }
  6990. show() {
  6991. super.show();
  6992. this.x = (Laya.stage.width - this.width) / 2;
  6993. this.y = (Laya.stage.height - this.height) / 2;
  6994. }
  6995. closeSelf() {
  6996. this.hide();
  6997. }
  6998. regUser() {
  6999. this.ui.lab_tip.visible = false;
  7000. let ua = this.ui.txt_ua.text;
  7001. let up1 = this.ui.txt_up1.text;
  7002. let up2 = this.ui.txt_up2.text;
  7003. if (ua && up1 && up2 && up1 == up2) {
  7004. let reqData = JSON.stringify({
  7005. username: ua.trim(),
  7006. password: up1.trim(),
  7007. fromMark: 'app_game'
  7008. });
  7009. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7010. try {
  7011. console.log('zh:res = ' + JSON.stringify(res));
  7012. let code = res.code;
  7013. let msg = res.msg;
  7014. xGame.uiMgr.Show(UIMsg, msg);
  7015. if (code == 200) {
  7016. this.ui.lab_tip.color = "#FFFFFF";
  7017. xGame.uiMgr.Show(UIMsg, msg);
  7018. this.closeSelf();
  7019. }
  7020. else {
  7021. this.ui.lab_tip.color = "#FF0000";
  7022. xGame.uiMgr.Show(UIMsg, msg);
  7023. }
  7024. }
  7025. catch (error) {
  7026. console.log('error=' + error);
  7027. alert(error);
  7028. }
  7029. finally {
  7030. }
  7031. });
  7032. }
  7033. else {
  7034. if (up1 != up2) {
  7035. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7036. }
  7037. else {
  7038. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7039. }
  7040. }
  7041. }
  7042. gotoLogin() {
  7043. this.closeSelf();
  7044. xGame.uiMgr.Show(UILogin);
  7045. }
  7046. }
  7047. UIReg.uiName = "UIReg";
  7048. class ui_UIFuli1 extends fgui.GComponent {
  7049. static createInstance() {
  7050. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  7051. }
  7052. onConstruct() {
  7053. this.n1 = (this.getChild("n1"));
  7054. this.n2 = (this.getChild("n2"));
  7055. }
  7056. }
  7057. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  7058. class UIFuli1 extends UIBase {
  7059. constructor() {
  7060. super();
  7061. }
  7062. onConstructor() {
  7063. this.ui = ui_UIFuli1.createInstance();
  7064. this.contentPane = this.ui;
  7065. this.isEject = false;
  7066. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7067. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7068. }
  7069. show() {
  7070. super.show();
  7071. this.x = (Laya.stage.width - this.width) / 2;
  7072. this.y = (Laya.stage.height - this.height) / 2;
  7073. }
  7074. closeSelf() {
  7075. DataMgr.loadUserSpOrderForAd();
  7076. this.hide();
  7077. }
  7078. gotoBuy() {
  7079. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7080. if (userInfo != null) {
  7081. let token = userInfo.token;
  7082. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  7083. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  7084. return;
  7085. }
  7086. else {
  7087. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7088. }
  7089. }
  7090. gotoBuy2() {
  7091. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7092. if (userInfo == null) {
  7093. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7094. return;
  7095. }
  7096. let reqData = xGame.httpMgr.getReqData();
  7097. let pd = JSON.parse(reqData);
  7098. pd.productId = 1;
  7099. reqData = JSON.stringify(pd);
  7100. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7101. try {
  7102. console.log('zh:buySp res = ' + JSON.stringify(res));
  7103. let code = res.code;
  7104. let msg = res.msg;
  7105. if (code == 401) {
  7106. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7107. alert(TIP_MSG_key.loginTimeOut);
  7108. xGame.uiMgr.Show(UIMsg, msg);
  7109. return;
  7110. }
  7111. if (code == 200) {
  7112. xGame.uiMgr.Show(UIMsg, msg);
  7113. DataMgr.loadUserSpOrderForAd();
  7114. DataMgr.getUserZiChanInfo();
  7115. this.closeSelf();
  7116. }
  7117. else {
  7118. xGame.uiMgr.Show(UIMsg, msg);
  7119. }
  7120. }
  7121. catch (error) {
  7122. console.log('error=' + error);
  7123. alert(error);
  7124. }
  7125. finally {
  7126. }
  7127. });
  7128. }
  7129. }
  7130. UIFuli1.uiName = "UIFuli1";
  7131. class ui_UIFuli2 extends fgui.GComponent {
  7132. static createInstance() {
  7133. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  7134. }
  7135. onConstruct() {
  7136. this.n1 = (this.getChild("n1"));
  7137. this.n0 = (this.getChild("n0"));
  7138. }
  7139. }
  7140. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  7141. class UIFuli2 extends UIBase {
  7142. constructor() {
  7143. super();
  7144. }
  7145. onConstructor() {
  7146. this.ui = ui_UIFuli2.createInstance();
  7147. this.contentPane = this.ui;
  7148. this.isEject = false;
  7149. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  7150. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  7151. }
  7152. show() {
  7153. super.show();
  7154. this.x = (Laya.stage.width - this.width) / 2;
  7155. this.y = (Laya.stage.height - this.height) / 2;
  7156. }
  7157. closeSelf() {
  7158. DataMgr.loadUserSpOrderForAd();
  7159. this.hide();
  7160. }
  7161. gotoBuy() {
  7162. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7163. if (userInfo != null) {
  7164. let token = userInfo.token;
  7165. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  7166. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  7167. return;
  7168. }
  7169. else {
  7170. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7171. }
  7172. }
  7173. gotoBuy1() {
  7174. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7175. if (userInfo == null) {
  7176. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7177. return;
  7178. }
  7179. let reqData = xGame.httpMgr.getReqData();
  7180. let pd = JSON.parse(reqData);
  7181. pd.productId = 2;
  7182. reqData = JSON.stringify(pd);
  7183. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7184. try {
  7185. console.log('zh:buySp res = ' + JSON.stringify(res));
  7186. let code = res.code;
  7187. let msg = res.msg;
  7188. if (code == 401) {
  7189. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7190. alert(TIP_MSG_key.loginTimeOut);
  7191. xGame.uiMgr.Show(UIMsg, msg);
  7192. return;
  7193. }
  7194. if (code == 200) {
  7195. xGame.uiMgr.Show(UIMsg, msg);
  7196. DataMgr.loadUserSpOrderForAd();
  7197. DataMgr.getUserZiChanInfo();
  7198. this.closeSelf();
  7199. }
  7200. else {
  7201. xGame.uiMgr.Show(UIMsg, msg);
  7202. }
  7203. }
  7204. catch (error) {
  7205. console.log('error=' + error);
  7206. alert(error);
  7207. }
  7208. finally {
  7209. }
  7210. });
  7211. }
  7212. }
  7213. UIFuli2.uiName = "UIFuli2";
  7214. class ui_UIGetAward extends fgui.GComponent {
  7215. static createInstance() {
  7216. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7217. }
  7218. onConstruct() {
  7219. this.n4 = (this.getChild("n4"));
  7220. this.n0 = (this.getChild("n0"));
  7221. this.myList = (this.getChild("myList"));
  7222. this.n1 = (this.getChild("n1"));
  7223. this.eftNode = (this.getChild("eftNode"));
  7224. this.btnNode = (this.getChild("btnNode"));
  7225. this.t0 = this.getTransition("t0");
  7226. }
  7227. }
  7228. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7229. class UIGetAward extends UIBase {
  7230. constructor() {
  7231. super();
  7232. this.showTriple = true;
  7233. }
  7234. onConstructor() {
  7235. this.ui = ui_UIGetAward.createInstance();
  7236. this.contentPane = this.ui;
  7237. this.isEject = false;
  7238. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7239. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7240. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7241. }
  7242. show(arr, showTriple, callback) {
  7243. super.show();
  7244. this.ui.t0.play();
  7245. this.ui.eftNode.visible = true;
  7246. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7247. this.ui.eftNode.visible = false;
  7248. }), 1, 0, 0, 0.9);
  7249. this.awardArr = arr;
  7250. this.showTriple = showTriple;
  7251. this.callback = callback;
  7252. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7253. this.ui.myList.numItems = arr.length;
  7254. xGame.soundMgr.playSound("getaward");
  7255. }
  7256. updateSelf(index, obj) {
  7257. let temp = this.awardArr[index];
  7258. let icon = this.getIcon(temp.type);
  7259. let str = icon;
  7260. if (temp.type > 2) {
  7261. str = "s" + icon;
  7262. }
  7263. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7264. obj.myIcon.rotation = 0;
  7265. obj.numTxt.text = temp.num + "";
  7266. obj.numTxt.visible = temp.type > 2 ? false : true;
  7267. obj.nameTxt.text = this.getNameStr(temp.type);
  7268. }
  7269. renderItem(index, obj) {
  7270. this.updateSelf(index, obj);
  7271. }
  7272. tripleGetAward() {
  7273. console.log('zh:qjff_AD_for_uigetAward');
  7274. if (Laya.Browser.onAndroid) {
  7275. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7276. if (!boo) {
  7277. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7278. return;
  7279. }
  7280. }
  7281. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7282. }
  7283. else {
  7284. console.log('zh:AD 失败,直接发放奖励');
  7285. this.qjff_AD_for_uigetAward();
  7286. }
  7287. }
  7288. qjff_AD_for_uigetAward() {
  7289. this.getAward(3);
  7290. }
  7291. normalGetAward() {
  7292. if (PlatMgr.isMisVideo())
  7293. this.tripleGetAward();
  7294. else
  7295. this.getAward();
  7296. }
  7297. getAward(times = 1) {
  7298. this.hide();
  7299. for (let index = 0; index < this.awardArr.length; index++) {
  7300. this.awardArr[index].num *= times;
  7301. }
  7302. this.callback && this.callback(times != 1);
  7303. }
  7304. getIcon(type) {
  7305. switch (type) {
  7306. case Prop.diamond:
  7307. return "ty_zs";
  7308. case Prop.coin:
  7309. return "ty_jb";
  7310. case Prop.gan1:
  7311. return "qg1";
  7312. case Prop.gan2:
  7313. return "qg2";
  7314. case Prop.gan3:
  7315. return "qg3";
  7316. case Prop.gan4:
  7317. return "qg4";
  7318. default:
  7319. break;
  7320. }
  7321. }
  7322. getNameStr(type) {
  7323. switch (type) {
  7324. case Prop.diamond:
  7325. return "Diamond";
  7326. case Prop.coin:
  7327. return "Coins";
  7328. case Prop.gan1:
  7329. case Prop.gan2:
  7330. case Prop.gan3:
  7331. case Prop.gan4:
  7332. return cfgTable.ballrodData[type - 1].name;
  7333. default:
  7334. break;
  7335. }
  7336. }
  7337. }
  7338. UIGetAward.uiName = "UIGetAward";
  7339. class ui_UIRepentProp extends fgui.GComponent {
  7340. static createInstance() {
  7341. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7342. }
  7343. onConstruct() {
  7344. this.c1 = this.getController("c1");
  7345. this.n11 = (this.getChild("n11"));
  7346. this.regretNode = (this.getChild("regretNode"));
  7347. this.helpLineNode = (this.getChild("helpLineNode"));
  7348. this.t0 = this.getTransition("t0");
  7349. }
  7350. }
  7351. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7352. class UIRepentProp extends UIBase {
  7353. constructor() {
  7354. super();
  7355. this.viewType = 0;
  7356. this.regretType = 0;
  7357. }
  7358. onConstructor() {
  7359. this.ui = ui_UIRepentProp.createInstance();
  7360. this.contentPane = this.ui;
  7361. this.isEject = false;
  7362. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7363. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7364. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7365. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7366. }
  7367. show(viewType, regretType, callback) {
  7368. PlatMgr.showInsert(true);
  7369. this.viewType = viewType;
  7370. this.regretType = regretType;
  7371. this.callback = callback;
  7372. super.show();
  7373. this.ui.t0.play();
  7374. this.ui.c1.selectedIndex = this.viewType;
  7375. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7376. if (this.viewType == 0) {
  7377. let guide = DataMgr.getGuideHelpLine();
  7378. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7379. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7380. }
  7381. xGame.common.gameMgr.gamePause = true;
  7382. }
  7383. hideSelf() {
  7384. xGame.common.gameMgr.gamePause = false;
  7385. this.callback && this.callback(false);
  7386. this.hide();
  7387. }
  7388. videoRegret() {
  7389. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7390. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7391. }
  7392. else {
  7393. console.log('zh:AD 失败,直接发放奖励');
  7394. this.qjff_AD_for_UIrepentProp_videoRegret();
  7395. }
  7396. }
  7397. qjff_AD_for_UIrepentProp_videoRegret() {
  7398. this.callback && this.callback(true);
  7399. this.hideSelf();
  7400. }
  7401. videoAddHelpLine() {
  7402. let guide = DataMgr.getGuideHelpLine();
  7403. if (guide == 0) {
  7404. this.callback && this.callback(true);
  7405. this.hideSelf();
  7406. DataMgr.setGuideHelpLine();
  7407. xGame.common.gameUI.ui.guideNode.visible = false;
  7408. }
  7409. else {
  7410. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7411. if (Laya.Browser.onAndroid) {
  7412. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7413. if (!boo) {
  7414. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7415. return;
  7416. }
  7417. }
  7418. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7419. }
  7420. else {
  7421. console.log('zh:AD 失败,直接发放奖励');
  7422. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7423. }
  7424. }
  7425. }
  7426. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7427. this.callback && this.callback(true);
  7428. this.hideSelf();
  7429. }
  7430. }
  7431. UIRepentProp.uiName = "UIRepentProp";
  7432. class UIMain extends UIBase {
  7433. constructor() {
  7434. super();
  7435. this.firstEnter = true;
  7436. }
  7437. nativeCallJs(msg) {
  7438. let t = msg;
  7439. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7440. switch (t) {
  7441. case 'qjff_chouJiang':
  7442. let dui = xGame.uiMgr.getUI(UIDraw);
  7443. dui.qjff_chouJiang();
  7444. break;
  7445. case 'qjff_AD_for_uisign':
  7446. let dui2 = xGame.uiMgr.getUI(UISign);
  7447. dui2.qjff_AD_for_uisign();
  7448. break;
  7449. case 'qjff_AD_for_uitry':
  7450. let dui3 = xGame.uiMgr.getUI(UITry);
  7451. dui3.qjff_AD_for_uitry();
  7452. break;
  7453. case 'qjff_AD_for_uipower':
  7454. let dui4 = xGame.uiMgr.getUI(UIPower);
  7455. dui4.qjff_AD_for_uipower();
  7456. break;
  7457. case 'qjff_AD_for_uigetAward':
  7458. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7459. dui5.qjff_AD_for_uigetAward();
  7460. break;
  7461. case 'qjff_AD_for_uiGameEnd':
  7462. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7463. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7464. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7465. break;
  7466. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7467. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7468. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7469. break;
  7470. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7471. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7472. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7473. break;
  7474. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7475. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7476. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7477. break;
  7478. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7479. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7480. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7481. break;
  7482. case 'qjff_AD_for_UIBOX_onOpenBox':
  7483. let dui11 = xGame.uiMgr.getUI(UIBox);
  7484. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7485. break;
  7486. case 'qjff_AD_for_UIAddCoin':
  7487. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7488. dui12.qjff_AD_for_UIAddCoin();
  7489. break;
  7490. case '111a':
  7491. let dui14 = xGame.uiMgr.getUI(UISign);
  7492. dui14.qjff_AD_for_uisign();
  7493. break;
  7494. case '222a':
  7495. let dui15 = xGame.uiMgr.getUI(UISign);
  7496. dui15.qjff_AD_for_uisign();
  7497. break;
  7498. case '333a':
  7499. let dui16 = xGame.uiMgr.getUI(UISign);
  7500. dui16.qjff_AD_for_uisign();
  7501. break;
  7502. default:
  7503. console.log('zh:未知的方法名字' + t);
  7504. break;
  7505. }
  7506. }
  7507. onConstructor() {
  7508. console.log('zh: UIMain onConstructor');
  7509. this.ui = ui_UIMain.createInstance();
  7510. this.contentPane = this.ui;
  7511. this.isEject = false;
  7512. this.addEvent();
  7513. this.addClickSpine();
  7514. this.settingNode = new SettingNode(this.ui.settingNode);
  7515. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7516. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7517. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7518. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7519. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7520. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7521. let curUse = DataMgr.getCurSecretary();
  7522. this.changeSecretary(curUse);
  7523. this.ui.talkNode.visible = false;
  7524. let guide = DataMgr.getSkillGuide();
  7525. if (xGame.common.isNewDay && guide == 1) {
  7526. xGame.common.isNewDay = false;
  7527. xGame.soundMgr.playSound("s_main01");
  7528. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7529. console.log("zh:播放小秘书每天语音");
  7530. }
  7531. this.onGetUserInfo();
  7532. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7533. DataMgr.getUserZiChanInfo();
  7534. }
  7535. this.ui.n83.visible = false;
  7536. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7537. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7538. let ua = d.username;
  7539. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7540. }
  7541. this.c_btn_for_user();
  7542. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7543. }
  7544. Logout() {
  7545. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7546. LocalStorageManager.removeItem(keyForLoginInfo);
  7547. this.freshUser();
  7548. }
  7549. JSBridgeUtils.instance.loginOutForApp();
  7550. this.setUserDefaultNickname();
  7551. DataMgr.setCoin2(4000);
  7552. DataMgr.setDiamond2(0);
  7553. this.setDefaultQiuGanInfo();
  7554. DataMgr.setPlaceBallLevelList("");
  7555. }
  7556. setDefaultQiuGanInfo() {
  7557. DataMgr.setBallRod(0, 1);
  7558. DataMgr.setBallRod(1, 0);
  7559. DataMgr.setBallRod(2, 0);
  7560. DataMgr.setBallRod(3, 0);
  7561. DataMgr.setBallRod(4, 0);
  7562. DataMgr.setBallRod(5, 1);
  7563. }
  7564. setUserDefaultNickname() {
  7565. let defUsername = "player";
  7566. this.ui.headNode.nameTxt.text = defUsername;
  7567. DataMgr.updateUserNickName(defUsername);
  7568. Moyu.updateUserInfo(defUsername);
  7569. }
  7570. gotoLogin() {
  7571. xGame.uiMgr.Show(UILogin);
  7572. }
  7573. gotoRegUser() {
  7574. xGame.uiMgr.Show(UIReg);
  7575. }
  7576. showFuLiSp1() {
  7577. console.log('zh:福利1');
  7578. this.checkForShowFuLi17(1);
  7579. }
  7580. showFuLiSp7() {
  7581. console.log('zh:福利7');
  7582. this.checkForShowFuLi17(7);
  7583. }
  7584. checkForShowFuLi17(spid) {
  7585. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7586. if (userInfo == null) {
  7587. if (spid === 1) {
  7588. xGame.uiMgr.Show(UIFuli1);
  7589. }
  7590. if (spid === 7) {
  7591. xGame.uiMgr.Show(UIFuli2);
  7592. }
  7593. return;
  7594. }
  7595. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  7596. let reqData = xGame.httpMgr.getReqData();
  7597. let pd = JSON.parse(reqData);
  7598. pd.productId = spid;
  7599. reqData = JSON.stringify(pd);
  7600. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  7601. try {
  7602. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  7603. let code = res.code;
  7604. let msg = res.msg;
  7605. if (code == 401) {
  7606. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7607. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7608. return;
  7609. }
  7610. if (code == 200) {
  7611. let isBuyOk = res.data;
  7612. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  7613. if (isBuyOk === false) {
  7614. if (spid === 1) {
  7615. xGame.uiMgr.Show(UIFuli1);
  7616. }
  7617. if (spid === 7) {
  7618. xGame.uiMgr.Show(UIFuli2);
  7619. }
  7620. }
  7621. else {
  7622. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  7623. }
  7624. }
  7625. else {
  7626. xGame.uiMgr.Show(UIMsg, msg);
  7627. }
  7628. }
  7629. catch (error) {
  7630. console.log('error=' + error);
  7631. alert(error);
  7632. }
  7633. finally {
  7634. }
  7635. });
  7636. }
  7637. c_btn_for_user() {
  7638. this.ui.n_Logout.visible = false;
  7639. this.ui.n_dengLu.visible = false;
  7640. this.ui.n_zhuCe.visible = false;
  7641. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7642. this.ui.n_Logout.visible = true;
  7643. }
  7644. else {
  7645. this.ui.n_dengLu.visible = true;
  7646. }
  7647. }
  7648. changeSecretary(curUse) {
  7649. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7650. xGame.common.secretary && xGame.common.secretary.dispose();
  7651. this.addSecretarySpine(name);
  7652. }
  7653. addSecretarySpine(name) {
  7654. let spine = new SpineMgr(name, () => {
  7655. this.playSecretaryIdle();
  7656. });
  7657. xGame.common.secretary = spine;
  7658. }
  7659. addClickSpine() {
  7660. let clickSpine = new SpineMgr("dianji", () => {
  7661. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7662. let parent = Laya.stage;
  7663. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7664. clickSpine.play(data, 0, false, parent, (spine) => {
  7665. spine.destroy(true);
  7666. });
  7667. });
  7668. });
  7669. }
  7670. addEvent() {
  7671. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7672. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7673. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7674. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7675. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7676. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7677. this.addUIClick(this.ui, this.interuptSecretary);
  7678. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7679. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7680. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7681. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7682. this.addUIClick(this.ui.signBtn, this.openSignView);
  7683. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7684. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7685. this.addUIClick(this.ui.n_Logout, this.Logout);
  7686. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7687. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7688. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7689. }
  7690. show(showFailWords) {
  7691. super.show();
  7692. this.moneyNode.ui.c1.selectedIndex = 1;
  7693. this.playSecretaryIdle();
  7694. xGame.soundMgr.playMusic("caromhall01", 0);
  7695. Laya.timer.clearAll(this);
  7696. this.playSecretaryRandomSound();
  7697. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7698. if (showFailWords) {
  7699. console.log('zh:uimain.ts ');
  7700. setTimeout(() => {
  7701. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7702. let words = -1;
  7703. if (str == "s_main02") {
  7704. words = 2;
  7705. }
  7706. else {
  7707. words = 3;
  7708. }
  7709. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7710. xGame.soundMgr.playSound(str);
  7711. }, 300);
  7712. }
  7713. this.showGuide();
  7714. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7715. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7716. let guide = DataMgr.getSkillGuide();
  7717. if (guide == 1) {
  7718. let randTime = xGame.common.randomNum(300, 800);
  7719. if (this.firstEnter) {
  7720. console.log("zh: firstEnter");
  7721. this.firstEnter = false;
  7722. randTime += 900;
  7723. }
  7724. else {
  7725. console.log("zh: no firstEnter");
  7726. }
  7727. Laya.timer.once(randTime, this, () => {
  7728. });
  7729. Laya.timer.once(1000, this, () => {
  7730. console.log('zh: 1秒后 showFuLiSp1');
  7731. this.showFuLiSp1();
  7732. });
  7733. Laya.timer.once(10000, this, () => {
  7734. console.log('zh: 10秒后 showFuLiSp1');
  7735. this.showFuLiSp7();
  7736. });
  7737. }
  7738. }
  7739. checkActive(show) {
  7740. }
  7741. showGuide() {
  7742. let guide = DataMgr.getSkillGuide();
  7743. this.ui.guideBtn.visible = guide == 0;
  7744. this.ui.enterGuide.visible = false;
  7745. this.ui.secretaryGuide.visible = guide == 0;
  7746. if (guide == 0) {
  7747. console.log("zh:显示引导");
  7748. xGame.soundMgr.playSound("s_guide");
  7749. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7750. }
  7751. else {
  7752. console.log("zh:不需要显示引导");
  7753. }
  7754. }
  7755. ensureSecretary() {
  7756. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7757. this.ui.secretaryGuide.visible = false;
  7758. this.ui.enterGuide.visible = true;
  7759. this.ui.wordsNode.t0.play();
  7760. if (DataMgr.getNewUser())
  7761. Moyu.sendDataEvent("gameReady");
  7762. }
  7763. playSecretaryIdle() {
  7764. let parent = this.ui.secretary.displayObject;
  7765. parent.destroyChildren();
  7766. let xx = this.ui.secretary.width / 2;
  7767. let yy = this.ui.secretary.height;
  7768. let scale = xGame.common.getSecretaryScale();
  7769. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7770. xGame.common.secretary.play(data, 0, true, parent);
  7771. }
  7772. startGame(type) {
  7773. if (!this.isReadyForLoadNetSource()) {
  7774. return;
  7775. }
  7776. xGame.common.gameMode = type;
  7777. Moyu.sendDataEvent("PlayGame", { type: type });
  7778. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7779. switch (xGame.common.gameMode) {
  7780. case GameMode.classic:
  7781. console.log('zh:进入经典模式111111111');
  7782. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7783. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7784. console.log('zh:classic db_over_lev=', db_over_lev);
  7785. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7786. console.log('zh:判断是否可以玩该模式classic =NO');
  7787. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7788. xGame.uiMgr.Show(UIMsg, tipStr);
  7789. return;
  7790. }
  7791. else {
  7792. console.log('zh:可以玩该模式classic 66666666666666');
  7793. this.beginGame();
  7794. }
  7795. }
  7796. else {
  7797. console.log('zh:不需要判断是否可以玩该classic');
  7798. let challengeTimes = DataMgr.getChallengeTimes();
  7799. if (challengeTimes == 0) {
  7800. xGame.uiMgr.Show(UIInvitation);
  7801. }
  7802. else {
  7803. this.beginGame();
  7804. }
  7805. break;
  7806. }
  7807. case GameMode.bigMove:
  7808. console.error('zh:bigMove check');
  7809. let guide = DataMgr.getSkillGuide();
  7810. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7811. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7812. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7813. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7814. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7815. xGame.uiMgr.Show(UIMsg, tipStr);
  7816. return;
  7817. }
  7818. else {
  7819. console.log('zh:可以玩该模式 bigMove');
  7820. this.beginGame();
  7821. if (DataMgr.getNewUser())
  7822. Moyu.sendDataEvent("gameStart0");
  7823. }
  7824. }
  7825. else {
  7826. this.beginGame();
  7827. if (DataMgr.getNewUser())
  7828. Moyu.sendDataEvent("gameStart0");
  7829. }
  7830. break;
  7831. default:
  7832. console.error('zh:未知错误!!!!');
  7833. break;
  7834. }
  7835. }
  7836. beginGame(isNice = false) {
  7837. console.log('zh:beginGame ');
  7838. let guide = DataMgr.getSkillGuide();
  7839. if (guide == 1) {
  7840. console.log('zh:非新手引导,showInternAd ');
  7841. JSBridgeUtils.instance.showInternAd('beginGame');
  7842. }
  7843. else {
  7844. console.log('zh:新手引导,不显示AD ');
  7845. }
  7846. console.log('zh:beginGame 2 go');
  7847. if (xGame.common.gameMode == GameMode.classic) {
  7848. if (isNice) {
  7849. this.enterClassic();
  7850. }
  7851. else {
  7852. xGame.uiMgr.Show(UIModeSelection, () => {
  7853. console.log('zh:BBBBBBBBBBBBBBB');
  7854. this.enterClassic();
  7855. });
  7856. }
  7857. }
  7858. else if (xGame.common.gameMode == GameMode.bigMove) {
  7859. this.ui.enterGuide.visible = false;
  7860. xGame.uiMgr.Show(UISkill);
  7861. }
  7862. }
  7863. enterClassic() {
  7864. xGame.uiMgr.Show(UIGame);
  7865. xGame.uiMgr.Show(UIMatching, () => {
  7866. if (!this.isHide)
  7867. this.hide();
  7868. xGame.common.gameUI.ui.alpha = 1;
  7869. xGame.common.gameUI.startGame();
  7870. xGame.uiMgr.Hide(UIGameEnd);
  7871. });
  7872. }
  7873. start_debug_for_moni_payOk() {
  7874. console.log('zh:start_debug_for_moni_payOk');
  7875. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7876. if (userInfo != null) {
  7877. let token = userInfo.token;
  7878. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7879. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7880. alert('模拟支付OK');
  7881. return;
  7882. }
  7883. else {
  7884. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7885. }
  7886. }
  7887. startGlobal() {
  7888. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7889. }
  7890. startWeekly() {
  7891. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7892. }
  7893. zhouSaiMonth() {
  7894. console.log('zh: zhouSaiMonth 被调用');
  7895. }
  7896. isReadyForLoadNetSource() {
  7897. let reqCount = xGame.cfgMgr.httpReqCount;
  7898. let ok = xGame.cfgMgr.httpReqOkCount;
  7899. if (reqCount > ok) {
  7900. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7901. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7902. Laya.timer.once(5000, this, () => {
  7903. let retryCount = 0;
  7904. const maxRetries = 3;
  7905. const tryFetchConfig = () => {
  7906. try {
  7907. xGame.cfgMgr.getConfigFromServer();
  7908. }
  7909. catch (error) {
  7910. if (retryCount < maxRetries) {
  7911. retryCount++;
  7912. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7913. Laya.timer.once(5000, this, tryFetchConfig);
  7914. }
  7915. else {
  7916. console.error("❌ 达到最大重试次数,配置获取失败");
  7917. }
  7918. }
  7919. };
  7920. tryFetchConfig();
  7921. });
  7922. return false;
  7923. }
  7924. return true;
  7925. }
  7926. startPlaceBall() {
  7927. if (!this.isReadyForLoadNetSource()) {
  7928. return;
  7929. }
  7930. xGame.uiMgr.Show(UILevelDisplay);
  7931. }
  7932. hide() {
  7933. console.log('zh:uimain hide ...');
  7934. super.hide();
  7935. xGame.common.stopGirlPop(this.ui.talkNode);
  7936. }
  7937. onGetUserInfo(force = false) {
  7938. if (Moyu.isWx) {
  7939. let info = Moyu.getSystemInfo();
  7940. if (info)
  7941. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7942. }
  7943. else {
  7944. Moyu.initUser(this, this.freshUser, force);
  7945. }
  7946. this.freshUser();
  7947. console.log('zh:5秒后更新用戶資產信息');
  7948. setTimeout(() => {
  7949. console.log('setTimeout 5秒over 執行');
  7950. DataMgr.getUserZiChanInfo();
  7951. }, 5000);
  7952. }
  7953. event_login_in() {
  7954. console.log("zh:event_login_in被触发");
  7955. this.freshUser();
  7956. }
  7957. freshUser() {
  7958. let user = Moyu.getUserInfo();
  7959. if (!user.isAuth) {
  7960. user.headIcon = 'res/ty_touxiang.png';
  7961. }
  7962. else {
  7963. DataMgr.upRankData();
  7964. }
  7965. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7966. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7967. let keyStr = keyForLoginInfo;
  7968. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7969. const d = LocalStorageManager.getItem(keyStr);
  7970. let ua = d.username;
  7971. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7972. }
  7973. else {
  7974. }
  7975. this.c_btn_for_user();
  7976. }
  7977. interuptSecretary() {
  7978. Laya.timer.clearAll(this);
  7979. this.playSecretaryRandomSound();
  7980. }
  7981. playSecretaryRandomSound() {
  7982. if (this.isHide)
  7983. return;
  7984. let time = xGame.common.randomNum(45000, 60000);
  7985. Laya.timer.once(time, this, () => {
  7986. if (this.isHide)
  7987. return;
  7988. let index = xGame.common.randomNum(4, 7);
  7989. xGame.soundMgr.playSound("s_main0" + index);
  7990. let words = 1;
  7991. switch (index) {
  7992. case 4:
  7993. words = 5;
  7994. break;
  7995. case 5:
  7996. words = 3;
  7997. break;
  7998. case 6:
  7999. words = 6;
  8000. break;
  8001. case 7:
  8002. words = 7;
  8003. break;
  8004. default:
  8005. break;
  8006. }
  8007. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8008. this.playSecretaryRandomSound();
  8009. });
  8010. }
  8011. openSecretaryView() {
  8012. xGame.uiMgr.Show(UISecretary);
  8013. Moyu.sendDataEvent("secretary");
  8014. }
  8015. openShopView() {
  8016. xGame.uiMgr.Show(UIShop, 0);
  8017. }
  8018. openSignView() {
  8019. xGame.uiMgr.Show(UISign);
  8020. }
  8021. openDrawView() {
  8022. xGame.uiMgr.Show(UIDraw);
  8023. }
  8024. openRanking() {
  8025. console.log('zh:phb openRanking');
  8026. xGame.uiMgr.Show(UIRanking);
  8027. Moyu.sendDataEvent("rankingList");
  8028. }
  8029. }
  8030. UIMain.uiName = "UIMain";
  8031. class UIGameEnd extends UIBase {
  8032. constructor() {
  8033. super();
  8034. this.success = false;
  8035. this.awardCoinNum = 1000;
  8036. this.awardDiamondNum = 10;
  8037. }
  8038. onConstructor() {
  8039. this.ui = ui_UIGameEnd.createInstance();
  8040. this.contentPane = this.ui;
  8041. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8042. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8043. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8044. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8045. this.ui.talkNode.visible = false;
  8046. if (Moyu.isKs)
  8047. this.ui.closeNode.closeBtn.x += 100;
  8048. }
  8049. updateType() {
  8050. switch (xGame.common.gameMode) {
  8051. case GameMode.classic:
  8052. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8053. this.ui.coinNode.visible = this.success;
  8054. if (!this.success) {
  8055. Laya.timer.once(500, this, () => {
  8056. xGame.uiMgr.Show(UIAddCoin);
  8057. });
  8058. }
  8059. else {
  8060. this.logEventForClassic_win();
  8061. }
  8062. this.logEventForClassic_complete();
  8063. this.ui.isGetAward.visible = false;
  8064. this.ui.leftBtn.c1.selectedIndex = 3;
  8065. this.ui.rightBtn.c1.selectedIndex = 0;
  8066. this.moneyNode.ui.c1.selectedIndex = 1;
  8067. break;
  8068. case GameMode.bigMove:
  8069. console.log('zh:招法模式 aaaaaa bigMove');
  8070. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8071. this.ui.coinNode.visible = this.success;
  8072. if (xGame.common.gameMode == GameMode.bigMove) {
  8073. if (this.success) {
  8074. DataMgr.setSkillSuccessTimes(1, true);
  8075. DataMgr.setSkillAccTimes(1);
  8076. }
  8077. else {
  8078. DataMgr.setSkillSuccessTimes(0, false);
  8079. }
  8080. }
  8081. this.logEventForRod_complete_N();
  8082. if (!this.success) {
  8083. Laya.timer.once(500, this, () => {
  8084. xGame.uiMgr.Show(UIAddCoin);
  8085. });
  8086. }
  8087. else {
  8088. this.logEventForRod_win();
  8089. }
  8090. this.ui.isGetAward.visible = false;
  8091. this.ui.leftBtn.c1.selectedIndex = 3;
  8092. this.ui.rightBtn.c1.selectedIndex = 0;
  8093. this.moneyNode.ui.c1.selectedIndex = 1;
  8094. break;
  8095. case GameMode.placeBall:
  8096. this.ui.coinNode.visible = false;
  8097. if (this.success) {
  8098. if (xGame.common.placeBallStarNum == 3) {
  8099. this.ui.c1.selectedIndex = 2;
  8100. }
  8101. else {
  8102. this.ui.c1.selectedIndex = 3;
  8103. }
  8104. let level = xGame.common.placeBallCurLevel;
  8105. if (level > 59) {
  8106. this.logEventForChallenge_level_complete(level);
  8107. }
  8108. else {
  8109. this.logEventForChallenge_level_N(level);
  8110. }
  8111. }
  8112. else {
  8113. this.ui.c1.selectedIndex = 4;
  8114. }
  8115. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8116. if (cfg.type == PlaceBallType.challenge) {
  8117. this.ui.c1.selectedIndex = 2;
  8118. }
  8119. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8120. this.updatePlaceBallBtn();
  8121. this.updatePlaceBallStarNum();
  8122. this.updatePlaceBallAwardState();
  8123. this.moneyNode.ui.c1.selectedIndex = 2;
  8124. this.moneyNode.checkPowerTime();
  8125. this.moneyNode.powerChange();
  8126. DataMgr.upRankData();
  8127. break;
  8128. default:
  8129. break;
  8130. }
  8131. }
  8132. logEventForRod_complete_N() {
  8133. let gfmsIdx = xGame.common.curPlayerSkillType;
  8134. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8135. let gfmc = 'Skyfall Shot';
  8136. if (gfmsIdx == 0) {
  8137. gfmc = 'Skyfall Shot';
  8138. }
  8139. if (gfmsIdx == 1) {
  8140. gfmc = 'Surging break';
  8141. }
  8142. if (gfmsIdx == 2) {
  8143. gfmc = 'Frost Lock';
  8144. }
  8145. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8146. console.log('zh:logEventForRod_complete_N level = ' + level);
  8147. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8148. let jsonStr = {
  8149. "count": 0,
  8150. "name": gfmc
  8151. };
  8152. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8153. const d = LocalStorageManager.getItem(keyStr);
  8154. jsonStr.count = d.count + 1;
  8155. LocalStorageManager.setItem(keyStr, jsonStr);
  8156. }
  8157. else {
  8158. LocalStorageManager.setItem(keyStr, jsonStr);
  8159. }
  8160. const d2 = LocalStorageManager.getItem(keyStr);
  8161. let count = d2.count;
  8162. console.log('zh:logEventForRod_complete_N count = ' + count);
  8163. if (count % 5 == 0) {
  8164. const reqStr = JSON.stringify(jsonStr);
  8165. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8166. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8167. }
  8168. }
  8169. logEventForRod_win() {
  8170. console.log('zh:logEventForRod_win,胜利');
  8171. let gfmsIdx = xGame.common.curPlayerSkillType;
  8172. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8173. let gfmc = 'Skyfall Shot';
  8174. if (gfmsIdx == 0) {
  8175. gfmc = 'Skyfall Shot';
  8176. }
  8177. if (gfmsIdx == 1) {
  8178. gfmc = 'Surging break';
  8179. }
  8180. if (gfmsIdx == 2) {
  8181. gfmc = 'Frost Lock';
  8182. }
  8183. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8184. console.log('zh:logEventForRod_win level = ' + level);
  8185. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8186. let jsonStr = {
  8187. "count": 1,
  8188. "name": gfmc + ' Lev' + level
  8189. };
  8190. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8191. const d = LocalStorageManager.getItem(keyStr);
  8192. jsonStr.count = d.count + 1;
  8193. LocalStorageManager.setItem(keyStr, jsonStr);
  8194. }
  8195. else {
  8196. LocalStorageManager.setItem(keyStr, jsonStr);
  8197. }
  8198. const reqStr = JSON.stringify(jsonStr);
  8199. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8200. }
  8201. logEventForClassic_win() {
  8202. console.log('zh:logEventForClassic_win,胜利');
  8203. let rtype = xGame.common.classicRoomType;
  8204. let msmc = '';
  8205. if (rtype == 1) {
  8206. msmc = 'beginner';
  8207. }
  8208. if (rtype == 2) {
  8209. msmc = 'expert';
  8210. }
  8211. if (rtype == 3) {
  8212. msmc = 'master';
  8213. }
  8214. let keyStr = 'sjmd_classic_win_' + rtype;
  8215. let jsonStr = {
  8216. "difficulty": msmc,
  8217. "classic_count": 1,
  8218. "difficulty_count": 1
  8219. };
  8220. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8221. const d = LocalStorageManager.getItem(keyStr);
  8222. jsonStr.classic_count = d.classic_count + 1;
  8223. jsonStr.difficulty_count = d.difficulty_count + 1;
  8224. LocalStorageManager.setItem(keyStr, jsonStr);
  8225. }
  8226. else {
  8227. LocalStorageManager.setItem(keyStr, jsonStr);
  8228. }
  8229. const reqStr = JSON.stringify(jsonStr);
  8230. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8231. }
  8232. logEventForClassic_complete() {
  8233. console.log('zh:logEventForClassic_complete,胜利');
  8234. let rtype = xGame.common.classicRoomType;
  8235. let msmc = '';
  8236. if (rtype == 1) {
  8237. msmc = 'beginner';
  8238. }
  8239. if (rtype == 2) {
  8240. msmc = 'expert';
  8241. }
  8242. if (rtype == 3) {
  8243. msmc = 'master';
  8244. }
  8245. let keyStr = 'sjmd_classic_complete_' + rtype;
  8246. let jsonStr = {
  8247. "msmc": msmc,
  8248. "count": 0
  8249. };
  8250. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8251. const d = LocalStorageManager.getItem(keyStr);
  8252. jsonStr.count = d.count + 1;
  8253. LocalStorageManager.setItem(keyStr, jsonStr);
  8254. }
  8255. else {
  8256. LocalStorageManager.setItem(keyStr, jsonStr);
  8257. }
  8258. if (jsonStr.count % 5 == 0) {
  8259. const reqStr = JSON.stringify(jsonStr);
  8260. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8261. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8262. }
  8263. }
  8264. updatePlaceBallBtn() {
  8265. this.ui.leftBtn.c1.selectedIndex = 5;
  8266. if (this.success) {
  8267. this.ui.rightBtn.c1.selectedIndex = 14;
  8268. }
  8269. else {
  8270. if (xGame.common.placeBallStarNum == 3) {
  8271. this.ui.rightBtn.c1.selectedIndex = 14;
  8272. }
  8273. else {
  8274. this.ui.rightBtn.c1.selectedIndex = 1;
  8275. }
  8276. }
  8277. }
  8278. updatePlaceBallStarNum() {
  8279. let starNum = xGame.common.placeBallStarNum;
  8280. if (starNum == 0)
  8281. this.ui.starNumNode.c1.selectedIndex = 3;
  8282. else {
  8283. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8284. }
  8285. }
  8286. updatePlaceBallAwardState() {
  8287. let level = xGame.common.placeBallCurLevel;
  8288. let starNum = xGame.common.placeBallStarNum;
  8289. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8290. let data = cfgTable.placeballData[level].award;
  8291. let cfg = cfgTable.placeballData[level];
  8292. this.awardDiamondNum = data[1];
  8293. this.awardCoinNum = data[0];
  8294. if (cfg.type == PlaceBallType.challenge) {
  8295. this.awardDiamondNum = 0;
  8296. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8297. }
  8298. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8299. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8300. if (cfg.type == PlaceBallType.challenge) {
  8301. this.ui.awardNode.coinNode.visible = true;
  8302. }
  8303. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8304. this.ui.awardNode.diamondNode.x = 265;
  8305. this.ui.awardNode.coinNode.x = 354;
  8306. }
  8307. else {
  8308. this.ui.awardNode.diamondNode.x = 291;
  8309. this.ui.awardNode.coinNode.x = 291;
  8310. }
  8311. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8312. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8313. if (this.awardCoinNum == 0) {
  8314. this.ui.awardNode.coinNode.numTxt.text = "";
  8315. }
  8316. if (getAward) {
  8317. this.ui.isGetAward.visible = true;
  8318. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8319. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8320. }
  8321. else {
  8322. this.ui.isGetAward.visible = false;
  8323. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8324. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8325. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8326. }
  8327. else {
  8328. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8329. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8330. }
  8331. }
  8332. }
  8333. show(success) {
  8334. super.show();
  8335. xGame.eventMgr.event(RESET_GAME);
  8336. this.success = success;
  8337. Laya.timer.clearAll(this);
  8338. this.playSecretaryAni();
  8339. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8340. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8341. offsetTime = Math.floor(offsetTime / 1000);
  8342. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8343. this.updateType();
  8344. Laya.timer.once(200, this, () => {
  8345. this.addAward(() => {
  8346. this.updateType();
  8347. Laya.timer.once(500, this, () => {
  8348. this.showChallengeLevel();
  8349. });
  8350. });
  8351. });
  8352. if (this.success) {
  8353. JSBridgeUtils.instance.showInternAd('gameend_success');
  8354. console.log('zh:game end 成功');
  8355. xGame.soundMgr.playSound('slots_roll01');
  8356. xGame.soundMgr.playSound("s_win");
  8357. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8358. this.diyGameDataUtilForGameWin();
  8359. this.updateGamePlaceBallData2Server();
  8360. }
  8361. else {
  8362. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8363. console.log('zh:game end失败');
  8364. xGame.soundMgr.playSound('matchwin01');
  8365. xGame.soundMgr.playSound("s_lose");
  8366. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8367. }
  8368. let challengeNum = DataMgr.getChallengeTimes();
  8369. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8370. DataMgr.setChallengeTimes(1);
  8371. }
  8372. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8373. DataMgr.setClassicTimes();
  8374. }
  8375. }
  8376. diyGameDataUtilForGameWin() {
  8377. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8378. switch (xGame.common.gameMode) {
  8379. case GameMode.classic:
  8380. console.log('zh:DiyGameDataUtilForGameWin 111');
  8381. case GameMode.bigMove:
  8382. console.log('zh:DiyGameDataUtilForGameWin 222');
  8383. this.restartGame();
  8384. break;
  8385. case GameMode.placeBall:
  8386. console.log('zh:DiyGameDataUtilForGameWin 333');
  8387. var level = xGame.common.placeBallCurLevel;
  8388. console.log('zh:练习模式 联系了多少LEV=' + level);
  8389. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8390. if (level > db_over_lev) {
  8391. DataMgr.setChallengeMode_overLev(level);
  8392. }
  8393. break;
  8394. default:
  8395. console.log('zh:DiyGameDataUtilForGameWin 444');
  8396. break;
  8397. }
  8398. }
  8399. updateGamePlaceBallData2Server() {
  8400. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8401. if (userInfo == null) {
  8402. return;
  8403. }
  8404. let pbdObj = DataMgr.getPlaceBallLevelList();
  8405. let reqData = xGame.httpMgr.getReqData();
  8406. let pd = JSON.parse(reqData);
  8407. pd.placeBallData = JSON.stringify(pbdObj);
  8408. reqData = JSON.stringify(pd);
  8409. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8410. try {
  8411. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8412. let code = res.code;
  8413. let msg = res.msg;
  8414. if (code == 401) {
  8415. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  8416. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8417. return;
  8418. }
  8419. if (code == 200) {
  8420. let data = res.data;
  8421. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8422. }
  8423. else {
  8424. xGame.uiMgr.Show(UIMsg, msg);
  8425. }
  8426. }
  8427. catch (error) {
  8428. console.log('error=' + error);
  8429. alert(error);
  8430. }
  8431. finally {
  8432. }
  8433. });
  8434. }
  8435. showChallengeLevel() {
  8436. if (DataMgr.getChallengeTimes() != 0)
  8437. return;
  8438. let skill = DataMgr.getSkillAccTimes();
  8439. let put = DataMgr.getPlaceBallLevelList().length;
  8440. if (skill >= 3 || put >= 5) {
  8441. xGame.uiMgr.Show(UIInvitation);
  8442. this.hide();
  8443. }
  8444. }
  8445. addAward(callback) {
  8446. if (!this.success) {
  8447. callback && callback();
  8448. return;
  8449. }
  8450. switch (xGame.common.gameMode) {
  8451. case GameMode.classic:
  8452. this.awardCoinNum = xGame.common.passAwardCoin;
  8453. this.awardDiamondNum = 0;
  8454. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8455. break;
  8456. case GameMode.bigMove:
  8457. this.awardCoinNum = xGame.common.passAwardCoin;
  8458. this.awardDiamondNum = 0;
  8459. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8460. callback && callback();
  8461. break;
  8462. case GameMode.placeBall:
  8463. let level = xGame.common.placeBallCurLevel;
  8464. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8465. if (xGame.common.placeBallStarNum != 3) {
  8466. callback && callback();
  8467. return;
  8468. }
  8469. else {
  8470. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8471. if (getAward) {
  8472. callback && callback();
  8473. return;
  8474. }
  8475. }
  8476. let cfg = cfgTable.placeballData[level];
  8477. let data = cfgTable.placeballData[level].award;
  8478. this.awardCoinNum = data[0];
  8479. this.awardDiamondNum = data[1];
  8480. if (cfg.type == PlaceBallType.challenge) {
  8481. this.awardDiamondNum = 0;
  8482. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8483. }
  8484. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8485. let diamondAward;
  8486. if (this.awardDiamondNum > 0) {
  8487. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8488. xGame.common.getAward([diamondAward, coinAward], callback);
  8489. }
  8490. else {
  8491. xGame.common.getAward([coinAward], callback);
  8492. }
  8493. if (cfg.type == PlaceBallType.normal) {
  8494. DataMgr.setPlaceBallAward(level);
  8495. }
  8496. break;
  8497. default:
  8498. break;
  8499. }
  8500. }
  8501. playSecretaryAni_old() {
  8502. let parent = this.ui.secretary.displayObject;
  8503. parent.destroyChildren();
  8504. let xx = this.ui.secretary.width / 2;
  8505. let yy = this.ui.secretary.height;
  8506. let scale = xGame.common.getSecretaryScale();
  8507. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8508. if (this.success) {
  8509. let rand = Math.random() <= 0.5 ? 2 : 3;
  8510. xGame.common.secretary.play(data, rand, false, parent, () => {
  8511. xGame.common.secretary.play(data, 1, true, parent);
  8512. });
  8513. }
  8514. else {
  8515. xGame.common.secretary.play(data, 0, true, parent);
  8516. }
  8517. }
  8518. playSecretaryAni() {
  8519. let parent = this.ui.secretary.displayObject;
  8520. parent.destroyChildren();
  8521. let xx = this.ui.secretary.width / 2;
  8522. let yy = this.ui.secretary.height;
  8523. let scale = xGame.common.getSecretaryScale();
  8524. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8525. if (this.success) {
  8526. let rand = 0;
  8527. xGame.common.secretary.play(data, 0, true, parent);
  8528. }
  8529. else {
  8530. xGame.common.secretary.play(data, 0, true, parent);
  8531. }
  8532. }
  8533. restartGame() {
  8534. switch (xGame.common.gameMode) {
  8535. case GameMode.classic:
  8536. xGame.eventMgr.event(RESTART_GAME);
  8537. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8538. break;
  8539. case GameMode.bigMove:
  8540. this.hide();
  8541. xGame.eventMgr.event(RESTART_GAME);
  8542. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8543. break;
  8544. default:
  8545. break;
  8546. }
  8547. }
  8548. hide() {
  8549. super.hide();
  8550. xGame.common.stopGirlPop(this.ui.talkNode);
  8551. PlatMgr.showBanner(false);
  8552. }
  8553. returnHome() {
  8554. this.hide();
  8555. let showFailWords = !this.success;
  8556. xGame.uiMgr.Show(UIMain, showFailWords);
  8557. }
  8558. clickLeftBtn() {
  8559. switch (xGame.common.gameMode) {
  8560. case GameMode.classic:
  8561. case GameMode.bigMove:
  8562. this.returnHome();
  8563. break;
  8564. case GameMode.placeBall:
  8565. let level = xGame.common.placeBallCurLevel;
  8566. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8567. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8568. break;
  8569. default:
  8570. break;
  8571. }
  8572. }
  8573. powerStartPlaceBallLevel(level, btn) {
  8574. if (DataMgr.powerEnough()) {
  8575. btn.touchable = false;
  8576. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8577. btn.touchable = true;
  8578. DataMgr.setPower(-1);
  8579. xGame.eventMgr.event(POWER_TIME);
  8580. this.startPlaceBallLevel(level);
  8581. this.logEventForChallenge_level_start(level);
  8582. }));
  8583. }
  8584. else {
  8585. xGame.uiMgr.Show(UIPower, 0);
  8586. }
  8587. }
  8588. clickRightBtn() {
  8589. switch (xGame.common.gameMode) {
  8590. case GameMode.classic:
  8591. console.log('zh:clickRightBtn 111');
  8592. case GameMode.bigMove:
  8593. console.log('zh:clickRightBtn 222');
  8594. this.restartGame();
  8595. break;
  8596. case GameMode.placeBall:
  8597. console.log('zh:clickRightBtn 333');
  8598. let level = xGame.common.placeBallCurLevel;
  8599. let data = DataMgr.getPlaceBallLevel(level);
  8600. let curPss = data.play && !data.isCur;
  8601. if (curPss) {
  8602. console.log('zh:clickRightBtn 333-111');
  8603. console.log('zh:当前LV=' + level);
  8604. if (level == 60) {
  8605. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8606. Laya.timer.once(3000, this, () => {
  8607. this.returnHome();
  8608. });
  8609. }
  8610. else {
  8611. let lev = level + 1;
  8612. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8613. }
  8614. }
  8615. else {
  8616. console.log('zh:clickRightBtn 333-000');
  8617. Moyu.sendDataEvent("placeBallNextLevel");
  8618. console.log('zh:qjff_AD_for_uiGameEnd');
  8619. if (Laya.Browser.onAndroid) {
  8620. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8621. if (!boo) {
  8622. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8623. return;
  8624. }
  8625. }
  8626. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8627. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8628. }
  8629. else {
  8630. console.log('zh:AD 失败,直接发放奖励');
  8631. this.qjff_AD_for_uiGameEnd(level);
  8632. }
  8633. }
  8634. break;
  8635. default:
  8636. console.log('zh:clickRightBtn 444');
  8637. break;
  8638. }
  8639. }
  8640. logEventForChallenge_level_start(level) {
  8641. let keyStr = 'sjmd_challenge_level_start';
  8642. let jsonStr = {
  8643. "count": 0,
  8644. "gold_balance ": DataMgr.getCoin(),
  8645. "level": level,
  8646. "diamond_balance ": DataMgr.getDiamond()
  8647. };
  8648. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8649. const d = LocalStorageManager.getItem(keyStr);
  8650. if (level > d.level) {
  8651. jsonStr.count = d.count + 1;
  8652. LocalStorageManager.setItem(keyStr, jsonStr);
  8653. }
  8654. else {
  8655. }
  8656. }
  8657. else {
  8658. LocalStorageManager.setItem(keyStr, jsonStr);
  8659. }
  8660. const reqStr = JSON.stringify(jsonStr);
  8661. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8662. }
  8663. qjff_AD_for_uiGameEnd(level) {
  8664. DataMgr.setPlaceBallLevel(level, 1);
  8665. this.startPlaceBallLevel(level + 1);
  8666. }
  8667. startPlaceBallLevel(level) {
  8668. xGame.common.gameMode = GameMode.placeBall;
  8669. xGame.common.placeBallCurLevel = level;
  8670. xGame.uiMgr.Show(UIGame);
  8671. this.hide();
  8672. }
  8673. logEventForChallenge_level_complete(level) {
  8674. let keyStr = 'sjmd_challenge_level_complete';
  8675. let jsonStr = {
  8676. "count": 1,
  8677. "gold_balance ": DataMgr.getCoin(),
  8678. "level": level,
  8679. "diamond_balance ": DataMgr.getDiamond()
  8680. };
  8681. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8682. const d = LocalStorageManager.getItem(keyStr);
  8683. jsonStr.count = d.count + 1;
  8684. LocalStorageManager.setItem(keyStr, jsonStr);
  8685. }
  8686. else {
  8687. LocalStorageManager.setItem(keyStr, jsonStr);
  8688. }
  8689. const reqStr = JSON.stringify(jsonStr);
  8690. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8691. }
  8692. logEventForChallenge_level_N(level) {
  8693. console.log('zh:logEventForChallenge_level_N ' + level);
  8694. let keyStr = 'sjmd_challenge_level_N';
  8695. if (LocalStorageManager.hasKey(keyStr)) {
  8696. let lev = LocalStorageManager.getItem(keyStr);
  8697. if (level > lev) {
  8698. LocalStorageManager.setItem(keyStr, level);
  8699. }
  8700. if ((level) % 5 == 0) {
  8701. console.log('zh:每5关上报1次');
  8702. let sjmc = 'challenge_level_' + level;
  8703. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8704. let sjmcForFirebase = 'challenge_level_' + level;
  8705. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8706. }
  8707. else {
  8708. console.log('zh:5 no 上报');
  8709. }
  8710. }
  8711. else {
  8712. LocalStorageManager.setItem(keyStr, level);
  8713. }
  8714. }
  8715. }
  8716. UIGameEnd.uiName = "UIGameEnd";
  8717. class ui_UIVideoShare extends fgui.GComponent {
  8718. static createInstance() {
  8719. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8720. }
  8721. onConstruct() {
  8722. this.n10 = (this.getChild("n10"));
  8723. this.myNode = (this.getChild("myNode"));
  8724. this.t0 = this.getTransition("t0");
  8725. }
  8726. }
  8727. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8728. class UIVideoShare extends UIBase {
  8729. constructor() {
  8730. super();
  8731. this.success = false;
  8732. this.awardNum = 0;
  8733. this.isShared = true;
  8734. }
  8735. onConstructor() {
  8736. this.ui = ui_UIVideoShare.createInstance();
  8737. this.contentPane = this.ui;
  8738. this.isEject = false;
  8739. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8740. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8741. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8742. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8743. }
  8744. show(success) {
  8745. super.show();
  8746. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8747. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8748. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8749. this.success = success;
  8750. let time = xGame.common.randomNum(600, 1500);
  8751. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8752. if (success)
  8753. xGame.soundMgr.playSound("applause");
  8754. this.ui.t0.play();
  8755. this.checkShareState();
  8756. let times = DataMgr.getDailyVideoShareTimes();
  8757. this.awardNum = times == 0 ? 2000 : 200;
  8758. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8759. }
  8760. checkShareState() {
  8761. if (PlatMgr.forceShare == 0) {
  8762. this.ui.myNode.closeBtn.visible = true;
  8763. this.ui.myNode.tipsNode.visible = false;
  8764. this.ui.myNode.closeBtn.x = 90;
  8765. this.ui.myNode.shareBtn.x = 342;
  8766. }
  8767. else if (PlatMgr.forceShare == 1) {
  8768. this.ui.myNode.closeBtn.visible = false;
  8769. this.ui.myNode.tipsNode.visible = true;
  8770. this.ui.myNode.shareBtn.x = 218;
  8771. this.isShared = true;
  8772. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8773. }
  8774. }
  8775. checkForceShare() {
  8776. this.isShared = !this.isShared;
  8777. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8778. }
  8779. videoShare() {
  8780. if (PlatMgr.forceShare == 1) {
  8781. if (this.isShared) {
  8782. this.shareGame();
  8783. }
  8784. else {
  8785. this.hideSelf();
  8786. }
  8787. }
  8788. else {
  8789. this.shareGame();
  8790. }
  8791. }
  8792. shareGame() {
  8793. Moyu.sendDataEvent("VideoShare");
  8794. if (Moyu.canShare() > 100) {
  8795. Moyu.shareGame((success) => {
  8796. if (success) {
  8797. DataMgr.setDailyVideoShareTimes(1);
  8798. DataMgr.setCoin(this.awardNum);
  8799. }
  8800. this.hideSelf();
  8801. }, this);
  8802. }
  8803. else {
  8804. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8805. this.hideSelf();
  8806. }
  8807. }
  8808. hideSelf() {
  8809. this.hide();
  8810. xGame.uiMgr.Show(UIGameEnd, this.success);
  8811. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8812. xGame.common.screenImg.destroy();
  8813. xGame.common.screenImg = null;
  8814. }
  8815. }
  8816. }
  8817. UIVideoShare.uiName = "UIVideoShare";
  8818. class ui_UITips extends fgui.GComponent {
  8819. static createInstance() {
  8820. return (fgui.UIPackage.createObject("game", "UITips"));
  8821. }
  8822. onConstruct() {
  8823. this.n0 = (this.getChild("n0"));
  8824. this.myNode = (this.getChild("myNode"));
  8825. this.t0 = this.getTransition("t0");
  8826. }
  8827. }
  8828. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8829. class UITips extends UIBase {
  8830. constructor() {
  8831. super();
  8832. this.type = 0;
  8833. }
  8834. onConstructor() {
  8835. this.ui = ui_UITips.createInstance();
  8836. this.contentPane = this.ui;
  8837. this.isEject = false;
  8838. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8839. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8840. }
  8841. show(tipsTxt, womanTxt, type) {
  8842. super.show();
  8843. this.ui.t0.play();
  8844. this.ui.myNode.tipsTxt.text = tipsTxt;
  8845. this.ui.myNode.womanTxt.text = womanTxt;
  8846. PlatMgr.showInsert(true);
  8847. this.ui.myNode.c1.selectedIndex = type;
  8848. this.type = type;
  8849. switch (this.type) {
  8850. case TipsType.exitGame:
  8851. xGame.common.gameMgr.gamePause = true;
  8852. break;
  8853. case TipsType.foul:
  8854. Laya.timer.once(200, this, () => {
  8855. xGame.common.gameMgr.gamePause = true;
  8856. });
  8857. break;
  8858. default:
  8859. break;
  8860. }
  8861. }
  8862. clickLeftBtn() {
  8863. this.hide();
  8864. xGame.common.gameMgr.gamePause = false;
  8865. switch (this.type) {
  8866. case TipsType.exitGame:
  8867. break;
  8868. case TipsType.foul:
  8869. break;
  8870. default:
  8871. break;
  8872. }
  8873. }
  8874. clickRightBtn() {
  8875. this.hide();
  8876. switch (this.type) {
  8877. case TipsType.exitGame:
  8878. xGame.eventMgr.event(RESET_GAME);
  8879. xGame.uiMgr.Show(UIMain);
  8880. Moyu.recordEnd(this, null);
  8881. xGame.common.longHelpLine = false;
  8882. break;
  8883. case TipsType.foul:
  8884. xGame.common.gameMgr.gamePause = false;
  8885. Laya.timer.clearAll(this);
  8886. break;
  8887. default:
  8888. break;
  8889. }
  8890. }
  8891. }
  8892. UITips.uiName = "UITips";
  8893. class GameMgr {
  8894. constructor() {
  8895. this.selfCamp = "";
  8896. this.selfFoulNum = 0;
  8897. this.selfBallArr = [];
  8898. this.selfTimer = 0;
  8899. this.selfScore = 0;
  8900. this.aiCamp = "";
  8901. this.aiFoulNum = 0;
  8902. this.aiBallArr = [];
  8903. this.aiTimer = 0;
  8904. this.aiScore = 0;
  8905. this.aiSkillLevelNum = 1;
  8906. this.targertScore = 0;
  8907. this.setTime = 30;
  8908. this.selfTurnRate = 0.5;
  8909. this.accTime = 0;
  8910. this.curFoul = "";
  8911. this.maxFoulTimes = 3;
  8912. this.isFirstInGame = true;
  8913. this.firstColliObj = null;
  8914. this.inHoleBalls = [];
  8915. this.blackNum = 8;
  8916. this.success = false;
  8917. this.holePosList = [];
  8918. this.posObj = {};
  8919. this._selfTurn = false;
  8920. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8921. this.ensureBallType = false;
  8922. this.isOpenBall = true;
  8923. this.finishOneShoot = true;
  8924. this.isEnd = false;
  8925. this.isChangeTurn = false;
  8926. this.isInterrupt = false;
  8927. this.aiPlayedBreakArmy = false;
  8928. this.isTouchedBall = false;
  8929. this.finishBalls = 0;
  8930. this.needBalls = 0;
  8931. this.allBallNum = 0;
  8932. this.placeBallPosData = {};
  8933. this.curHP = 0;
  8934. this.showLongView = false;
  8935. this.firstShoot = true;
  8936. this._gamePause = false;
  8937. this.trunCount = 0;
  8938. this.isBlackInHole = false;
  8939. this.isEnter = true;
  8940. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8941. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8942. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8943. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8944. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8945. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8946. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8947. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8948. }
  8949. get gamePause() {
  8950. return this._gamePause;
  8951. }
  8952. set gamePause(v) {
  8953. if (v) {
  8954. Laya.physicsTimer.pause();
  8955. }
  8956. else {
  8957. Laya.physicsTimer.resume();
  8958. }
  8959. this._gamePause = v;
  8960. }
  8961. get selfTurn() {
  8962. return this._selfTurn;
  8963. }
  8964. set selfTurn(val) {
  8965. this.trunCount++;
  8966. this._selfTurn = val;
  8967. if (val) {
  8968. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8969. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8970. }
  8971. else {
  8972. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8973. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8974. if (this.trunCount > 1)
  8975. PlatMgr.openBox();
  8976. }
  8977. }
  8978. resetGame() {
  8979. this.inHoleBalls = [];
  8980. this.isFirstInGame = true;
  8981. this.firstColliObj = null;
  8982. this.aiCamp = "";
  8983. this.selfCamp = "";
  8984. this.aiFoulNum = 0;
  8985. this.selfFoulNum = 0;
  8986. this.selfBallArr = [];
  8987. this.aiBallArr = [];
  8988. this.gamePause = false;
  8989. this.ensureBallType = false;
  8990. this.isInterrupt = false;
  8991. this.updateLeftBall();
  8992. this.clearTime();
  8993. this.aiPlayedBreakArmy = false;
  8994. this.isBlackInHole = false;
  8995. this.placeBallPosData = {};
  8996. if (xGame.common.d3World.knifeRoot) {
  8997. xGame.common.d3World.knifeRoot.destroyChildren();
  8998. }
  8999. }
  9000. gameReady() {
  9001. this.trunCount = 0;
  9002. this.firstColliObj = null;
  9003. this.isFirstInGame = true;
  9004. this.selfTurn = Math.random() <= this.selfTurnRate;
  9005. let challengeNum = DataMgr.getChallengeTimes();
  9006. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9007. this.selfTurn = true;
  9008. }
  9009. if (xGame.common.gameMode == GameMode.placeBall)
  9010. this.selfTurn = true;
  9011. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  9012. this.selfTurn = true;
  9013. }
  9014. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  9015. this.checkGuide();
  9016. if (xGame.common.uiRodMethod)
  9017. xGame.common.uiRodMethod.resetRod();
  9018. xGame.common.d2World.getHelpLine();
  9019. this.isOpenBall = true;
  9020. this.isTouchedBall = false;
  9021. xGame.common.aiPlayer.stopRun();
  9022. this.setTime = 30;
  9023. let ui = xGame.common.gameUI.ui;
  9024. switch (xGame.common.gameMode) {
  9025. case GameMode.classic:
  9026. xGame.common.aiPlayer.init();
  9027. this.blackNum = 8;
  9028. this.placeRootBall();
  9029. this.peoplePlay(9, 10);
  9030. ui.wordsBtn.visible = true;
  9031. ui.aiWordsBtn.visible = true;
  9032. xGame.common.talkMgr.changeAIState(true);
  9033. DataMgr.gameData.gameCount++;
  9034. DataMgr.saveGameData();
  9035. break;
  9036. case GameMode.bigMove:
  9037. this.blackNum = -1;
  9038. this.selfScore = 0;
  9039. this.aiScore = 0;
  9040. xGame.common.aiPlayer.init();
  9041. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9042. this.updateSelfScore();
  9043. this.updateAIScore();
  9044. this.updateTargetSroce();
  9045. this.placeRootBall();
  9046. this.peoplePlay(9, 10);
  9047. ui.wordsBtn.visible = true;
  9048. ui.aiWordsBtn.visible = true;
  9049. xGame.common.talkMgr.changeAIState(true);
  9050. if (DataMgr.getSkillGuide() < 1)
  9051. DataMgr.gameData.gameCount = 0;
  9052. else {
  9053. DataMgr.gameData.gameCount++;
  9054. DataMgr.saveGameData();
  9055. PlatMgr.openTry();
  9056. }
  9057. if (xGame.common.d3World.knifeRoot) {
  9058. xGame.common.d3World.knifeRoot.destroyChildren();
  9059. }
  9060. break;
  9061. case GameMode.placeBall:
  9062. this.blackNum = -1;
  9063. this.selfTurn = true;
  9064. this.setTime = 10000;
  9065. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9066. this.curHP = this.placeBallData.hp;
  9067. if (this.placeBallData.ball == -1)
  9068. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9069. else
  9070. this.needBalls = this.placeBallData.ball;
  9071. console.log("需要的进球数目", this.needBalls);
  9072. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9073. this.finishBalls = 0;
  9074. this.placeBallPosData = {};
  9075. this.updatePlaceBallPos();
  9076. this.updatePlaceBallState();
  9077. this.finishOneShoot = true;
  9078. xGame.common.gameUI.ui.moveNode.visible = false;
  9079. this.isOpenBall = false;
  9080. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9081. ui.wordsBtn.visible = false;
  9082. ui.aiWordsBtn.visible = false;
  9083. xGame.common.talkMgr.changeAIState(false);
  9084. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9085. PlatMgr.openBox();
  9086. });
  9087. break;
  9088. default:
  9089. break;
  9090. }
  9091. this.showLongView = false;
  9092. xGame.common.wordsMgr.comboTimes = 1;
  9093. let guide = DataMgr.getSkillGuide();
  9094. if (guide)
  9095. xGame.eventMgr.event(WAIT_SHOOT);
  9096. xGame.common.upSkillLevel = false;
  9097. xGame.common.gameStartTime = new Date().getTime();
  9098. this.firstShoot = true;
  9099. }
  9100. checkGuide() {
  9101. let guide = DataMgr.getSkillGuide();
  9102. let gameUI = xGame.common.gameUI.ui;
  9103. gameUI.guide1.visible = false;
  9104. gameUI.guide2.visible = false;
  9105. gameUI.guide3.visible = false;
  9106. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9107. this.selfTurn = true;
  9108. }
  9109. else {
  9110. return;
  9111. }
  9112. let oneBall = this.getOneBall();
  9113. gameUI.guide1.visible = true;
  9114. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9115. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9116. }
  9117. getOneBall() {
  9118. let arr = xGame.common.d2World.ballArr;
  9119. for (let index = 0; index < arr.length; index++) {
  9120. if (arr[index].number == 0)
  9121. continue;
  9122. return arr[index];
  9123. }
  9124. }
  9125. updateSelfScore() {
  9126. let ui = xGame.common.gameUI.ui.topNode;
  9127. ui.selfScoreTxt.text = this.selfScore + "";
  9128. }
  9129. updateAIScore() {
  9130. let ui = xGame.common.gameUI.ui.topNode;
  9131. ui.aiScoreTxt.text = this.aiScore + "";
  9132. }
  9133. updateTargetSroce() {
  9134. let ui = xGame.common.gameUI.ui.topNode;
  9135. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9136. }
  9137. updateLeftBall() {
  9138. let topUI = xGame.common.gameUI.ui.topNode;
  9139. topUI.selfBallList.numItems = this.selfBallArr.length;
  9140. topUI.aiBallList.numItems = this.aiBallArr.length;
  9141. }
  9142. ballShoot() {
  9143. this.clearTime();
  9144. this.finishOneShoot = false;
  9145. xGame.common.gameUI.ui.moveNode.visible = false;
  9146. if (xGame.common.gameUI.ui.guideNode.visible) {
  9147. xGame.common.gameUI.ui.guideNode.visible = false;
  9148. }
  9149. if (this.firstShoot) {
  9150. this.firstShoot = false;
  9151. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9152. }
  9153. }
  9154. ensureCamp(number) {
  9155. this.ensureBallType = true;
  9156. this.isOpenBall = false;
  9157. if (xGame.common.gameMode != GameMode.classic)
  9158. return;
  9159. let full = [1, 2, 3, 4, 5, 6, 7];
  9160. let flower = [9, 10, 11, 12, 13, 14, 15];
  9161. let sayWords = "";
  9162. if (this.selfTurn) {
  9163. if (number <= 7) {
  9164. this.selfCamp = ballCamp.full;
  9165. this.selfBallArr = full;
  9166. this.aiCamp = ballCamp.flower;
  9167. this.aiBallArr = flower;
  9168. sayWords = cfgTable.wordsData[3].msg;
  9169. }
  9170. else {
  9171. this.selfCamp = ballCamp.flower;
  9172. this.selfBallArr = flower;
  9173. this.aiCamp = ballCamp.full;
  9174. this.aiBallArr = full;
  9175. sayWords = cfgTable.wordsData[4].msg;
  9176. }
  9177. }
  9178. else {
  9179. if (number <= 7) {
  9180. this.selfCamp = ballCamp.flower;
  9181. this.selfBallArr = flower;
  9182. this.aiCamp = ballCamp.full;
  9183. this.aiBallArr = full;
  9184. sayWords = cfgTable.wordsData[2].msg;
  9185. }
  9186. else {
  9187. this.selfCamp = ballCamp.full;
  9188. this.selfBallArr = full;
  9189. this.aiCamp = ballCamp.flower;
  9190. this.aiBallArr = flower;
  9191. sayWords = cfgTable.wordsData[1].msg;
  9192. }
  9193. }
  9194. this.updateLeftBall();
  9195. xGame.uiMgr.Show(UIMsg, sayWords);
  9196. }
  9197. updatePlaceBallState() {
  9198. let ui = xGame.common.gameUI.ui;
  9199. switch (this.placeBallData.type) {
  9200. case PlaceBallType.normal:
  9201. let normal = ui.placeNormalNode;
  9202. normal.hpTxt.text = this.curHP + "";
  9203. this.updatePlaceBallStar(normal);
  9204. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9205. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9206. break;
  9207. case PlaceBallType.challenge:
  9208. let challenge = ui.placeChallengeNode;
  9209. challenge.hpTxt.text = "Shots:" + this.curHP;
  9210. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9211. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9212. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9213. break;
  9214. default:
  9215. break;
  9216. }
  9217. }
  9218. playSubHpAni() {
  9219. let ui = xGame.common.gameUI.ui;
  9220. switch (this.placeBallData.type) {
  9221. case PlaceBallType.normal:
  9222. let normal = ui.placeNormalNode;
  9223. normal.hpTxt.visible = false;
  9224. normal.starAni.c1.selectedIndex = 1;
  9225. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9226. normal.hpTxt.visible = true;
  9227. normal.starAni.c1.selectedIndex = 0;
  9228. }));
  9229. break;
  9230. default:
  9231. break;
  9232. }
  9233. }
  9234. getEndStarNum() {
  9235. let num;
  9236. let level = xGame.common.placeBallCurLevel;
  9237. if (this.curHP == this.placeBallData.hp) {
  9238. num = 3;
  9239. }
  9240. else if (this.curHP <= 1) {
  9241. num = 1;
  9242. }
  9243. else {
  9244. num = 2;
  9245. }
  9246. if (!this.success) {
  9247. num = 0;
  9248. }
  9249. else {
  9250. DataMgr.setPlaceBallLevel(level, num);
  9251. }
  9252. let myType = cfgTable.placeballData[level].type;
  9253. if (this.success && myType == 1) {
  9254. num = 3;
  9255. }
  9256. xGame.common.placeBallStarNum = num;
  9257. }
  9258. updatePlaceBallStar(node) {
  9259. let star = 0;
  9260. if (this.curHP == this.placeBallData.hp) {
  9261. star = 3;
  9262. }
  9263. else if (this.curHP >= 2) {
  9264. star = 2;
  9265. }
  9266. else if (this.curHP == 1) {
  9267. star = 1;
  9268. }
  9269. else {
  9270. star = 0;
  9271. }
  9272. let temp;
  9273. for (let index = 1; index <= 3; index++) {
  9274. temp = node["star" + index];
  9275. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9276. }
  9277. node.myProgress.value = (star / 3) * 100;
  9278. }
  9279. openRegretView(isFoul, GoalNum, challenge = false) {
  9280. let regretType = -1;
  9281. if (isFoul) {
  9282. regretType = 1;
  9283. }
  9284. else {
  9285. if (GoalNum <= 0) {
  9286. regretType = 0;
  9287. }
  9288. }
  9289. if (challenge) {
  9290. regretType = 1;
  9291. }
  9292. if (regretType != -1) {
  9293. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9294. if (success) {
  9295. this.curHP++;
  9296. this.updatePlaceBallState();
  9297. this.setPlaceBallAllPos();
  9298. xGame.common.gameUI.ui.moveNode.visible = false;
  9299. }
  9300. else {
  9301. if (this.curHP <= 0) {
  9302. this.success = false;
  9303. this.gameEnd();
  9304. }
  9305. this.playSubHpAni();
  9306. }
  9307. this.updatePlaceBallState();
  9308. this.updatePlaceBallPos();
  9309. });
  9310. }
  9311. }
  9312. setPlaceBallAllPos() {
  9313. let allBall = xGame.common.d2World.ballArr;
  9314. let cfgArr = this.placeBallPosData;
  9315. let temp;
  9316. let obj;
  9317. for (let index = 0; index < allBall.length; index++) {
  9318. temp = allBall[index];
  9319. if (temp.destroyed)
  9320. continue;
  9321. obj = cfgArr[temp.myUNID];
  9322. if (obj && obj.src && !obj.src.destroyed) {
  9323. temp.gameObj.x = obj.posX;
  9324. temp.gameObj.y = obj.posY;
  9325. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9326. }
  9327. }
  9328. xGame.common.d2World.getHelpLine();
  9329. }
  9330. updatePlaceBallPos() {
  9331. let arr = xGame.common.d2World.ballArr;
  9332. let temp;
  9333. for (let index = 0; index < arr.length; index++) {
  9334. temp = arr[index];
  9335. if (!this.placeBallPosData[temp.myUNID]) {
  9336. this.placeBallPosData[temp.myUNID] = {
  9337. src: temp,
  9338. posX: temp.gameObj.x,
  9339. posY: temp.gameObj.y
  9340. };
  9341. }
  9342. else {
  9343. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9344. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9345. }
  9346. }
  9347. let check;
  9348. for (const key in this.placeBallPosData) {
  9349. check = this.placeBallPosData[key];
  9350. if (check.src.destroyed) {
  9351. delete this.placeBallPosData[key];
  9352. }
  9353. }
  9354. }
  9355. gameRun(type) {
  9356. if (this.gamePause)
  9357. return;
  9358. this.curFoul = this.getFoulType();
  9359. if (type) {
  9360. xGame.common.d2World.d2Gan.shoot();
  9361. xGame.common.gameUI.forceCancel();
  9362. this.curFoul = type;
  9363. }
  9364. this.isEnd = false;
  9365. this.isChangeTurn = true;
  9366. if (xGame.common.gameMode == GameMode.classic) {
  9367. this.judgeClassic(this.curFoul);
  9368. this.checkClassicWords(() => {
  9369. xGame.common.destroyClassicEmotion();
  9370. if (this.isEnd) {
  9371. if (this.isBlackInHole) {
  9372. xGame.common.gameUI.ui.blackAni.visible = true;
  9373. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9374. xGame.common.gameUI.ui.blackAni.visible = false;
  9375. this.gameEnd();
  9376. }));
  9377. }
  9378. else {
  9379. this.gameEnd();
  9380. }
  9381. }
  9382. else {
  9383. this.waitShoot();
  9384. xGame.eventMgr.event(WAIT_SHOOT);
  9385. }
  9386. });
  9387. }
  9388. else if (xGame.common.gameMode == GameMode.bigMove) {
  9389. xGame.common.aiPlayer.stopRun();
  9390. let scoreArr = this.getScore(this.curFoul);
  9391. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9392. this.isEnd = true;
  9393. }
  9394. this.checkBigSkillWords(() => {
  9395. if (this.isEnd) {
  9396. this.gameEnd();
  9397. }
  9398. else {
  9399. this.waitShoot();
  9400. xGame.eventMgr.event(WAIT_SHOOT);
  9401. }
  9402. });
  9403. }
  9404. else if (xGame.common.gameMode == GameMode.placeBall) {
  9405. xGame.common.destroyAwardSpine();
  9406. let isFoul = this.curFoul == FoulType.rootHole;
  9407. let GoalNum = this.inHoleBalls.length;
  9408. if (this.inHoleBalls.indexOf(0) > -1)
  9409. GoalNum -= 1;
  9410. if (isFoul) {
  9411. this.placeRootBall();
  9412. }
  9413. console.log("neeballs", this.needBalls);
  9414. console.log("当前完成的goalNum", GoalNum);
  9415. this.finishBalls += GoalNum;
  9416. console.log("当前完成的finishballs", this.finishBalls);
  9417. let need = this.needBalls;
  9418. if (this.placeBallData.type == PlaceBallType.challenge) {
  9419. need += 100;
  9420. }
  9421. if (this.finishBalls >= need) {
  9422. this.success = true;
  9423. this.gameEnd();
  9424. }
  9425. else {
  9426. switch (this.placeBallData.type) {
  9427. case PlaceBallType.normal:
  9428. if (!isFoul && GoalNum > 0) {
  9429. this.updatePlaceBallPos();
  9430. this.updatePlaceBallState();
  9431. }
  9432. else {
  9433. this.curHP--;
  9434. this.openRegretView(isFoul, GoalNum);
  9435. }
  9436. this.waitShoot();
  9437. xGame.eventMgr.event(WAIT_SHOOT);
  9438. break;
  9439. case PlaceBallType.challenge:
  9440. this.curHP--;
  9441. this.updatePlaceBallState();
  9442. if (isFoul) {
  9443. this.openRegretView(isFoul, GoalNum, true);
  9444. }
  9445. else {
  9446. this.updatePlaceBallPos();
  9447. if (this.curHP <= 0) {
  9448. this.success = true;
  9449. this.gameEnd();
  9450. }
  9451. }
  9452. this.waitShoot();
  9453. xGame.eventMgr.event(WAIT_SHOOT);
  9454. break;
  9455. default:
  9456. break;
  9457. }
  9458. }
  9459. }
  9460. }
  9461. checkClassicWords(callback) {
  9462. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9463. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9464. let type = this.getClassicWordsType();
  9465. if (condition && type != -1) {
  9466. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9467. xGame.soundMgr.playSound(str);
  9468. xGame.common.wordsMgr.playClassicWords(type, callback);
  9469. }
  9470. else {
  9471. Laya.timer.once(300, this, () => {
  9472. callback && callback();
  9473. });
  9474. }
  9475. }
  9476. getClassicWordsType() {
  9477. let d2world = xGame.common.d2World;
  9478. let type = -1;
  9479. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9480. type = ClassicWordsType.perfectShow;
  9481. return type;
  9482. }
  9483. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9484. type = ClassicWordsType.directShoot;
  9485. return type;
  9486. }
  9487. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9488. type = ClassicWordsType.anotherShoot;
  9489. return type;
  9490. }
  9491. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9492. type = ClassicWordsType.bigPower;
  9493. return type;
  9494. }
  9495. let minSpeed = 1;
  9496. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9497. type = ClassicWordsType.hardShoot;
  9498. return type;
  9499. }
  9500. if (this.inHoleBalls.length > 0) {
  9501. type = ClassicWordsType.directShoot;
  9502. return type;
  9503. }
  9504. return type;
  9505. }
  9506. checkBigSkillWords(callback) {
  9507. if (this.curFoul == FoulType.timeOut) {
  9508. callback && callback();
  9509. }
  9510. else {
  9511. let playSkill = false;
  9512. if (this.selfTurn) {
  9513. playSkill = true;
  9514. }
  9515. else {
  9516. if (!this.aiPlayedBreakArmy) {
  9517. this.aiPlayedBreakArmy = true;
  9518. playSkill = true;
  9519. }
  9520. if (this.aiCurSkill != SkillType.breakArmy) {
  9521. playSkill = true;
  9522. }
  9523. }
  9524. if (xGame.common.skillMgr.playedLastSkill) {
  9525. xGame.common.skillMgr.playedLastSkill = false;
  9526. playSkill = false;
  9527. }
  9528. if (playSkill) {
  9529. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9530. let selfExtra = 0;
  9531. let aiExtra = 0;
  9532. if (this.selfTurn)
  9533. selfExtra += extraScore;
  9534. else
  9535. aiExtra += extraScore;
  9536. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9537. this.isEnd = true;
  9538. }
  9539. this.playBigSkillTimes(callback);
  9540. });
  9541. }
  9542. else {
  9543. this.playBigSkillTimes(callback);
  9544. }
  9545. }
  9546. }
  9547. playBigSkillTimes(callback) {
  9548. let length = this.inHoleBalls.length;
  9549. if (this.inHoleBalls.indexOf(0) > -1) {
  9550. length = this.inHoleBalls.length - 1;
  9551. }
  9552. if (length <= 0) {
  9553. callback && callback();
  9554. return;
  9555. }
  9556. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9557. callback && callback();
  9558. });
  9559. }
  9560. playSkillTips() {
  9561. let levelNum = 0;
  9562. let curType;
  9563. if (this.selfTurn) {
  9564. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9565. curType = this.selfCurSkill;
  9566. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9567. levelNum += 5;
  9568. }
  9569. }
  9570. else {
  9571. levelNum = this.aiSkillLevelNum;
  9572. curType = this.aiCurSkill;
  9573. }
  9574. let str = ``;
  9575. switch (curType) {
  9576. case SkillType.highSpace:
  9577. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9578. break;
  9579. case SkillType.breakArmy:
  9580. str = `You pocketed ${levelNum} extra balls`;
  9581. break;
  9582. case SkillType.ice:
  9583. str = `${levelNum * 2} extra balls were frozen`;
  9584. break;
  9585. case SkillType.fireworks:
  9586. str = `${levelNum} extra balls exploded `;
  9587. break;
  9588. case SkillType.GuanYu:
  9589. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9590. break;
  9591. default:
  9592. break;
  9593. }
  9594. xGame.uiMgr.Show(UIMsg, str);
  9595. }
  9596. getFoulType() {
  9597. let foulType = "";
  9598. if (this.firstColliObj == null) {
  9599. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9600. return FoulType.rootHole;
  9601. }
  9602. return FoulType.notTouch;
  9603. }
  9604. else {
  9605. if (this.selfTurn) {
  9606. if (this.selfBallArr.length > 0) {
  9607. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9608. foulType = FoulType.wrongTouch;
  9609. }
  9610. }
  9611. else {
  9612. if (this.ensureBallType) {
  9613. }
  9614. else {
  9615. if (this.firstColliObj == this.blackNum) {
  9616. foulType = FoulType.wrongTouch;
  9617. }
  9618. }
  9619. }
  9620. }
  9621. else {
  9622. if (this.aiBallArr.length > 0) {
  9623. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9624. foulType = FoulType.wrongTouch;
  9625. }
  9626. }
  9627. else {
  9628. if (this.ensureBallType) {
  9629. }
  9630. else {
  9631. if (this.firstColliObj == this.blackNum) {
  9632. foulType = FoulType.wrongTouch;
  9633. }
  9634. }
  9635. }
  9636. }
  9637. if (this.inHoleBalls.length <= 0) {
  9638. return foulType;
  9639. }
  9640. let temp;
  9641. if (this.inHoleBalls.indexOf(0) > -1) {
  9642. foulType = FoulType.rootHole;
  9643. }
  9644. else {
  9645. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9646. temp = this.inHoleBalls[index];
  9647. if (this.selfTurn) {
  9648. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9649. foulType = FoulType.wrongHole;
  9650. break;
  9651. }
  9652. }
  9653. else {
  9654. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9655. foulType = FoulType.wrongHole;
  9656. break;
  9657. }
  9658. }
  9659. }
  9660. }
  9661. let foo;
  9662. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9663. temp = this.inHoleBalls[index];
  9664. foo = this.selfBallArr.indexOf(temp);
  9665. if (foo > -1) {
  9666. this.selfBallArr.splice(foo, 1);
  9667. }
  9668. foo = this.aiBallArr.indexOf(temp);
  9669. if (foo > -1) {
  9670. this.aiBallArr.splice(foo, 1);
  9671. }
  9672. }
  9673. this.updateLeftBall();
  9674. }
  9675. return foulType;
  9676. }
  9677. judgeGameEndByBlack(arr) {
  9678. if (this.selfTurn) {
  9679. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9680. this.selfFoulNum = this.maxFoulTimes;
  9681. return true;
  9682. }
  9683. }
  9684. else {
  9685. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9686. this.aiFoulNum = this.maxFoulTimes;
  9687. return true;
  9688. }
  9689. }
  9690. }
  9691. judgeClassic(type) {
  9692. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9693. xGame.common.aiPlayer.stopRun();
  9694. if (this.judgeNormalSuccess()) {
  9695. this.isEnd = true;
  9696. return;
  9697. }
  9698. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9699. if (this.selfTurn) {
  9700. if (isFoul) {
  9701. this.selfFoulNum++;
  9702. }
  9703. if (this.selfFoulNum >= this.maxFoulTimes) {
  9704. this.success = false;
  9705. this.isEnd = true;
  9706. return;
  9707. }
  9708. }
  9709. else {
  9710. if (isFoul)
  9711. this.aiFoulNum++;
  9712. if (this.aiFoulNum >= this.maxFoulTimes) {
  9713. this.success = true;
  9714. this.isEnd = true;
  9715. return;
  9716. }
  9717. }
  9718. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9719. this.isChangeTurn = false;
  9720. }
  9721. else {
  9722. this.isInterrupt = true;
  9723. }
  9724. }
  9725. waitShoot() {
  9726. if (xGame.common.gameMode == GameMode.classic) {
  9727. switch (this.curFoul) {
  9728. case FoulType.timeOut:
  9729. case FoulType.rootHole:
  9730. this.selfTurn = !this.selfTurn;
  9731. this.peoplePlay(5, 6, true);
  9732. break;
  9733. case FoulType.notTouch:
  9734. this.selfTurn = !this.selfTurn;
  9735. this.peoplePlay(7, 7);
  9736. break;
  9737. case FoulType.wrongHole:
  9738. this.selfTurn = !this.selfTurn;
  9739. this.peoplePlay(11, 11);
  9740. break;
  9741. default:
  9742. if (this.inHoleBalls.length > 0) {
  9743. this.peoplePlay(0, 0, false, false);
  9744. }
  9745. else {
  9746. this.selfTurn = !this.selfTurn;
  9747. this.peoplePlay(7, 7);
  9748. }
  9749. break;
  9750. }
  9751. }
  9752. else if (xGame.common.gameMode == GameMode.bigMove) {
  9753. if (this.curFoul == FoulType.timeOut) {
  9754. this.selfTurn = !this.selfTurn;
  9755. this.peoplePlay(14, 15);
  9756. this.placeRootBall();
  9757. }
  9758. else {
  9759. this.selfTurn = !this.selfTurn;
  9760. if (this.curFoul == FoulType.rootHole) {
  9761. this.peoplePlay(12, 13);
  9762. this.placeRootBall();
  9763. }
  9764. else {
  9765. this.peoplePlay(0, 0, false, false);
  9766. }
  9767. }
  9768. }
  9769. else if (xGame.common.gameMode == GameMode.placeBall) {
  9770. this.finishOneShoot = true;
  9771. }
  9772. this.gameResult();
  9773. }
  9774. gameResult() {
  9775. this.firstColliObj = null;
  9776. this.inHoleBalls = [];
  9777. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9778. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9779. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9780. if (xGame.common.uiRodMethod)
  9781. xGame.common.uiRodMethod.resetRod();
  9782. xGame.common.d2World.rootBall.showSelf();
  9783. this.clearIceSkill();
  9784. if (this.selfTurn) {
  9785. PlatMgr.gameInsert();
  9786. }
  9787. xGame.common.d3World.knifeRoot.destroyChildren();
  9788. if (this.selfTurn) {
  9789. xGame.common.gameUI.showHelpLineGuide();
  9790. xGame.common.gameUI.setTurnAlpha(true);
  9791. }
  9792. else {
  9793. xGame.common.gameUI.setTurnAlpha(false);
  9794. }
  9795. }
  9796. getScore(type) {
  9797. let selfAdd = 0;
  9798. let aiAdd = 0;
  9799. if (type == FoulType.timeOut) {
  9800. if (this.selfTurn)
  9801. aiAdd += 3;
  9802. else
  9803. selfAdd += 3;
  9804. }
  9805. else {
  9806. if (this.inHoleBalls.length > 0) {
  9807. if (this.selfTurn) {
  9808. if (type == FoulType.rootHole) {
  9809. aiAdd += 3;
  9810. if (this.inHoleBalls.length - 1 > 0) {
  9811. selfAdd += this.inHoleBalls.length - 1;
  9812. }
  9813. }
  9814. else {
  9815. selfAdd += this.inHoleBalls.length;
  9816. }
  9817. }
  9818. else {
  9819. if (type == FoulType.rootHole) {
  9820. selfAdd += 3;
  9821. if (this.inHoleBalls.length - 1 > 0) {
  9822. aiAdd += this.inHoleBalls.length - 1;
  9823. }
  9824. }
  9825. else {
  9826. aiAdd += this.inHoleBalls.length;
  9827. }
  9828. }
  9829. }
  9830. }
  9831. return [selfAdd, aiAdd];
  9832. }
  9833. judgeScoreEnd(selfAdd, aiAdd) {
  9834. this.selfScore += selfAdd;
  9835. this.aiScore += aiAdd;
  9836. this.updateAIScore();
  9837. this.updateSelfScore();
  9838. if (this.selfScore >= this.targertScore) {
  9839. this.success = true;
  9840. return true;
  9841. }
  9842. if (this.aiScore >= this.targertScore) {
  9843. this.success = false;
  9844. return true;
  9845. }
  9846. let ballArr = xGame.common.d2World.ballArr;
  9847. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9848. if (this.selfScore > this.aiScore) {
  9849. this.success = true;
  9850. return true;
  9851. }
  9852. else if (this.selfScore < this.aiScore) {
  9853. this.success = false;
  9854. return true;
  9855. }
  9856. else {
  9857. if (this.selfTurn) {
  9858. this.success = false;
  9859. }
  9860. else {
  9861. this.success = true;
  9862. }
  9863. return true;
  9864. }
  9865. }
  9866. }
  9867. clearIceSkill() {
  9868. let arr = xGame.common.d2World.ballArr;
  9869. let temp;
  9870. if (this.selfTurn) {
  9871. if (this.selfCurSkill == SkillType.ice) {
  9872. for (let index = 0; index < arr.length; index++) {
  9873. temp = arr[index];
  9874. if (temp.ballFunc == "ice") {
  9875. temp.setBallFunc("normal", "self");
  9876. }
  9877. }
  9878. }
  9879. }
  9880. else {
  9881. if (this.aiCurSkill == SkillType.ice) {
  9882. for (let index = 0; index < arr.length; index++) {
  9883. temp = arr[index];
  9884. if (temp.ballFunc == "ice") {
  9885. temp.setBallFunc("normal", "ai");
  9886. }
  9887. }
  9888. }
  9889. }
  9890. }
  9891. judgeNormalSuccess() {
  9892. if (this.selfTurn) {
  9893. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9894. this.success = true;
  9895. return true;
  9896. }
  9897. }
  9898. else {
  9899. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9900. this.success = false;
  9901. return true;
  9902. }
  9903. }
  9904. }
  9905. gameEnd() {
  9906. if (Moyu.isTT) {
  9907. xGame.common.screenImg = getScreenImg();
  9908. }
  9909. console.log("游戏结束", this.success);
  9910. xGame.common.aiPlayer.stopRun();
  9911. if (xGame.common.gameMode == GameMode.placeBall) {
  9912. this.getEndStarNum();
  9913. this.updatePlaceBallState();
  9914. }
  9915. this.isEnter = false;
  9916. Moyu.recordEnd(this, () => {
  9917. if (this.isEnter)
  9918. return;
  9919. this.isEnter = true;
  9920. console.log("进入录结束回调");
  9921. this.enterNext();
  9922. });
  9923. Laya.timer.once(1000, this, () => {
  9924. if (this.isEnter)
  9925. return;
  9926. this.isEnter = true;
  9927. this.enterNext();
  9928. });
  9929. xGame.common.longHelpLine = false;
  9930. }
  9931. enterNext() {
  9932. Laya.timer.clearAll(this);
  9933. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9934. xGame.uiMgr.Show(UIVideoShare, this.success);
  9935. }
  9936. else {
  9937. xGame.uiMgr.Show(UIGameEnd, this.success);
  9938. }
  9939. }
  9940. aiLeave() {
  9941. let ui = xGame.common.gameUI.ui;
  9942. ui.topNode.aiNameTxt.text = "offline";
  9943. }
  9944. aiGameEnd(suc) {
  9945. this.success = suc;
  9946. xGame.common.aiPlayer.stopRun();
  9947. if (this.success) {
  9948. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9949. Laya.timer.once(1000, this, () => {
  9950. this.clearTime();
  9951. this.gameEnd();
  9952. });
  9953. }
  9954. }
  9955. openTimer() {
  9956. let src = xGame.common.gameUI;
  9957. if (this.selfTurn) {
  9958. src.ui.topNode.selfProgress.visible = true;
  9959. src.ui.topNode.aiProgress.visible = false;
  9960. this.curTimer = src.ui.topNode.selfProgress;
  9961. }
  9962. else {
  9963. src.ui.topNode.selfProgress.visible = false;
  9964. src.ui.topNode.aiProgress.visible = true;
  9965. this.curTimer = src.ui.topNode.aiProgress;
  9966. }
  9967. this.accTime = 0;
  9968. Laya.timer.clearAll(this);
  9969. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9970. this.curTimer.value = 100;
  9971. }
  9972. updateTime(dt) {
  9973. if (this.gamePause)
  9974. return;
  9975. this.accTime += dt;
  9976. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9977. if (this.accTime >= this.setTime) {
  9978. this.clearTime();
  9979. console.log("时钟进入了gameRun");
  9980. this.gameRun(FoulType.timeOut);
  9981. }
  9982. }
  9983. clearTime() {
  9984. let src = xGame.common.gameUI;
  9985. src.ui.topNode.selfProgress.visible = false;
  9986. src.ui.topNode.aiProgress.visible = false;
  9987. Laya.timer.clearAll(this);
  9988. }
  9989. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9990. let ui = xGame.common.gameUI.ui;
  9991. let selfMsg, aiMsg;
  9992. if (sayWords) {
  9993. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9994. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9995. if (Foul) {
  9996. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9997. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9998. this.placeRootBall();
  9999. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  10000. if (this.curFoul == FoulType.rootHole) {
  10001. if (!DataMgr.getRootBallFoul()) {
  10002. DataMgr.setRootBallFoul();
  10003. aiMsg = "";
  10004. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  10005. let woman = "Boss, pay attention next time~";
  10006. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10007. }
  10008. }
  10009. else if (this.curFoul == FoulType.timeOut) {
  10010. if (!DataMgr.getTimeoutFoul()) {
  10011. DataMgr.setTimeoutFoul();
  10012. aiMsg = "";
  10013. let tips = "Game timeout, 3 fouls, this game failed.";
  10014. let woman = "Boss, pay attention to the timeline~";
  10015. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10016. }
  10017. }
  10018. }
  10019. }
  10020. }
  10021. if (this.selfTurn) {
  10022. if (sayWords) {
  10023. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  10024. ui.selfTurn.visible = true;
  10025. ui.aiTurn.visible = false;
  10026. ui.selfTurn.t0.play();
  10027. Moyu.vibration();
  10028. });
  10029. }
  10030. }
  10031. else {
  10032. let aiNum = xGame.tools.random(1, 11);
  10033. let challengeNum = DataMgr.getChallengeTimes();
  10034. let delay = false;
  10035. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  10036. aiNum = 9;
  10037. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  10038. aiNum = 3;
  10039. if (challengeNum == 3) {
  10040. if (!this.showLongView) {
  10041. this.showLongView = true;
  10042. delay = true;
  10043. }
  10044. }
  10045. }
  10046. }
  10047. if (delay) {
  10048. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10049. if (success) {
  10050. xGame.common.longHelpLine = true;
  10051. xGame.common.d2World.getHelpLine();
  10052. }
  10053. else {
  10054. aiNum = 10;
  10055. }
  10056. xGame.common.aiPlayer.setAiLevel(aiNum);
  10057. if (sayWords) {
  10058. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10059. xGame.common.aiPlayer.runAI();
  10060. ui.selfTurn.visible = false;
  10061. ui.aiTurn.visible = true;
  10062. ui.aiTurn.t0.play();
  10063. });
  10064. }
  10065. else {
  10066. xGame.common.aiPlayer.runAI();
  10067. }
  10068. this.openTimer();
  10069. this.finishOneShoot = true;
  10070. if (this.selfTurn) {
  10071. ui.topNode.selfKuang.visible = true;
  10072. ui.topNode.aiKuang.visible = false;
  10073. ui.topNode.selfTips.visible = true;
  10074. ui.topNode.aiTips.visible = false;
  10075. }
  10076. else {
  10077. ui.topNode.selfKuang.visible = false;
  10078. ui.topNode.aiKuang.visible = true;
  10079. ui.topNode.selfTips.visible = false;
  10080. ui.topNode.aiTips.visible = true;
  10081. }
  10082. });
  10083. return;
  10084. }
  10085. if (xGame.common.gameMode == GameMode.classic) {
  10086. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10087. if (cfg) {
  10088. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10089. aiNum = aiLevel;
  10090. }
  10091. }
  10092. xGame.common.aiPlayer.setAiLevel(aiNum);
  10093. if (sayWords) {
  10094. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10095. xGame.common.aiPlayer.runAI();
  10096. ui.selfTurn.visible = false;
  10097. ui.aiTurn.visible = true;
  10098. ui.aiTurn.t0.play();
  10099. });
  10100. }
  10101. else {
  10102. xGame.common.aiPlayer.runAI();
  10103. }
  10104. }
  10105. this.openTimer();
  10106. this.finishOneShoot = true;
  10107. if (this.selfTurn) {
  10108. ui.topNode.selfKuang.visible = true;
  10109. ui.topNode.aiKuang.visible = false;
  10110. ui.topNode.selfTips.visible = true;
  10111. ui.topNode.aiTips.visible = false;
  10112. }
  10113. else {
  10114. ui.topNode.selfKuang.visible = false;
  10115. ui.topNode.aiKuang.visible = true;
  10116. ui.topNode.selfTips.visible = false;
  10117. ui.topNode.aiTips.visible = true;
  10118. }
  10119. }
  10120. placeRootBall() {
  10121. let rootBall = xGame.common.d2World.rootBall;
  10122. if (!rootBall)
  10123. return;
  10124. rootBall.gameObj.x = this.lastRootBallPos.x;
  10125. rootBall.gameObj.y = this.lastRootBallPos.y;
  10126. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10127. let moveNode = xGame.common.gameUI.ui.moveNode;
  10128. moveNode.visible = true;
  10129. moveNode.x = this.lastRootBallPos.x;
  10130. moveNode.y = this.lastRootBallPos.y;
  10131. if (!this.selfTurn) {
  10132. xGame.common.aiPlayer.resetRoot();
  10133. }
  10134. }
  10135. }
  10136. class ui_guanyuAni extends fgui.GComponent {
  10137. static createInstance() {
  10138. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10139. }
  10140. onConstruct() {
  10141. this.n0 = (this.getChild("n0"));
  10142. }
  10143. }
  10144. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10145. class UIFireworks extends UIBase {
  10146. constructor() {
  10147. super();
  10148. }
  10149. onConstructor() {
  10150. this.isEject = false;
  10151. }
  10152. show(callback) {
  10153. super.show();
  10154. }
  10155. }
  10156. UIFireworks.uiName = "UIFireworks";
  10157. class ui_UIGuanYu extends fgui.GComponent {
  10158. static createInstance() {
  10159. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10160. }
  10161. onConstruct() {
  10162. this.n2 = (this.getChild("n2"));
  10163. this.n1 = (this.getChild("n1"));
  10164. this.n3 = (this.getChild("n3"));
  10165. this.n4 = (this.getChild("n4"));
  10166. this.n5 = (this.getChild("n5"));
  10167. this.n6 = (this.getChild("n6"));
  10168. this.n8 = (this.getChild("n8"));
  10169. this.n7 = (this.getChild("n7"));
  10170. this.t0 = this.getTransition("t0");
  10171. }
  10172. }
  10173. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10174. class UIGuanYu extends UIBase {
  10175. constructor() {
  10176. super();
  10177. }
  10178. onConstructor() {
  10179. this.ui = ui_UIGuanYu.createInstance();
  10180. this.contentPane = this.ui;
  10181. this.isEject = false;
  10182. }
  10183. show(callback) {
  10184. super.show();
  10185. this.ui.t0.play(Laya.Handler.create(this, () => {
  10186. callback && callback();
  10187. this.hide();
  10188. }));
  10189. }
  10190. }
  10191. UIGuanYu.uiName = "UIGuanYu";
  10192. class SkillMgr {
  10193. constructor() {
  10194. this.leveNum = 0;
  10195. this.extraScore = 0;
  10196. this.selfTurn = false;
  10197. this.playedLastSkill = false;
  10198. this.tweenArr = [];
  10199. this._finishNum = 0;
  10200. this._curFinish = 0;
  10201. this._rootX = 0;
  10202. this._rootY = 0;
  10203. this.knifeTimes = 0;
  10204. this.knifeV2 = new Laya.Vector2();
  10205. this.knifeV3 = new Laya.Vector3();
  10206. this.rtStarX = 0;
  10207. this.rtStarY = 0;
  10208. this.addBigSkillSpine();
  10209. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10210. }
  10211. addBigSkillSpine() {
  10212. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10213. console.log("extra2 success");
  10214. });
  10215. }
  10216. runBigSkill(callback) {
  10217. this.tweenArr = [];
  10218. this.callback = callback;
  10219. this.judgeSkill();
  10220. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10221. let guide = DataMgr.getSkillGuide();
  10222. if (!xGame.common.gameMgr.selfTurn) {
  10223. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10224. }
  10225. else {
  10226. if (xGame.common.temSelfLevel != 0) {
  10227. this.leveNum = xGame.common.temSelfLevel;
  10228. }
  10229. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10230. this.leveNum += 5;
  10231. }
  10232. }
  10233. if (guide == 0) {
  10234. DataMgr.setSkillGuide(1);
  10235. if (DataMgr.getNewUser()) {
  10236. Moyu.sendDataEvent("gameFirstPlay");
  10237. DataMgr.setNewUser();
  10238. }
  10239. }
  10240. this.playSpineAni(() => {
  10241. switch (this.curSkill) {
  10242. case SkillType.highSpace:
  10243. this.runHighSpace();
  10244. break;
  10245. case SkillType.breakArmy:
  10246. this.runBreakArmy();
  10247. break;
  10248. case SkillType.ice:
  10249. this.runIce();
  10250. break;
  10251. case SkillType.fireworks:
  10252. this.runFireworks();
  10253. break;
  10254. case SkillType.GuanYu:
  10255. this.runGuanYu();
  10256. break;
  10257. default:
  10258. break;
  10259. }
  10260. });
  10261. }
  10262. judgeSkill() {
  10263. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10264. let gameMgr = xGame.common.gameMgr;
  10265. let type;
  10266. for (let index = 0; index < typeArr.length; index++) {
  10267. type = typeArr[index];
  10268. if (gameMgr.selfTurn) {
  10269. if (gameMgr.selfCurSkill == type) {
  10270. this.selfTurn = true;
  10271. this.curSkill = type;
  10272. return;
  10273. }
  10274. }
  10275. else {
  10276. if (gameMgr.aiCurSkill == type) {
  10277. this.selfTurn = false;
  10278. this.curSkill = type;
  10279. return;
  10280. }
  10281. }
  10282. }
  10283. }
  10284. playSpineAni(callback) {
  10285. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10286. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10287. parent.destroyChildren();
  10288. let aniIndex = 0;
  10289. let skillSpine;
  10290. switch (this.curSkill) {
  10291. case SkillType.highSpace:
  10292. aniIndex = 1;
  10293. xGame.soundMgr.playSound("skill01");
  10294. skillSpine = this.skillSpine2;
  10295. data.scaleX = 0.5;
  10296. data.scaleY = 0.5;
  10297. skillSpine.play(data, 1, false, parent, () => {
  10298. callback && callback();
  10299. });
  10300. break;
  10301. case SkillType.breakArmy:
  10302. aniIndex = 2;
  10303. xGame.soundMgr.playSound("skill02");
  10304. skillSpine = this.skillSpine2;
  10305. data.scaleX = 0.5;
  10306. data.scaleY = 0.5;
  10307. skillSpine.play(data, 2, false, parent, () => {
  10308. callback && callback();
  10309. });
  10310. break;
  10311. case SkillType.ice:
  10312. aniIndex = 0;
  10313. xGame.soundMgr.playSound("skill03");
  10314. skillSpine = this.skillSpine2;
  10315. data.scaleX = 0.5;
  10316. data.scaleY = 0.5;
  10317. skillSpine.play(data, 0, false, parent, () => {
  10318. callback && callback();
  10319. });
  10320. break;
  10321. case SkillType.fireworks:
  10322. xGame.soundMgr.playSound("skill_04_01");
  10323. xGame.soundMgr.playSound("skill04");
  10324. xGame.uiMgr.Show(UIFireworks, callback);
  10325. break;
  10326. case SkillType.GuanYu:
  10327. xGame.soundMgr.playSound("skill05_1");
  10328. xGame.soundMgr.playSound("skill05");
  10329. xGame.uiMgr.Show(UIGuanYu, callback);
  10330. break;
  10331. default:
  10332. break;
  10333. }
  10334. }
  10335. getAllBallArr() {
  10336. let arr = xGame.common.d2World.ballArr;
  10337. let outArr = [];
  10338. for (let index = 0; index < arr.length; index++) {
  10339. if (arr[index] instanceof D2RootBallSrc)
  10340. continue;
  10341. if (arr[index].ballFunc == "ice")
  10342. continue;
  10343. if (arr[index].destroyed)
  10344. continue;
  10345. outArr.push(arr[index]);
  10346. }
  10347. return outArr;
  10348. }
  10349. getOneArr(deletObj) {
  10350. let allArr = this.getAllBallArr();
  10351. let temp;
  10352. for (let index = 0; index < allArr.length; index++) {
  10353. temp = allArr[index];
  10354. if (temp.id == deletObj.id) {
  10355. allArr.splice(index, 1);
  10356. break;
  10357. }
  10358. }
  10359. return allArr;
  10360. }
  10361. getNearBallBag(ball) {
  10362. let ui = xGame.common.gameUI.ui;
  10363. let circleArr = [];
  10364. for (let index = 1; index <= 6; index++) {
  10365. circleArr.push(ui.border["circle" + index]);
  10366. }
  10367. let outIndex = 0;
  10368. let temp;
  10369. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10370. ;
  10371. let dis = 0;
  10372. for (let index = 1; index < circleArr.length; index++) {
  10373. temp = circleArr[index];
  10374. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10375. if (dis < min) {
  10376. min = dis;
  10377. outIndex = index;
  10378. }
  10379. }
  10380. return [circleArr[outIndex], outIndex];
  10381. }
  10382. ballFlyToBag(ballArr, time = 300) {
  10383. let temp;
  10384. let hole;
  10385. this._finishNum = ballArr.length;
  10386. this._curFinish = 0;
  10387. let holeObj = {};
  10388. let holeCfg = {
  10389. "1": 0,
  10390. "2": 0,
  10391. "3": 0,
  10392. "4": 0,
  10393. "5": 0,
  10394. "6": 0
  10395. };
  10396. for (let index = 0; index < ballArr.length; index++) {
  10397. temp = ballArr[index];
  10398. temp.outColli.isSensor = true;
  10399. temp.innerColli.isSensor = true;
  10400. temp.isRunSkillAni = true;
  10401. let holeArr = this.getNearBallBag(temp);
  10402. hole = holeArr[0];
  10403. holeObj[index] = holeArr[1];
  10404. temp.d3BallSrc.scaleXYZ = 0.5;
  10405. this.tweenArr.push(temp.d3BallSrc, temp);
  10406. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10407. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10408. }));
  10409. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10410. let mIndex = holeObj[this._curFinish];
  10411. let isDone = holeCfg[mIndex];
  10412. if (isDone) {
  10413. ballArr[this._curFinish].checkWrongBall(false);
  10414. }
  10415. else {
  10416. holeCfg[mIndex] = 1;
  10417. ballArr[this._curFinish].checkWrongBall();
  10418. }
  10419. this._curFinish++;
  10420. if (this._curFinish >= this._finishNum) {
  10421. if (this.curSkill == SkillType.highSpace) {
  10422. }
  10423. else if (this.curSkill == SkillType.breakArmy) {
  10424. let rootBall = xGame.common.d2World.rootBall;
  10425. rootBall.gameObj.x = this._rootX;
  10426. rootBall.gameObj.y = this._rootY;
  10427. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10428. xGame.common.d2World.d2Gan.ui.visible = true;
  10429. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10430. xGame.common.d2World.getHelpLine();
  10431. this.callback && this.callback(this.extraScore);
  10432. }
  10433. }
  10434. }));
  10435. }
  10436. }
  10437. runHighSpace() {
  10438. let rootBall = xGame.common.d2World.rootBall;
  10439. rootBall.showSelf();
  10440. let d3Src = rootBall.d3BallSrc;
  10441. let allArr = this.getAllBallArr();
  10442. if (allArr.length <= 0) {
  10443. this.callback && this.callback(0);
  10444. return;
  10445. }
  10446. let selectBall = xGame.common.d2World.targetBall;
  10447. let wrong = selectBall && selectBall.destroyed;
  10448. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10449. selectBall = xGame.common.getRandArrEle(allArr);
  10450. }
  10451. let targetD3Src = selectBall.d3BallSrc;
  10452. xGame.common.d2World.d2Gan.ui.visible = false;
  10453. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10454. d3Src.scaleXYZ = 0.5;
  10455. this.tweenArr.push(d3Src);
  10456. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10457. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10458. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10459. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10460. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10461. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10462. let outArr = [selectBall];
  10463. let other = this.leveNum - 1;
  10464. if (other > 0) {
  10465. let nearArr = this.getOneArr(selectBall);
  10466. if (nearArr.length > 0) {
  10467. xGame.common.botherArr(nearArr);
  10468. if (other >= nearArr.length)
  10469. other = nearArr.length;
  10470. for (let index = 0; index < other; index++) {
  10471. outArr.push(nearArr[index]);
  10472. }
  10473. }
  10474. }
  10475. xGame.common.extraMoveNum = other + 1;
  10476. this.extraScore = other + 1;
  10477. this._rootX = selectBall.gameObj.x;
  10478. this._rootY = selectBall.gameObj.y;
  10479. rootBall.gameObj.x = this._rootX;
  10480. rootBall.gameObj.y = this._rootY;
  10481. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10482. Laya.Tween.clearAll(d3Src);
  10483. this.addRandomForce(outArr);
  10484. }));
  10485. }));
  10486. }
  10487. addRandomForce(outArr) {
  10488. if (outArr.length > 0) {
  10489. xGame.common.d2World.openCheckStill = true;
  10490. this.playedLastSkill = true;
  10491. }
  10492. let temp;
  10493. for (let index = 0; index < outArr.length; index++) {
  10494. let angle = xGame.common.randomNum(0, 360);
  10495. let linearPercent = xGame.common.randomNum(65, 100);
  10496. temp = outArr[index];
  10497. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10498. }
  10499. }
  10500. setLinearSpeed(angle, rigy, linearPercent) {
  10501. let sin = Math.sin(angle * Math.PI / 180);
  10502. let cos = Math.cos(angle * Math.PI / 180);
  10503. let maxSpeed = 4;
  10504. let speed = new Laya.Vector2();
  10505. speed.x = maxSpeed * linearPercent * sin;
  10506. speed.y = -maxSpeed * linearPercent * cos;
  10507. rigy.applyLinearImpulseToCenter(speed);
  10508. }
  10509. runBreakArmy() {
  10510. xGame.common.d2World.d2Gan.ui.visible = false;
  10511. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10512. let gameUI = xGame.common.gameUI.ui;
  10513. gameUI.skillRod.visible = true;
  10514. gameUI.skillRod.rotation = 110;
  10515. let outArr = this.getAllBallArr();
  10516. if (outArr.length <= 0) {
  10517. gameUI.skillRod.visible = false;
  10518. this.callback && this.callback(0);
  10519. return;
  10520. }
  10521. xGame.common.botherArr(outArr);
  10522. if (this.leveNum >= outArr.length)
  10523. this.leveNum = outArr.length;
  10524. let deleteNum = outArr.length - this.leveNum;
  10525. outArr.splice(0, deleteNum);
  10526. this.extraScore = this.leveNum;
  10527. let potX = gameUI.skillRod.x;
  10528. let potY = gameUI.skillRod.y;
  10529. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10530. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10531. let disArr = [];
  10532. for (let index = 0; index < outArr.length; index++) {
  10533. let obj = outArr[index];
  10534. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10535. dis = Math.pow(dis, 0.5);
  10536. disArr.push(dis);
  10537. }
  10538. this.tweenArr.push(gameUI.skillRod);
  10539. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10540. })).update = Laya.Handler.create(this, (e, t, c) => {
  10541. let angle = gameUI.skillRod.rotation;
  10542. let xx;
  10543. let yy;
  10544. let temp;
  10545. for (let index = 0; index < outArr.length; index++) {
  10546. temp = outArr[index];
  10547. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10548. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10549. yy -= 20;
  10550. temp.gameObj.x = xx;
  10551. temp.gameObj.y = yy;
  10552. temp.d3BallSrc.setTransPos(xx, yy);
  10553. }
  10554. if (angle <= 60) {
  10555. Laya.Tween.clearAll(gameUI.skillRod);
  10556. this.ballFlyToBag(outArr, 150);
  10557. gameUI.skillRod.visible = false;
  10558. }
  10559. }, null, false);
  10560. }
  10561. runIce() {
  10562. let ballArr = xGame.common.d2World.ballArr;
  10563. this.leveNum *= 2;
  10564. if (this.leveNum >= ballArr.length - 1)
  10565. this.leveNum = ballArr.length - 1;
  10566. let tempArr = [];
  10567. let outArr = [];
  10568. for (let index = 0; index < ballArr.length; index++) {
  10569. if (ballArr[index] instanceof D2RootBallSrc)
  10570. continue;
  10571. tempArr.push(ballArr[index]);
  10572. }
  10573. if (tempArr.length <= 0) {
  10574. this.callback && this.callback(0);
  10575. return;
  10576. }
  10577. xGame.common.botherArr(tempArr);
  10578. for (let index = 0; index < this.leveNum; index++) {
  10579. outArr.push(tempArr[index]);
  10580. }
  10581. this.extraScore = this.leveNum;
  10582. let temp;
  10583. for (let index = 0; index < outArr.length; index++) {
  10584. temp = outArr[index];
  10585. temp.d3BallSrc.playIceEft();
  10586. }
  10587. Laya.timer.once(2000, this, () => {
  10588. for (let index = 0; index < outArr.length; index++) {
  10589. temp = outArr[index];
  10590. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10591. temp.setBallFunc("ice", str);
  10592. }
  10593. this.callback && this.callback(0);
  10594. });
  10595. }
  10596. runFireworks() {
  10597. let allArr = this.getAllBallArr();
  10598. if (allArr.length <= 0) {
  10599. this.callback && this.callback(0);
  10600. return;
  10601. }
  10602. xGame.common.d2World.d2Gan.ui.visible = false;
  10603. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10604. let outArr = [];
  10605. let other = this.leveNum;
  10606. if (other > 0) {
  10607. if (allArr.length > 0) {
  10608. xGame.common.botherArr(allArr);
  10609. if (other >= allArr.length)
  10610. other = allArr.length;
  10611. for (let index = 0; index < other; index++) {
  10612. outArr.push(allArr[index]);
  10613. }
  10614. }
  10615. }
  10616. xGame.common.extraMoveNum = other;
  10617. this.extraScore = other;
  10618. this.addRandmomFireworks(outArr);
  10619. }
  10620. addRandmomFireworks(outArr) {
  10621. Laya.timer.once(1100, this, () => {
  10622. if (outArr.length > 0) {
  10623. xGame.common.d2World.openCheckStill = true;
  10624. this.playedLastSkill = true;
  10625. }
  10626. });
  10627. xGame.soundMgr.playSound("skill_04_02");
  10628. let temp;
  10629. let delay = -200;
  10630. for (let index = 0; index < outArr.length; index++) {
  10631. temp = outArr[index];
  10632. delay += 200;
  10633. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10634. let angle = xGame.common.randomNum(0, 360);
  10635. angle = this.getFireworksAngle(obj);
  10636. let linearPercent = xGame.common.randomNum(45, 80);
  10637. if (!obj.destroyed)
  10638. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10639. });
  10640. }
  10641. }
  10642. getFireworksAngle(obj) {
  10643. let rootBall = xGame.common.d2World.rootBall;
  10644. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10645. }
  10646. resetGame() {
  10647. Laya.timer.clearAll(this);
  10648. if (this.tweenArr) {
  10649. for (let index = 0; index < this.tweenArr.length; index++) {
  10650. Laya.Tween.clearAll(this.tweenArr[index]);
  10651. }
  10652. }
  10653. this.tweenArr = null;
  10654. }
  10655. runGuanYu() {
  10656. xGame.common.d2World.d2Gan.ui.visible = false;
  10657. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10658. let rootBall = xGame.common.d2World.rootBall;
  10659. if (rootBall.isInHole) {
  10660. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10661. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10662. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10663. rootBall.showSelf();
  10664. }
  10665. this.rtStarX = rootBall.gameObj.x;
  10666. this.rtStarY = rootBall.gameObj.y;
  10667. this.knifeTimes = 0;
  10668. this.playedLastSkill = true;
  10669. rootBall.forceRun = true;
  10670. rootBall.rigy.type = "static";
  10671. xGame.common.d2World.openCheckStill = true;
  10672. this.guanyuRandomKnife();
  10673. }
  10674. guanyuRandomKnife() {
  10675. let rootBall = xGame.common.d2World.rootBall;
  10676. let dir = this.getRandDir();
  10677. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10678. console.log("当前angle", angle);
  10679. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10680. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10681. let dis = 324;
  10682. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10683. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10684. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10685. this.rtStarX = rootBall.gameObj.x;
  10686. this.rtStarY = rootBall.gameObj.y;
  10687. this.knifeTimes++;
  10688. let skillLevel;
  10689. if (xGame.common.gameMgr.selfTurn) {
  10690. skillLevel = DataMgr.getBigSkillByIndex(4);
  10691. }
  10692. else {
  10693. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10694. }
  10695. if (!skillLevel)
  10696. skillLevel = 1;
  10697. skillLevel += 2;
  10698. if (this.knifeTimes < skillLevel) {
  10699. Laya.timer.once(400, this, () => {
  10700. this.guanyuRandomKnife();
  10701. });
  10702. }
  10703. else {
  10704. rootBall.forceRun = false;
  10705. rootBall.rigy.type = "dynamic";
  10706. xGame.common.extraMoveNum = skillLevel;
  10707. }
  10708. }));
  10709. }
  10710. getRandDir() {
  10711. let rootBall = xGame.common.d2World.rootBall;
  10712. let allBall = this.getAllBallArr();
  10713. let target = xGame.common.getRandArrEle(allBall);
  10714. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10715. return this.knifeV2;
  10716. }
  10717. cloneKnife(x, y, rotation) {
  10718. let parent = xGame.common.d3World.knifeRoot;
  10719. let prefab = xGame.common.d3World.knife;
  10720. let clone = prefab.clone();
  10721. parent.addChild(clone);
  10722. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10723. clone.transform.localPositionX = this.knifeV3.x;
  10724. clone.transform.localPositionY = 0;
  10725. clone.transform.localPositionZ = this.knifeV3.z;
  10726. clone.transform.localRotationEulerX = 0;
  10727. clone.transform.localRotationEulerY = rotation;
  10728. clone.transform.localRotationEulerZ = 0;
  10729. clone.active = true;
  10730. return clone;
  10731. }
  10732. cloneGuanYuEft(x, y, angle) {
  10733. return;
  10734. let parent = xGame.common.gameUI.ui.guanyuNode;
  10735. let eft = new ui_guanyuAni();
  10736. eft.parent = parent;
  10737. eft.x = x;
  10738. eft.y = y;
  10739. eft.rotation = angle;
  10740. }
  10741. }
  10742. class ui_UIWordsList extends fgui.GComponent {
  10743. static createInstance() {
  10744. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10745. }
  10746. onConstruct() {
  10747. this.c1 = this.getController("c1");
  10748. this.n74 = (this.getChild("n74"));
  10749. this.clickNode = (this.getChild("clickNode"));
  10750. this.myNode = (this.getChild("myNode"));
  10751. this.n68 = (this.getChild("n68"));
  10752. this.n66 = (this.getChild("n66"));
  10753. this.n55 = (this.getChild("n55"));
  10754. this.wordsBtn = (this.getChild("wordsBtn"));
  10755. this.emotionBtn = (this.getChild("emotionBtn"));
  10756. this.mybggg = (this.getChild("mybggg"));
  10757. this.wordsList = (this.getChild("wordsList"));
  10758. this.emotionList = (this.getChild("emotionList"));
  10759. this.myRoot = (this.getChild("myRoot"));
  10760. }
  10761. }
  10762. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10763. class EmotionDisplay {
  10764. constructor(index, ui) {
  10765. this.ui = ui;
  10766. this.index = index;
  10767. this.ui.onClick(this, this.clickSelf);
  10768. this.updateSelf();
  10769. }
  10770. updateSelf() {
  10771. let data = cfgTable.emotionData[this.index + 1];
  10772. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10773. }
  10774. clickSelf() {
  10775. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10776. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10777. xGame.common.talkMgr.closeTalkView();
  10778. }
  10779. }
  10780. class WordsDisplay {
  10781. constructor(index, ui) {
  10782. this.ui = ui;
  10783. this.index = index;
  10784. this.ui.onClick(this, this.clickSelf);
  10785. this.updateSelf();
  10786. }
  10787. updateSelf() {
  10788. let data = cfgTable.talkwordsData[this.index + 1];
  10789. this.ui.txt.text = data.msg;
  10790. }
  10791. clickSelf() {
  10792. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10793. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10794. xGame.common.talkMgr.closeTalkView();
  10795. }
  10796. }
  10797. class UIWordsList extends UIBase {
  10798. constructor() {
  10799. super();
  10800. }
  10801. onConstructor() {
  10802. this.ui = ui_UIWordsList.createInstance();
  10803. this.contentPane = this.ui;
  10804. this.isEject = false;
  10805. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10806. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10807. this.addUIClick(this.ui.clickNode, this.hide);
  10808. this.initTalkList();
  10809. this.initEmotionList();
  10810. }
  10811. show() {
  10812. super.show();
  10813. }
  10814. initTalkList() {
  10815. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10816. let data = cfgTable.talkwordsData;
  10817. let length = Object.keys(data).length;
  10818. this.ui.wordsList.numItems = length;
  10819. }
  10820. initEmotionList() {
  10821. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10822. let data = cfgTable.emotionData;
  10823. let length = Object.keys(data).length;
  10824. this.ui.emotionList.numItems = length;
  10825. }
  10826. renderTalkItem(index, obj) {
  10827. let temp = new WordsDisplay(index, obj);
  10828. }
  10829. renderEmotionItem(index, obj) {
  10830. let temp = new EmotionDisplay(index, obj);
  10831. }
  10832. openTalkList() {
  10833. this.ui.c1.selectedIndex = 0;
  10834. }
  10835. openEmotionList() {
  10836. this.ui.c1.selectedIndex = 1;
  10837. }
  10838. }
  10839. UIWordsList.uiName = "UIWordsList";
  10840. class TalkMgr {
  10841. constructor() {
  10842. this.aiSpeak = true;
  10843. this.emotionList = [];
  10844. this.talkList = [];
  10845. this.addEvent();
  10846. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10847. this.emotionList = [];
  10848. this.talkList = [];
  10849. for (let k in cfgTable.emotionData) {
  10850. this.emotionList.push(cfgTable.emotionData[k].id);
  10851. }
  10852. for (let k in cfgTable.talkwordsData) {
  10853. this.talkList.push(cfgTable.talkwordsData[k].id);
  10854. }
  10855. }
  10856. addEvent() {
  10857. let ui = xGame.common.gameUI.ui;
  10858. ui.wordsBtn.visible = true;
  10859. ui.wordsBtn.onClick(this, this.openTalkView);
  10860. ui.aiWordsBtn.visible = true;
  10861. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10862. }
  10863. openTalkView() {
  10864. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10865. xGame.uiMgr.Show(UIWordsList);
  10866. }
  10867. closeTalkView() {
  10868. xGame.uiMgr.Hide(UIWordsList);
  10869. }
  10870. clickAIState() {
  10871. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10872. this.aiSpeak = !this.aiSpeak;
  10873. this.changeAIState(this.aiSpeak);
  10874. }
  10875. changeAIState(speak) {
  10876. this.aiSpeak = speak;
  10877. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10878. if (speak) {
  10879. btn.c1.selectedIndex = 0;
  10880. }
  10881. else {
  10882. btn.c1.selectedIndex = 1;
  10883. }
  10884. }
  10885. showSelfTalk(wordsId) {
  10886. let ui = xGame.common.gameUI.ui;
  10887. ui.selfTalk.visible = true;
  10888. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10889. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10890. ui.selfTalk.t0.play();
  10891. }
  10892. showSelfEmotion(emotionId) {
  10893. let ui = xGame.common.gameUI.ui;
  10894. ui.selfTalk.visible = true;
  10895. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10896. this.selfSpine && this.selfSpine.dispose();
  10897. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10898. let spineData = cfgTable.emotionData[emotionId].spine;
  10899. this.selfSpine = new SpineMgr(spineData, () => {
  10900. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10901. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10902. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10903. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10904. });
  10905. ui.selfTalk.t0.play();
  10906. }
  10907. showAITalk(wordsId) {
  10908. if (!this.aiSpeak)
  10909. return;
  10910. if (DataMgr.gameData.gameCount < 2)
  10911. return;
  10912. if (wordsId < 1)
  10913. wordsId = this.getRandTalk();
  10914. let ui = xGame.common.gameUI.ui;
  10915. ui.aiTalk.visible = true;
  10916. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10917. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10918. ui.aiTalk.t0.play();
  10919. }
  10920. getRandTalk() {
  10921. let rand = xGame.tools.random(0, this.talkList.length);
  10922. return this.emotionList[rand];
  10923. }
  10924. getRandEmotion() {
  10925. let rand = xGame.tools.random(0, this.emotionList.length);
  10926. return this.emotionList[rand];
  10927. }
  10928. showAIEmotion(emotionId) {
  10929. if (!this.aiSpeak)
  10930. return;
  10931. if (DataMgr.gameData.gameCount < 2)
  10932. return;
  10933. if (emotionId < 1)
  10934. emotionId = this.getRandEmotion();
  10935. let ui = xGame.common.gameUI.ui;
  10936. ui.aiTalk.visible = true;
  10937. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10938. this.aiSpine && this.aiSpine.dispose();
  10939. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10940. let spineData = cfgTable.emotionData[emotionId].spine;
  10941. this.aiSpine = new SpineMgr(spineData, () => {
  10942. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10943. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10944. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10945. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10946. });
  10947. ui.aiTalk.t0.play();
  10948. }
  10949. resetGame() {
  10950. let ui = xGame.common.gameUI.ui;
  10951. ui.aiTalk.visible = false;
  10952. ui.selfTalk.visible = false;
  10953. this.aiSpine && this.aiSpine.dispose();
  10954. this.selfSpine && this.selfSpine.dispose();
  10955. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10956. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10957. this.closeTalkView();
  10958. }
  10959. }
  10960. class WordsMgr {
  10961. constructor() {
  10962. this.comboTimes = 1;
  10963. this.skillTimes = 0;
  10964. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10965. this.comboSpine = new SpineMgr("yxz_liangan");
  10966. this.skillSpine = new SpineMgr("yiganxqiu");
  10967. this.scoreSpine = new SpineMgr("defen");
  10968. }
  10969. setClassicCombo(isInterrupt) {
  10970. if (isInterrupt) {
  10971. this.comboTimes = 0;
  10972. }
  10973. }
  10974. playClassicWords(type, callback) {
  10975. this.callback = callback;
  10976. let aniIndex = type;
  10977. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10978. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10979. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10980. mySpine.destroy(true);
  10981. this.playClassicTimes();
  10982. });
  10983. }
  10984. playClassicTimes() {
  10985. this.comboTimes++;
  10986. if (this.comboTimes <= 1) {
  10987. this.callback && this.callback();
  10988. }
  10989. else {
  10990. let aniIndex = this.comboTimes - 1;
  10991. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10992. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10993. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10994. mySpine.destroy(true);
  10995. this.callback && this.callback();
  10996. });
  10997. }
  10998. }
  10999. playBigSkillTimes(times, callback) {
  11000. if (times <= 0) {
  11001. callback && callback();
  11002. return;
  11003. }
  11004. this.callback = callback;
  11005. let pre = "sz_0";
  11006. let aniIndex = 0;
  11007. this.getWordsImg(times, pre, () => {
  11008. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11009. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11010. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  11011. let r1 = ``;
  11012. let r2 = ``;
  11013. if (times <= 9) {
  11014. r1 = `res/d2Res/${pre}${times}.png`;
  11015. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11016. aniIndex = 0;
  11017. }
  11018. else {
  11019. r1 = `res/d2Res/${pre}${times % 10}.png`;
  11020. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  11021. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  11022. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  11023. aniIndex = 1;
  11024. }
  11025. this.skillSpine.play(data, aniIndex, false, parent, () => {
  11026. mySpine.destroy(true);
  11027. xGame.common.gameMgr.playSkillTips();
  11028. this.playScore(times);
  11029. xGame.common.playRandomMutiBallBigSkillSound();
  11030. }, mySpine);
  11031. });
  11032. }
  11033. playScore(score) {
  11034. let pre = "sz_";
  11035. let aniIndex = 0;
  11036. this.getWordsImg(score, pre, () => {
  11037. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11038. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11039. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11040. let r1 = ``;
  11041. let r2 = ``;
  11042. if (score <= 9) {
  11043. r1 = `res/d2Res/${pre}${score}.png`;
  11044. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11045. aniIndex = 0;
  11046. }
  11047. else {
  11048. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11049. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11050. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11051. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11052. aniIndex = 1;
  11053. }
  11054. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11055. mySpine.destroy(true);
  11056. this.callback && this.callback();
  11057. }, mySpine);
  11058. });
  11059. }
  11060. getWordsImg(number, pre = "", callback) {
  11061. let arr = [];
  11062. if (number <= 9) {
  11063. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11064. }
  11065. else {
  11066. 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 });
  11067. }
  11068. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11069. callback && callback();
  11070. }));
  11071. }
  11072. }
  11073. class ui_UIRodMethod extends fgui.GComponent {
  11074. static createInstance() {
  11075. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11076. }
  11077. onConstruct() {
  11078. this.n24 = (this.getChild("n24"));
  11079. this.white = (this.getChild("white"));
  11080. this.dot = (this.getChild("dot"));
  11081. this.sureBtn = (this.getChild("sureBtn"));
  11082. this.n20 = (this.getChild("n20"));
  11083. this.n21 = (this.getChild("n21"));
  11084. this.n22 = (this.getChild("n22"));
  11085. this.n23 = (this.getChild("n23"));
  11086. this.n5 = (this.getChild("n5"));
  11087. this.n14 = (this.getChild("n14"));
  11088. this.t0 = this.getTransition("t0");
  11089. }
  11090. }
  11091. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11092. class UIRodMethod extends UIBase {
  11093. constructor() {
  11094. super();
  11095. this.isPressd = false;
  11096. }
  11097. onConstructor() {
  11098. this.ui = ui_UIRodMethod.createInstance();
  11099. this.contentPane = this.ui;
  11100. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11101. this.moveDir = new Laya.Vector2();
  11102. this.moveDest = new Laya.Vector2();
  11103. this.centerPos = new Laya.Vector2();
  11104. xGame.common.uiRodMethod = this;
  11105. }
  11106. show() {
  11107. super.show();
  11108. xGame.common.gameMgr.gamePause = true;
  11109. this.openPressDotEvent();
  11110. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11111. this.centerPos.x = this.ui.white.x;
  11112. this.centerPos.y = this.ui.white.y;
  11113. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11114. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11115. this.setDot();
  11116. }
  11117. setDot() {
  11118. this.ui.dot.x = this.moveDest.x;
  11119. this.ui.dot.y = this.moveDest.y;
  11120. }
  11121. closeSelf() {
  11122. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11123. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11124. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11125. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11126. xGame.common.gameMgr.gamePause = false;
  11127. this.hide();
  11128. }
  11129. openPressDotEvent() {
  11130. this.closePressDotEvent();
  11131. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11132. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11133. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11134. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11135. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11136. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11137. }
  11138. closePressDotEvent() {
  11139. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11140. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11141. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11142. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11143. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11144. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11145. }
  11146. onDown(e) {
  11147. if (e.type == Laya.Event.MOUSE_DOWN)
  11148. this.isPressd = true;
  11149. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11150. this.isPressd = false;
  11151. if (!this.isPressd)
  11152. return;
  11153. this.moveDest.x = e.stageX;
  11154. this.moveDest.y = e.stageY;
  11155. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11156. if (dis > 6724) {
  11157. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11158. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11159. }
  11160. this.setDot();
  11161. }
  11162. resetRod() {
  11163. this.ui.dot.x = this.ui.white.x;
  11164. this.ui.dot.y = this.ui.white.y;
  11165. this.gameRod.dot.x = this.gameRod.bg.x;
  11166. this.gameRod.dot.y = this.gameRod.bg.y;
  11167. xGame.common.rodOffest.x = 0;
  11168. xGame.common.rodOffest.y = 0;
  11169. }
  11170. }
  11171. UIRodMethod.uiName = "UIRodMethod";
  11172. class UIGame extends UIBase {
  11173. constructor() {
  11174. super();
  11175. this.powerNum = 0;
  11176. this.isD3Inited = false;
  11177. this.isPrePlay = false;
  11178. this.isMoveRod = false;
  11179. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11180. this.rulerDis = 20;
  11181. this.rulerOffset = 0;
  11182. }
  11183. onConstructor() {
  11184. this.ui = ui_UIGame.createInstance();
  11185. this.contentPane = this.ui;
  11186. this.ui.x += xGame.common.sysOffestNum;
  11187. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11188. this.isEject = false;
  11189. xGame.common.gameUI = this;
  11190. this.initSelf();
  11191. }
  11192. isTurnSelf() {
  11193. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11194. return true;
  11195. }
  11196. }
  11197. initSelf() {
  11198. let topUI = this.ui.topNode;
  11199. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11200. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11201. this.barInfo = {};
  11202. this.barInfo.curY = 0;
  11203. this.barInfo.height = this.ui.powerNode.height;
  11204. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11205. this.barInfo.powerStartY = this.ui.powerNode.y;
  11206. xGame.common.aiPlayer = new AIPlayer();
  11207. xGame.common.gameMgr = new GameMgr();
  11208. xGame.common.skillMgr = new SkillMgr();
  11209. xGame.common.wordsMgr = new WordsMgr();
  11210. xGame.common.talkMgr = new TalkMgr();
  11211. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11212. console.log("加载经典模式表情文件chenggon !");
  11213. });
  11214. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11215. console.log("挑战模式奖励模式spine加载成功!");
  11216. });
  11217. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11218. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11219. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11220. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11221. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11222. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11223. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11224. }
  11225. getGanZiImg() {
  11226. let index = DataMgr.getCurBallRod();
  11227. let data = cfgTable.ballrodData[index + 1];
  11228. let gan_url = xGame.common.getGameIconUrl(data.img);
  11229. console.log('zh:getGanZiImg gan_url==' + gan_url);
  11230. this.ui.powerNode.showImg.url = gan_url;
  11231. console.log('zh:修改杆子图标O K');
  11232. }
  11233. returnHome() {
  11234. let tips = "Are you sure to exit the game?";
  11235. let woman = "Boss, why don't you play for a while longer?";
  11236. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11237. }
  11238. addRodMethodClick() {
  11239. if (this.isTurnSelf()) {
  11240. xGame.uiMgr.Show(UIRodMethod);
  11241. }
  11242. }
  11243. clickHelpLineBtn(force = false) {
  11244. if (!this.isTurnSelf())
  11245. return;
  11246. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11247. if (success) {
  11248. xGame.common.longHelpLine = true;
  11249. xGame.common.d2World.getHelpLine();
  11250. Moyu.sendDataEvent("guideNum");
  11251. }
  11252. else {
  11253. }
  11254. });
  11255. }
  11256. renderSelfDisplayBalls(index, target) {
  11257. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11258. target.myImg.url = xGame.common.getGameIconUrl(str);
  11259. }
  11260. renderAIDisplayBalls(index, target) {
  11261. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11262. target.myImg.url = xGame.common.getGameIconUrl(str);
  11263. ;
  11264. }
  11265. updateMode() {
  11266. if (xGame.common.gameMode == GameMode.classic) {
  11267. this.ui.topNode.scoreNode.visible = false;
  11268. }
  11269. else if (xGame.common.gameMode == GameMode.bigMove) {
  11270. this.ui.topNode.scoreNode.visible = true;
  11271. }
  11272. }
  11273. show() {
  11274. super.show();
  11275. console.log("zh:uigame show AADD");
  11276. this.ui.alpha = 0;
  11277. this.updateSelf();
  11278. xGame.common.gameMgr.gamePause = false;
  11279. xGame.common.gameUI.ui.blackAni.visible = false;
  11280. xGame.common.gameUI.ui.whiteAni.visible = false;
  11281. this.ui.powerEft.visible = false;
  11282. this.ui.colorNode.visible = false;
  11283. this.updateHead();
  11284. let curUse = DataMgr.getCurBallRod();
  11285. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  11286. this.getGanZiImg();
  11287. }
  11288. updateSelf() {
  11289. if (xGame.common.gameMode == GameMode.classic) {
  11290. this.ui.c1.selectedIndex = 0;
  11291. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11292. this.ui.topNode.middleNode.visible = true;
  11293. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11294. }
  11295. else if (xGame.common.gameMode == GameMode.bigMove) {
  11296. this.ui.c1.selectedIndex = 0;
  11297. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11298. this.ui.topNode.middleNode.visible = false;
  11299. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11300. let rand = xGame.common.randomNum(1, max);
  11301. let guide = DataMgr.getSkillGuide();
  11302. if (guide == 0)
  11303. rand = 1;
  11304. xGame.common.bigMoveLevelIndex = rand;
  11305. }
  11306. else if (xGame.common.gameMode == GameMode.placeBall) {
  11307. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11308. this.ui.c1.selectedIndex = 1 + data.type;
  11309. this.ui.alpha = 1;
  11310. this.startGame();
  11311. }
  11312. this.updateMode();
  11313. this.initD3world();
  11314. this.initD2world();
  11315. }
  11316. startGame() {
  11317. this.ui.snowNode.visible = Math.random() <= 0.1;
  11318. this.ui.d2Node.visible = false;
  11319. xGame.common.d3World.d3Hand.gameObj.active = false;
  11320. xGame.common.d3World.tableSrc.init();
  11321. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11322. this.cameraViewChange(() => {
  11323. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11324. switch (xGame.common.gameMode) {
  11325. case GameMode.classic:
  11326. xGame.common.d3World.d3Hand.gameObj.active = true;
  11327. this.playPutBallD3Ani();
  11328. break;
  11329. case GameMode.bigMove:
  11330. this.enterGame();
  11331. Laya.timer.once(500, this, () => {
  11332. this.ui.topNode.middleNode.visible = true;
  11333. this.ui.topNode.middleNode.t0.play();
  11334. });
  11335. break;
  11336. case GameMode.placeBall:
  11337. this.enterGame();
  11338. break;
  11339. default:
  11340. break;
  11341. }
  11342. });
  11343. PlatMgr.showBanner(false);
  11344. }
  11345. enterGame() {
  11346. this.ui.d2Node.visible = true;
  11347. xGame.common.d3World.d3Hand.gameObj.active = false;
  11348. xGame.common.showOneCamera("mainCamera");
  11349. Moyu.recordGame(30, true);
  11350. if (!this.isPrePlay) {
  11351. this.isPrePlay = true;
  11352. xGame.common.d3World.prePlayEft();
  11353. }
  11354. xGame.common.gameMgr.gameReady();
  11355. this.openAllEvent();
  11356. this.ui.snowNode.visible = false;
  11357. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11358. this.ui.helpBtn.visible = condition;
  11359. }
  11360. showHelpLineGuide() {
  11361. let longGuide = DataMgr.getGuideHelpLine();
  11362. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11363. this.ui.helpBtn.visible = true;
  11364. this.ui.guideNode.visible = true;
  11365. }
  11366. }
  11367. setTurnAlpha(alpha) {
  11368. this.ui.keduNode.alpha = alpha;
  11369. this.ui.ganNode.alpha = alpha;
  11370. this.ui.rodMethodNode.alpha = alpha;
  11371. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11372. }
  11373. cameraViewChange(callback) {
  11374. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11375. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11376. xGame.common.showOneCamera("visitAngle");
  11377. cameraSrc.localRotationEulerY = 180;
  11378. cameraSrc.localRotationEulerZ = 0;
  11379. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11380. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11381. callback && callback();
  11382. }));
  11383. }));
  11384. }
  11385. playPutBallD3Ani() {
  11386. xGame.common.showOneCamera("mainCamera");
  11387. let handSrc = xGame.common.d3World.d3Hand;
  11388. handSrc.gameObj.active = true;
  11389. handSrc.transform.localPositionZ = 3;
  11390. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11391. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11392. handSrc.gameObj.active = false;
  11393. this.enterGame();
  11394. }), 400);
  11395. }));
  11396. }
  11397. updateHead() {
  11398. let user = Moyu.getUserInfo();
  11399. this.ui.topNode.selfNameTxt.text = user.nickName;
  11400. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11401. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11402. if (DataMgr.getSkillGuide() < 1) {
  11403. this.ui.topNode.aiNameTxt.text = 'billiards';
  11404. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11405. }
  11406. else {
  11407. this.ui.topNode.aiNameTxt.text = aiData.name;
  11408. let randNo = Math.floor(Math.random() * 10) + 1;
  11409. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11410. }
  11411. }
  11412. initD2world() {
  11413. let node = this.ui.d2Root.displayObject;
  11414. let src = node.getComponent(D2World);
  11415. if (!src) {
  11416. xGame.common.d2World = node.addComponent(D2World);
  11417. }
  11418. xGame.common.d2World.initSelf();
  11419. }
  11420. initD3world() {
  11421. if (this.isD3Inited)
  11422. return;
  11423. this.isD3Inited = true;
  11424. let scene3D = xGame.common.d3Scene;
  11425. this.ui.d3Root.displayObject.addChild(scene3D);
  11426. scene3D.active = true;
  11427. xGame.common.d3World.tableSrc.setBorderPos();
  11428. }
  11429. onRootMove(e) {
  11430. let rootBall = xGame.common.d2World.rootBall;
  11431. this.ui.moveNode.x = e.x;
  11432. this.ui.moveNode.y = e.y;
  11433. rootBall.gameObj.x = e.x;
  11434. rootBall.gameObj.y = e.y;
  11435. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11436. }
  11437. aiRootMove(move) {
  11438. if (move)
  11439. this.hideBallUI();
  11440. else {
  11441. this.showBallUI();
  11442. xGame.common.d2World.getHelpLine();
  11443. }
  11444. }
  11445. aiForce(type, force = 0) {
  11446. this.pressTarget = PressType.powerNode;
  11447. if (type == 1)
  11448. this.onEventUp({ force: true });
  11449. else if (type == 2)
  11450. this.onEventMove({ stageY: force, force: true });
  11451. }
  11452. onEventPress(e) {
  11453. if (e.stopPropagation)
  11454. e.stopPropagation();
  11455. if (!this.isTurnSelf())
  11456. return;
  11457. let target = e.target;
  11458. switch (target) {
  11459. case this.ui.myPowerNode.displayObject:
  11460. this.pressTarget = PressType.powerNode;
  11461. this.barInfo.curY = e.stageY;
  11462. this.updateBarInfo();
  11463. break;
  11464. case this.ui.moveNode.displayObject:
  11465. this.pressTarget = PressType.moveNode;
  11466. this.hideBallUI();
  11467. this.eventObj.curX = this.ui.moveNode.x;
  11468. this.eventObj.curY = this.ui.moveNode.y;
  11469. this.ui.moveNode.finger.visible = false;
  11470. this.eventObj.lastX = e.stageX;
  11471. this.eventObj.lastY = e.stageY;
  11472. break;
  11473. case this.ui.rulerClickNode.displayObject:
  11474. this.pressTarget = PressType.rulerNode;
  11475. this.eventObj.lastY = e.stageY;
  11476. break;
  11477. case this.ui.d2Root.displayObject:
  11478. this.pressTarget = PressType.d2Root;
  11479. this.eventObj.lastX = e.stageX;
  11480. this.eventObj.lastY = e.stageY;
  11481. this.eventObj.starX = e.stageX;
  11482. this.eventObj.starY = e.stageY;
  11483. this.eventObj.curX = 0;
  11484. this.eventObj.curY = 0;
  11485. xGame.common.d2World.d2Gan.setGanLastInfo();
  11486. this.rulerOffset = 0;
  11487. break;
  11488. default:
  11489. break;
  11490. }
  11491. }
  11492. onEventMove(e) {
  11493. if (e.stopPropagation)
  11494. e.stopPropagation();
  11495. if (e && e.force) {
  11496. }
  11497. else {
  11498. if (!this.isTurnSelf())
  11499. return;
  11500. }
  11501. switch (this.pressTarget) {
  11502. case PressType.powerNode:
  11503. this.barInfo.curY = e.stageY;
  11504. this.updateBarInfo();
  11505. this.isMoveRod = true;
  11506. break;
  11507. case PressType.moveNode:
  11508. let rootBall = xGame.common.d2World.rootBall;
  11509. let radius = rootBall.gameObj.width / 2;
  11510. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11511. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11512. let border = xGame.common.d2World.borderRect;
  11513. if (curX <= border.x + radius)
  11514. curX = border.x + radius;
  11515. else if (curX >= border.x + border.width - radius)
  11516. curX = border.x + border.width - radius;
  11517. if (curY <= border.y + radius)
  11518. curY = border.y + radius;
  11519. else if (curY >= border.y + border.height - radius)
  11520. curY = border.y + border.height - radius;
  11521. if (xGame.common.gameMgr.isOpenBall) {
  11522. if (curX >= border.x + border.openBallW - radius)
  11523. curX = border.x + border.openBallW - radius;
  11524. }
  11525. this.ui.moveNode.x = curX;
  11526. this.ui.moveNode.y = curY;
  11527. rootBall.gameObj.x = curX;
  11528. rootBall.gameObj.y = curY;
  11529. rootBall.d3BallSrc.setTransPos(curX, curY);
  11530. this.isMoveRod = true;
  11531. break;
  11532. case PressType.rulerNode:
  11533. let yy = e.stageY - this.eventObj.lastY;
  11534. this.eventObj.lastY = e.stageY;
  11535. let ruler1 = this.ui.rulerNode.img1;
  11536. let ruler2 = this.ui.rulerNode.img2;
  11537. ruler1.y += yy;
  11538. ruler2.y += yy;
  11539. this.rulerOffset += yy;
  11540. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11541. this.rulerOffset = 0;
  11542. xGame.soundMgr.playSound("inch", 1, 10);
  11543. }
  11544. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11545. let h = ruler1.height;
  11546. this.checkGuide();
  11547. this.isMoveRod = true;
  11548. if (ruler1.y >= h) {
  11549. ruler1.y = -h;
  11550. ruler2.y = 0;
  11551. return;
  11552. }
  11553. else if (ruler1.y <= -h) {
  11554. ruler1.y = h;
  11555. ruler2.y = 0;
  11556. return;
  11557. }
  11558. if (ruler2.y >= h) {
  11559. ruler2.y = -h;
  11560. ruler1.y = 0;
  11561. return;
  11562. }
  11563. else if (ruler2.y <= -h) {
  11564. ruler2.y = h;
  11565. ruler1.y = 0;
  11566. return;
  11567. }
  11568. break;
  11569. case PressType.d2Root:
  11570. this.eventObj.curX = e.stageX;
  11571. this.eventObj.curY = e.stageY;
  11572. let offset = this.checkRodMoveDir();
  11573. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11574. this.eventObj.lastX = e.stageX;
  11575. this.eventObj.lastY = e.stageY;
  11576. break;
  11577. default:
  11578. break;
  11579. }
  11580. }
  11581. onEventUp(e) {
  11582. if (e.stopPropagation)
  11583. e.stopPropagation();
  11584. if (e && e.force) {
  11585. }
  11586. else {
  11587. if (!this.isTurnSelf())
  11588. return;
  11589. }
  11590. switch (this.pressTarget) {
  11591. case PressType.powerNode:
  11592. this.ui.powerNode.value = 0;
  11593. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11594. this.ui.powerTxt.text = "";
  11595. if (this.powerNum > 0) {
  11596. xGame.eventMgr.event(BALL_SHOOT);
  11597. xGame.common.d2World.shoot(this.powerNum);
  11598. xGame.common.d2World.d2Gan.shoot();
  11599. xGame.common.d2World.d2HelpLine.shoot();
  11600. this.finishGuide();
  11601. this.ui.powerEft.visible = false;
  11602. this.ui.colorNode.visible = false;
  11603. let ganStr = "";
  11604. if (this.powerNum <= 30) {
  11605. ganStr = "gan_30";
  11606. }
  11607. else if (this.powerNum <= 60) {
  11608. ganStr = "gan_50";
  11609. }
  11610. else {
  11611. ganStr = "gan_80";
  11612. }
  11613. xGame.soundMgr.playSound(ganStr);
  11614. }
  11615. break;
  11616. case PressType.moveNode:
  11617. let rootBall = xGame.common.d2World.rootBall;
  11618. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11619. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11620. let isIntersect = this.judgeBallIntersect();
  11621. if (isIntersect) {
  11622. this.ui.moveNode.x = lastX;
  11623. this.ui.moveNode.y = lastY;
  11624. rootBall.gameObj.x = lastX;
  11625. rootBall.gameObj.y = lastY;
  11626. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11627. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11628. }
  11629. else {
  11630. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11631. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11632. }
  11633. this.showBallUI();
  11634. this.ui.moveNode.finger.visible = true;
  11635. xGame.common.d2World.getHelpLine();
  11636. break;
  11637. case PressType.rulerNode:
  11638. break;
  11639. case PressType.d2Root:
  11640. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11641. if (dis <= 25) {
  11642. this.moveToClickDot(e);
  11643. }
  11644. break;
  11645. default:
  11646. break;
  11647. }
  11648. this.pressTarget = -1;
  11649. }
  11650. checkGuide() {
  11651. let guide = DataMgr.getSkillGuide();
  11652. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11653. xGame.common.guideStep++;
  11654. xGame.common.gameUI.ui.guide2.visible = false;
  11655. xGame.common.gameUI.ui.guide3.visible = true;
  11656. }
  11657. }
  11658. finishGuide() {
  11659. let guide = DataMgr.getSkillGuide();
  11660. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11661. xGame.common.guideStep = 10;
  11662. this.closeAllGuide();
  11663. console.log('zh: 新手引导完毕');
  11664. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11665. }
  11666. }
  11667. closeAllGuide() {
  11668. xGame.common.gameUI.ui.guide1.visible = false;
  11669. xGame.common.gameUI.ui.guide2.visible = false;
  11670. xGame.common.gameUI.ui.guide3.visible = false;
  11671. }
  11672. updateBarInfo() {
  11673. let star = this.ui.powerNode.y;
  11674. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11675. if (rate >= 1)
  11676. rate = 1;
  11677. if (rate <= 0)
  11678. rate = 0;
  11679. this.powerNum = Math.ceil(rate * 100);
  11680. this.ui.powerNode.value = this.powerNum;
  11681. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11682. this.ui.colorNode.value = this.powerNum;
  11683. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11684. this.ui.powerEft.visible = this.powerNum != 0;
  11685. this.ui.colorNode.visible = this.powerNum != 0;
  11686. this.ui.powerTxt.text = this.powerNum + "";
  11687. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11688. }
  11689. forceCancel() {
  11690. this.ui.powerNode.value = 0;
  11691. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11692. this.ui.powerTxt.text = "";
  11693. }
  11694. checkRodMoveDir() {
  11695. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11696. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11697. if (tempX >= 0 && tempY <= 0) {
  11698. return this.checkDir();
  11699. }
  11700. else if (tempX < 0 && tempY < 0) {
  11701. return this.checkDir(1, -1);
  11702. }
  11703. else if (tempX < 0 && tempY > 0) {
  11704. return this.checkDir(-1, -1);
  11705. }
  11706. else {
  11707. return this.checkDir(-1, 1);
  11708. }
  11709. }
  11710. checkDir(flagX = 1, flagY = 1) {
  11711. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11712. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11713. if (offsetY == 0) {
  11714. return offsetX * flagX;
  11715. }
  11716. if (offsetX == 0) {
  11717. return offsetY * flagY;
  11718. }
  11719. let angle = offsetY / offsetX;
  11720. if (Math.abs(angle) >= 1) {
  11721. return offsetY * flagY;
  11722. }
  11723. else {
  11724. return offsetX * flagX;
  11725. }
  11726. }
  11727. judgeBallIntersect() {
  11728. let rootBall = xGame.common.d2World.rootBall;
  11729. let ballArr = xGame.common.d2World.ballArr;
  11730. let radius = rootBall.gameObj.width / 2;
  11731. let temp;
  11732. let isIntersect = false;
  11733. for (let index = 0; index < ballArr.length; index++) {
  11734. temp = ballArr[index];
  11735. if (temp.number == rootBall.number)
  11736. continue;
  11737. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11738. if (isIntersect) {
  11739. break;
  11740. }
  11741. }
  11742. return isIntersect;
  11743. }
  11744. hideBallUI() {
  11745. let d2Gan = xGame.common.d2World.d2Gan;
  11746. if (!d2Gan.ui.isDisposed)
  11747. d2Gan.ui.visible = false;
  11748. let d2Help = xGame.common.d2World.d2HelpLine;
  11749. if (!d2Help.ui.isDisposed)
  11750. d2Help.ui.visible = false;
  11751. let rootBall = xGame.common.d2World.rootBall;
  11752. if (!rootBall.destroyed) {
  11753. rootBall.gameObj.active = false;
  11754. }
  11755. }
  11756. showBallUI() {
  11757. let d2Gan = xGame.common.d2World.d2Gan;
  11758. if (!d2Gan.ui.isDisposed)
  11759. d2Gan.ui.visible = true;
  11760. let d2Help = xGame.common.d2World.d2HelpLine;
  11761. if (!d2Help.ui.isDisposed)
  11762. d2Help.ui.visible = true;
  11763. let rootBall = xGame.common.d2World.rootBall;
  11764. if (!rootBall.destroyed) {
  11765. rootBall.gameObj.active = true;
  11766. }
  11767. }
  11768. moveToClickDot(e) {
  11769. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11770. let root = xGame.common.d2World.rootBall.gameObj;
  11771. let xx = e.stageX - xGame.common.sysOffestNum;
  11772. let yy = e.stageY;
  11773. let x = xx - root.x;
  11774. let y = yy - root.y;
  11775. let angle = xGame.common.getfguiRotation(x, y);
  11776. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11777. xGame.common.d2World.getHelpLine();
  11778. }
  11779. this.isMoveRod = false;
  11780. xGame.common.clickedBall = false;
  11781. }
  11782. openAllEvent() {
  11783. this.closeAllEvent();
  11784. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11785. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11786. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11787. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11788. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11789. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11790. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11791. }
  11792. closeAllEvent() {
  11793. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11794. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11795. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11796. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11797. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11798. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11799. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11800. }
  11801. resetGame() {
  11802. this.closeAllEvent();
  11803. this.hideBallUI();
  11804. xGame.common.gameMgr.gamePause = true;
  11805. }
  11806. }
  11807. UIGame.uiName = "UIGame";
  11808. class UIAddProp extends UIBase {
  11809. constructor() {
  11810. super();
  11811. this.curType = "";
  11812. }
  11813. onConstructor() {
  11814. this.ui = ui_UIAddProp.createInstance();
  11815. this.contentPane = this.ui;
  11816. this.isEject = false;
  11817. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11818. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11819. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11820. this.updateUI();
  11821. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11822. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11823. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11824. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11825. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11826. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11827. }
  11828. show(type) {
  11829. super.show();
  11830. this.curType = type == 0 ? "coin" : "diamond";
  11831. this.switchBtn("");
  11832. this.ui.t0.play();
  11833. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11834. PlatMgr.showInsert(true);
  11835. }
  11836. closeSelf() {
  11837. this.hide();
  11838. }
  11839. updateUI() {
  11840. let data = cfgTable.moneyData;
  11841. let temp;
  11842. let obj;
  11843. for (const key in data) {
  11844. temp = data[key];
  11845. obj = this.ui.myNode["node" + key];
  11846. if (parseInt(key) <= 2) {
  11847. obj.diamondTxt.text = "+" + temp.num;
  11848. }
  11849. else {
  11850. obj.coinTxt.text = temp.num;
  11851. obj.diamondTxt.text = temp.get.split('_')[1];
  11852. }
  11853. }
  11854. this.updateDiamondShare();
  11855. }
  11856. updateDiamondShare() {
  11857. let data = DataMgr.getShareDiamondTimes();
  11858. if (data >= xGame.common.maxShareDiamondTimes) {
  11859. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11860. this.ui.myNode.node1.touchable = false;
  11861. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11862. }
  11863. else {
  11864. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11865. this.ui.myNode.node1.touchable = true;
  11866. }
  11867. }
  11868. switchBtn(type) {
  11869. if (type == "")
  11870. type = this.curType;
  11871. else {
  11872. if (this.curType == type) {
  11873. return;
  11874. }
  11875. else {
  11876. this.curType = type;
  11877. }
  11878. }
  11879. if (type == "coin") {
  11880. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11881. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11882. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11883. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11884. this.ui.myNode.c1.selectedIndex = 0;
  11885. }
  11886. else {
  11887. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11888. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11889. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11890. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11891. this.ui.myNode.c1.selectedIndex = 1;
  11892. }
  11893. }
  11894. convertCoin(index) {
  11895. let data = cfgTable.moneyData[index];
  11896. let coinNum = data.num;
  11897. let str = data.get.split('_')[1];
  11898. let needDiamond = parseInt(str);
  11899. if (DataMgr.diamondEnough(needDiamond)) {
  11900. DataMgr.setDiamond(-needDiamond);
  11901. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11902. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11903. }
  11904. else {
  11905. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11906. this.switchBtn("diamond");
  11907. }
  11908. }
  11909. videoGetDiamond() {
  11910. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11911. if (Laya.Browser.onAndroid) {
  11912. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11913. if (!boo) {
  11914. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11915. return;
  11916. }
  11917. }
  11918. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11919. }
  11920. else {
  11921. console.log('zh:AD 失败,直接发放奖励');
  11922. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11923. }
  11924. }
  11925. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11926. let num = cfgTable.moneyData[2].num;
  11927. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11928. this.closeSelf();
  11929. }
  11930. videoGetCoin() {
  11931. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11932. if (Laya.Browser.onAndroid) {
  11933. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11934. if (!boo) {
  11935. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11936. return;
  11937. }
  11938. }
  11939. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11940. }
  11941. else {
  11942. console.log('zh:AD 失败,直接发放奖励');
  11943. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11944. }
  11945. }
  11946. qjff_AD_for_uiAddProp_videoGetCoin() {
  11947. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11948. this.closeSelf();
  11949. }
  11950. shareGetDiamond() {
  11951. let times = DataMgr.getShareDiamondTimes();
  11952. if (times >= xGame.common.maxShareDiamondTimes) {
  11953. console.log('zh: 233333333333 maxShareDiamondTimes');
  11954. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11955. }
  11956. else {
  11957. console.log('zh:33333333333333ad');
  11958. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11959. if (Laya.Browser.onAndroid) {
  11960. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11961. if (!boo) {
  11962. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11963. return;
  11964. }
  11965. }
  11966. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11967. }
  11968. else {
  11969. console.log('zh:AD 失败,直接发放奖励');
  11970. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11971. }
  11972. }
  11973. }
  11974. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11975. let diamond = xGame.common.randomNum(50, 100);
  11976. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11977. DataMgr.setShareDiamondTimes(1);
  11978. this.updateDiamondShare();
  11979. }
  11980. openPutBallView() {
  11981. let end = xGame.uiMgr.getUI(UIGameEnd);
  11982. let skill = xGame.uiMgr.getUI(UISkill);
  11983. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11984. let uigame = xGame.uiMgr.getUI(UIGame);
  11985. if (end && !end.isHide) {
  11986. xGame.uiMgr.Hide(UIGameEnd);
  11987. xGame.uiMgr.Show(UIMain);
  11988. }
  11989. if (skill && !skill.isHide)
  11990. xGame.uiMgr.Hide(UISkill);
  11991. if (uigame && !uigame.isHide)
  11992. xGame.uiMgr.Hide(UIGame);
  11993. if (level && !level.isHide) {
  11994. }
  11995. else {
  11996. xGame.uiMgr.Show(UILevelDisplay);
  11997. }
  11998. this.closeSelf();
  11999. }
  12000. }
  12001. UIAddProp.uiName = "UIAddProp";
  12002. class MoneyNode {
  12003. constructor(ui) {
  12004. this.leftTime = 0;
  12005. this.ui = ui;
  12006. this.ui.addCoinBtn.onClick(this, this.addCoin);
  12007. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  12008. this.ui.addPowerBtn.onClick(this, this.addPower);
  12009. this.ui.c1.selectedIndex = 1;
  12010. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  12011. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  12012. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  12013. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  12014. this.coinChange();
  12015. this.diamondChange();
  12016. this.powerChange();
  12017. }
  12018. addPower() {
  12019. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12020. xGame.uiMgr.Show(UIPower);
  12021. }
  12022. powerChange() {
  12023. let powerNum = DataMgr.getPower();
  12024. this.ui.powerTxt.text = powerNum + "";
  12025. }
  12026. checkPowerTime() {
  12027. let cur = new Date().getTime();
  12028. let last = DataMgr.getPowerTime();
  12029. if (last == 0) {
  12030. last = cur;
  12031. DataMgr.setPowerTime(cur);
  12032. }
  12033. let power = DataMgr.getPower();
  12034. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  12035. Laya.timer.clearAll(this);
  12036. if (power >= xGame.common.natureMaxPower) {
  12037. this.ui.powerTimeTxt.text = "";
  12038. DataMgr.setPowerTime(cur);
  12039. return;
  12040. }
  12041. if (power + offset >= xGame.common.natureMaxPower) {
  12042. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12043. this.ui.powerTimeTxt.text = "";
  12044. DataMgr.setPowerTime(cur);
  12045. }
  12046. else {
  12047. if (offset > 0) {
  12048. DataMgr.setPower(offset);
  12049. DataMgr.setPowerTime(cur);
  12050. }
  12051. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12052. this.leftTime = xGame.common.powerRecoverNum - time;
  12053. if (this.leftTime <= 0)
  12054. this.leftTime = 0;
  12055. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12056. Laya.timer.loop(1000, this, this.updatePowerTime);
  12057. }
  12058. }
  12059. updatePowerTime() {
  12060. this.leftTime -= 1;
  12061. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12062. if (this.leftTime <= 0) {
  12063. this.checkPowerTime();
  12064. }
  12065. }
  12066. coinChange() {
  12067. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12068. }
  12069. diamondChange() {
  12070. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12071. }
  12072. addCoin() {
  12073. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12074. Moyu.sendDataEvent("AddCoinBtn");
  12075. xGame.uiMgr.Show(UIAddProp, 0);
  12076. }
  12077. addDiamond() {
  12078. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12079. Moyu.sendDataEvent("AddDiamondBtn");
  12080. xGame.uiMgr.Show(UIAddProp, 1);
  12081. }
  12082. }
  12083. class UIDraw extends UIBase {
  12084. constructor() {
  12085. super();
  12086. this.curKey = 0;
  12087. }
  12088. onConstructor() {
  12089. this.ui = ui_UIDraw.createInstance();
  12090. this.contentPane = this.ui;
  12091. this.isEject = false;
  12092. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12093. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12094. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12095. this.initDraw();
  12096. this.initUI();
  12097. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12098. }
  12099. show() {
  12100. super.show();
  12101. this.ui.t0.play();
  12102. this.playSecretaryIdle();
  12103. this.updateDraw();
  12104. this.checkFree();
  12105. if (PlatMgr.bannerDelay > 0) {
  12106. this.ui.closeNode.closeBtn.visible = false;
  12107. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12108. this.ui.closeNode.closeBtn.visible = true;
  12109. });
  12110. }
  12111. PlatMgr.showRateBanner();
  12112. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12113. }
  12114. hide() {
  12115. Laya.timer.clearAll(this);
  12116. super.hide();
  12117. }
  12118. checkFree() {
  12119. let isFree = DataMgr.getDailyfreeDrawTimes();
  12120. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12121. }
  12122. initDraw() {
  12123. this.drawObj = [];
  12124. let data = cfgTable.drawData;
  12125. let temp;
  12126. let weight = 0;
  12127. for (const key in data) {
  12128. temp = data[key];
  12129. weight += temp.weight;
  12130. this.drawObj.push(weight);
  12131. }
  12132. this.allWeight = weight;
  12133. }
  12134. initUI() {
  12135. let data = cfgTable.drawData;
  12136. let temp;
  12137. let img;
  12138. let txt;
  12139. for (const key in data) {
  12140. temp = data[key];
  12141. img = this.ui.myNode.rotNode["img" + key];
  12142. txt = this.ui.myNode.rotNode["txt" + key];
  12143. img.url = xGame.common.getGameIconUrl(temp.icon);
  12144. txt.visible = true;
  12145. if (temp.award > 2) {
  12146. img.rotation = 0;
  12147. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12148. }
  12149. else {
  12150. img.rotation = temp.rotation;
  12151. txt.text = temp.num;
  12152. }
  12153. }
  12154. }
  12155. getCurkey() {
  12156. let rand = Math.random() * this.allWeight;
  12157. let temp;
  12158. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12159. temp = this.drawObj[index];
  12160. if (index == 0) {
  12161. if (rand < temp) {
  12162. return index + 1;
  12163. }
  12164. }
  12165. else {
  12166. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12167. return index + 1;
  12168. }
  12169. }
  12170. }
  12171. return 2;
  12172. }
  12173. startDraw() {
  12174. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12175. if (freeTimes > 0) {
  12176. this.beginDraw();
  12177. DataMgr.setDailyfreeDrawTimes(0);
  12178. this.checkFree();
  12179. }
  12180. else {
  12181. if (Laya.Browser.onAndroid) {
  12182. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12183. if (!boo) {
  12184. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12185. return;
  12186. }
  12187. }
  12188. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12189. }
  12190. else {
  12191. console.log('zh:AD 失败,直接发放奖励');
  12192. this.qjff_chouJiang();
  12193. }
  12194. }
  12195. }
  12196. qjff_chouJiang() {
  12197. this.beginDraw();
  12198. }
  12199. beginDraw() {
  12200. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12201. this.ui.drawBtn.touchable = false;
  12202. this.curKey = this.getCurkey();
  12203. console.log("当前key", this.curKey);
  12204. let cell = 60;
  12205. let lap = 3;
  12206. let angle = cell * (this.curKey - 1) + lap * 360;
  12207. let target = this.ui.myNode.rotNode;
  12208. target.rotation = 0;
  12209. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12210. console.log("旋转完成");
  12211. this.ui.drawBtn.touchable = true;
  12212. this.getAward();
  12213. }));
  12214. }
  12215. getAward() {
  12216. let data = cfgTable.drawData[this.curKey];
  12217. let temp = new AwardType();
  12218. temp.type = data.award;
  12219. temp.num = data.num;
  12220. xGame.common.getAward([temp], () => {
  12221. DataMgr.setDrawTimes(1);
  12222. this.updateDraw();
  12223. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12224. });
  12225. }
  12226. updateDraw() {
  12227. let drawTimes = DataMgr.getDrawTimes();
  12228. let awardTimes = DataMgr.getDrawAwardTimes();
  12229. if (Math.floor(drawTimes / 3) > awardTimes) {
  12230. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12231. this.ui.extraNode.boxBtn.touchable = true;
  12232. this.ui.extraNode.tipsTxt.text = "3/3";
  12233. this.ui.extraNode.barNode.width = 265;
  12234. this.getExtraAward();
  12235. }
  12236. else {
  12237. this.ui.extraNode.boxBtn.t0.stop();
  12238. this.ui.extraNode.boxBtn.touchable = false;
  12239. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12240. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12241. }
  12242. let data = cfgTable.drawData[1];
  12243. if (awardTimes == 0) {
  12244. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12245. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12246. this.ui.myNode.rotNode.img1.rotation = 0;
  12247. }
  12248. else {
  12249. let award = data.nextid;
  12250. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12251. this.ui.myNode.rotNode.txt1.text = award[1];
  12252. this.ui.myNode.rotNode.img1.rotation = 0;
  12253. }
  12254. }
  12255. getExtraAward() {
  12256. let drawTimes = DataMgr.getDrawTimes();
  12257. let awardTimes = DataMgr.getDrawAwardTimes();
  12258. let data = cfgTable.drawData[1];
  12259. let award = new AwardType();
  12260. if (awardTimes == 0) {
  12261. award.num = data.num;
  12262. award.type = data.award;
  12263. xGame.common.getAward([award], () => {
  12264. let all = Math.floor(drawTimes / 3);
  12265. DataMgr.setDrawAwardTimes(all);
  12266. this.updateDraw();
  12267. });
  12268. }
  12269. else {
  12270. award.num = parseInt(data.nextid[1]);
  12271. award.type = parseInt(data.nextid[0]);
  12272. xGame.common.getAward([award], () => {
  12273. let all = Math.floor(drawTimes / 3);
  12274. DataMgr.setDrawAwardTimes(all);
  12275. this.updateDraw();
  12276. });
  12277. }
  12278. }
  12279. closeSelf() {
  12280. this.hide();
  12281. }
  12282. playSecretaryIdle() {
  12283. let parent = this.ui.secretary.displayObject;
  12284. parent.destroyChildren();
  12285. let xx = this.ui.secretary.width / 2;
  12286. let yy = this.ui.secretary.height;
  12287. let scale = xGame.common.getSecretaryScale();
  12288. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12289. xGame.common.secretary.play(data, 0, true, parent);
  12290. }
  12291. }
  12292. UIDraw.uiName = "UIDraw";
  12293. class ui_UIFlyEft extends fgui.GComponent {
  12294. static createInstance() {
  12295. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12296. }
  12297. onConstruct() {
  12298. this.n0 = (this.getChild("n0"));
  12299. this.n1 = (this.getChild("n1"));
  12300. this.n2 = (this.getChild("n2"));
  12301. this.n3 = (this.getChild("n3"));
  12302. this.n4 = (this.getChild("n4"));
  12303. this.n5 = (this.getChild("n5"));
  12304. this.n6 = (this.getChild("n6"));
  12305. this.n7 = (this.getChild("n7"));
  12306. this.iconNode = (this.getChild("iconNode"));
  12307. this.txt = (this.getChild("txt"));
  12308. this.txtNode = (this.getChild("txtNode"));
  12309. }
  12310. }
  12311. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12312. class UIFlyEft extends UIBase {
  12313. constructor() {
  12314. super();
  12315. this.max = 8;
  12316. this.delay = 0;
  12317. }
  12318. onConstructor() {
  12319. this.ui = ui_UIFlyEft.createInstance();
  12320. this.contentPane = this.ui;
  12321. this.isEject = false;
  12322. this.isMuti = true;
  12323. this.ui.x += xGame.common.sysOffestNum;
  12324. }
  12325. getArrPos() {
  12326. if (this.iconPos && this.iconPos.length > 0)
  12327. return;
  12328. this.iconPos = [];
  12329. let temp;
  12330. for (let index = 0; index < this.max; index++) {
  12331. temp = this.ui["n" + index];
  12332. this.iconPos.push([temp.x, temp.y]);
  12333. }
  12334. }
  12335. show(stPos, edPos, num, type, callback) {
  12336. super.show();
  12337. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12338. this.getArrPos();
  12339. this.updateUI(type);
  12340. this.updatePos();
  12341. this.runFly(edPos, callback);
  12342. this.runWorlds(stPos, num);
  12343. }
  12344. updateUI(type) {
  12345. let temp;
  12346. let str;
  12347. for (let index = 0; index < this.max; index++) {
  12348. temp = this.ui["n" + index];
  12349. str = this.getIconStr(type);
  12350. temp.url = xGame.common.getGameIconUrl(str);
  12351. }
  12352. }
  12353. getIconStr(type) {
  12354. switch (type) {
  12355. case Prop.diamond:
  12356. return "ty_zs";
  12357. case Prop.coin:
  12358. return "ty_jb";
  12359. default:
  12360. break;
  12361. }
  12362. }
  12363. updatePos() {
  12364. let temp;
  12365. for (let index = 0; index < this.max; index++) {
  12366. temp = this.ui["n" + index];
  12367. temp.x = this.iconPos[index][0];
  12368. temp.y = this.iconPos[index][1];
  12369. }
  12370. }
  12371. runFly(endPos, callback) {
  12372. let all = 0;
  12373. let temp;
  12374. for (let index = 0; index < this.max; index++) {
  12375. temp = this.ui["n" + index];
  12376. temp.visible = true;
  12377. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12378. temp.visible = false;
  12379. all++;
  12380. if (all >= this.max) {
  12381. callback && callback();
  12382. }
  12383. }), 20 * index);
  12384. }
  12385. }
  12386. runWorlds(stPos, num) {
  12387. let str = "+" + num;
  12388. this.ui.txt.text = str;
  12389. let starX = stPos.x;
  12390. let starY = stPos.y + 50;
  12391. this.ui.txt.x = starX;
  12392. this.ui.txt.y = starY;
  12393. this.ui.txt.visible = true;
  12394. this.ui.txt.alpha = 1;
  12395. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12396. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12397. this.ui.txt.visible = false;
  12398. this.hide();
  12399. }));
  12400. }));
  12401. }
  12402. }
  12403. UIFlyEft.uiName = "UIFlyEft";
  12404. class Common {
  12405. constructor() {
  12406. this.convertNum = 0.025;
  12407. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12408. this.scaleV3One = new Laya.Vector3();
  12409. this.scaleV3Two = new Laya.Vector3();
  12410. this.posV4 = new Laya.Vector4();
  12411. this.showDebug = false;
  12412. this.openGuide = true;
  12413. this.rodOffest = new Laya.Vector2(0, 0);
  12414. this.rodAngle = 0;
  12415. this.gameMode = GameMode.classic;
  12416. this.bigMoveLevelIndex = 1;
  12417. this.bigMoveNeedCoin = 1000;
  12418. this.classicNiceNeddCoin = 1000;
  12419. this.passAwardCoin = 2000;
  12420. this.classicRoomType = 1;
  12421. this.maxPower = 20;
  12422. this.natureMaxPower = 5;
  12423. this.videoPower = 2;
  12424. this.powerRecoverNum = 900;
  12425. this.curPlayerSkillType = 0;
  12426. this.isNewDay = false;
  12427. this.clickedBall = false;
  12428. this.placeBallCurLevel = 0;
  12429. this.placeBallStarNum = 0;
  12430. this.longHelpLine = false;
  12431. this.maxShareDiamondTimes = 3;
  12432. this.guideStep = 0;
  12433. this.temSelfLevel = 0;
  12434. this.extraMoveNum = 0;
  12435. this.curRankID = 0;
  12436. this.rankID = {
  12437. normalStar: 12000,
  12438. wxStar: 12001
  12439. };
  12440. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  12441. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12442. this.btnClickStr = "buttonclick";
  12443. this.maxSkillLevel = 10;
  12444. this.upSkillLevel = false;
  12445. this.gameStartTime = 0;
  12446. this._sysOffestNum = 0;
  12447. this.angleV2 = new Laya.Vector2();
  12448. this.rootV = new Laya.Vector2(0, 1);
  12449. this.tempDir1 = new Laya.Vector2();
  12450. this.tempDir2 = new Laya.Vector2();
  12451. this.ballSize = 33;
  12452. this.stPos = new Laya.Point();
  12453. this.edPos = new Laya.Point();
  12454. Common._instance = this;
  12455. window["common"] = this;
  12456. }
  12457. static getInstance() {
  12458. if (!this._instance) {
  12459. this._instance = new Common();
  12460. }
  12461. return this._instance;
  12462. }
  12463. get sysOffestNum() {
  12464. if (this._sysOffestNum == 0) {
  12465. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12466. }
  12467. return this._sysOffestNum;
  12468. }
  12469. testShader() {
  12470. let test = new LightShader();
  12471. test.texture = "res/d3Res/ballTexture/ball1.png";
  12472. Laya.stage.addChild(test);
  12473. }
  12474. playScale(node) {
  12475. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12476. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12477. }));
  12478. }));
  12479. }
  12480. setGroup(colli, ...group) {
  12481. let out = 0;
  12482. for (let index = 0; index < group.length; index++) {
  12483. if (index == 0) {
  12484. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12485. }
  12486. else {
  12487. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12488. }
  12489. }
  12490. colli.collisionGroup = out;
  12491. }
  12492. setCanGroupWith(colli, ...group) {
  12493. let out = 0;
  12494. for (let index = 0; index < group.length; index++) {
  12495. if (index == 0) {
  12496. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12497. }
  12498. else {
  12499. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12500. }
  12501. }
  12502. colli.canCollideWith = out;
  12503. }
  12504. loadPrefab(name, callback) {
  12505. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12506. let prefab = new Laya.Prefab();
  12507. prefab.json = obj;
  12508. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12509. callback && callback(img);
  12510. }));
  12511. }
  12512. pos2to3Convert(x, y, d3Pos) {
  12513. x = x + this.sysOffestNum;
  12514. d3Pos.setValue(x, y, 0);
  12515. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12516. if (success) {
  12517. }
  12518. else {
  12519. console.error("转换出错了。。。。。。。。");
  12520. }
  12521. }
  12522. scale2to3Convert(num) {
  12523. this.scaleV3One.setValue(0, 0, 0);
  12524. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12525. this.scaleV3Two.setValue(0, num, 0);
  12526. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12527. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12528. return outNum;
  12529. }
  12530. pos3to2Convert(d3Pos) {
  12531. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12532. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12533. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12534. d3Pos.x -= this.sysOffestNum;
  12535. }
  12536. scale3to2Convert(num) {
  12537. let scale = this.scale2to3Convert(1);
  12538. let d2Out = num / scale;
  12539. return d2Out;
  12540. }
  12541. getCollider(type, restitution = 0.9, density = 10) {
  12542. let colli;
  12543. if (type == "box")
  12544. colli = new Laya.BoxCollider();
  12545. else
  12546. colli = new Laya.CircleCollider();
  12547. colli.friction = 0;
  12548. colli.restitution = restitution;
  12549. colli.density = density;
  12550. return colli;
  12551. }
  12552. getRigbody() {
  12553. let rigy = new Laya.RigidBody();
  12554. rigy.bullet = true;
  12555. rigy.allowRotation = false;
  12556. rigy.allowSleep = false;
  12557. rigy.gravityScale = 0;
  12558. return rigy;
  12559. }
  12560. getfguiRotation(x, y) {
  12561. this.angleV2.setValue(x, y);
  12562. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12563. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12564. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12565. angle = -angle;
  12566. }
  12567. return 180 + angle;
  12568. }
  12569. getAngle(x, y) {
  12570. this.angleV2.setValue(x, y);
  12571. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12572. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12573. return angle;
  12574. }
  12575. randomNum(a, b) {
  12576. return a + Math.floor((b - a + 1) * Math.random());
  12577. }
  12578. getRandArrEle(arr) {
  12579. return arr[Math.floor(arr.length * Math.random())];
  12580. }
  12581. getSign(val) {
  12582. return val >= 0 ? 1 : -1;
  12583. }
  12584. botherArr(arr) {
  12585. let times = arr.length + 2;
  12586. let length = arr.length;
  12587. let a;
  12588. let b;
  12589. let temp;
  12590. for (let index = 0; index < times; index++) {
  12591. a = Math.floor(Math.random() * length);
  12592. b = Math.floor(Math.random() * length);
  12593. temp = arr[a];
  12594. arr[a] = arr[b];
  12595. arr[b] = temp;
  12596. }
  12597. }
  12598. getGameIconUrl(id) {
  12599. return "ui://game/" + id;
  12600. }
  12601. getComponentUrl(id) {
  12602. return "ui://game/" + id;
  12603. }
  12604. getAnimation() {
  12605. }
  12606. judgeSkillType(type = SkillType.highSpace) {
  12607. if (this.gameMode == GameMode.classic)
  12608. return;
  12609. let gameMgr = this.gameMgr;
  12610. if (gameMgr.selfTurn) {
  12611. if (gameMgr.selfCurSkill == type) {
  12612. return true;
  12613. }
  12614. }
  12615. else {
  12616. if (gameMgr.aiCurSkill == type) {
  12617. return true;
  12618. }
  12619. }
  12620. }
  12621. ballColliHole(collider) {
  12622. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12623. xGame.common.gameMgr.isFirstInGame = false;
  12624. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12625. }
  12626. collider.owner.mySrc.checkWrongBall();
  12627. }
  12628. getArrMaxEle(arr) {
  12629. let max = -Infinity;
  12630. for (let index = 0; index < arr.length; index++) {
  12631. max = Math.max(arr[index], max);
  12632. }
  12633. return max;
  12634. }
  12635. getArrMinEle(arr) {
  12636. let min = Infinity;
  12637. for (let index = 0; index < arr.length; index++) {
  12638. min = Math.min(arr[index], min);
  12639. }
  12640. return min;
  12641. }
  12642. playRandomMutiBallBigSkillSound() {
  12643. if (Math.random() <= 0.5)
  12644. return;
  12645. let rand = this.randomNum(1, 6);
  12646. let str = "ganfa0" + rand;
  12647. xGame.soundMgr.playSound(str);
  12648. }
  12649. showOneCamera(type) {
  12650. let object = xGame.common.d3World.cameraObj;
  12651. for (const key in object) {
  12652. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12653. object[key].init();
  12654. object[key].owner.active = key == type;
  12655. }
  12656. }
  12657. }
  12658. checkBallOverBorder(x, y) {
  12659. let radius = 17;
  12660. let condition = this._checkBorder(x + radius, y) ||
  12661. this._checkBorder(x - radius, y) ||
  12662. this._checkBorder(x, y + radius) ||
  12663. this._checkBorder(x, y - radius);
  12664. if (condition) {
  12665. return true;
  12666. }
  12667. }
  12668. _checkBorder(x, y) {
  12669. let borderRect = this.d2World.borderRect;
  12670. let xOffest = 20;
  12671. let yOffest = 20;
  12672. if (y <= borderRect.y - yOffest) {
  12673. return true;
  12674. }
  12675. if (y >= borderRect.y + borderRect.height + yOffest) {
  12676. return true;
  12677. }
  12678. if (x <= borderRect.x - xOffest) {
  12679. return true;
  12680. }
  12681. if (x >= borderRect.x + borderRect.width + xOffest) {
  12682. return true;
  12683. }
  12684. }
  12685. initWeight(cfg) {
  12686. let allCfgData = { data: {}, allWeightNum: 0 };
  12687. let weightCfg = allCfgData.data;
  12688. let weight = 0;
  12689. for (const key in cfg) {
  12690. weightCfg[key] = {};
  12691. weightCfg[key].id = cfg[key].id;
  12692. weightCfg[key].minWeight = weight;
  12693. weight += cfg[key].weight;
  12694. weightCfg[key].maxWeight = weight;
  12695. }
  12696. allCfgData.allWeightNum = weight;
  12697. return allCfgData;
  12698. }
  12699. getRandomWeightData(cfg) {
  12700. let weightCfg = cfg.data;
  12701. let allWeightNum = cfg.allWeightNum;
  12702. let rand = Math.floor(Math.random() * allWeightNum);
  12703. for (const key in weightCfg) {
  12704. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12705. return weightCfg[key];
  12706. }
  12707. }
  12708. return weightCfg[1];
  12709. }
  12710. showGirlTalkPop(wordsIndex, node, msgNode) {
  12711. node.visible = true;
  12712. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12713. node.t0.play(Laya.Handler.create(this, () => {
  12714. node.visible = false;
  12715. }));
  12716. }
  12717. stopGirlPop(node) {
  12718. node.t0.stop();
  12719. node.visible = false;
  12720. }
  12721. createHead(loader, url, size = 107) {
  12722. if (Laya.Browser.name == "Browser") {
  12723. loader.url = url;
  12724. return;
  12725. }
  12726. else {
  12727. console.log('zh:url=', url);
  12728. loader.url = url;
  12729. }
  12730. }
  12731. addTestCoin(num) {
  12732. DataMgr.setCoin(num);
  12733. }
  12734. addTestDiamond(num) {
  12735. DataMgr.setDiamond(num);
  12736. }
  12737. addTestSkill() {
  12738. DataMgr.setBigSkill(0, 99);
  12739. DataMgr.setBigSkill(1, 99);
  12740. DataMgr.setBigSkill(2, 99);
  12741. }
  12742. playClassicEmotion(number, x, y) {
  12743. if (this.gameMode == GameMode.bigMove)
  12744. return;
  12745. let randIndex = this.randomNum(0, 2);
  12746. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12747. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12748. if (this.gameMgr.selfTurn) {
  12749. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12750. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12751. }
  12752. else {
  12753. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12754. }
  12755. else {
  12756. if (number == this.gameMgr.blackNum) {
  12757. if (this.gameMgr.selfBallArr.length == 0) {
  12758. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12759. }
  12760. else {
  12761. }
  12762. }
  12763. else {
  12764. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12765. }
  12766. }
  12767. }
  12768. }
  12769. else {
  12770. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12771. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12772. }
  12773. else {
  12774. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12775. }
  12776. else {
  12777. if (number == this.gameMgr.blackNum) {
  12778. if (this.gameMgr.aiBallArr.length == 0) {
  12779. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12780. }
  12781. else {
  12782. }
  12783. }
  12784. else {
  12785. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12786. }
  12787. }
  12788. }
  12789. }
  12790. }
  12791. playHappySound(number) {
  12792. if (this.gameMode != GameMode.classic)
  12793. return;
  12794. if (number == 8)
  12795. return;
  12796. let play = false;
  12797. if (this.gameMgr.selfTurn) {
  12798. if (this.gameMgr.ensureBallType) {
  12799. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12800. play = true;
  12801. }
  12802. }
  12803. else {
  12804. play = true;
  12805. }
  12806. }
  12807. else {
  12808. if (this.gameMgr.ensureBallType) {
  12809. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12810. play = true;
  12811. }
  12812. }
  12813. else {
  12814. play = true;
  12815. }
  12816. }
  12817. if (play)
  12818. xGame.soundMgr.playSound("applause");
  12819. }
  12820. destroyClassicEmotion() {
  12821. if (this.gameMode == GameMode.bigMove)
  12822. return;
  12823. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12824. parent.destroyChildren();
  12825. }
  12826. playAwardSpine(x, y) {
  12827. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12828. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12829. this.awardSpine.play(data, 0, false, parent);
  12830. }
  12831. destroyAwardSpine() {
  12832. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12833. parent.destroyChildren();
  12834. }
  12835. isBlock(bx, by, hx, hy, except = null) {
  12836. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12837. let balls = xGame.common.d2World.ballArr;
  12838. let outArr = [];
  12839. for (let index = 0; index < balls.length; index++) {
  12840. let obj = balls[index];
  12841. if (obj.number == 0)
  12842. continue;
  12843. if (obj == except)
  12844. continue;
  12845. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12846. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12847. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12848. if (num >= 1)
  12849. num = 1;
  12850. if (num < 0)
  12851. continue;
  12852. let gap = Math.sin(Math.acos(num)) * dis;
  12853. if (gap < this.ballSize) {
  12854. outArr.push({
  12855. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12856. disHon: Math.cos(Math.acos(num)) * dis,
  12857. disVer: Math.sin(Math.acos(num)) * dis,
  12858. src: balls[index],
  12859. dir: this.tempDir1
  12860. });
  12861. }
  12862. }
  12863. if (outArr.length > 0) {
  12864. outArr.sort((a, b) => { return a.dis - b.dis; });
  12865. return outArr[0];
  12866. }
  12867. }
  12868. AngleBetween(vector1, vector2) {
  12869. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12870. return rad * (180 / Math.PI);
  12871. }
  12872. getSecretaryScale() {
  12873. if (this.secretary.spineName == "mishu") {
  12874. return 1.28;
  12875. }
  12876. else {
  12877. return 1.024;
  12878. }
  12879. }
  12880. signAwardContainsRod(arr) {
  12881. let temp;
  12882. for (let index = 0; index < arr.length; index++) {
  12883. temp = arr[index].split('-')[0];
  12884. if (parseInt(temp) > 2) {
  12885. return true;
  12886. }
  12887. }
  12888. }
  12889. judgeSameDay() {
  12890. let lastTime = DataMgr.getSignTime();
  12891. let curTime = new Date().getTime();
  12892. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12893. return true;
  12894. }
  12895. return false;
  12896. }
  12897. getAward(arr, callback) {
  12898. let showTriple = arr[0].type <= 2;
  12899. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12900. let temp;
  12901. for (let index = 0; index < arr.length; index++) {
  12902. temp = arr[index];
  12903. switch (temp.type) {
  12904. case 1:
  12905. this.playObjFlyAnim(temp.num, temp.type);
  12906. break;
  12907. case 2:
  12908. this.playObjFlyAnim(temp.num, temp.type);
  12909. break;
  12910. case 3:
  12911. case 4:
  12912. case 5:
  12913. case 6:
  12914. DataMgr.setBallRod(temp.type - 2, 1);
  12915. DataMgr.setCurBallRod(temp.type - 2);
  12916. break;
  12917. default:
  12918. break;
  12919. }
  12920. }
  12921. callback && callback(watchVideo);
  12922. });
  12923. }
  12924. getMoneyNode() {
  12925. let moneyNode;
  12926. let sign = xGame.uiMgr.getUI(UISign);
  12927. let draw = xGame.uiMgr.getUI(UIDraw);
  12928. let end = xGame.uiMgr.getUI(UIGameEnd);
  12929. let skill = xGame.uiMgr.getUI(UISkill);
  12930. if (sign && !sign.isHide)
  12931. moneyNode = sign.ui.moneyNode;
  12932. if (draw && !draw.isHide)
  12933. moneyNode = draw.ui.moneyNode;
  12934. if (end && !end.isHide)
  12935. moneyNode = end.ui.moneyNode;
  12936. if (skill && !skill.isHide)
  12937. moneyNode = skill.ui.moneyNode;
  12938. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12939. let main = xGame.uiMgr.getUI(UIMain);
  12940. if (condition1 && main && !main.isHide) {
  12941. moneyNode = main.ui.moneyNode;
  12942. }
  12943. return moneyNode;
  12944. }
  12945. playObjFlyAnim(num, type, callback = null) {
  12946. this.stPos.x = Laya.stage.width / 2;
  12947. this.stPos.y = Laya.stage.height / 2;
  12948. let moneyNode = this.getMoneyNode();
  12949. switch (type) {
  12950. case Prop.diamond:
  12951. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12952. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12953. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12954. this.edPos.x /= 2;
  12955. this.edPos.y /= 2;
  12956. break;
  12957. case Prop.coin:
  12958. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12959. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12960. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12961. this.edPos.x /= 2;
  12962. this.edPos.y /= 2;
  12963. break;
  12964. default:
  12965. break;
  12966. }
  12967. xGame.soundMgr.playSound("coinbag");
  12968. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12969. switch (type) {
  12970. case Prop.diamond:
  12971. DataMgr.setDiamond(num);
  12972. break;
  12973. case Prop.coin:
  12974. DataMgr.setCoin(num);
  12975. break;
  12976. default:
  12977. break;
  12978. }
  12979. callback && callback();
  12980. });
  12981. }
  12982. autoPopUIView() {
  12983. let arr = [];
  12984. let sign = this.judgeSameDay() ? false : true;
  12985. if (sign)
  12986. arr.push("sign");
  12987. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12988. if (draw)
  12989. arr.push("draw");
  12990. if (arr.length <= 0)
  12991. return;
  12992. let str = this.getRandArrEle(arr);
  12993. switch (str) {
  12994. case "sign":
  12995. xGame.uiMgr.Show(UISign);
  12996. break;
  12997. case "draw":
  12998. xGame.uiMgr.Show(UIDraw);
  12999. break;
  13000. default:
  13001. break;
  13002. }
  13003. }
  13004. getMSTime(time) {
  13005. let min = Math.floor(time / 60);
  13006. let sec = Math.floor((time - min * 60));
  13007. if (sec < 10)
  13008. sec = "0" + sec;
  13009. if (min < 10)
  13010. min = "0" + min;
  13011. return `${min}:${sec}`;
  13012. }
  13013. testPower() {
  13014. DataMgr.setPower(0, false);
  13015. }
  13016. getAllStarNum() {
  13017. let data = DataMgr.getPlaceBallLevelList();
  13018. let out = 0;
  13019. for (let index = 0; index < data.length; index++) {
  13020. out += data[index].star;
  13021. }
  13022. return out;
  13023. }
  13024. recoverCameraView() {
  13025. Laya.timer.once(900, this, () => {
  13026. xGame.common.showOneCamera("mainCamera");
  13027. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  13028. xGame.common.gameUI.ui.d2Node.alpha = 1;
  13029. xGame.common.gameUI.ui.border.alpha = 0;
  13030. if (Laya.physicsTimer.scale < 1) {
  13031. Laya.physicsTimer.scale = 1;
  13032. }
  13033. }
  13034. });
  13035. }
  13036. getClassicLevel() {
  13037. let successTimes = DataMgr.getClassicTimes();
  13038. let needKey = "";
  13039. let lastKey = "";
  13040. let cfg = cfgTable.classictimesData;
  13041. let data;
  13042. for (const key in cfg) {
  13043. data = cfg[key];
  13044. if (successTimes <= data.times) {
  13045. needKey = key;
  13046. }
  13047. lastKey = key;
  13048. }
  13049. if (needKey == "")
  13050. needKey = lastKey;
  13051. return cfg[needKey];
  13052. }
  13053. }
  13054. Common._instance = null;
  13055. class ui_Component92 extends fgui.GComponent {
  13056. static createInstance() {
  13057. return (fgui.UIPackage.createObject("game", "Component92"));
  13058. }
  13059. onConstruct() {
  13060. this.n0 = (this.getChild("n0"));
  13061. }
  13062. }
  13063. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13064. class ui_Component129 extends fgui.GProgressBar {
  13065. static createInstance() {
  13066. return (fgui.UIPackage.createObject("game", "Component129"));
  13067. }
  13068. onConstruct() {
  13069. this.bar_v = (this.getChild("bar_v"));
  13070. this.n84 = (this.getChild("n84"));
  13071. }
  13072. }
  13073. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13074. class ui_Component130 extends fgui.GComponent {
  13075. static createInstance() {
  13076. return (fgui.UIPackage.createObject("game", "Component130"));
  13077. }
  13078. onConstruct() {
  13079. this.ani = (this.getChild("ani"));
  13080. this.t0 = this.getTransition("t0");
  13081. }
  13082. }
  13083. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13084. class ui_powerEft extends fgui.GComponent {
  13085. static createInstance() {
  13086. return (fgui.UIPackage.createObject("game", "powerEft"));
  13087. }
  13088. onConstruct() {
  13089. this.ani = (this.getChild("ani"));
  13090. this.n88 = (this.getChild("n88"));
  13091. this.n89 = (this.getChild("n89"));
  13092. }
  13093. }
  13094. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13095. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13096. static createInstance() {
  13097. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13098. }
  13099. onConstruct() {
  13100. this.c1 = this.getController("c1");
  13101. this.n2 = (this.getChild("n2"));
  13102. this.n22 = (this.getChild("n22"));
  13103. this.n23 = (this.getChild("n23"));
  13104. this.n15 = (this.getChild("n15"));
  13105. this.challenge = (this.getChild("challenge"));
  13106. this.n17 = (this.getChild("n17"));
  13107. this.n3 = (this.getChild("n3"));
  13108. this.starNode = (this.getChild("starNode"));
  13109. this.levelTxt = (this.getChild("levelTxt"));
  13110. this.n14 = (this.getChild("n14"));
  13111. this.n19 = (this.getChild("n19"));
  13112. this.n20 = (this.getChild("n20"));
  13113. this.n21 = (this.getChild("n21"));
  13114. this.special = (this.getChild("special"));
  13115. }
  13116. }
  13117. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13118. class ui_Component79 extends fgui.GComponent {
  13119. static createInstance() {
  13120. return (fgui.UIPackage.createObject("game", "Component79"));
  13121. }
  13122. onConstruct() {
  13123. this.c1 = this.getController("c1");
  13124. this.n7 = (this.getChild("n7"));
  13125. this.n8 = (this.getChild("n8"));
  13126. this.n9 = (this.getChild("n9"));
  13127. this.n10 = (this.getChild("n10"));
  13128. this.n11 = (this.getChild("n11"));
  13129. this.n12 = (this.getChild("n12"));
  13130. }
  13131. }
  13132. ui_Component79.URL = "ui://isxx5ak7avag477";
  13133. class ui_Component80 extends fgui.GComponent {
  13134. static createInstance() {
  13135. return (fgui.UIPackage.createObject("game", "Component80"));
  13136. }
  13137. onConstruct() {
  13138. this.n0 = (this.getChild("n0"));
  13139. this.n1 = (this.getChild("n1"));
  13140. this.myList = (this.getChild("myList"));
  13141. this.t0 = this.getTransition("t0");
  13142. }
  13143. }
  13144. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13145. class ui_SignNormal extends fgui.GComponent {
  13146. static createInstance() {
  13147. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13148. }
  13149. onConstruct() {
  13150. this.c1 = this.getController("c1");
  13151. this.n7 = (this.getChild("n7"));
  13152. this.n15 = (this.getChild("n15"));
  13153. this.titleTxt = (this.getChild("titleTxt"));
  13154. this.n8 = (this.getChild("n8"));
  13155. this.myIcon = (this.getChild("myIcon"));
  13156. this.numTxt = (this.getChild("numTxt"));
  13157. this.n12 = (this.getChild("n12"));
  13158. this.n13 = (this.getChild("n13"));
  13159. this.n17 = (this.getChild("n17"));
  13160. this.n14 = (this.getChild("n14"));
  13161. }
  13162. }
  13163. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13164. class ui_Button_reg extends fgui.GButton {
  13165. static createInstance() {
  13166. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13167. }
  13168. onConstruct() {
  13169. this.button = this.getController("button");
  13170. this.n6 = (this.getChild("n6"));
  13171. this.n4 = (this.getChild("n4"));
  13172. }
  13173. }
  13174. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13175. class ui_screenNode extends fgui.GComponent {
  13176. static createInstance() {
  13177. return (fgui.UIPackage.createObject("game", "screenNode"));
  13178. }
  13179. onConstruct() {
  13180. this.n9 = (this.getChild("n9"));
  13181. this.screenImg = (this.getChild("screenImg"));
  13182. }
  13183. }
  13184. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13185. class ui_GetAwrad_com1 extends fgui.GComponent {
  13186. static createInstance() {
  13187. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13188. }
  13189. onConstruct() {
  13190. this.n38 = (this.getChild("n38"));
  13191. this.n39 = (this.getChild("n39"));
  13192. this.n40 = (this.getChild("n40"));
  13193. this.t0 = this.getTransition("t0");
  13194. this.t1 = this.getTransition("t1");
  13195. }
  13196. }
  13197. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13198. class ui_GetAwrad_com2 extends fgui.GComponent {
  13199. static createInstance() {
  13200. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13201. }
  13202. onConstruct() {
  13203. this.n39 = (this.getChild("n39"));
  13204. this.n40 = (this.getChild("n40"));
  13205. this.t0 = this.getTransition("t0");
  13206. }
  13207. }
  13208. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13209. class ui_Component128 extends fgui.GComponent {
  13210. static createInstance() {
  13211. return (fgui.UIPackage.createObject("game", "Component128"));
  13212. }
  13213. onConstruct() {
  13214. this.n38 = (this.getChild("n38"));
  13215. this.n40 = (this.getChild("n40"));
  13216. }
  13217. }
  13218. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13219. class ui_Component100_1 extends fgui.GComponent {
  13220. static createInstance() {
  13221. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13222. }
  13223. onConstruct() {
  13224. this.myNode = (this.getChild("myNode"));
  13225. this.t0 = this.getTransition("t0");
  13226. }
  13227. }
  13228. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13229. class ui_Component142 extends fgui.GComponent {
  13230. static createInstance() {
  13231. return (fgui.UIPackage.createObject("game", "Component142"));
  13232. }
  13233. onConstruct() {
  13234. this.n41 = (this.getChild("n41"));
  13235. this.n42 = (this.getChild("n42"));
  13236. }
  13237. }
  13238. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13239. class ui_main_guang extends fgui.GComponent {
  13240. static createInstance() {
  13241. return (fgui.UIPackage.createObject("game", "main_guang"));
  13242. }
  13243. onConstruct() {
  13244. this.n1 = (this.getChild("n1"));
  13245. this.n2 = (this.getChild("n2"));
  13246. this.n3 = (this.getChild("n3"));
  13247. this.n4 = (this.getChild("n4"));
  13248. this.n5 = (this.getChild("n5"));
  13249. this.n6 = (this.getChild("n6"));
  13250. this.n8 = (this.getChild("n8"));
  13251. this.t0 = this.getTransition("t0");
  13252. }
  13253. }
  13254. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13255. class ui_try_com1 extends fgui.GComponent {
  13256. static createInstance() {
  13257. return (fgui.UIPackage.createObject("game", "try_com1"));
  13258. }
  13259. onConstruct() {
  13260. this.c1 = this.getController("c1");
  13261. this.n0 = (this.getChild("n0"));
  13262. this.n2 = (this.getChild("n2"));
  13263. this.cancelBtn = (this.getChild("cancelBtn"));
  13264. this.videoBtn = (this.getChild("videoBtn"));
  13265. this.n9 = (this.getChild("n9"));
  13266. this.n24 = (this.getChild("n24"));
  13267. this.titleTxt = (this.getChild("titleTxt"));
  13268. this.n32 = (this.getChild("n32"));
  13269. this.n29 = (this.getChild("n29"));
  13270. this.n36 = (this.getChild("n36"));
  13271. this.txtTime = (this.getChild("txtTime"));
  13272. this.t0 = this.getTransition("t0");
  13273. }
  13274. }
  13275. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13276. class ui_try_com2 extends fgui.GComponent {
  13277. static createInstance() {
  13278. return (fgui.UIPackage.createObject("game", "try_com2"));
  13279. }
  13280. onConstruct() {
  13281. this.skillicon = (this.getChild("skillicon"));
  13282. this.n35 = (this.getChild("n35"));
  13283. this.n31 = (this.getChild("n31"));
  13284. this.n32 = (this.getChild("n32"));
  13285. this.n33 = (this.getChild("n33"));
  13286. this.n34 = (this.getChild("n34"));
  13287. }
  13288. }
  13289. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13290. class ui_try_com3 extends fgui.GComponent {
  13291. static createInstance() {
  13292. return (fgui.UIPackage.createObject("game", "try_com3"));
  13293. }
  13294. onConstruct() {
  13295. this.n33 = (this.getChild("n33"));
  13296. this.n34 = (this.getChild("n34"));
  13297. this.n35 = (this.getChild("n35"));
  13298. this.t0 = this.getTransition("t0");
  13299. }
  13300. }
  13301. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13302. class ui_huihe1 extends fgui.GComponent {
  13303. static createInstance() {
  13304. return (fgui.UIPackage.createObject("game", "huihe1"));
  13305. }
  13306. onConstruct() {
  13307. this.n0 = (this.getChild("n0"));
  13308. this.n1 = (this.getChild("n1"));
  13309. this.t0 = this.getTransition("t0");
  13310. }
  13311. }
  13312. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13313. class ui_huihe2 extends fgui.GComponent {
  13314. static createInstance() {
  13315. return (fgui.UIPackage.createObject("game", "huihe2"));
  13316. }
  13317. onConstruct() {
  13318. this.n0 = (this.getChild("n0"));
  13319. this.n1 = (this.getChild("n1"));
  13320. this.t0 = this.getTransition("t0");
  13321. }
  13322. }
  13323. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13324. class ui_Component143 extends fgui.GComponent {
  13325. static createInstance() {
  13326. return (fgui.UIPackage.createObject("game", "Component143"));
  13327. }
  13328. onConstruct() {
  13329. this.n3 = (this.getChild("n3"));
  13330. this.n4 = (this.getChild("n4"));
  13331. this.n5 = (this.getChild("n5"));
  13332. this.n6 = (this.getChild("n6"));
  13333. this.n7 = (this.getChild("n7"));
  13334. this.n8 = (this.getChild("n8"));
  13335. this.n9 = (this.getChild("n9"));
  13336. this.n10 = (this.getChild("n10"));
  13337. this.t0 = this.getTransition("t0");
  13338. }
  13339. }
  13340. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13341. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13342. static createInstance() {
  13343. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13344. }
  13345. onConstruct() {
  13346. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13347. }
  13348. }
  13349. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13350. class ui_dh_jingbi2 extends fgui.GComponent {
  13351. static createInstance() {
  13352. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13353. }
  13354. onConstruct() {
  13355. this.n0 = (this.getChild("n0"));
  13356. this.n1 = (this.getChild("n1"));
  13357. this.n2 = (this.getChild("n2"));
  13358. this.n3 = (this.getChild("n3"));
  13359. this.n4 = (this.getChild("n4"));
  13360. this.n5 = (this.getChild("n5"));
  13361. this.n6 = (this.getChild("n6"));
  13362. this.n8 = (this.getChild("n8"));
  13363. this.n10 = (this.getChild("n10"));
  13364. this.t0 = this.getTransition("t0");
  13365. }
  13366. }
  13367. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13368. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13369. static createInstance() {
  13370. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13371. }
  13372. onConstruct() {
  13373. this.n1 = (this.getChild("n1"));
  13374. this.n4 = (this.getChild("n4"));
  13375. this.t0 = this.getTransition("t0");
  13376. }
  13377. }
  13378. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13379. class ui_dh_jingbi3 extends fgui.GComponent {
  13380. static createInstance() {
  13381. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13382. }
  13383. onConstruct() {
  13384. this.n0 = (this.getChild("n0"));
  13385. this.n1 = (this.getChild("n1"));
  13386. this.n2 = (this.getChild("n2"));
  13387. this.n3 = (this.getChild("n3"));
  13388. this.n4 = (this.getChild("n4"));
  13389. this.n5 = (this.getChild("n5"));
  13390. this.n6 = (this.getChild("n6"));
  13391. this.n8 = (this.getChild("n8"));
  13392. this.n10 = (this.getChild("n10"));
  13393. this.t0 = this.getTransition("t0");
  13394. }
  13395. }
  13396. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13397. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13398. static createInstance() {
  13399. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13400. }
  13401. onConstruct() {
  13402. this.n3 = (this.getChild("n3"));
  13403. this.n1 = (this.getChild("n1"));
  13404. this.t0 = this.getTransition("t0");
  13405. }
  13406. }
  13407. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13408. class ui_hb_jinbi1 extends fgui.GButton {
  13409. static createInstance() {
  13410. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13411. }
  13412. onConstruct() {
  13413. this.n20 = (this.getChild("n20"));
  13414. this.n25 = (this.getChild("n25"));
  13415. this.coinTxt = (this.getChild("coinTxt"));
  13416. this.n28 = (this.getChild("n28"));
  13417. this.n32 = (this.getChild("n32"));
  13418. this.n38 = (this.getChild("n38"));
  13419. this.n45 = (this.getChild("n45"));
  13420. this.getTips = (this.getChild("getTips"));
  13421. this.n39 = (this.getChild("n39"));
  13422. this.diamondTxt = (this.getChild("diamondTxt"));
  13423. this.n41 = (this.getChild("n41"));
  13424. this.n42 = (this.getChild("n42"));
  13425. this.n46 = (this.getChild("n46"));
  13426. this.n47 = (this.getChild("n47"));
  13427. this.n48 = (this.getChild("n48"));
  13428. this.t0 = this.getTransition("t0");
  13429. }
  13430. }
  13431. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13432. class ui_hb_jinbi2 extends fgui.GButton {
  13433. static createInstance() {
  13434. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13435. }
  13436. onConstruct() {
  13437. this.n20 = (this.getChild("n20"));
  13438. this.n25 = (this.getChild("n25"));
  13439. this.coinTxt = (this.getChild("coinTxt"));
  13440. this.n28 = (this.getChild("n28"));
  13441. this.n32 = (this.getChild("n32"));
  13442. this.n38 = (this.getChild("n38"));
  13443. this.n39 = (this.getChild("n39"));
  13444. this.diamondTxt = (this.getChild("diamondTxt"));
  13445. this.n41 = (this.getChild("n41"));
  13446. this.n42 = (this.getChild("n42"));
  13447. this.n43 = (this.getChild("n43"));
  13448. this.n44 = (this.getChild("n44"));
  13449. this.n45 = (this.getChild("n45"));
  13450. this.t0 = this.getTransition("t0");
  13451. }
  13452. }
  13453. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13454. class ui_hb_jinbi3 extends fgui.GButton {
  13455. static createInstance() {
  13456. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13457. }
  13458. onConstruct() {
  13459. this.n20 = (this.getChild("n20"));
  13460. this.n25 = (this.getChild("n25"));
  13461. this.coinTxt = (this.getChild("coinTxt"));
  13462. this.n28 = (this.getChild("n28"));
  13463. this.n32 = (this.getChild("n32"));
  13464. this.n38 = (this.getChild("n38"));
  13465. this.n39 = (this.getChild("n39"));
  13466. this.diamondTxt = (this.getChild("diamondTxt"));
  13467. this.n41 = (this.getChild("n41"));
  13468. this.n42 = (this.getChild("n42"));
  13469. this.n43 = (this.getChild("n43"));
  13470. this.n44 = (this.getChild("n44"));
  13471. this.n45 = (this.getChild("n45"));
  13472. this.t0 = this.getTransition("t0");
  13473. }
  13474. }
  13475. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13476. class ui_Component104 extends fgui.GComponent {
  13477. static createInstance() {
  13478. return (fgui.UIPackage.createObject("game", "Component104"));
  13479. }
  13480. onConstruct() {
  13481. this.c1 = this.getController("c1");
  13482. this.n12 = (this.getChild("n12"));
  13483. this.coinBtn = (this.getChild("coinBtn"));
  13484. this.diamondBtn = (this.getChild("diamondBtn"));
  13485. this.node3 = (this.getChild("node3"));
  13486. this.node4 = (this.getChild("node4"));
  13487. this.node5 = (this.getChild("node5"));
  13488. this.node1 = (this.getChild("node1"));
  13489. this.node2 = (this.getChild("node2"));
  13490. this.node6 = (this.getChild("node6"));
  13491. this.t0 = this.getTransition("t0");
  13492. }
  13493. }
  13494. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13495. class ui_Component105 extends fgui.GButton {
  13496. static createInstance() {
  13497. return (fgui.UIPackage.createObject("game", "Component105"));
  13498. }
  13499. onConstruct() {
  13500. this.c1 = this.getController("c1");
  13501. this.n49 = (this.getChild("n49"));
  13502. this.n18 = (this.getChild("n18"));
  13503. this.n46 = (this.getChild("n46"));
  13504. this.n48 = (this.getChild("n48"));
  13505. }
  13506. }
  13507. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13508. class ui_Component106 extends fgui.GButton {
  13509. static createInstance() {
  13510. return (fgui.UIPackage.createObject("game", "Component106"));
  13511. }
  13512. onConstruct() {
  13513. this.c1 = this.getController("c1");
  13514. this.n49 = (this.getChild("n49"));
  13515. this.n18 = (this.getChild("n18"));
  13516. this.n46 = (this.getChild("n46"));
  13517. this.n48 = (this.getChild("n48"));
  13518. }
  13519. }
  13520. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13521. class ui_hb_zs1 extends fgui.GButton {
  13522. static createInstance() {
  13523. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13524. }
  13525. onConstruct() {
  13526. this.c1 = this.getController("c1");
  13527. this.n20 = (this.getChild("n20"));
  13528. this.n21 = (this.getChild("n21"));
  13529. this.n26 = (this.getChild("n26"));
  13530. this.n27 = (this.getChild("n27"));
  13531. this.shareTxt = (this.getChild("shareTxt"));
  13532. this.n32 = (this.getChild("n32"));
  13533. this.n38 = (this.getChild("n38"));
  13534. this.n39 = (this.getChild("n39"));
  13535. this.n44 = (this.getChild("n44"));
  13536. this.diamondTxt = (this.getChild("diamondTxt"));
  13537. this.n41 = (this.getChild("n41"));
  13538. this.n45 = (this.getChild("n45"));
  13539. this.n47 = (this.getChild("n47"));
  13540. this.n48 = (this.getChild("n48"));
  13541. this.randTxt = (this.getChild("randTxt"));
  13542. this.n50 = (this.getChild("n50"));
  13543. this.t0 = this.getTransition("t0");
  13544. }
  13545. }
  13546. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13547. class ui_dh_zs1 extends fgui.GComponent {
  13548. static createInstance() {
  13549. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13550. }
  13551. onConstruct() {
  13552. this.n10 = (this.getChild("n10"));
  13553. this.n9 = (this.getChild("n9"));
  13554. this.n1 = (this.getChild("n1"));
  13555. this.n2 = (this.getChild("n2"));
  13556. this.n3 = (this.getChild("n3"));
  13557. this.n4 = (this.getChild("n4"));
  13558. this.n5 = (this.getChild("n5"));
  13559. this.n6 = (this.getChild("n6"));
  13560. this.n8 = (this.getChild("n8"));
  13561. this.n11 = (this.getChild("n11"));
  13562. this.t0 = this.getTransition("t0");
  13563. }
  13564. }
  13565. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13566. class ui_dh_zs1_1 extends fgui.GComponent {
  13567. static createInstance() {
  13568. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13569. }
  13570. onConstruct() {
  13571. this.n3 = (this.getChild("n3"));
  13572. this.n1 = (this.getChild("n1"));
  13573. this.t0 = this.getTransition("t0");
  13574. }
  13575. }
  13576. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13577. class ui_hb_zs2 extends fgui.GButton {
  13578. static createInstance() {
  13579. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13580. }
  13581. onConstruct() {
  13582. this.n20 = (this.getChild("n20"));
  13583. this.n21 = (this.getChild("n21"));
  13584. this.n26 = (this.getChild("n26"));
  13585. this.n27 = (this.getChild("n27"));
  13586. this.n32 = (this.getChild("n32"));
  13587. this.n38 = (this.getChild("n38"));
  13588. this.n39 = (this.getChild("n39"));
  13589. this.n44 = (this.getChild("n44"));
  13590. this.diamondTxt = (this.getChild("diamondTxt"));
  13591. this.n41 = (this.getChild("n41"));
  13592. this.n45 = (this.getChild("n45"));
  13593. this.t0 = this.getTransition("t0");
  13594. }
  13595. }
  13596. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13597. class ui_hb_zs3 extends fgui.GButton {
  13598. static createInstance() {
  13599. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13600. }
  13601. onConstruct() {
  13602. this.n20 = (this.getChild("n20"));
  13603. this.n21 = (this.getChild("n21"));
  13604. this.n26 = (this.getChild("n26"));
  13605. this.n27 = (this.getChild("n27"));
  13606. this.n32 = (this.getChild("n32"));
  13607. this.n38 = (this.getChild("n38"));
  13608. this.n47 = (this.getChild("n47"));
  13609. this.t0 = this.getTransition("t0");
  13610. }
  13611. }
  13612. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13613. class ui_dh_zs2 extends fgui.GComponent {
  13614. static createInstance() {
  13615. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13616. }
  13617. onConstruct() {
  13618. this.n10 = (this.getChild("n10"));
  13619. this.n9 = (this.getChild("n9"));
  13620. this.n1 = (this.getChild("n1"));
  13621. this.n2 = (this.getChild("n2"));
  13622. this.n3 = (this.getChild("n3"));
  13623. this.n4 = (this.getChild("n4"));
  13624. this.n5 = (this.getChild("n5"));
  13625. this.n6 = (this.getChild("n6"));
  13626. this.n8 = (this.getChild("n8"));
  13627. this.n11 = (this.getChild("n11"));
  13628. this.t0 = this.getTransition("t0");
  13629. }
  13630. }
  13631. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13632. class ui_dh_zs2_1 extends fgui.GComponent {
  13633. static createInstance() {
  13634. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13635. }
  13636. onConstruct() {
  13637. this.n3 = (this.getChild("n3"));
  13638. this.n1 = (this.getChild("n1"));
  13639. this.t0 = this.getTransition("t0");
  13640. }
  13641. }
  13642. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13643. class ui_dh_zs3 extends fgui.GComponent {
  13644. static createInstance() {
  13645. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13646. }
  13647. onConstruct() {
  13648. this.n10 = (this.getChild("n10"));
  13649. this.n9 = (this.getChild("n9"));
  13650. this.n1 = (this.getChild("n1"));
  13651. this.n2 = (this.getChild("n2"));
  13652. this.n3 = (this.getChild("n3"));
  13653. this.n4 = (this.getChild("n4"));
  13654. this.n5 = (this.getChild("n5"));
  13655. this.n6 = (this.getChild("n6"));
  13656. this.n8 = (this.getChild("n8"));
  13657. this.n11 = (this.getChild("n11"));
  13658. this.t0 = this.getTransition("t0");
  13659. }
  13660. }
  13661. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13662. class ui_dh_zs3_1 extends fgui.GComponent {
  13663. static createInstance() {
  13664. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13665. }
  13666. onConstruct() {
  13667. this.n3 = (this.getChild("n3"));
  13668. this.n1 = (this.getChild("n1"));
  13669. this.t0 = this.getTransition("t0");
  13670. }
  13671. }
  13672. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13673. class ui_Component107 extends fgui.GComponent {
  13674. static createInstance() {
  13675. return (fgui.UIPackage.createObject("game", "Component107"));
  13676. }
  13677. onConstruct() {
  13678. this.n18 = (this.getChild("n18"));
  13679. this.n19 = (this.getChild("n19"));
  13680. this.n20 = (this.getChild("n20"));
  13681. this.n21 = (this.getChild("n21"));
  13682. this.n22 = (this.getChild("n22"));
  13683. this.levelTxt = (this.getChild("levelTxt"));
  13684. this.t0 = this.getTransition("t0");
  13685. }
  13686. }
  13687. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13688. class ui_box_com1 extends fgui.GComponent {
  13689. static createInstance() {
  13690. return (fgui.UIPackage.createObject("game", "box_com1"));
  13691. }
  13692. onConstruct() {
  13693. this.n14 = (this.getChild("n14"));
  13694. this.n6 = (this.getChild("n6"));
  13695. this.t0 = this.getTransition("t0");
  13696. }
  13697. }
  13698. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13699. class ui_box_com2 extends fgui.GProgressBar {
  13700. static createInstance() {
  13701. return (fgui.UIPackage.createObject("game", "box_com2"));
  13702. }
  13703. onConstruct() {
  13704. this.bg0 = (this.getChild("bg0"));
  13705. this.bg = (this.getChild("bg"));
  13706. this.bar = (this.getChild("bar"));
  13707. this.n7 = (this.getChild("n7"));
  13708. this.n8 = (this.getChild("n8"));
  13709. this.n10 = (this.getChild("n10"));
  13710. this.n11 = (this.getChild("n11"));
  13711. this.n12 = (this.getChild("n12"));
  13712. }
  13713. }
  13714. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13715. class ui_box_com4 extends fgui.GComponent {
  13716. static createInstance() {
  13717. return (fgui.UIPackage.createObject("game", "box_com4"));
  13718. }
  13719. onConstruct() {
  13720. this.n8 = (this.getChild("n8"));
  13721. this.t0 = this.getTransition("t0");
  13722. }
  13723. }
  13724. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13725. class ui_box_com3 extends fgui.GComponent {
  13726. static createInstance() {
  13727. return (fgui.UIPackage.createObject("game", "box_com3"));
  13728. }
  13729. onConstruct() {
  13730. this.n2 = (this.getChild("n2"));
  13731. this.n3 = (this.getChild("n3"));
  13732. this.n4 = (this.getChild("n4"));
  13733. this.n5 = (this.getChild("n5"));
  13734. this.t0 = this.getTransition("t0");
  13735. this.t1 = this.getTransition("t1");
  13736. }
  13737. }
  13738. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13739. class ui_Component97 extends fgui.GComponent {
  13740. static createInstance() {
  13741. return (fgui.UIPackage.createObject("game", "Component97"));
  13742. }
  13743. onConstruct() {
  13744. this.c1 = this.getController("c1");
  13745. this.n46 = (this.getChild("n46"));
  13746. this.diamondNode = (this.getChild("diamondNode"));
  13747. this.coinNode = (this.getChild("coinNode"));
  13748. this.t0 = this.getTransition("t0");
  13749. }
  13750. }
  13751. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13752. class ui_Component98 extends fgui.GButton {
  13753. static createInstance() {
  13754. return (fgui.UIPackage.createObject("game", "Component98"));
  13755. }
  13756. onConstruct() {
  13757. this.n8 = (this.getChild("n8"));
  13758. this.n40 = (this.getChild("n40"));
  13759. }
  13760. }
  13761. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13762. class ui_Component28_11 extends fgui.GButton {
  13763. static createInstance() {
  13764. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13765. }
  13766. onConstruct() {
  13767. this.c1 = this.getController("c1");
  13768. this.n12 = (this.getChild("n12"));
  13769. this.n17 = (this.getChild("n17"));
  13770. this.n13 = (this.getChild("n13"));
  13771. this.diamondTxt = (this.getChild("diamondTxt"));
  13772. this.n15 = (this.getChild("n15"));
  13773. this.n16 = (this.getChild("n16"));
  13774. }
  13775. }
  13776. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13777. class ui_Component58_11 extends fgui.GComponent {
  13778. static createInstance() {
  13779. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13780. }
  13781. onConstruct() {
  13782. this.c1 = this.getController("c1");
  13783. this.n23 = (this.getChild("n23"));
  13784. this.n41 = (this.getChild("n41"));
  13785. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13786. this.n_daoju = (this.getChild("n_daoju"));
  13787. this.myList = (this.getChild("myList"));
  13788. this.djList = (this.getChild("djList"));
  13789. this.t0 = this.getTransition("t0");
  13790. }
  13791. }
  13792. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13793. class ui_Component100 extends fgui.GComponent {
  13794. static createInstance() {
  13795. return (fgui.UIPackage.createObject("game", "Component100"));
  13796. }
  13797. onConstruct() {
  13798. this.c1 = this.getController("c1");
  13799. this.n75 = (this.getChild("n75"));
  13800. this.n76 = (this.getChild("n76"));
  13801. this.n80 = (this.getChild("n80"));
  13802. this.txt = (this.getChild("txt"));
  13803. this.spineRoot = (this.getChild("spineRoot"));
  13804. }
  13805. }
  13806. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13807. class ui_Component101 extends fgui.GComponent {
  13808. static createInstance() {
  13809. return (fgui.UIPackage.createObject("game", "Component101"));
  13810. }
  13811. onConstruct() {
  13812. this.c1 = this.getController("c1");
  13813. this.n36 = (this.getChild("n36"));
  13814. this.n35 = (this.getChild("n35"));
  13815. this.n33 = (this.getChild("n33"));
  13816. this.n34 = (this.getChild("n34"));
  13817. }
  13818. }
  13819. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13820. class ui_Component53 extends fgui.GComponent {
  13821. static createInstance() {
  13822. return (fgui.UIPackage.createObject("game", "Component53"));
  13823. }
  13824. onConstruct() {
  13825. this.n0 = (this.getChild("n0"));
  13826. this.n1 = (this.getChild("n1"));
  13827. this.n2 = (this.getChild("n2"));
  13828. this.n3 = (this.getChild("n3"));
  13829. this.n4 = (this.getChild("n4"));
  13830. this.n5 = (this.getChild("n5"));
  13831. this.n6 = (this.getChild("n6"));
  13832. this.n7 = (this.getChild("n7"));
  13833. this.n8 = (this.getChild("n8"));
  13834. this.n9 = (this.getChild("n9"));
  13835. this.n10 = (this.getChild("n10"));
  13836. this.n11 = (this.getChild("n11"));
  13837. this.n12 = (this.getChild("n12"));
  13838. this.n13 = (this.getChild("n13"));
  13839. this.n14 = (this.getChild("n14"));
  13840. this.n15 = (this.getChild("n15"));
  13841. this.n16 = (this.getChild("n16"));
  13842. this.n19 = (this.getChild("n19"));
  13843. this.n20 = (this.getChild("n20"));
  13844. this.n21 = (this.getChild("n21"));
  13845. this.n22 = (this.getChild("n22"));
  13846. this.n23 = (this.getChild("n23"));
  13847. this.n24 = (this.getChild("n24"));
  13848. this.n25 = (this.getChild("n25"));
  13849. this.n26 = (this.getChild("n26"));
  13850. this.n27 = (this.getChild("n27"));
  13851. this.n28 = (this.getChild("n28"));
  13852. this.n29 = (this.getChild("n29"));
  13853. this.n30 = (this.getChild("n30"));
  13854. this.n31 = (this.getChild("n31"));
  13855. this.n32 = (this.getChild("n32"));
  13856. this.n33 = (this.getChild("n33"));
  13857. this.n34 = (this.getChild("n34"));
  13858. this.n35 = (this.getChild("n35"));
  13859. this.t0 = this.getTransition("t0");
  13860. }
  13861. }
  13862. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13863. class ui_Component58 extends fgui.GComponent {
  13864. static createInstance() {
  13865. return (fgui.UIPackage.createObject("game", "Component58"));
  13866. }
  13867. onConstruct() {
  13868. this.n23 = (this.getChild("n23"));
  13869. this.n41 = (this.getChild("n41"));
  13870. this.n8 = (this.getChild("n8"));
  13871. this.skillList = (this.getChild("skillList"));
  13872. this.t0 = this.getTransition("t0");
  13873. }
  13874. }
  13875. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13876. class ui_Component59 extends fgui.GComponent {
  13877. static createInstance() {
  13878. return (fgui.UIPackage.createObject("game", "Component59"));
  13879. }
  13880. onConstruct() {
  13881. this.n3 = (this.getChild("n3"));
  13882. this.msgTxt = (this.getChild("msgTxt"));
  13883. this.t0 = this.getTransition("t0");
  13884. }
  13885. }
  13886. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13887. class ui_RulerNode extends fgui.GComponent {
  13888. static createInstance() {
  13889. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13890. }
  13891. onConstruct() {
  13892. this.n6 = (this.getChild("n6"));
  13893. this.n4 = (this.getChild("n4"));
  13894. this.img1 = (this.getChild("img1"));
  13895. this.img2 = (this.getChild("img2"));
  13896. }
  13897. }
  13898. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13899. class ui_Component108 extends fgui.GComponent {
  13900. static createInstance() {
  13901. return (fgui.UIPackage.createObject("game", "Component108"));
  13902. }
  13903. onConstruct() {
  13904. this.n19 = (this.getChild("n19"));
  13905. this.t0 = this.getTransition("t0");
  13906. }
  13907. }
  13908. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13909. class ui_Component63 extends fgui.GComponent {
  13910. static createInstance() {
  13911. return (fgui.UIPackage.createObject("game", "Component63"));
  13912. }
  13913. onConstruct() {
  13914. this.n66 = (this.getChild("n66"));
  13915. this.n56 = (this.getChild("n56"));
  13916. this.n63 = (this.getChild("n63"));
  13917. this.n65 = (this.getChild("n65"));
  13918. this.t0 = this.getTransition("t0");
  13919. }
  13920. }
  13921. ui_Component63.URL = "ui://isxx5ak7h657452";
  13922. class ui_topNode extends fgui.GComponent {
  13923. static createInstance() {
  13924. return (fgui.UIPackage.createObject("game", "topNode"));
  13925. }
  13926. onConstruct() {
  13927. this.selfProgress = (this.getChild("selfProgress"));
  13928. this.aiProgress = (this.getChild("aiProgress"));
  13929. this.selfKuang = (this.getChild("selfKuang"));
  13930. this.aiKuang = (this.getChild("aiKuang"));
  13931. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13932. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13933. this.n33 = (this.getChild("n33"));
  13934. this.n34 = (this.getChild("n34"));
  13935. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13936. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13937. this.selfBallList = (this.getChild("selfBallList"));
  13938. this.aiBallList = (this.getChild("aiBallList"));
  13939. this.middleNode = (this.getChild("middleNode"));
  13940. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13941. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13942. this.scoreNode = (this.getChild("scoreNode"));
  13943. this.selfTips = (this.getChild("selfTips"));
  13944. this.aiTips = (this.getChild("aiTips"));
  13945. }
  13946. }
  13947. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13948. class ui_selfProgress extends fgui.GProgressBar {
  13949. static createInstance() {
  13950. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13951. }
  13952. onConstruct() {
  13953. this.n3 = (this.getChild("n3"));
  13954. this.bar = (this.getChild("bar"));
  13955. }
  13956. }
  13957. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13958. class ui_aiProgress extends fgui.GProgressBar {
  13959. static createInstance() {
  13960. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13961. }
  13962. onConstruct() {
  13963. this.n3 = (this.getChild("n3"));
  13964. this.bar = (this.getChild("bar"));
  13965. }
  13966. }
  13967. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13968. class ui_ballDisplay extends fgui.GComponent {
  13969. static createInstance() {
  13970. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13971. }
  13972. onConstruct() {
  13973. this.myImg = (this.getChild("myImg"));
  13974. }
  13975. }
  13976. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13977. class ui_moveNode extends fgui.GComponent {
  13978. static createInstance() {
  13979. return (fgui.UIPackage.createObject("game", "moveNode"));
  13980. }
  13981. onConstruct() {
  13982. this.n8 = (this.getChild("n8"));
  13983. this.finger = (this.getChild("finger"));
  13984. }
  13985. }
  13986. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13987. class ui_cancelBtn extends fgui.GButton {
  13988. static createInstance() {
  13989. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13990. }
  13991. onConstruct() {
  13992. this.c1 = this.getController("c1");
  13993. this.n0 = (this.getChild("n0"));
  13994. this.n1 = (this.getChild("n1"));
  13995. }
  13996. }
  13997. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13998. class ui_shareBtn extends fgui.GButton {
  13999. static createInstance() {
  14000. return (fgui.UIPackage.createObject("game", "shareBtn"));
  14001. }
  14002. onConstruct() {
  14003. this.c1 = this.getController("c1");
  14004. this.n2 = (this.getChild("n2"));
  14005. this.n1 = (this.getChild("n1"));
  14006. this.n3 = (this.getChild("n3"));
  14007. this.n4 = (this.getChild("n4"));
  14008. this.n5 = (this.getChild("n5"));
  14009. this.n6 = (this.getChild("n6"));
  14010. }
  14011. }
  14012. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  14013. class ui_share2Btn extends fgui.GButton {
  14014. static createInstance() {
  14015. return (fgui.UIPackage.createObject("game", "share2Btn"));
  14016. }
  14017. onConstruct() {
  14018. this.n3 = (this.getChild("n3"));
  14019. }
  14020. }
  14021. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  14022. class ui_rodMethodNode extends fgui.GComponent {
  14023. static createInstance() {
  14024. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  14025. }
  14026. onConstruct() {
  14027. this.bg = (this.getChild("bg"));
  14028. this.dot = (this.getChild("dot"));
  14029. }
  14030. }
  14031. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  14032. class ui_sureBtn extends fgui.GButton {
  14033. static createInstance() {
  14034. return (fgui.UIPackage.createObject("game", "sureBtn"));
  14035. }
  14036. onConstruct() {
  14037. this.n2 = (this.getChild("n2"));
  14038. this.n1 = (this.getChild("n1"));
  14039. }
  14040. }
  14041. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14042. class ui_Component18 extends fgui.GComponent {
  14043. static createInstance() {
  14044. return (fgui.UIPackage.createObject("game", "Component18"));
  14045. }
  14046. onConstruct() {
  14047. this.c1 = this.getController("c1");
  14048. this.nameTxt = (this.getChild("nameTxt"));
  14049. this.headImg = (this.getChild("headImg"));
  14050. this.n24 = (this.getChild("n24"));
  14051. this.skillImg = (this.getChild("skillImg"));
  14052. this.skillTxt = (this.getChild("skillTxt"));
  14053. }
  14054. }
  14055. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14056. class ui_Component45 extends fgui.GComponent {
  14057. static createInstance() {
  14058. return (fgui.UIPackage.createObject("game", "Component45"));
  14059. }
  14060. onConstruct() {
  14061. this.c1 = this.getController("c1");
  14062. this.n40 = (this.getChild("n40"));
  14063. this.n41 = (this.getChild("n41"));
  14064. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14065. this.n42 = (this.getChild("n42"));
  14066. this.awardTxt = (this.getChild("awardTxt"));
  14067. this.n44 = (this.getChild("n44"));
  14068. this.t0 = this.getTransition("t0");
  14069. }
  14070. }
  14071. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14072. class ui_emotionDisplay extends fgui.GButton {
  14073. static createInstance() {
  14074. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14075. }
  14076. onConstruct() {
  14077. this.myIcon = (this.getChild("myIcon"));
  14078. }
  14079. }
  14080. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14081. class ui_Component49 extends fgui.GButton {
  14082. static createInstance() {
  14083. return (fgui.UIPackage.createObject("game", "Component49"));
  14084. }
  14085. onConstruct() {
  14086. this.n69 = (this.getChild("n69"));
  14087. this.n56 = (this.getChild("n56"));
  14088. }
  14089. }
  14090. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14091. class ui_Component50 extends fgui.GButton {
  14092. static createInstance() {
  14093. return (fgui.UIPackage.createObject("game", "Component50"));
  14094. }
  14095. onConstruct() {
  14096. this.n54 = (this.getChild("n54"));
  14097. this.n65 = (this.getChild("n65"));
  14098. }
  14099. }
  14100. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14101. class ui_Component51 extends fgui.GButton {
  14102. static createInstance() {
  14103. return (fgui.UIPackage.createObject("game", "Component51"));
  14104. }
  14105. onConstruct() {
  14106. this.c1 = this.getController("c1");
  14107. this.n51 = (this.getChild("n51"));
  14108. this.n54 = (this.getChild("n54"));
  14109. }
  14110. }
  14111. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14112. class ui_Button5 extends fgui.GButton {
  14113. static createInstance() {
  14114. return (fgui.UIPackage.createObject("game", "Button5"));
  14115. }
  14116. onConstruct() {
  14117. this.c1 = this.getController("c1");
  14118. this.n0 = (this.getChild("n0"));
  14119. this.n2 = (this.getChild("n2"));
  14120. }
  14121. }
  14122. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14123. class ui_Component124 extends fgui.GComponent {
  14124. static createInstance() {
  14125. return (fgui.UIPackage.createObject("game", "Component124"));
  14126. }
  14127. onConstruct() {
  14128. this.n22 = (this.getChild("n22"));
  14129. this.shareNode = (this.getChild("shareNode"));
  14130. }
  14131. }
  14132. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14133. class ui_Component125 extends fgui.GComponent {
  14134. static createInstance() {
  14135. return (fgui.UIPackage.createObject("game", "Component125"));
  14136. }
  14137. onConstruct() {
  14138. this.n29 = (this.getChild("n29"));
  14139. this.coinTxt = (this.getChild("coinTxt"));
  14140. }
  14141. }
  14142. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14143. class ui_Component52 extends fgui.GButton {
  14144. static createInstance() {
  14145. return (fgui.UIPackage.createObject("game", "Component52"));
  14146. }
  14147. onConstruct() {
  14148. this.n35 = (this.getChild("n35"));
  14149. this.n36 = (this.getChild("n36"));
  14150. }
  14151. }
  14152. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14153. class ui_Component_denglu extends fgui.GComponent {
  14154. static createInstance() {
  14155. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14156. }
  14157. onConstruct() {
  14158. this.n102 = (this.getChild("n102"));
  14159. }
  14160. }
  14161. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14162. class ui_Component_fl_1 extends fgui.GComponent {
  14163. static createInstance() {
  14164. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14165. }
  14166. onConstruct() {
  14167. this.n0 = (this.getChild("n0"));
  14168. this.n6 = (this.getChild("n6"));
  14169. this.n7 = (this.getChild("n7"));
  14170. this.n8 = (this.getChild("n8"));
  14171. this.n5 = (this.getChild("n5"));
  14172. this.n9 = (this.getChild("n9"));
  14173. this.n10 = (this.getChild("n10"));
  14174. this.txt_price = (this.getChild("txt_price"));
  14175. this.n_no = (this.getChild("n_no"));
  14176. this.n_buy = (this.getChild("n_buy"));
  14177. }
  14178. }
  14179. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14180. class ui_Component_fl_2 extends fgui.GComponent {
  14181. static createInstance() {
  14182. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14183. }
  14184. onConstruct() {
  14185. this.n0 = (this.getChild("n0"));
  14186. this.txt_price = (this.getChild("txt_price"));
  14187. this.n4 = (this.getChild("n4"));
  14188. this.n6 = (this.getChild("n6"));
  14189. this.n7 = (this.getChild("n7"));
  14190. this.n5 = (this.getChild("n5"));
  14191. this.n8 = (this.getChild("n8"));
  14192. this.n9 = (this.getChild("n9"));
  14193. this.n_no = (this.getChild("n_no"));
  14194. this.n_buy = (this.getChild("n_buy"));
  14195. }
  14196. }
  14197. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14198. class ui_drawBtn extends fgui.GButton {
  14199. static createInstance() {
  14200. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14201. }
  14202. onConstruct() {
  14203. this.c1 = this.getController("c1");
  14204. this.n2 = (this.getChild("n2"));
  14205. this.n1 = (this.getChild("n1"));
  14206. this.n5 = (this.getChild("n5"));
  14207. }
  14208. }
  14209. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14210. class ui_Component43 extends fgui.GButton {
  14211. static createInstance() {
  14212. return (fgui.UIPackage.createObject("game", "Component43"));
  14213. }
  14214. onConstruct() {
  14215. this.n49 = (this.getChild("n49"));
  14216. }
  14217. }
  14218. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14219. class ui_wordsDisplay extends fgui.GComponent {
  14220. static createInstance() {
  14221. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14222. }
  14223. onConstruct() {
  14224. this.txt = (this.getChild("txt"));
  14225. this.n63 = (this.getChild("n63"));
  14226. }
  14227. }
  14228. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14229. class ui_Component_phb extends fgui.GComponent {
  14230. static createInstance() {
  14231. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14232. }
  14233. onConstruct() {
  14234. this.n3 = (this.getChild("n3"));
  14235. this.n4 = (this.getChild("n4"));
  14236. }
  14237. }
  14238. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14239. class ui_Component3 extends fgui.GComponent {
  14240. static createInstance() {
  14241. return (fgui.UIPackage.createObject("game", "Component3"));
  14242. }
  14243. onConstruct() {
  14244. this.n26 = (this.getChild("n26"));
  14245. this.n24 = (this.getChild("n24"));
  14246. this.nameTxt = (this.getChild("nameTxt"));
  14247. this.headRoot = (this.getChild("headRoot"));
  14248. }
  14249. }
  14250. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14251. class ui_Component4 extends fgui.GComponent {
  14252. static createInstance() {
  14253. return (fgui.UIPackage.createObject("game", "Component4"));
  14254. }
  14255. onConstruct() {
  14256. this.headImg = (this.getChild("headImg"));
  14257. }
  14258. }
  14259. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14260. class ui_Component7 extends fgui.GButton {
  14261. static createInstance() {
  14262. return (fgui.UIPackage.createObject("game", "Component7"));
  14263. }
  14264. onConstruct() {
  14265. this.n17 = (this.getChild("n17"));
  14266. }
  14267. }
  14268. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14269. class ui_Component8 extends fgui.GButton {
  14270. static createInstance() {
  14271. return (fgui.UIPackage.createObject("game", "Component8"));
  14272. }
  14273. onConstruct() {
  14274. this.n19 = (this.getChild("n19"));
  14275. }
  14276. }
  14277. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14278. class ui_Component10 extends fgui.GButton {
  14279. static createInstance() {
  14280. return (fgui.UIPackage.createObject("game", "Component10"));
  14281. }
  14282. onConstruct() {
  14283. this.c1 = this.getController("c1");
  14284. this.n40 = (this.getChild("n40"));
  14285. }
  14286. }
  14287. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14288. class ui_Component11 extends fgui.GButton {
  14289. static createInstance() {
  14290. return (fgui.UIPackage.createObject("game", "Component11"));
  14291. }
  14292. onConstruct() {
  14293. this.n34 = (this.getChild("n34"));
  14294. }
  14295. }
  14296. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14297. class ui_Component12 extends fgui.GButton {
  14298. static createInstance() {
  14299. return (fgui.UIPackage.createObject("game", "Component12"));
  14300. }
  14301. onConstruct() {
  14302. this.n35 = (this.getChild("n35"));
  14303. }
  14304. }
  14305. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14306. class ui_Component13 extends fgui.GButton {
  14307. static createInstance() {
  14308. return (fgui.UIPackage.createObject("game", "Component13"));
  14309. }
  14310. onConstruct() {
  14311. this.n27 = (this.getChild("n27"));
  14312. this.n36 = (this.getChild("n36"));
  14313. }
  14314. }
  14315. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14316. class ui_dh_js_tuowei extends fgui.GComponent {
  14317. static createInstance() {
  14318. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14319. }
  14320. onConstruct() {
  14321. this.n19 = (this.getChild("n19"));
  14322. this.n18 = (this.getChild("n18"));
  14323. this.n0 = (this.getChild("n0"));
  14324. this.n3 = (this.getChild("n3"));
  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.n9 = (this.getChild("n9"));
  14330. this.n10 = (this.getChild("n10"));
  14331. this.n11 = (this.getChild("n11"));
  14332. this.n12 = (this.getChild("n12"));
  14333. this.n13 = (this.getChild("n13"));
  14334. this.n14 = (this.getChild("n14"));
  14335. this.n15 = (this.getChild("n15"));
  14336. this.n20 = (this.getChild("n20"));
  14337. this.t0 = this.getTransition("t0");
  14338. this.t1 = this.getTransition("t1");
  14339. }
  14340. }
  14341. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14342. class ui_dh_js_tw_g extends fgui.GComponent {
  14343. static createInstance() {
  14344. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14345. }
  14346. onConstruct() {
  14347. this.n0 = (this.getChild("n0"));
  14348. this.n1 = (this.getChild("n1"));
  14349. this.t0 = this.getTransition("t0");
  14350. }
  14351. }
  14352. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14353. class ui_dh_js_xingxing extends fgui.GComponent {
  14354. static createInstance() {
  14355. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14356. }
  14357. onConstruct() {
  14358. this.n1 = (this.getChild("n1"));
  14359. this.n2 = (this.getChild("n2"));
  14360. this.n3 = (this.getChild("n3"));
  14361. this.n4 = (this.getChild("n4"));
  14362. this.n0 = (this.getChild("n0"));
  14363. this.t2 = this.getTransition("t2");
  14364. this.t1 = this.getTransition("t1");
  14365. }
  14366. }
  14367. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14368. class ui_dh_zy_jiazai extends fgui.GComponent {
  14369. static createInstance() {
  14370. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14371. }
  14372. onConstruct() {
  14373. this.c1 = this.getController("c1");
  14374. this.n0 = (this.getChild("n0"));
  14375. this.n1 = (this.getChild("n1"));
  14376. this.n2 = (this.getChild("n2"));
  14377. this.n4 = (this.getChild("n4"));
  14378. this.n5 = (this.getChild("n5"));
  14379. this.n6 = (this.getChild("n6"));
  14380. this.n8 = (this.getChild("n8"));
  14381. this.n7 = (this.getChild("n7"));
  14382. this.t0 = this.getTransition("t0");
  14383. }
  14384. }
  14385. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14386. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14387. static createInstance() {
  14388. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14389. }
  14390. onConstruct() {
  14391. this.c1 = this.getController("c1");
  14392. this.n3 = (this.getChild("n3"));
  14393. this.n5 = (this.getChild("n5"));
  14394. this.n4 = (this.getChild("n4"));
  14395. this.n0 = (this.getChild("n0"));
  14396. this.n1 = (this.getChild("n1"));
  14397. this.n2 = (this.getChild("n2"));
  14398. }
  14399. }
  14400. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14401. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14402. static createInstance() {
  14403. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14404. }
  14405. onConstruct() {
  14406. this.n19 = (this.getChild("n19"));
  14407. this.n21 = (this.getChild("n21"));
  14408. this.n0 = (this.getChild("n0"));
  14409. this.n3 = (this.getChild("n3"));
  14410. this.n4 = (this.getChild("n4"));
  14411. this.n5 = (this.getChild("n5"));
  14412. this.n6 = (this.getChild("n6"));
  14413. this.n8 = (this.getChild("n8"));
  14414. this.n9 = (this.getChild("n9"));
  14415. this.n10 = (this.getChild("n10"));
  14416. this.n11 = (this.getChild("n11"));
  14417. this.n12 = (this.getChild("n12"));
  14418. this.n13 = (this.getChild("n13"));
  14419. this.n14 = (this.getChild("n14"));
  14420. this.n15 = (this.getChild("n15"));
  14421. this.n23 = (this.getChild("n23"));
  14422. this.t0 = this.getTransition("t0");
  14423. this.t1 = this.getTransition("t1");
  14424. }
  14425. }
  14426. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14427. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14428. static createInstance() {
  14429. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14430. }
  14431. onConstruct() {
  14432. this.n1 = (this.getChild("n1"));
  14433. this.n2 = (this.getChild("n2"));
  14434. this.t0 = this.getTransition("t0");
  14435. }
  14436. }
  14437. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14438. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14439. static createInstance() {
  14440. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14441. }
  14442. onConstruct() {
  14443. this.n4 = (this.getChild("n4"));
  14444. this.n2 = (this.getChild("n2"));
  14445. this.n3 = (this.getChild("n3"));
  14446. this.idle = this.getTransition("idle");
  14447. this.attack = this.getTransition("attack");
  14448. }
  14449. }
  14450. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14451. class ui_special extends fgui.GComponent {
  14452. static createInstance() {
  14453. return (fgui.UIPackage.createObject("game", "special"));
  14454. }
  14455. onConstruct() {
  14456. this.n18 = (this.getChild("n18"));
  14457. this.n19 = (this.getChild("n19"));
  14458. this.n20 = (this.getChild("n20"));
  14459. this.n21 = (this.getChild("n21"));
  14460. this.n22 = (this.getChild("n22"));
  14461. this.levelTxt = (this.getChild("levelTxt"));
  14462. this.n24 = (this.getChild("n24"));
  14463. this.n25 = (this.getChild("n25"));
  14464. this.t0 = this.getTransition("t0");
  14465. }
  14466. }
  14467. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14468. class ui_Component145 extends fgui.GComponent {
  14469. static createInstance() {
  14470. return (fgui.UIPackage.createObject("game", "Component145"));
  14471. }
  14472. onConstruct() {
  14473. this.guanyuNode = (this.getChild("guanyuNode"));
  14474. }
  14475. }
  14476. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14477. class ui_longBtn extends fgui.GButton {
  14478. static createInstance() {
  14479. return (fgui.UIPackage.createObject("game", "longBtn"));
  14480. }
  14481. onConstruct() {
  14482. this.c1 = this.getController("c1");
  14483. this.n2 = (this.getChild("n2"));
  14484. this.n1 = (this.getChild("n1"));
  14485. this.n4 = (this.getChild("n4"));
  14486. }
  14487. }
  14488. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14489. class ui_Component146 extends fgui.GComponent {
  14490. static createInstance() {
  14491. return (fgui.UIPackage.createObject("game", "Component146"));
  14492. }
  14493. onConstruct() {
  14494. this.n89 = (this.getChild("n89"));
  14495. this.n90 = (this.getChild("n90"));
  14496. this.guideBtn = (this.getChild("guideBtn"));
  14497. }
  14498. }
  14499. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14500. class ui_Component146_11 extends fgui.GComponent {
  14501. static createInstance() {
  14502. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14503. }
  14504. onConstruct() {
  14505. this.n89 = (this.getChild("n89"));
  14506. this.n90 = (this.getChild("n90"));
  14507. this.guideBtn = (this.getChild("guideBtn"));
  14508. }
  14509. }
  14510. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14511. class ui_Component111_1 extends fgui.GComponent {
  14512. static createInstance() {
  14513. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14514. }
  14515. onConstruct() {
  14516. this.n68 = (this.getChild("n68"));
  14517. this.myMask = (this.getChild("myMask"));
  14518. }
  14519. }
  14520. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14521. class ui_Component64_1 extends fgui.GComponent {
  14522. static createInstance() {
  14523. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14524. }
  14525. onConstruct() {
  14526. this.n57 = (this.getChild("n57"));
  14527. this.n54 = (this.getChild("n54"));
  14528. this.n55 = (this.getChild("n55"));
  14529. this.n56 = (this.getChild("n56"));
  14530. this.t1 = this.getTransition("t1");
  14531. }
  14532. }
  14533. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14534. class ui_ModeSelection_com123 extends fgui.GComponent {
  14535. static createInstance() {
  14536. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14537. }
  14538. onConstruct() {
  14539. this.type1 = (this.getChild("type1"));
  14540. this.type2 = (this.getChild("type2"));
  14541. this.type3 = (this.getChild("type3"));
  14542. this.n38 = (this.getChild("n38"));
  14543. this.t0 = this.getTransition("t0");
  14544. }
  14545. }
  14546. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14547. class ui_Component132_2 extends fgui.GComponent {
  14548. static createInstance() {
  14549. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14550. }
  14551. onConstruct() {
  14552. this.n25 = (this.getChild("n25"));
  14553. this.n26 = (this.getChild("n26"));
  14554. this.n27 = (this.getChild("n27"));
  14555. this.t0 = this.getTransition("t0");
  14556. }
  14557. }
  14558. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14559. class ui_UIPower$1 extends fgui.GComponent {
  14560. static createInstance() {
  14561. return (fgui.UIPackage.createObject("game", "UIPower"));
  14562. }
  14563. onConstruct() {
  14564. this.n11 = (this.getChild("n11"));
  14565. this.myNode = (this.getChild("myNode"));
  14566. this.t0 = this.getTransition("t0");
  14567. }
  14568. }
  14569. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14570. class ui_Component133 extends fgui.GComponent {
  14571. static createInstance() {
  14572. return (fgui.UIPackage.createObject("game", "Component133"));
  14573. }
  14574. onConstruct() {
  14575. this.n29 = (this.getChild("n29"));
  14576. this.n30 = (this.getChild("n30"));
  14577. }
  14578. }
  14579. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14580. class ui_Component134 extends fgui.GComponent {
  14581. static createInstance() {
  14582. return (fgui.UIPackage.createObject("game", "Component134"));
  14583. }
  14584. onConstruct() {
  14585. this.n30 = (this.getChild("n30"));
  14586. this.n31 = (this.getChild("n31"));
  14587. this.t0 = this.getTransition("t0");
  14588. }
  14589. }
  14590. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14591. class ui_Component135 extends fgui.GComponent {
  14592. static createInstance() {
  14593. return (fgui.UIPackage.createObject("game", "Component135"));
  14594. }
  14595. onConstruct() {
  14596. this.n30 = (this.getChild("n30"));
  14597. this.t0 = this.getTransition("t0");
  14598. }
  14599. }
  14600. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14601. class ui_Component137 extends fgui.GComponent {
  14602. static createInstance() {
  14603. return (fgui.UIPackage.createObject("game", "Component137"));
  14604. }
  14605. onConstruct() {
  14606. this.n28 = (this.getChild("n28"));
  14607. this.n29 = (this.getChild("n29"));
  14608. this.n30 = (this.getChild("n30"));
  14609. this.n32 = (this.getChild("n32"));
  14610. }
  14611. }
  14612. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14613. class ui_dh_zuanshi extends fgui.GButton {
  14614. static createInstance() {
  14615. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14616. }
  14617. onConstruct() {
  14618. this.n1 = (this.getChild("n1"));
  14619. this.n2 = (this.getChild("n2"));
  14620. this.n0 = (this.getChild("n0"));
  14621. this.n3 = (this.getChild("n3"));
  14622. this.n4 = (this.getChild("n4"));
  14623. }
  14624. }
  14625. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14626. class ui_Component138 extends fgui.GComponent {
  14627. static createInstance() {
  14628. return (fgui.UIPackage.createObject("game", "Component138"));
  14629. }
  14630. onConstruct() {
  14631. this.n1 = (this.getChild("n1"));
  14632. this.n2 = (this.getChild("n2"));
  14633. this.t0 = this.getTransition("t0");
  14634. }
  14635. }
  14636. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14637. class ui_Component139 extends fgui.GComponent {
  14638. static createInstance() {
  14639. return (fgui.UIPackage.createObject("game", "Component139"));
  14640. }
  14641. onConstruct() {
  14642. this.n0 = (this.getChild("n0"));
  14643. this.t0 = this.getTransition("t0");
  14644. }
  14645. }
  14646. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14647. class ui_Component140 extends fgui.GComponent {
  14648. static createInstance() {
  14649. return (fgui.UIPackage.createObject("game", "Component140"));
  14650. }
  14651. onConstruct() {
  14652. this.n2 = (this.getChild("n2"));
  14653. this.n3 = (this.getChild("n3"));
  14654. this.t0 = this.getTransition("t0");
  14655. }
  14656. }
  14657. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14658. class ui_Component141 extends fgui.GComponent {
  14659. static createInstance() {
  14660. return (fgui.UIPackage.createObject("game", "Component141"));
  14661. }
  14662. onConstruct() {
  14663. this.n0 = (this.getChild("n0"));
  14664. this.t0 = this.getTransition("t0");
  14665. }
  14666. }
  14667. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14668. class ui_powerNode extends fgui.GProgressBar {
  14669. static createInstance() {
  14670. return (fgui.UIPackage.createObject("game", "powerNode"));
  14671. }
  14672. onConstruct() {
  14673. this.n2 = (this.getChild("n2"));
  14674. this.bar_v = (this.getChild("bar_v"));
  14675. this.showImg = (this.getChild("showImg"));
  14676. this.n12 = (this.getChild("n12"));
  14677. }
  14678. }
  14679. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14680. class ui_dh_jingbi1 extends fgui.GComponent {
  14681. static createInstance() {
  14682. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14683. }
  14684. onConstruct() {
  14685. this.n0 = (this.getChild("n0"));
  14686. this.n1 = (this.getChild("n1"));
  14687. this.n2 = (this.getChild("n2"));
  14688. this.n3 = (this.getChild("n3"));
  14689. this.n4 = (this.getChild("n4"));
  14690. this.n5 = (this.getChild("n5"));
  14691. this.n6 = (this.getChild("n6"));
  14692. this.n8 = (this.getChild("n8"));
  14693. this.t0 = this.getTransition("t0");
  14694. }
  14695. }
  14696. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14697. class ui_Component94 extends fgui.GButton {
  14698. static createInstance() {
  14699. return (fgui.UIPackage.createObject("game", "Component94"));
  14700. }
  14701. onConstruct() {
  14702. this.n77 = (this.getChild("n77"));
  14703. }
  14704. }
  14705. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14706. class ui_Component95 extends fgui.GButton {
  14707. static createInstance() {
  14708. return (fgui.UIPackage.createObject("game", "Component95"));
  14709. }
  14710. onConstruct() {
  14711. this.n77 = (this.getChild("n77"));
  14712. }
  14713. }
  14714. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14715. class ui_Component126 extends fgui.GComponent {
  14716. static createInstance() {
  14717. return (fgui.UIPackage.createObject("game", "Component126"));
  14718. }
  14719. onConstruct() {
  14720. this.c1 = this.getController("c1");
  14721. this.normalBtn = (this.getChild("normalBtn"));
  14722. this.tripleBtn = (this.getChild("tripleBtn"));
  14723. }
  14724. }
  14725. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14726. class ui_Component60 extends fgui.GComponent {
  14727. static createInstance() {
  14728. return (fgui.UIPackage.createObject("game", "Component60"));
  14729. }
  14730. onConstruct() {
  14731. this.c1 = this.getController("c1");
  14732. this.n48 = (this.getChild("n48"));
  14733. this.womanTxt = (this.getChild("womanTxt"));
  14734. this.t0 = this.getTransition("t0");
  14735. }
  14736. }
  14737. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14738. class ui_Button_h extends fgui.GButton {
  14739. static createInstance() {
  14740. return (fgui.UIPackage.createObject("game", "Button_h"));
  14741. }
  14742. onConstruct() {
  14743. this.button = this.getController("button");
  14744. this.n0 = (this.getChild("n0"));
  14745. this.n1 = (this.getChild("n1"));
  14746. }
  14747. }
  14748. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14749. class ui_Button_lv extends fgui.GButton {
  14750. static createInstance() {
  14751. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14752. }
  14753. onConstruct() {
  14754. this.button = this.getController("button");
  14755. this.n0 = (this.getChild("n0"));
  14756. this.n1 = (this.getChild("n1"));
  14757. }
  14758. }
  14759. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14760. class ui_Component98_3 extends fgui.GButton {
  14761. static createInstance() {
  14762. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14763. }
  14764. onConstruct() {
  14765. this.c1 = this.getController("c1");
  14766. this.n8 = (this.getChild("n8"));
  14767. this.n41 = (this.getChild("n41"));
  14768. this.n40 = (this.getChild("n40"));
  14769. }
  14770. }
  14771. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14772. class ui_ModeSelection_com1 extends fgui.GButton {
  14773. static createInstance() {
  14774. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14775. }
  14776. onConstruct() {
  14777. this.n34 = (this.getChild("n34"));
  14778. this.n36 = (this.getChild("n36"));
  14779. this.n22 = (this.getChild("n22"));
  14780. this.n20 = (this.getChild("n20"));
  14781. this.n23 = (this.getChild("n23"));
  14782. this.n24 = (this.getChild("n24"));
  14783. this.n26 = (this.getChild("n26"));
  14784. this.n33 = (this.getChild("n33"));
  14785. this.coinImg = (this.getChild("coinImg"));
  14786. this.need = (this.getChild("need"));
  14787. this.n35 = (this.getChild("n35"));
  14788. this.n29 = (this.getChild("n29"));
  14789. this.tipsTxt = (this.getChild("tipsTxt"));
  14790. this.n30 = (this.getChild("n30"));
  14791. this.peopleTxt = (this.getChild("peopleTxt"));
  14792. this.t0 = this.getTransition("t0");
  14793. }
  14794. }
  14795. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14796. class ui_ModeSelection_com2 extends fgui.GButton {
  14797. static createInstance() {
  14798. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14799. }
  14800. onConstruct() {
  14801. this.n36 = (this.getChild("n36"));
  14802. this.n34 = (this.getChild("n34"));
  14803. this.n22 = (this.getChild("n22"));
  14804. this.n20 = (this.getChild("n20"));
  14805. this.n23 = (this.getChild("n23"));
  14806. this.n24 = (this.getChild("n24"));
  14807. this.n26 = (this.getChild("n26"));
  14808. this.n33 = (this.getChild("n33"));
  14809. this.coinImg = (this.getChild("coinImg"));
  14810. this.need = (this.getChild("need"));
  14811. this.n35 = (this.getChild("n35"));
  14812. this.n29 = (this.getChild("n29"));
  14813. this.tipsTxt = (this.getChild("tipsTxt"));
  14814. this.n30 = (this.getChild("n30"));
  14815. this.peopleTxt = (this.getChild("peopleTxt"));
  14816. this.t0 = this.getTransition("t0");
  14817. }
  14818. }
  14819. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14820. class ui_ModeSelection_com3 extends fgui.GButton {
  14821. static createInstance() {
  14822. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14823. }
  14824. onConstruct() {
  14825. this.n34 = (this.getChild("n34"));
  14826. this.n36 = (this.getChild("n36"));
  14827. this.n22 = (this.getChild("n22"));
  14828. this.n20 = (this.getChild("n20"));
  14829. this.n23 = (this.getChild("n23"));
  14830. this.n24 = (this.getChild("n24"));
  14831. this.n26 = (this.getChild("n26"));
  14832. this.n33 = (this.getChild("n33"));
  14833. this.coinImg = (this.getChild("coinImg"));
  14834. this.need = (this.getChild("need"));
  14835. this.n35 = (this.getChild("n35"));
  14836. this.n29 = (this.getChild("n29"));
  14837. this.tipsTxt = (this.getChild("tipsTxt"));
  14838. this.n30 = (this.getChild("n30"));
  14839. this.peopleTxt = (this.getChild("peopleTxt"));
  14840. this.t0 = this.getTransition("t0");
  14841. }
  14842. }
  14843. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14844. class ui_Invitation_com1 extends fgui.GComponent {
  14845. static createInstance() {
  14846. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14847. }
  14848. onConstruct() {
  14849. this.n14 = (this.getChild("n14"));
  14850. this.n13 = (this.getChild("n13"));
  14851. this.n3 = (this.getChild("n3"));
  14852. this.n1 = (this.getChild("n1"));
  14853. this.n6 = (this.getChild("n6"));
  14854. this.n7 = (this.getChild("n7"));
  14855. this.enterBtn = (this.getChild("enterBtn"));
  14856. this.n11 = (this.getChild("n11"));
  14857. this.n12 = (this.getChild("n12"));
  14858. this.n15 = (this.getChild("n15"));
  14859. this.t0 = this.getTransition("t0");
  14860. this.t1 = this.getTransition("t1");
  14861. }
  14862. }
  14863. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14864. class ui_Component87_1 extends fgui.GComponent {
  14865. static createInstance() {
  14866. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14867. }
  14868. onConstruct() {
  14869. this.n74 = (this.getChild("n74"));
  14870. this.n73 = (this.getChild("n73"));
  14871. this.ballTxt = (this.getChild("ballTxt"));
  14872. this.n76 = (this.getChild("n76"));
  14873. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14874. this.levelTxt = (this.getChild("levelTxt"));
  14875. this.n87 = (this.getChild("n87"));
  14876. this.n84 = (this.getChild("n84"));
  14877. this.hpTxt = (this.getChild("hpTxt"));
  14878. this.n89 = (this.getChild("n89"));
  14879. this.tipsTxt = (this.getChild("tipsTxt"));
  14880. }
  14881. }
  14882. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14883. class ui_sqg1 extends fgui.GComponent {
  14884. static createInstance() {
  14885. return (fgui.UIPackage.createObject("game", "sqg1"));
  14886. }
  14887. onConstruct() {
  14888. this.n1 = (this.getChild("n1"));
  14889. this.n0 = (this.getChild("n0"));
  14890. }
  14891. }
  14892. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14893. class ui_sqg2 extends fgui.GComponent {
  14894. static createInstance() {
  14895. return (fgui.UIPackage.createObject("game", "sqg2"));
  14896. }
  14897. onConstruct() {
  14898. this.n1 = (this.getChild("n1"));
  14899. this.n0 = (this.getChild("n0"));
  14900. }
  14901. }
  14902. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14903. class ui_sqg3 extends fgui.GComponent {
  14904. static createInstance() {
  14905. return (fgui.UIPackage.createObject("game", "sqg3"));
  14906. }
  14907. onConstruct() {
  14908. this.n1 = (this.getChild("n1"));
  14909. this.n0 = (this.getChild("n0"));
  14910. }
  14911. }
  14912. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14913. class ui_sqg4 extends fgui.GComponent {
  14914. static createInstance() {
  14915. return (fgui.UIPackage.createObject("game", "sqg4"));
  14916. }
  14917. onConstruct() {
  14918. this.n1 = (this.getChild("n1"));
  14919. this.n0 = (this.getChild("n0"));
  14920. }
  14921. }
  14922. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14923. class ui_Component36 extends fgui.GButton {
  14924. static createInstance() {
  14925. return (fgui.UIPackage.createObject("game", "Component36"));
  14926. }
  14927. onConstruct() {
  14928. this.c1 = this.getController("c1");
  14929. this.n53 = (this.getChild("n53"));
  14930. this.n56 = (this.getChild("n56"));
  14931. }
  14932. }
  14933. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14934. class ui_Component37 extends fgui.GButton {
  14935. static createInstance() {
  14936. return (fgui.UIPackage.createObject("game", "Component37"));
  14937. }
  14938. onConstruct() {
  14939. this.c1 = this.getController("c1");
  14940. this.n52 = (this.getChild("n52"));
  14941. this.n54 = (this.getChild("n54"));
  14942. }
  14943. }
  14944. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14945. class ui_UISetting extends fgui.GComponent {
  14946. static createInstance() {
  14947. return (fgui.UIPackage.createObject("game", "UISetting"));
  14948. }
  14949. onConstruct() {
  14950. this.c1 = this.getController("c1");
  14951. this.n4 = (this.getChild("n4"));
  14952. this.soundBtn = (this.getChild("soundBtn"));
  14953. this.shakeBtn = (this.getChild("shakeBtn"));
  14954. this.clickNode = (this.getChild("clickNode"));
  14955. this.xyBtn = (this.getChild("xyBtn"));
  14956. }
  14957. }
  14958. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14959. class ui_Component39 extends fgui.GComponent {
  14960. static createInstance() {
  14961. return (fgui.UIPackage.createObject("game", "Component39"));
  14962. }
  14963. onConstruct() {
  14964. this.n5 = (this.getChild("n5"));
  14965. this.n6 = (this.getChild("n6"));
  14966. this.n7 = (this.getChild("n7"));
  14967. this.t0 = this.getTransition("t0");
  14968. }
  14969. }
  14970. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14971. class ui_Component40 extends fgui.GButton {
  14972. static createInstance() {
  14973. return (fgui.UIPackage.createObject("game", "Component40"));
  14974. }
  14975. onConstruct() {
  14976. this.n46 = (this.getChild("n46"));
  14977. this.n47 = (this.getChild("n47"));
  14978. }
  14979. }
  14980. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14981. class ui_Component41 extends fgui.GComponent {
  14982. static createInstance() {
  14983. return (fgui.UIPackage.createObject("game", "Component41"));
  14984. }
  14985. onConstruct() {
  14986. this.c1 = this.getController("c1");
  14987. this.n0 = (this.getChild("n0"));
  14988. this.titleTxt = (this.getChild("titleTxt"));
  14989. this.n2 = (this.getChild("n2"));
  14990. this.msgTips = (this.getChild("msgTips"));
  14991. this.numTxt = (this.getChild("numTxt"));
  14992. this.n18 = (this.getChild("n18"));
  14993. this.cancelBtn = (this.getChild("cancelBtn"));
  14994. this.videoBtn = (this.getChild("videoBtn"));
  14995. this.n10 = (this.getChild("n10"));
  14996. }
  14997. }
  14998. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14999. class ui_Component42 extends fgui.GComponent {
  15000. static createInstance() {
  15001. return (fgui.UIPackage.createObject("game", "Component42"));
  15002. }
  15003. onConstruct() {
  15004. this.c1 = this.getController("c1");
  15005. this.n1 = (this.getChild("n1"));
  15006. this.n2 = (this.getChild("n2"));
  15007. this.n3 = (this.getChild("n3"));
  15008. this.tipsTxt = (this.getChild("tipsTxt"));
  15009. this.cancelBtn = (this.getChild("cancelBtn"));
  15010. this.sureBtn = (this.getChild("sureBtn"));
  15011. this.n11 = (this.getChild("n11"));
  15012. this.n13 = (this.getChild("n13"));
  15013. this.n14 = (this.getChild("n14"));
  15014. this.womanTxt = (this.getChild("womanTxt"));
  15015. this.t0 = this.getTransition("t0");
  15016. }
  15017. }
  15018. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  15019. class ui_dh_js_shengli extends fgui.GComponent {
  15020. static createInstance() {
  15021. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  15022. }
  15023. onConstruct() {
  15024. this.n3 = (this.getChild("n3"));
  15025. this.n4 = (this.getChild("n4"));
  15026. this.n1 = (this.getChild("n1"));
  15027. this.n2 = (this.getChild("n2"));
  15028. this.n5 = (this.getChild("n5"));
  15029. this.n6 = (this.getChild("n6"));
  15030. this.n7 = (this.getChild("n7"));
  15031. this.n8 = (this.getChild("n8"));
  15032. this.attack = this.getTransition("attack");
  15033. this.idle = this.getTransition("idle");
  15034. }
  15035. }
  15036. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  15037. class ui_dh_js_shengli_g extends fgui.GComponent {
  15038. static createInstance() {
  15039. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  15040. }
  15041. onConstruct() {
  15042. this.n3 = (this.getChild("n3"));
  15043. this.n1 = (this.getChild("n1"));
  15044. this.t0 = this.getTransition("t0");
  15045. }
  15046. }
  15047. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15048. class ui_dh_js_shibai extends fgui.GComponent {
  15049. static createInstance() {
  15050. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15051. }
  15052. onConstruct() {
  15053. this.n0 = (this.getChild("n0"));
  15054. this.n1 = (this.getChild("n1"));
  15055. this.n2 = (this.getChild("n2"));
  15056. this.n3 = (this.getChild("n3"));
  15057. this.idle = this.getTransition("idle");
  15058. this.attack = this.getTransition("attack");
  15059. }
  15060. }
  15061. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15062. class ui_dh_zy_ganfa extends fgui.GButton {
  15063. static createInstance() {
  15064. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15065. }
  15066. onConstruct() {
  15067. this.n0 = (this.getChild("n0"));
  15068. }
  15069. }
  15070. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15071. class ui_dh_zy_sc_guang extends fgui.GButton {
  15072. static createInstance() {
  15073. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15074. }
  15075. onConstruct() {
  15076. this.n0 = (this.getChild("n0"));
  15077. this.n2 = (this.getChild("n2"));
  15078. }
  15079. }
  15080. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15081. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15082. static createInstance() {
  15083. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15084. }
  15085. onConstruct() {
  15086. this.n0 = (this.getChild("n0"));
  15087. this.n3 = (this.getChild("n3"));
  15088. this.t0 = this.getTransition("t0");
  15089. }
  15090. }
  15091. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15092. class ui_dh_zy_wanfa extends fgui.GButton {
  15093. static createInstance() {
  15094. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15095. }
  15096. onConstruct() {
  15097. this.n0 = (this.getChild("n0"));
  15098. }
  15099. }
  15100. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15101. class ui_Button_login extends fgui.GButton {
  15102. static createInstance() {
  15103. return (fgui.UIPackage.createObject("game", "Button_login"));
  15104. }
  15105. onConstruct() {
  15106. this.button = this.getController("button");
  15107. this.n5 = (this.getChild("n5"));
  15108. this.n3 = (this.getChild("n3"));
  15109. }
  15110. }
  15111. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15112. class ui_Component53_1 extends fgui.GComponent {
  15113. static createInstance() {
  15114. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15115. }
  15116. onConstruct() {
  15117. this.n0 = (this.getChild("n0"));
  15118. this.n1 = (this.getChild("n1"));
  15119. this.n2 = (this.getChild("n2"));
  15120. this.n3 = (this.getChild("n3"));
  15121. this.n4 = (this.getChild("n4"));
  15122. this.n5 = (this.getChild("n5"));
  15123. this.n6 = (this.getChild("n6"));
  15124. this.n7 = (this.getChild("n7"));
  15125. this.n8 = (this.getChild("n8"));
  15126. this.n9 = (this.getChild("n9"));
  15127. this.n10 = (this.getChild("n10"));
  15128. this.n11 = (this.getChild("n11"));
  15129. this.n12 = (this.getChild("n12"));
  15130. this.n13 = (this.getChild("n13"));
  15131. this.n14 = (this.getChild("n14"));
  15132. this.n15 = (this.getChild("n15"));
  15133. this.n16 = (this.getChild("n16"));
  15134. this.n19 = (this.getChild("n19"));
  15135. this.n20 = (this.getChild("n20"));
  15136. this.n21 = (this.getChild("n21"));
  15137. this.n22 = (this.getChild("n22"));
  15138. this.n23 = (this.getChild("n23"));
  15139. this.n24 = (this.getChild("n24"));
  15140. this.n25 = (this.getChild("n25"));
  15141. this.n26 = (this.getChild("n26"));
  15142. this.n27 = (this.getChild("n27"));
  15143. this.n28 = (this.getChild("n28"));
  15144. this.n29 = (this.getChild("n29"));
  15145. this.n30 = (this.getChild("n30"));
  15146. this.n31 = (this.getChild("n31"));
  15147. this.n32 = (this.getChild("n32"));
  15148. this.n33 = (this.getChild("n33"));
  15149. this.n34 = (this.getChild("n34"));
  15150. this.n35 = (this.getChild("n35"));
  15151. this.t0 = this.getTransition("t0");
  15152. }
  15153. }
  15154. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15155. class ui_Component30 extends fgui.GComponent {
  15156. static createInstance() {
  15157. return (fgui.UIPackage.createObject("game", "Component30"));
  15158. }
  15159. onConstruct() {
  15160. this.c1 = this.getController("c1");
  15161. this.n46 = (this.getChild("n46"));
  15162. this.n47 = (this.getChild("n47"));
  15163. this.numTxt = (this.getChild("numTxt"));
  15164. this.n50 = (this.getChild("n50"));
  15165. this.n53 = (this.getChild("n53"));
  15166. this.n54 = (this.getChild("n54"));
  15167. this.n55 = (this.getChild("n55"));
  15168. this.n56 = (this.getChild("n56"));
  15169. }
  15170. }
  15171. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15172. class ui_Component30_1 extends fgui.GComponent {
  15173. static createInstance() {
  15174. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15175. }
  15176. onConstruct() {
  15177. this.c1 = this.getController("c1");
  15178. this.n46 = (this.getChild("n46"));
  15179. this.n47 = (this.getChild("n47"));
  15180. this.numTxt = (this.getChild("numTxt"));
  15181. this.n50 = (this.getChild("n50"));
  15182. this.n51 = (this.getChild("n51"));
  15183. this.n52 = (this.getChild("n52"));
  15184. this.n53 = (this.getChild("n53"));
  15185. this.n54 = (this.getChild("n54"));
  15186. }
  15187. }
  15188. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15189. class ui_Component31 extends fgui.GComponent {
  15190. static createInstance() {
  15191. return (fgui.UIPackage.createObject("game", "Component31"));
  15192. }
  15193. onConstruct() {
  15194. this.n55 = (this.getChild("n55"));
  15195. this.n54 = (this.getChild("n54"));
  15196. this.conditionTxt = (this.getChild("conditionTxt"));
  15197. this.n57 = (this.getChild("n57"));
  15198. this.t0 = this.getTransition("t0");
  15199. }
  15200. }
  15201. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15202. class ui_Component32 extends fgui.GComponent {
  15203. static createInstance() {
  15204. return (fgui.UIPackage.createObject("game", "Component32"));
  15205. }
  15206. onConstruct() {
  15207. this.n5 = (this.getChild("n5"));
  15208. this.n6 = (this.getChild("n6"));
  15209. this.n7 = (this.getChild("n7"));
  15210. this.t0 = this.getTransition("t0");
  15211. }
  15212. }
  15213. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15214. class ui_AwardItem extends fgui.GComponent {
  15215. static createInstance() {
  15216. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15217. }
  15218. onConstruct() {
  15219. this.n9 = (this.getChild("n9"));
  15220. this.myIcon = (this.getChild("myIcon"));
  15221. this.numTxt = (this.getChild("numTxt"));
  15222. this.nameTxt = (this.getChild("nameTxt"));
  15223. this.n16 = (this.getChild("n16"));
  15224. this.n17 = (this.getChild("n17"));
  15225. }
  15226. }
  15227. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15228. class ui_ranking_com1 extends fgui.GButton {
  15229. static createInstance() {
  15230. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15231. }
  15232. onConstruct() {
  15233. this.c1 = this.getController("c1");
  15234. this.n49 = (this.getChild("n49"));
  15235. this.n18 = (this.getChild("n18"));
  15236. this.n46 = (this.getChild("n46"));
  15237. this.n48 = (this.getChild("n48"));
  15238. this.n50 = (this.getChild("n50"));
  15239. }
  15240. }
  15241. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15242. class ui_ranking_com2 extends fgui.GButton {
  15243. static createInstance() {
  15244. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15245. }
  15246. onConstruct() {
  15247. this.c1 = this.getController("c1");
  15248. this.n49 = (this.getChild("n49"));
  15249. this.n18 = (this.getChild("n18"));
  15250. this.n46 = (this.getChild("n46"));
  15251. this.n48 = (this.getChild("n48"));
  15252. this.n50 = (this.getChild("n50"));
  15253. }
  15254. }
  15255. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15256. class ui_ranking_com3 extends fgui.GComponent {
  15257. static createInstance() {
  15258. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15259. }
  15260. onConstruct() {
  15261. this.n17 = (this.getChild("n17"));
  15262. this.myIcon = (this.getChild("myIcon"));
  15263. }
  15264. }
  15265. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15266. class ui_ranking_com4 extends fgui.GComponent {
  15267. static createInstance() {
  15268. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15269. }
  15270. onConstruct() {
  15271. this.n16 = (this.getChild("n16"));
  15272. this.head = (this.getChild("head"));
  15273. }
  15274. }
  15275. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15276. class ui_ranking_com5 extends fgui.GComponent {
  15277. static createInstance() {
  15278. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15279. }
  15280. onConstruct() {
  15281. this.c1 = this.getController("c1");
  15282. this.c2 = this.getController("c2");
  15283. this.n2 = (this.getChild("n2"));
  15284. this.n3 = (this.getChild("n3"));
  15285. this.levelBtn = (this.getChild("levelBtn"));
  15286. this.starBtn = (this.getChild("starBtn"));
  15287. this.n23 = (this.getChild("n23"));
  15288. this.n24 = (this.getChild("n24"));
  15289. this.n25 = (this.getChild("n25"));
  15290. this.myList = (this.getChild("myList"));
  15291. this.selfNode = (this.getChild("selfNode"));
  15292. this.n9 = (this.getChild("n9"));
  15293. this.n12 = (this.getChild("n12"));
  15294. this.n13 = (this.getChild("n13"));
  15295. this.n14 = (this.getChild("n14"));
  15296. this.n39 = (this.getChild("n39"));
  15297. this.n41 = (this.getChild("n41"));
  15298. this.n42 = (this.getChild("n42"));
  15299. this.n45 = (this.getChild("n45"));
  15300. this.changeBtn = (this.getChild("changeBtn"));
  15301. this.closeBtn = (this.getChild("closeBtn"));
  15302. this.t0 = this.getTransition("t0");
  15303. }
  15304. }
  15305. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15306. class ui_RankItem extends fgui.GComponent {
  15307. static createInstance() {
  15308. return (fgui.UIPackage.createObject("game", "RankItem"));
  15309. }
  15310. onConstruct() {
  15311. this.n10 = (this.getChild("n10"));
  15312. this.n11 = (this.getChild("n11"));
  15313. this.rankTxt = (this.getChild("rankTxt"));
  15314. this.headNode = (this.getChild("headNode"));
  15315. this.nameTxt = (this.getChild("nameTxt"));
  15316. this.n19 = (this.getChild("n19"));
  15317. this.valueTxt = (this.getChild("valueTxt"));
  15318. this.img1 = (this.getChild("img1"));
  15319. this.img2 = (this.getChild("img2"));
  15320. this.img3 = (this.getChild("img3"));
  15321. }
  15322. }
  15323. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15324. class ui_ranking_com9 extends fgui.GComponent {
  15325. static createInstance() {
  15326. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15327. }
  15328. onConstruct() {
  15329. this.c1 = this.getController("c1");
  15330. this.n27 = (this.getChild("n27"));
  15331. this.n28 = (this.getChild("n28"));
  15332. this.headNode = (this.getChild("headNode"));
  15333. this.rankTxt = (this.getChild("rankTxt"));
  15334. this.nameTxt = (this.getChild("nameTxt"));
  15335. this.n34 = (this.getChild("n34"));
  15336. this.valueTxt = (this.getChild("valueTxt"));
  15337. this.n36 = (this.getChild("n36"));
  15338. this.n37 = (this.getChild("n37"));
  15339. this.n38 = (this.getChild("n38"));
  15340. this.n39 = (this.getChild("n39"));
  15341. this.n40 = (this.getChild("n40"));
  15342. }
  15343. }
  15344. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15345. class ui_ranking_com10 extends fgui.GComponent {
  15346. static createInstance() {
  15347. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15348. }
  15349. onConstruct() {
  15350. this.n23 = (this.getChild("n23"));
  15351. this.n24 = (this.getChild("n24"));
  15352. }
  15353. }
  15354. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15355. class ui_ranking_com11 extends fgui.GComponent {
  15356. static createInstance() {
  15357. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15358. }
  15359. onConstruct() {
  15360. this.n24 = (this.getChild("n24"));
  15361. this.n25 = (this.getChild("n25"));
  15362. this.t0 = this.getTransition("t0");
  15363. }
  15364. }
  15365. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15366. class ui_ranking_com13 extends fgui.GButton {
  15367. static createInstance() {
  15368. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15369. }
  15370. onConstruct() {
  15371. this.c1 = this.getController("c1");
  15372. this.n44 = (this.getChild("n44"));
  15373. this.n45 = (this.getChild("n45"));
  15374. this.n46 = (this.getChild("n46"));
  15375. }
  15376. }
  15377. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15378. class ui_Component_dl_zc extends fgui.GButton {
  15379. static createInstance() {
  15380. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  15381. }
  15382. onConstruct() {
  15383. this.c1 = this.getController("c1");
  15384. this.n0 = (this.getChild("n0"));
  15385. }
  15386. }
  15387. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  15388. class ui_Component122 extends fgui.GComponent {
  15389. static createInstance() {
  15390. return (fgui.UIPackage.createObject("game", "Component122"));
  15391. }
  15392. onConstruct() {
  15393. this.gameNode3 = (this.getChild("gameNode3"));
  15394. }
  15395. }
  15396. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15397. class ui_skillItem extends fgui.GComponent {
  15398. static createInstance() {
  15399. return (fgui.UIPackage.createObject("game", "skillItem"));
  15400. }
  15401. onConstruct() {
  15402. this.c1 = this.getController("c1");
  15403. this.n31 = (this.getChild("n31"));
  15404. this.n6 = (this.getChild("n6"));
  15405. this.skillImg = (this.getChild("skillImg"));
  15406. this.nameTxt = (this.getChild("nameTxt"));
  15407. this.levelTxt = (this.getChild("levelTxt"));
  15408. this.n28 = (this.getChild("n28"));
  15409. this.describeTxt = (this.getChild("describeTxt"));
  15410. this.n32 = (this.getChild("n32"));
  15411. this.mutiBtn = (this.getChild("mutiBtn"));
  15412. this.tryNode = (this.getChild("tryNode"));
  15413. this.normalBtn = (this.getChild("normalBtn"));
  15414. this.startBtn = (this.getChild("startBtn"));
  15415. this.n42 = (this.getChild("n42"));
  15416. this.n43 = (this.getChild("n43"));
  15417. this.n44 = (this.getChild("n44"));
  15418. }
  15419. }
  15420. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15421. class ui_Component26 extends fgui.GButton {
  15422. static createInstance() {
  15423. return (fgui.UIPackage.createObject("game", "Component26"));
  15424. }
  15425. onConstruct() {
  15426. this.n11 = (this.getChild("n11"));
  15427. this.n30 = (this.getChild("n30"));
  15428. this.n34 = (this.getChild("n34"));
  15429. }
  15430. }
  15431. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15432. class ui_Component28 extends fgui.GButton {
  15433. static createInstance() {
  15434. return (fgui.UIPackage.createObject("game", "Component28"));
  15435. }
  15436. onConstruct() {
  15437. this.n12 = (this.getChild("n12"));
  15438. this.n31 = (this.getChild("n31"));
  15439. this.curTxt = (this.getChild("curTxt"));
  15440. this.n33 = (this.getChild("n33"));
  15441. }
  15442. }
  15443. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15444. class ui_Component1302 extends fgui.GComponent {
  15445. static createInstance() {
  15446. return (fgui.UIPackage.createObject("game", "Component1302"));
  15447. }
  15448. onConstruct() {
  15449. this.n2 = (this.getChild("n2"));
  15450. this.n3 = (this.getChild("n3"));
  15451. }
  15452. }
  15453. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15454. class ui_Component113 extends fgui.GComponent {
  15455. static createInstance() {
  15456. return (fgui.UIPackage.createObject("game", "Component113"));
  15457. }
  15458. onConstruct() {
  15459. this.n85 = (this.getChild("n85"));
  15460. this.n86 = (this.getChild("n86"));
  15461. this.n77 = (this.getChild("n77"));
  15462. this.n79 = (this.getChild("n79"));
  15463. this.n80 = (this.getChild("n80"));
  15464. this.n81 = (this.getChild("n81"));
  15465. this.n82 = (this.getChild("n82"));
  15466. this.n84 = (this.getChild("n84"));
  15467. this.n87 = (this.getChild("n87"));
  15468. this.t0 = this.getTransition("t0");
  15469. }
  15470. }
  15471. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15472. class ui_Component114 extends fgui.GComponent {
  15473. static createInstance() {
  15474. return (fgui.UIPackage.createObject("game", "Component114"));
  15475. }
  15476. onConstruct() {
  15477. this.n77 = (this.getChild("n77"));
  15478. this.t0 = this.getTransition("t0");
  15479. }
  15480. }
  15481. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15482. class ui_Component115 extends fgui.GComponent {
  15483. static createInstance() {
  15484. return (fgui.UIPackage.createObject("game", "Component115"));
  15485. }
  15486. onConstruct() {
  15487. this.n83 = (this.getChild("n83"));
  15488. this.fingerNode = (this.getChild("fingerNode"));
  15489. this.n84 = (this.getChild("n84"));
  15490. }
  15491. }
  15492. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15493. class ui_Component117 extends fgui.GComponent {
  15494. static createInstance() {
  15495. return (fgui.UIPackage.createObject("game", "Component117"));
  15496. }
  15497. onConstruct() {
  15498. this.n87 = (this.getChild("n87"));
  15499. this.n88 = (this.getChild("n88"));
  15500. this.n84 = (this.getChild("n84"));
  15501. this.n85 = (this.getChild("n85"));
  15502. this.n86 = (this.getChild("n86"));
  15503. this.t0 = this.getTransition("t0");
  15504. }
  15505. }
  15506. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15507. class ui_Component98_1 extends fgui.GButton {
  15508. static createInstance() {
  15509. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15510. }
  15511. onConstruct() {
  15512. this.c1 = this.getController("c1");
  15513. this.n8 = (this.getChild("n8"));
  15514. this.n41 = (this.getChild("n41"));
  15515. this.n40 = (this.getChild("n40"));
  15516. }
  15517. }
  15518. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15519. class ui_Component61 extends fgui.GComponent {
  15520. static createInstance() {
  15521. return (fgui.UIPackage.createObject("game", "Component61"));
  15522. }
  15523. onConstruct() {
  15524. this.n14 = (this.getChild("n14"));
  15525. this.n6 = (this.getChild("n6"));
  15526. this.t0 = this.getTransition("t0");
  15527. }
  15528. }
  15529. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15530. class ui_Component62 extends fgui.GComponent {
  15531. static createInstance() {
  15532. return (fgui.UIPackage.createObject("game", "Component62"));
  15533. }
  15534. onConstruct() {
  15535. this.n66 = (this.getChild("n66"));
  15536. this.n56 = (this.getChild("n56"));
  15537. this.n63 = (this.getChild("n63"));
  15538. this.n65 = (this.getChild("n65"));
  15539. this.t0 = this.getTransition("t0");
  15540. }
  15541. }
  15542. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15543. class ui_d3Root extends fgui.GComponent {
  15544. static createInstance() {
  15545. return (fgui.UIPackage.createObject("game", "d3Root"));
  15546. }
  15547. onConstruct() {
  15548. }
  15549. }
  15550. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15551. class ui_d2Root extends fgui.GComponent {
  15552. static createInstance() {
  15553. return (fgui.UIPackage.createObject("game", "d2Root"));
  15554. }
  15555. onConstruct() {
  15556. }
  15557. }
  15558. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15559. class ui_ballNode extends fgui.GComponent {
  15560. static createInstance() {
  15561. return (fgui.UIPackage.createObject("game", "ballNode"));
  15562. }
  15563. onConstruct() {
  15564. }
  15565. }
  15566. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15567. class ui_border extends fgui.GComponent {
  15568. static createInstance() {
  15569. return (fgui.UIPackage.createObject("game", "border"));
  15570. }
  15571. onConstruct() {
  15572. this.bar1 = (this.getChild("bar1"));
  15573. this.bar2 = (this.getChild("bar2"));
  15574. this.bar3 = (this.getChild("bar3"));
  15575. this.bar4 = (this.getChild("bar4"));
  15576. this.bar5 = (this.getChild("bar5"));
  15577. this.bar6 = (this.getChild("bar6"));
  15578. this.circle1 = (this.getChild("circle1"));
  15579. this.circle2 = (this.getChild("circle2"));
  15580. this.circle3 = (this.getChild("circle3"));
  15581. this.circle4 = (this.getChild("circle4"));
  15582. this.circle5 = (this.getChild("circle5"));
  15583. this.circle6 = (this.getChild("circle6"));
  15584. this.n28 = (this.getChild("n28"));
  15585. }
  15586. }
  15587. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15588. class ui_btn_buy extends fgui.GButton {
  15589. static createInstance() {
  15590. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15591. }
  15592. onConstruct() {
  15593. this.button = this.getController("button");
  15594. this.n0 = (this.getChild("n0"));
  15595. this.n1 = (this.getChild("n1"));
  15596. this.n2 = (this.getChild("n2"));
  15597. }
  15598. }
  15599. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15600. class ui_Component41_2 extends fgui.GComponent {
  15601. static createInstance() {
  15602. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15603. }
  15604. onConstruct() {
  15605. this.c1 = this.getController("c1");
  15606. this.n0 = (this.getChild("n0"));
  15607. this.n2 = (this.getChild("n2"));
  15608. this.n19 = (this.getChild("n19"));
  15609. this.cancelBtn = (this.getChild("cancelBtn"));
  15610. this.videoBtn = (this.getChild("videoBtn"));
  15611. this.n9 = (this.getChild("n9"));
  15612. this.n22 = (this.getChild("n22"));
  15613. this.tipsTxt = (this.getChild("tipsTxt"));
  15614. this.n23 = (this.getChild("n23"));
  15615. this.n24 = (this.getChild("n24"));
  15616. this.n26 = (this.getChild("n26"));
  15617. this.n27 = (this.getChild("n27"));
  15618. this.titleTxt = (this.getChild("titleTxt"));
  15619. }
  15620. }
  15621. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15622. class ui_Component41_1 extends fgui.GComponent {
  15623. static createInstance() {
  15624. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15625. }
  15626. onConstruct() {
  15627. this.c1 = this.getController("c1");
  15628. this.n0 = (this.getChild("n0"));
  15629. this.n2 = (this.getChild("n2"));
  15630. this.cancelBtn = (this.getChild("cancelBtn"));
  15631. this.videoBtn = (this.getChild("videoBtn"));
  15632. this.n27 = (this.getChild("n27"));
  15633. this.n30 = (this.getChild("n30"));
  15634. this.n31 = (this.getChild("n31"));
  15635. this.n32 = (this.getChild("n32"));
  15636. this.n33 = (this.getChild("n33"));
  15637. this.n34 = (this.getChild("n34"));
  15638. this.n35 = (this.getChild("n35"));
  15639. this.n36 = (this.getChild("n36"));
  15640. this.n1 = (this.getChild("n1"));
  15641. this.n37 = (this.getChild("n37"));
  15642. this.t0 = this.getTransition("t0");
  15643. this.t1 = this.getTransition("t1");
  15644. this.t2 = this.getTransition("t2");
  15645. this.t3 = this.getTransition("t3");
  15646. }
  15647. }
  15648. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15649. class ui_againBtn extends fgui.GButton {
  15650. static createInstance() {
  15651. return (fgui.UIPackage.createObject("game", "againBtn"));
  15652. }
  15653. onConstruct() {
  15654. this.n2 = (this.getChild("n2"));
  15655. this.n1 = (this.getChild("n1"));
  15656. this.n5 = (this.getChild("n5"));
  15657. }
  15658. }
  15659. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15660. class ui_Component118 extends fgui.GButton {
  15661. static createInstance() {
  15662. return (fgui.UIPackage.createObject("game", "Component118"));
  15663. }
  15664. onConstruct() {
  15665. this.c1 = this.getController("c1");
  15666. this.n14 = (this.getChild("n14"));
  15667. this.n9 = (this.getChild("n9"));
  15668. this.n10 = (this.getChild("n10"));
  15669. this.diamondTxt = (this.getChild("diamondTxt"));
  15670. this.n13 = (this.getChild("n13"));
  15671. this.n15 = (this.getChild("n15"));
  15672. }
  15673. }
  15674. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15675. class ui_Component119 extends fgui.GComponent {
  15676. static createInstance() {
  15677. return (fgui.UIPackage.createObject("game", "Component119"));
  15678. }
  15679. onConstruct() {
  15680. this.n1 = (this.getChild("n1"));
  15681. this.n2 = (this.getChild("n2"));
  15682. this.n13 = (this.getChild("n13"));
  15683. this.n6 = (this.getChild("n6"));
  15684. this.screenNode = (this.getChild("screenNode"));
  15685. this.n15 = (this.getChild("n15"));
  15686. this.closeBtn = (this.getChild("closeBtn"));
  15687. this.share2Btn = (this.getChild("share2Btn"));
  15688. this.shareBtn = (this.getChild("shareBtn"));
  15689. this.tipsNode = (this.getChild("tipsNode"));
  15690. this.awardNode = (this.getChild("awardNode"));
  15691. }
  15692. }
  15693. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15694. class ui_daoJuDisplay extends fgui.GComponent {
  15695. static createInstance() {
  15696. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15697. }
  15698. onConstruct() {
  15699. this.n6 = (this.getChild("n6"));
  15700. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15701. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15702. this.btn_buy = (this.getChild("btn_buy"));
  15703. this.nameTxt = (this.getChild("nameTxt"));
  15704. this.zsImg = (this.getChild("zsImg"));
  15705. }
  15706. }
  15707. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15708. class ui_Component132_1 extends fgui.GComponent {
  15709. static createInstance() {
  15710. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15711. }
  15712. onConstruct() {
  15713. this.n25 = (this.getChild("n25"));
  15714. this.n26 = (this.getChild("n26"));
  15715. this.n27 = (this.getChild("n27"));
  15716. this.t0 = this.getTransition("t0");
  15717. }
  15718. }
  15719. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15720. class ui_SecretaryDisplay extends fgui.GComponent {
  15721. static createInstance() {
  15722. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15723. }
  15724. onConstruct() {
  15725. this.n2 = (this.getChild("n2"));
  15726. this.levelTxt = (this.getChild("levelTxt"));
  15727. this.n4 = (this.getChild("n4"));
  15728. this.secretary = (this.getChild("secretary"));
  15729. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15730. this.n16 = (this.getChild("n16"));
  15731. this.n37 = (this.getChild("n37"));
  15732. this.n41 = (this.getChild("n41"));
  15733. this.n14 = (this.getChild("n14"));
  15734. this.n17 = (this.getChild("n17"));
  15735. this.heightTxt = (this.getChild("heightTxt"));
  15736. this.n46 = (this.getChild("n46"));
  15737. this.n36 = (this.getChild("n36"));
  15738. this.n38 = (this.getChild("n38"));
  15739. this.foodTxt = (this.getChild("foodTxt"));
  15740. this.n47 = (this.getChild("n47"));
  15741. this.n40 = (this.getChild("n40"));
  15742. this.n42 = (this.getChild("n42"));
  15743. this.historyTxt = (this.getChild("historyTxt"));
  15744. this.n48 = (this.getChild("n48"));
  15745. this.nameImg = (this.getChild("nameImg"));
  15746. this.n12 = (this.getChild("n12"));
  15747. this.n49 = (this.getChild("n49"));
  15748. this.t0 = this.getTransition("t0");
  15749. }
  15750. }
  15751. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15752. class ui_BallRodDisplay extends fgui.GComponent {
  15753. static createInstance() {
  15754. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15755. }
  15756. onConstruct() {
  15757. this.c1 = this.getController("c1");
  15758. this.n31 = (this.getChild("n31"));
  15759. this.n6 = (this.getChild("n6"));
  15760. this.nameTxt = (this.getChild("nameTxt"));
  15761. this.rodImg = (this.getChild("rodImg"));
  15762. this.eftRod = (this.getChild("eftRod"));
  15763. this.levelNode = (this.getChild("levelNode"));
  15764. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15765. }
  15766. }
  15767. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15768. class ui_Component111_11 extends fgui.GComponent {
  15769. static createInstance() {
  15770. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15771. }
  15772. onConstruct() {
  15773. this.n68 = (this.getChild("n68"));
  15774. this.n69 = (this.getChild("n69"));
  15775. }
  15776. }
  15777. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15778. class ui_Component112 extends fgui.GComponent {
  15779. static createInstance() {
  15780. return (fgui.UIPackage.createObject("game", "Component112"));
  15781. }
  15782. onConstruct() {
  15783. this.n68 = (this.getChild("n68"));
  15784. this.n70 = (this.getChild("n70"));
  15785. this.myMask = (this.getChild("myMask"));
  15786. }
  15787. }
  15788. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15789. class ui_Component111 extends fgui.GComponent {
  15790. static createInstance() {
  15791. return (fgui.UIPackage.createObject("game", "Component111"));
  15792. }
  15793. onConstruct() {
  15794. this.n68 = (this.getChild("n68"));
  15795. this.myMask = (this.getChild("myMask"));
  15796. }
  15797. }
  15798. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15799. class ui_Component144 extends fgui.GButton {
  15800. static createInstance() {
  15801. return (fgui.UIPackage.createObject("game", "Component144"));
  15802. }
  15803. onConstruct() {
  15804. this.n8 = (this.getChild("n8"));
  15805. }
  15806. }
  15807. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15808. class ui_Sign_com2 extends fgui.GComponent {
  15809. static createInstance() {
  15810. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15811. }
  15812. onConstruct() {
  15813. this.n0 = (this.getChild("n0"));
  15814. this.n1 = (this.getChild("n1"));
  15815. this.t0 = this.getTransition("t0");
  15816. }
  15817. }
  15818. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15819. class ui_Sign_guang extends fgui.GComponent {
  15820. static createInstance() {
  15821. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15822. }
  15823. onConstruct() {
  15824. this.n1 = (this.getChild("n1"));
  15825. this.n2 = (this.getChild("n2"));
  15826. this.n3 = (this.getChild("n3"));
  15827. this.n4 = (this.getChild("n4"));
  15828. this.n5 = (this.getChild("n5"));
  15829. this.n6 = (this.getChild("n6"));
  15830. this.n8 = (this.getChild("n8"));
  15831. }
  15832. }
  15833. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15834. class ui_SignMax extends fgui.GComponent {
  15835. static createInstance() {
  15836. return (fgui.UIPackage.createObject("game", "SignMax"));
  15837. }
  15838. onConstruct() {
  15839. this.c1 = this.getController("c1");
  15840. this.n7 = (this.getChild("n7"));
  15841. this.n15 = (this.getChild("n15"));
  15842. this.n8 = (this.getChild("n8"));
  15843. this.titleTxt = (this.getChild("titleTxt"));
  15844. this.myIcon1 = (this.getChild("myIcon1"));
  15845. this.numTxt1 = (this.getChild("numTxt1"));
  15846. this.myIcon2 = (this.getChild("myIcon2"));
  15847. this.n20 = (this.getChild("n20"));
  15848. this.n17 = (this.getChild("n17"));
  15849. this.numTxt2 = (this.getChild("numTxt2"));
  15850. this.n12 = (this.getChild("n12"));
  15851. this.n13 = (this.getChild("n13"));
  15852. this.n21 = (this.getChild("n21"));
  15853. this.n14 = (this.getChild("n14"));
  15854. }
  15855. }
  15856. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15857. class ui_Sign_com2_1 extends fgui.GComponent {
  15858. static createInstance() {
  15859. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15860. }
  15861. onConstruct() {
  15862. this.n0 = (this.getChild("n0"));
  15863. this.n1 = (this.getChild("n1"));
  15864. this.t0 = this.getTransition("t0");
  15865. }
  15866. }
  15867. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15868. class ui_Sign_com5 extends fgui.GComponent {
  15869. static createInstance() {
  15870. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15871. }
  15872. onConstruct() {
  15873. this.n3 = (this.getChild("n3"));
  15874. this.n29 = (this.getChild("n29"));
  15875. this.n4 = (this.getChild("n4"));
  15876. this.day1 = (this.getChild("day1"));
  15877. this.day2 = (this.getChild("day2"));
  15878. this.day3 = (this.getChild("day3"));
  15879. this.day4 = (this.getChild("day4"));
  15880. this.day5 = (this.getChild("day5"));
  15881. this.day6 = (this.getChild("day6"));
  15882. this.day7 = (this.getChild("day7"));
  15883. this.t0 = this.getTransition("t0");
  15884. }
  15885. }
  15886. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15887. class ui_Sign_com8 extends fgui.GComponent {
  15888. static createInstance() {
  15889. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15890. }
  15891. onConstruct() {
  15892. this.n48 = (this.getChild("n48"));
  15893. this.womanTxt = (this.getChild("womanTxt"));
  15894. this.t0 = this.getTransition("t0");
  15895. }
  15896. }
  15897. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15898. class ui_Sign_com6 extends fgui.GComponent {
  15899. static createInstance() {
  15900. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15901. }
  15902. onConstruct() {
  15903. this.n2 = (this.getChild("n2"));
  15904. this.n3 = (this.getChild("n3"));
  15905. this.t0 = this.getTransition("t0");
  15906. }
  15907. }
  15908. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15909. class ui_Sign_com7 extends fgui.GComponent {
  15910. static createInstance() {
  15911. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15912. }
  15913. onConstruct() {
  15914. this.n29 = (this.getChild("n29"));
  15915. this.n2 = (this.getChild("n2"));
  15916. }
  15917. }
  15918. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15919. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15920. static createInstance() {
  15921. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15922. }
  15923. onConstruct() {
  15924. this.n5 = (this.getChild("n5"));
  15925. this.n4 = (this.getChild("n4"));
  15926. this.t0 = this.getTransition("t0");
  15927. }
  15928. }
  15929. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15930. class ui_UITurntable_com2 extends fgui.GComponent {
  15931. static createInstance() {
  15932. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15933. }
  15934. onConstruct() {
  15935. this.c1 = this.getController("c1");
  15936. this.n4 = (this.getChild("n4"));
  15937. this.n6 = (this.getChild("n6"));
  15938. this.n10 = (this.getChild("n10"));
  15939. this.n11 = (this.getChild("n11"));
  15940. this.n12 = (this.getChild("n12"));
  15941. this.n13 = (this.getChild("n13"));
  15942. this.n14 = (this.getChild("n14"));
  15943. this.n15 = (this.getChild("n15"));
  15944. this.n16 = (this.getChild("n16"));
  15945. this.n17 = (this.getChild("n17"));
  15946. this.n18 = (this.getChild("n18"));
  15947. this.n19 = (this.getChild("n19"));
  15948. this.n20 = (this.getChild("n20"));
  15949. this.n21 = (this.getChild("n21"));
  15950. this.n22 = (this.getChild("n22"));
  15951. this.n23 = (this.getChild("n23"));
  15952. this.n24 = (this.getChild("n24"));
  15953. this.n25 = (this.getChild("n25"));
  15954. this.n26 = (this.getChild("n26"));
  15955. this.n27 = (this.getChild("n27"));
  15956. this.n28 = (this.getChild("n28"));
  15957. this.n29 = (this.getChild("n29"));
  15958. this.n30 = (this.getChild("n30"));
  15959. this.n31 = (this.getChild("n31"));
  15960. this.n32 = (this.getChild("n32"));
  15961. this.n33 = (this.getChild("n33"));
  15962. }
  15963. }
  15964. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15965. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15966. static createInstance() {
  15967. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15968. }
  15969. onConstruct() {
  15970. this.n5 = (this.getChild("n5"));
  15971. this.n4 = (this.getChild("n4"));
  15972. this.t0 = this.getTransition("t0");
  15973. }
  15974. }
  15975. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15976. class ui_UITurntable_com5 extends fgui.GComponent {
  15977. static createInstance() {
  15978. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15979. }
  15980. onConstruct() {
  15981. this.flashNode = (this.getChild("flashNode"));
  15982. this.rotNode = (this.getChild("rotNode"));
  15983. this.n3 = (this.getChild("n3"));
  15984. this.n21 = (this.getChild("n21"));
  15985. this.t0 = this.getTransition("t0");
  15986. }
  15987. }
  15988. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15989. class ui_UITurntable_com7 extends fgui.GComponent {
  15990. static createInstance() {
  15991. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15992. }
  15993. onConstruct() {
  15994. this.n2 = (this.getChild("n2"));
  15995. this.n35 = (this.getChild("n35"));
  15996. this.img1 = (this.getChild("img1"));
  15997. this.img2 = (this.getChild("img2"));
  15998. this.img3 = (this.getChild("img3"));
  15999. this.img4 = (this.getChild("img4"));
  16000. this.img6 = (this.getChild("img6"));
  16001. this.img5 = (this.getChild("img5"));
  16002. this.txt1 = (this.getChild("txt1"));
  16003. this.txt2 = (this.getChild("txt2"));
  16004. this.txt3 = (this.getChild("txt3"));
  16005. this.txt4 = (this.getChild("txt4"));
  16006. this.txt5 = (this.getChild("txt5"));
  16007. this.txt6 = (this.getChild("txt6"));
  16008. }
  16009. }
  16010. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  16011. class ui_UITurntable_com9 extends fgui.GComponent {
  16012. static createInstance() {
  16013. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  16014. }
  16015. onConstruct() {
  16016. this.n38 = (this.getChild("n38"));
  16017. this.n39 = (this.getChild("n39"));
  16018. }
  16019. }
  16020. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16021. class ui_UITurntable_com10 extends fgui.GComponent {
  16022. static createInstance() {
  16023. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16024. }
  16025. onConstruct() {
  16026. this.n39 = (this.getChild("n39"));
  16027. this.n40 = (this.getChild("n40"));
  16028. this.t0 = this.getTransition("t0");
  16029. }
  16030. }
  16031. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16032. class ui_UITurntable_com11 extends fgui.GComponent {
  16033. static createInstance() {
  16034. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16035. }
  16036. onConstruct() {
  16037. this.n38 = (this.getChild("n38"));
  16038. this.n39 = (this.getChild("n39"));
  16039. this.n40 = (this.getChild("n40"));
  16040. this.t0 = this.getTransition("t0");
  16041. }
  16042. }
  16043. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16044. class ui_UITurntable_com12 extends fgui.GComponent {
  16045. static createInstance() {
  16046. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16047. }
  16048. onConstruct() {
  16049. this.n43 = (this.getChild("n43"));
  16050. this.barNode = (this.getChild("barNode"));
  16051. this.tipsTxt = (this.getChild("tipsTxt"));
  16052. this.n45 = (this.getChild("n45"));
  16053. this.boxBtn = (this.getChild("boxBtn"));
  16054. }
  16055. }
  16056. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16057. class ui_UITurntable_com1 extends fgui.GButton {
  16058. static createInstance() {
  16059. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16060. }
  16061. onConstruct() {
  16062. this.n41 = (this.getChild("n41"));
  16063. this.n42 = (this.getChild("n42"));
  16064. this.t0 = this.getTransition("t0");
  16065. }
  16066. }
  16067. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16068. class ui_UITurntable_com3 extends fgui.GComponent {
  16069. static createInstance() {
  16070. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16071. }
  16072. onConstruct() {
  16073. this.n48 = (this.getChild("n48"));
  16074. this.womanTxt = (this.getChild("womanTxt"));
  16075. this.t0 = this.getTransition("t0");
  16076. }
  16077. }
  16078. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16079. class ui_cancelBtn2 extends fgui.GButton {
  16080. static createInstance() {
  16081. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16082. }
  16083. onConstruct() {
  16084. this.c1 = this.getController("c1");
  16085. this.n0 = (this.getChild("n0"));
  16086. this.n1 = (this.getChild("n1"));
  16087. this.n2 = (this.getChild("n2"));
  16088. this.n3 = (this.getChild("n3"));
  16089. this.n4 = (this.getChild("n4"));
  16090. this.n5 = (this.getChild("n5"));
  16091. this.n6 = (this.getChild("n6"));
  16092. this.n7 = (this.getChild("n7"));
  16093. this.n8 = (this.getChild("n8"));
  16094. this.powerEft = (this.getChild("powerEft"));
  16095. }
  16096. }
  16097. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16098. class ui_shareBtn2 extends fgui.GButton {
  16099. static createInstance() {
  16100. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16101. }
  16102. onConstruct() {
  16103. this.c1 = this.getController("c1");
  16104. this.n2 = (this.getChild("n2"));
  16105. this.n24 = (this.getChild("n24"));
  16106. this.n1 = (this.getChild("n1"));
  16107. this.n3 = (this.getChild("n3"));
  16108. this.n23 = (this.getChild("n23"));
  16109. this.n4 = (this.getChild("n4"));
  16110. this.n5 = (this.getChild("n5"));
  16111. this.n6 = (this.getChild("n6"));
  16112. this.n20 = (this.getChild("n20"));
  16113. this.n21 = (this.getChild("n21"));
  16114. this.n22 = (this.getChild("n22"));
  16115. this.powerEft = (this.getChild("powerEft"));
  16116. }
  16117. }
  16118. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16119. class ui_UIMoney extends fgui.GComponent {
  16120. static createInstance() {
  16121. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16122. }
  16123. onConstruct() {
  16124. this.c1 = this.getController("c1");
  16125. this.n4 = (this.getChild("n4"));
  16126. this.coinImg = (this.getChild("coinImg"));
  16127. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16128. this.coinTxt = (this.getChild("coinTxt"));
  16129. this.n7 = (this.getChild("n7"));
  16130. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16131. this.diamondTxt = (this.getChild("diamondTxt"));
  16132. this.diamondImg = (this.getChild("diamondImg"));
  16133. this.n12 = (this.getChild("n12"));
  16134. this.powerImg = (this.getChild("powerImg"));
  16135. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16136. this.powerTxt = (this.getChild("powerTxt"));
  16137. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16138. }
  16139. }
  16140. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16141. class ui_backBtn extends fgui.GButton {
  16142. static createInstance() {
  16143. return (fgui.UIPackage.createObject("game", "backBtn"));
  16144. }
  16145. onConstruct() {
  16146. this.n0 = (this.getChild("n0"));
  16147. this.t0 = this.getTransition("t0");
  16148. this.t1 = this.getTransition("t1");
  16149. }
  16150. }
  16151. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16152. class ui_MoneyBtn extends fgui.GButton {
  16153. static createInstance() {
  16154. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16155. }
  16156. onConstruct() {
  16157. this.button = this.getController("button");
  16158. this.n0 = (this.getChild("n0"));
  16159. }
  16160. }
  16161. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16162. class ui_UIMoneyBtn extends fgui.GComponent {
  16163. static createInstance() {
  16164. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16165. }
  16166. onConstruct() {
  16167. this.n1 = (this.getChild("n1"));
  16168. this.closeBtn = (this.getChild("closeBtn"));
  16169. }
  16170. }
  16171. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16172. class ui_Component64 extends fgui.GComponent {
  16173. static createInstance() {
  16174. return (fgui.UIPackage.createObject("game", "Component64"));
  16175. }
  16176. onConstruct() {
  16177. this.n57 = (this.getChild("n57"));
  16178. this.n54 = (this.getChild("n54"));
  16179. this.n55 = (this.getChild("n55"));
  16180. this.n56 = (this.getChild("n56"));
  16181. this.t1 = this.getTransition("t1");
  16182. }
  16183. }
  16184. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16185. class ui_Component41_3 extends fgui.GComponent {
  16186. static createInstance() {
  16187. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16188. }
  16189. onConstruct() {
  16190. this.c1 = this.getController("c1");
  16191. this.n0 = (this.getChild("n0"));
  16192. this.n2 = (this.getChild("n2"));
  16193. this.cancelBtn = (this.getChild("cancelBtn"));
  16194. this.videoBtn = (this.getChild("videoBtn"));
  16195. this.n9 = (this.getChild("n9"));
  16196. this.n24 = (this.getChild("n24"));
  16197. this.n27 = (this.getChild("n27"));
  16198. this.titleTxt = (this.getChild("titleTxt"));
  16199. this.n28 = (this.getChild("n28"));
  16200. this.t0 = this.getTransition("t0");
  16201. }
  16202. }
  16203. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16204. class ui_dh_zs_4 extends fgui.GComponent {
  16205. static createInstance() {
  16206. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16207. }
  16208. onConstruct() {
  16209. this.n1 = (this.getChild("n1"));
  16210. this.n2 = (this.getChild("n2"));
  16211. this.n3 = (this.getChild("n3"));
  16212. this.n4 = (this.getChild("n4"));
  16213. this.n5 = (this.getChild("n5"));
  16214. this.n6 = (this.getChild("n6"));
  16215. this.n8 = (this.getChild("n8"));
  16216. this.t0 = this.getTransition("t0");
  16217. }
  16218. }
  16219. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16220. class ui_Component71_1 extends fgui.GButton {
  16221. static createInstance() {
  16222. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16223. }
  16224. onConstruct() {
  16225. this.n17 = (this.getChild("n17"));
  16226. this.t0 = this.getTransition("t0");
  16227. }
  16228. }
  16229. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16230. class ui_Component83 extends fgui.GComponent {
  16231. static createInstance() {
  16232. return (fgui.UIPackage.createObject("game", "Component83"));
  16233. }
  16234. onConstruct() {
  16235. this.c1 = this.getController("c1");
  16236. this.n17 = (this.getChild("n17"));
  16237. this.n19 = (this.getChild("n19"));
  16238. this.n20 = (this.getChild("n20"));
  16239. }
  16240. }
  16241. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16242. class ui_Component84 extends fgui.GComponent {
  16243. static createInstance() {
  16244. return (fgui.UIPackage.createObject("game", "Component84"));
  16245. }
  16246. onConstruct() {
  16247. this.c1 = this.getController("c1");
  16248. this.n4 = (this.getChild("n4"));
  16249. this.n22 = (this.getChild("n22"));
  16250. this.n23 = (this.getChild("n23"));
  16251. this.numTxt = (this.getChild("numTxt"));
  16252. this.n25 = (this.getChild("n25"));
  16253. this.n26 = (this.getChild("n26"));
  16254. }
  16255. }
  16256. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16257. class ui_Component84_1 extends fgui.GComponent {
  16258. static createInstance() {
  16259. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16260. }
  16261. onConstruct() {
  16262. this.c1 = this.getController("c1");
  16263. this.n4 = (this.getChild("n4"));
  16264. this.n22 = (this.getChild("n22"));
  16265. this.n23 = (this.getChild("n23"));
  16266. this.numTxt = (this.getChild("numTxt"));
  16267. this.n25 = (this.getChild("n25"));
  16268. this.n26 = (this.getChild("n26"));
  16269. }
  16270. }
  16271. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16272. class ui_Component85 extends fgui.GComponent {
  16273. static createInstance() {
  16274. return (fgui.UIPackage.createObject("game", "Component85"));
  16275. }
  16276. onConstruct() {
  16277. this.n1 = (this.getChild("n1"));
  16278. this.n6 = (this.getChild("n6"));
  16279. this.n2 = (this.getChild("n2"));
  16280. this.n3 = (this.getChild("n3"));
  16281. this.levelTxt = (this.getChild("levelTxt"));
  16282. this.n10 = (this.getChild("n10"));
  16283. this.n11 = (this.getChild("n11"));
  16284. this.n12 = (this.getChild("n12"));
  16285. this.n13 = (this.getChild("n13"));
  16286. this.n14 = (this.getChild("n14"));
  16287. this.modeNode = (this.getChild("modeNode"));
  16288. this.n18 = (this.getChild("n18"));
  16289. this.conditionTxt = (this.getChild("conditionTxt"));
  16290. this.diamondNode = (this.getChild("diamondNode"));
  16291. this.coinNode = (this.getChild("coinNode"));
  16292. this.startBtn = (this.getChild("startBtn"));
  16293. this.n28 = (this.getChild("n28"));
  16294. this.displayRoot = (this.getChild("displayRoot"));
  16295. this.t0 = this.getTransition("t0");
  16296. }
  16297. }
  16298. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16299. class ui_Component86 extends fgui.GButton {
  16300. static createInstance() {
  16301. return (fgui.UIPackage.createObject("game", "Component86"));
  16302. }
  16303. onConstruct() {
  16304. this.n15 = (this.getChild("n15"));
  16305. this.t0 = this.getTransition("t0");
  16306. }
  16307. }
  16308. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16309. class ui_Component87 extends fgui.GComponent {
  16310. static createInstance() {
  16311. return (fgui.UIPackage.createObject("game", "Component87"));
  16312. }
  16313. onConstruct() {
  16314. this.n66 = (this.getChild("n66"));
  16315. this.myProgress = (this.getChild("myProgress"));
  16316. this.starAni = (this.getChild("starAni"));
  16317. this.hpTxt = (this.getChild("hpTxt"));
  16318. this.n74 = (this.getChild("n74"));
  16319. this.n73 = (this.getChild("n73"));
  16320. this.ballTxt = (this.getChild("ballTxt"));
  16321. this.n76 = (this.getChild("n76"));
  16322. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16323. this.levelTxt = (this.getChild("levelTxt"));
  16324. this.star1 = (this.getChild("star1"));
  16325. this.star2 = (this.getChild("star2"));
  16326. this.star3 = (this.getChild("star3"));
  16327. }
  16328. }
  16329. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16330. class ui_Component88 extends fgui.GProgressBar {
  16331. static createInstance() {
  16332. return (fgui.UIPackage.createObject("game", "Component88"));
  16333. }
  16334. onConstruct() {
  16335. this.n68 = (this.getChild("n68"));
  16336. this.bar = (this.getChild("bar"));
  16337. }
  16338. }
  16339. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16340. class ui_Component89 extends fgui.GComponent {
  16341. static createInstance() {
  16342. return (fgui.UIPackage.createObject("game", "Component89"));
  16343. }
  16344. onConstruct() {
  16345. this.c1 = this.getController("c1");
  16346. this.n71 = (this.getChild("n71"));
  16347. this.n72 = (this.getChild("n72"));
  16348. }
  16349. }
  16350. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16351. class ui_Component90 extends fgui.GComponent {
  16352. static createInstance() {
  16353. return (fgui.UIPackage.createObject("game", "Component90"));
  16354. }
  16355. onConstruct() {
  16356. this.c1 = this.getController("c1");
  16357. this.n64 = (this.getChild("n64"));
  16358. this.n65 = (this.getChild("n65"));
  16359. this.n66 = (this.getChild("n66"));
  16360. this.t0 = this.getTransition("t0");
  16361. }
  16362. }
  16363. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16364. class ui_Component127 extends fgui.GButton {
  16365. static createInstance() {
  16366. return (fgui.UIPackage.createObject("game", "Component127"));
  16367. }
  16368. onConstruct() {
  16369. this.n5 = (this.getChild("n5"));
  16370. }
  16371. }
  16372. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16373. class gameBinder {
  16374. static bindAll() {
  16375. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16376. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16377. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16378. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16379. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16380. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16381. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16382. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16383. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16384. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16385. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16386. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16387. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16388. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16389. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16390. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16391. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16392. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16393. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16394. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16395. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16396. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16397. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16398. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16399. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16400. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16401. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16402. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16403. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16404. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16405. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16406. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16407. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16408. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16409. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16410. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16411. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16412. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16413. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16414. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16415. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16416. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16417. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16418. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16419. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16420. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16421. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16422. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16423. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16424. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16425. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16426. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16427. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16428. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16429. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16430. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16431. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16432. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16433. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16434. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16435. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16436. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16437. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16438. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16439. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16440. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16441. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16442. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16443. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16444. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16445. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16446. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16447. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16448. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16449. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16450. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16451. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16452. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16453. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16454. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16455. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16456. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16457. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16458. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16459. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16460. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16461. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16462. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16463. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16464. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16465. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16466. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16467. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16468. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16469. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16470. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16471. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16472. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16473. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16474. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16475. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16476. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16477. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16478. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16479. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16480. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16481. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16482. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16483. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16484. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16485. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16486. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16487. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16488. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16489. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16490. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16491. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16492. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16493. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16494. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16495. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16496. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16497. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16498. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16499. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16500. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16501. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16502. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16503. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16504. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16505. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16506. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16507. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16508. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16509. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16510. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16511. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16512. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16513. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16514. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16515. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16516. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16517. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16518. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16519. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16520. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16521. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16522. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16523. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16524. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16525. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16526. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16527. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16528. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16529. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16530. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16531. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16532. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16533. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16534. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16535. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16536. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16537. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16538. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16539. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16540. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16541. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16542. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16543. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16544. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16545. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16546. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16547. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16548. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16549. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16550. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16551. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16552. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16553. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16554. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16555. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16556. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16557. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16558. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16559. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16560. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16561. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16562. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16563. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16564. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16565. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16566. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16567. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16568. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16569. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16570. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16571. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16572. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16573. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  16574. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16575. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16576. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16577. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16578. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16579. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16580. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16581. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16582. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16583. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16584. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16585. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16586. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16587. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16588. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16589. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16590. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16591. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16592. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16593. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16594. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16595. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16596. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16597. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16598. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16599. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16600. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16601. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16602. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16603. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16604. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16605. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16606. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16607. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16608. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16609. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16610. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16611. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16612. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16613. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16614. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16615. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16616. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16617. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16618. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16619. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16620. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16621. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16622. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16623. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16624. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16625. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16626. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16627. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16628. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16629. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16630. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16631. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16632. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16633. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16634. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16635. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16636. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16637. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16638. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16639. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16640. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16641. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16642. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16643. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16644. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16645. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16646. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16647. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16648. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16649. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16650. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16651. }
  16652. }
  16653. class ui_btn6 extends fgui.GButton {
  16654. static createInstance() {
  16655. return (fgui.UIPackage.createObject("loading", "btn6"));
  16656. }
  16657. onConstruct() {
  16658. this.n6 = (this.getChild("n6"));
  16659. this.n1 = (this.getChild("n1"));
  16660. }
  16661. }
  16662. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16663. class ui_xyItem extends fgui.GComponent {
  16664. static createInstance() {
  16665. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16666. }
  16667. onConstruct() {
  16668. this.xyItem = (this.getChild("xyItem"));
  16669. }
  16670. }
  16671. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16672. class ui_loadinfo extends fgui.GProgressBar {
  16673. static createInstance() {
  16674. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16675. }
  16676. onConstruct() {
  16677. this.bg = (this.getChild("bg"));
  16678. this.bar = (this.getChild("bar"));
  16679. this.title = (this.getChild("title"));
  16680. this.ani = (this.getChild("ani"));
  16681. }
  16682. }
  16683. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16684. class ui_xyNode extends fgui.GComponent {
  16685. static createInstance() {
  16686. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16687. }
  16688. onConstruct() {
  16689. this.n0 = (this.getChild("n0"));
  16690. this.btnYes = (this.getChild("btnYes"));
  16691. this.btnNo = (this.getChild("btnNo"));
  16692. this.btnKnown = (this.getChild("btnKnown"));
  16693. this.btnSure = (this.getChild("btnSure"));
  16694. this.txtWelcom = (this.getChild("txtWelcom"));
  16695. this.txtXy = (this.getChild("txtXy"));
  16696. this.n75 = (this.getChild("n75"));
  16697. this.btnXy1 = (this.getChild("btnXy1"));
  16698. this.btnXy3 = (this.getChild("btnXy3"));
  16699. this.btnXy2 = (this.getChild("btnXy2"));
  16700. this.n74 = (this.getChild("n74"));
  16701. this.xy1 = (this.getChild("xy1"));
  16702. this.txtTitle = (this.getChild("txtTitle"));
  16703. this.btnBack = (this.getChild("btnBack"));
  16704. this.xyList = (this.getChild("xyList"));
  16705. this.xy2 = (this.getChild("xy2"));
  16706. this.xyNode = (this.getChild("xyNode"));
  16707. }
  16708. }
  16709. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16710. class ui_ageNode extends fgui.GComponent {
  16711. static createInstance() {
  16712. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16713. }
  16714. onConstruct() {
  16715. this.n3 = (this.getChild("n3"));
  16716. this.n7 = (this.getChild("n7"));
  16717. this.n4 = (this.getChild("n4"));
  16718. this.btnAge = (this.getChild("btnAge"));
  16719. this.ageNode = (this.getChild("ageNode"));
  16720. }
  16721. }
  16722. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16723. class ui_rnNode extends fgui.GComponent {
  16724. static createInstance() {
  16725. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16726. }
  16727. onConstruct() {
  16728. this.n28 = (this.getChild("n28"));
  16729. this.n30 = (this.getChild("n30"));
  16730. this.n33 = (this.getChild("n33"));
  16731. this.rn1 = (this.getChild("rn1"));
  16732. this.n40 = (this.getChild("n40"));
  16733. this.n41 = (this.getChild("n41"));
  16734. this.rn3 = (this.getChild("rn3"));
  16735. this.n37 = (this.getChild("n37"));
  16736. this.n39 = (this.getChild("n39"));
  16737. this.rn2 = (this.getChild("rn2"));
  16738. this.n47 = (this.getChild("n47"));
  16739. this.n49 = (this.getChild("n49"));
  16740. this.n44 = (this.getChild("n44"));
  16741. this.inputCode = (this.getChild("inputCode"));
  16742. this.inputName = (this.getChild("inputName"));
  16743. this.n48 = (this.getChild("n48"));
  16744. this.n50 = (this.getChild("n50"));
  16745. this.rn4 = (this.getChild("rn4"));
  16746. this.btnCheck = (this.getChild("btnCheck"));
  16747. this.btnExit = (this.getChild("btnExit"));
  16748. this.btnDone = (this.getChild("btnDone"));
  16749. this.rnNode = (this.getChild("rnNode"));
  16750. }
  16751. }
  16752. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16753. class ui_tipNode extends fgui.GComponent {
  16754. static createInstance() {
  16755. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16756. }
  16757. onConstruct() {
  16758. this.bg = (this.getChild("bg"));
  16759. this.n55 = (this.getChild("n55"));
  16760. this.n56 = (this.getChild("n56"));
  16761. this.tipNode = (this.getChild("tipNode"));
  16762. }
  16763. }
  16764. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16765. class ui_fcmNode extends fgui.GComponent {
  16766. static createInstance() {
  16767. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16768. }
  16769. onConstruct() {
  16770. this.n63 = (this.getChild("n63"));
  16771. this.n62 = (this.getChild("n62"));
  16772. this.btnRn = (this.getChild("btnRn"));
  16773. this.n61 = (this.getChild("n61"));
  16774. this.n58 = (this.getChild("n58"));
  16775. this.fcmNode = (this.getChild("fcmNode"));
  16776. }
  16777. }
  16778. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16779. class ui_msgNode extends fgui.GComponent {
  16780. static createInstance() {
  16781. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16782. }
  16783. onConstruct() {
  16784. this.n69 = (this.getChild("n69"));
  16785. this.txtMsg = (this.getChild("txtMsg"));
  16786. this.msgNode = (this.getChild("msgNode"));
  16787. }
  16788. }
  16789. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16790. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16791. static createInstance() {
  16792. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16793. }
  16794. onConstruct() {
  16795. this.n1 = (this.getChild("n1"));
  16796. this.n13 = (this.getChild("n13"));
  16797. this.n14 = (this.getChild("n14"));
  16798. this.n15 = (this.getChild("n15"));
  16799. this.n3 = (this.getChild("n3"));
  16800. this.n4 = (this.getChild("n4"));
  16801. this.n5 = (this.getChild("n5"));
  16802. this.n6 = (this.getChild("n6"));
  16803. this.n7 = (this.getChild("n7"));
  16804. this.n8 = (this.getChild("n8"));
  16805. this.n9 = (this.getChild("n9"));
  16806. this.n10 = (this.getChild("n10"));
  16807. this.n12 = (this.getChild("n12"));
  16808. this.n11 = (this.getChild("n11"));
  16809. this.n16 = (this.getChild("n16"));
  16810. this.n17 = (this.getChild("n17"));
  16811. this.n18 = (this.getChild("n18"));
  16812. this.n20 = (this.getChild("n20"));
  16813. this.n21 = (this.getChild("n21"));
  16814. this.t0 = this.getTransition("t0");
  16815. }
  16816. }
  16817. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16818. class ui_btn5 extends fgui.GButton {
  16819. static createInstance() {
  16820. return (fgui.UIPackage.createObject("loading", "btn5"));
  16821. }
  16822. onConstruct() {
  16823. this.n9 = (this.getChild("n9"));
  16824. this.n1 = (this.getChild("n1"));
  16825. }
  16826. }
  16827. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16828. class ui_UILoading extends fgui.GComponent {
  16829. static createInstance() {
  16830. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16831. }
  16832. onConstruct() {
  16833. this.n12 = (this.getChild("n12"));
  16834. this.loadinfo = (this.getChild("loadinfo"));
  16835. this.n13 = (this.getChild("n13"));
  16836. this.txtLoad = (this.getChild("txtLoad"));
  16837. this.n18 = (this.getChild("n18"));
  16838. }
  16839. }
  16840. ui_UILoading.URL = "ui://37nctnhwphc33";
  16841. class ui_AgeItem extends fgui.GComponent {
  16842. static createInstance() {
  16843. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16844. }
  16845. onConstruct() {
  16846. this.txtAge = (this.getChild("txtAge"));
  16847. }
  16848. }
  16849. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16850. class ui_btn1 extends fgui.GButton {
  16851. static createInstance() {
  16852. return (fgui.UIPackage.createObject("loading", "btn1"));
  16853. }
  16854. onConstruct() {
  16855. this.n6 = (this.getChild("n6"));
  16856. this.n1 = (this.getChild("n1"));
  16857. }
  16858. }
  16859. ui_btn1.URL = "ui://37nctnhwxe622p";
  16860. class ui_btn3 extends fgui.GButton {
  16861. static createInstance() {
  16862. return (fgui.UIPackage.createObject("loading", "btn3"));
  16863. }
  16864. onConstruct() {
  16865. this.n9 = (this.getChild("n9"));
  16866. this.n1 = (this.getChild("n1"));
  16867. }
  16868. }
  16869. ui_btn3.URL = "ui://37nctnhwxe622s";
  16870. class ui_btn2 extends fgui.GButton {
  16871. static createInstance() {
  16872. return (fgui.UIPackage.createObject("loading", "btn2"));
  16873. }
  16874. onConstruct() {
  16875. this.n6 = (this.getChild("n6"));
  16876. this.n1 = (this.getChild("n1"));
  16877. }
  16878. }
  16879. ui_btn2.URL = "ui://37nctnhwxe622t";
  16880. class ui_btnBack extends fgui.GButton {
  16881. static createInstance() {
  16882. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16883. }
  16884. onConstruct() {
  16885. this.n6 = (this.getChild("n6"));
  16886. this.n7 = (this.getChild("n7"));
  16887. }
  16888. }
  16889. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16890. class ui_btnXy1 extends fgui.GButton {
  16891. static createInstance() {
  16892. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16893. }
  16894. onConstruct() {
  16895. this.n1 = (this.getChild("n1"));
  16896. }
  16897. }
  16898. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16899. class ui_btnXy2 extends fgui.GButton {
  16900. static createInstance() {
  16901. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16902. }
  16903. onConstruct() {
  16904. this.n1 = (this.getChild("n1"));
  16905. }
  16906. }
  16907. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16908. class ui_btnXy3 extends fgui.GButton {
  16909. static createInstance() {
  16910. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16911. }
  16912. onConstruct() {
  16913. this.n1 = (this.getChild("n1"));
  16914. }
  16915. }
  16916. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16917. class ui_btn4 extends fgui.GButton {
  16918. static createInstance() {
  16919. return (fgui.UIPackage.createObject("loading", "btn4"));
  16920. }
  16921. onConstruct() {
  16922. this.n9 = (this.getChild("n9"));
  16923. this.n1 = (this.getChild("n1"));
  16924. }
  16925. }
  16926. ui_btn4.URL = "ui://37nctnhwxe622z";
  16927. class loadingBinder {
  16928. static bindAll() {
  16929. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16930. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16931. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16932. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16933. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16934. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16935. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16936. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16937. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16938. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16939. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16940. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16941. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16942. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16943. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16944. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16945. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16946. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16947. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16948. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16949. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16950. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16951. }
  16952. }
  16953. class UIMgr {
  16954. constructor() {
  16955. this._stage = null;
  16956. this._uiList = [];
  16957. this._showList = [];
  16958. this._bindPkgList = [];
  16959. this.uiIndex = 0;
  16960. }
  16961. static get inst() {
  16962. if (UIMgr._inst == null) {
  16963. UIMgr._inst = new UIMgr();
  16964. }
  16965. return UIMgr._inst;
  16966. }
  16967. setStage(s) {
  16968. if (this._stage) {
  16969. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16970. return;
  16971. }
  16972. this._stage = s;
  16973. }
  16974. clearTempData() {
  16975. console.log('zh:clearTempData start');
  16976. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16977. console.log('zh:clearTempData end');
  16978. }
  16979. init() {
  16980. this.setStage(Laya.stage);
  16981. fairygui.UIConfig.defaultFont = "微软雅黑";
  16982. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16983. fairygui.UIConfig.packageFileExtension = "obj";
  16984. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16985. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16986. fairygui.GRoot.inst.width = Laya.stage.width;
  16987. fairygui.GRoot.inst.height = Laya.stage.height;
  16988. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16989. }
  16990. addAllUpdate() {
  16991. this.uiIndex = 0;
  16992. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16993. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16994. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16995. }
  16996. }
  16997. }
  16998. bindFUI(pkgname) {
  16999. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  17000. return;
  17001. }
  17002. switch (pkgname) {
  17003. case fguiRes.loading:
  17004. fairygui.UIPackage.addPackage(pkgname);
  17005. loadingBinder.bindAll();
  17006. this._bindPkgList.push(pkgname);
  17007. break;
  17008. case fguiRes.game:
  17009. fairygui.UIPackage.addPackage(pkgname);
  17010. gameBinder.bindAll();
  17011. this._bindPkgList.push(pkgname);
  17012. break;
  17013. default:
  17014. break;
  17015. }
  17016. }
  17017. Show(cls, ...param) {
  17018. let nameStr = cls.uiName;
  17019. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17020. let temp = this._uiList[i];
  17021. let str = temp.className;
  17022. if (str == nameStr) {
  17023. if (temp.isMuti) {
  17024. if (temp.isHide) {
  17025. temp.show(...param);
  17026. this._uiList.splice(i, 1);
  17027. this._uiList.push(temp);
  17028. return temp;
  17029. }
  17030. }
  17031. else {
  17032. temp.show(...param);
  17033. this._uiList.splice(i, 1);
  17034. this._uiList.push(temp);
  17035. return temp;
  17036. }
  17037. }
  17038. }
  17039. let ui = new cls();
  17040. ui.className = nameStr;
  17041. this._showUI(ui, param);
  17042. return ui;
  17043. }
  17044. destroyUI(ui) {
  17045. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17046. let temp = this._uiList[i].className;
  17047. if (temp == ui.className) {
  17048. this._uiList.splice(i, 1);
  17049. break;
  17050. }
  17051. }
  17052. this.checkUIState();
  17053. }
  17054. _showUI(ui, param) {
  17055. this._uiList.push(ui);
  17056. ui.show(...param);
  17057. }
  17058. Hide(uiClass) {
  17059. let ui = this.getUI(uiClass);
  17060. if (ui && !ui.isHide) {
  17061. ui.hide();
  17062. }
  17063. }
  17064. getUI(ui) {
  17065. let nameStr = ui.uiName;
  17066. for (let index = 0; index < this._uiList.length; index++) {
  17067. let temp = this._uiList[index];
  17068. if (temp.className == nameStr) {
  17069. return temp;
  17070. }
  17071. }
  17072. return null;
  17073. }
  17074. isShow(cls) {
  17075. for (var i of this._uiList) {
  17076. if (i instanceof cls) {
  17077. return i.isShowing;
  17078. }
  17079. }
  17080. return false;
  17081. }
  17082. showUINum() {
  17083. let num = 0;
  17084. for (var i of this._uiList) {
  17085. if (i.isShowing) {
  17086. num++;
  17087. }
  17088. }
  17089. return num;
  17090. }
  17091. checkUIState() {
  17092. Laya.timer.clear(this, this._uiCheck);
  17093. Laya.timer.once(400, this, this._uiCheck);
  17094. }
  17095. _uiCheck() {
  17096. let showList = [];
  17097. for (var i of this._uiList) {
  17098. if (!i.isHide) {
  17099. showList.push(i);
  17100. }
  17101. }
  17102. for (let index = 0; index < showList.length; index++) {
  17103. if (index == showList.length - 1) {
  17104. showList[index].checkActive(true);
  17105. }
  17106. else {
  17107. showList[index].checkActive(false);
  17108. }
  17109. }
  17110. }
  17111. showTip(msg, time = 600, size = 30) {
  17112. }
  17113. }
  17114. class UIShowList {
  17115. }
  17116. class SoundMgr {
  17117. constructor() {
  17118. this.soundMax = 4;
  17119. this.isLoad = false;
  17120. this.soundMap = {};
  17121. this.isSound = true;
  17122. this.openShake = true;
  17123. SoundMgr._instance = this;
  17124. }
  17125. static getInstance() {
  17126. if (!this._instance) {
  17127. this._instance = new SoundMgr();
  17128. }
  17129. return this._instance;
  17130. }
  17131. init() {
  17132. console.log('zh:sm init 1');
  17133. Laya.SoundManager.autoReleaseSound = true;
  17134. Laya.SoundManager.autoStopMusic = true;
  17135. Laya.SoundManager.musicVolume = 0.3;
  17136. Laya.SoundManager.soundVolume = 0.5;
  17137. this.musicPlayed = false;
  17138. this.audioUrl = "asset/sound/ogg/";
  17139. console.log('zh:sm init 2');
  17140. console.log('zh:dev type ');
  17141. if (Laya.Browser.onAndroid) {
  17142. console.log('zh:dev type android');
  17143. this.audioUrl = "asset/sound/ogg/";
  17144. this.isLoad = true;
  17145. }
  17146. else {
  17147. console.log('zh:dev type not android');
  17148. this.audioUrl = "asset/sound/mp3/";
  17149. this.isLoad = true;
  17150. }
  17151. }
  17152. onSetting(isS) {
  17153. this.isSound = isS;
  17154. this.mute(!this.isSound);
  17155. }
  17156. clearCount() {
  17157. for (var key in this.soundMap) {
  17158. delete this.soundMap[key];
  17159. }
  17160. }
  17161. playMusic(path, loop = 0) {
  17162. console.log('zh:playMusic 1 PATH=' + path);
  17163. this.musicPath = path;
  17164. if (!this.isLoad) {
  17165. return;
  17166. }
  17167. if (!path || path == "") {
  17168. return;
  17169. }
  17170. if (!this.isSound) {
  17171. return;
  17172. }
  17173. this.musicPlayed = true;
  17174. let url = this.getUrl(path);
  17175. if (!Laya.Browser.onAndroid) {
  17176. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17177. this.play(url, loop);
  17178. }));
  17179. }
  17180. else {
  17181. this.play(url, loop);
  17182. }
  17183. }
  17184. play(url, loop) {
  17185. Laya.SoundManager.playMusic(url, loop);
  17186. }
  17187. getUrl(path) {
  17188. let url = this.audioUrl + path;
  17189. if (Laya.Browser.onAndroid) {
  17190. url += ".ogg";
  17191. }
  17192. else {
  17193. url += ".mp3";
  17194. }
  17195. return url;
  17196. }
  17197. pauseMusic(pause) {
  17198. if (pause) {
  17199. this.mute(true);
  17200. }
  17201. else if (this.isSound)
  17202. this.mute(false);
  17203. }
  17204. stopMusic() {
  17205. Laya.SoundManager.stopMusic();
  17206. if (Moyu.isNeedPlatAudio) {
  17207. Moyu.stopMusic();
  17208. }
  17209. }
  17210. mute(mute) {
  17211. if (Moyu.isNeedPlatAudio) {
  17212. Moyu.pauseMusic(mute);
  17213. }
  17214. else {
  17215. Laya.SoundManager.musicMuted = mute;
  17216. if (!mute && !this.musicPlayed && this.musicPath) {
  17217. this.playMusic(this.musicPath);
  17218. }
  17219. }
  17220. }
  17221. stopSound(path) {
  17222. let url = this.getUrl(path);
  17223. Laya.SoundManager.stopSound(url);
  17224. }
  17225. playSound(path, loop = 1, soundMax = this.soundMax) {
  17226. if (!this.isLoad)
  17227. return;
  17228. if (!this.isSound)
  17229. return;
  17230. if (!path || path == "")
  17231. return;
  17232. let url = this.getUrl(path);
  17233. if (Moyu.isNeedPlatAudio) {
  17234. Moyu.playSound(path, loop == 0);
  17235. }
  17236. else {
  17237. let count = 1;
  17238. if (this.soundMap[path])
  17239. count = this.soundMap[path] + 1;
  17240. if (count > soundMax)
  17241. return;
  17242. this.soundMap[path] = count;
  17243. Laya.SoundManager.playSound(url, loop);
  17244. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17245. }
  17246. }
  17247. removePath(path) {
  17248. if (this.soundMap[path]) {
  17249. let count = this.soundMap[path];
  17250. count--;
  17251. if (count < 1)
  17252. delete this.soundMap[path];
  17253. else
  17254. this.soundMap[path] = count;
  17255. }
  17256. }
  17257. playBtnSound() {
  17258. this.playSound("btn");
  17259. }
  17260. playGetSound() {
  17261. }
  17262. playCloseUISound() {
  17263. }
  17264. }
  17265. SoundMgr._instance = null;
  17266. var Handler$1 = Laya.Handler;
  17267. var EResType;
  17268. (function (EResType) {
  17269. EResType[EResType["none"] = 0] = "none";
  17270. EResType[EResType["nromal"] = 1] = "nromal";
  17271. EResType[EResType["td"] = 2] = "td";
  17272. EResType[EResType["sk"] = 3] = "sk";
  17273. })(EResType || (EResType = {}));
  17274. class CResLoader {
  17275. constructor(doneCall, proCall) {
  17276. this.completrCall = doneCall;
  17277. this.progressCall = proCall;
  17278. this.progressHander = new Handler$1(this, this.onProgress);
  17279. this.tdResMap = {};
  17280. }
  17281. load(resList) {
  17282. this.resCount = 0;
  17283. this.loadCount = 0;
  17284. for (let i = 0; i < resList.length; i++) {
  17285. let path = resList[i];
  17286. if (!path)
  17287. continue;
  17288. this.resCount++;
  17289. let type = this.getResType(path);
  17290. if (type == EResType.nromal)
  17291. this.loadNromal(path);
  17292. else if (type == EResType.td)
  17293. this.loadTd(path);
  17294. }
  17295. }
  17296. getRes(path) {
  17297. let type = this.getResType(path);
  17298. if (type == EResType.nromal)
  17299. return Laya.loader.getRes(path);
  17300. else if (type == EResType.td) {
  17301. let res = this.tdResMap[path];
  17302. if (res)
  17303. return res.clone();
  17304. return null;
  17305. }
  17306. }
  17307. destroy() {
  17308. this.progressHander.clear();
  17309. this.progressHander = null;
  17310. }
  17311. clearRes(path) {
  17312. let type = this.getResType(path);
  17313. if (type == EResType.nromal)
  17314. Laya.loader.clearRes(path);
  17315. else if (type == EResType.td) {
  17316. let obj = this.tdResMap[path];
  17317. if (obj)
  17318. obj.destroy();
  17319. delete this.tdResMap[path];
  17320. }
  17321. }
  17322. getResType(path) {
  17323. let exs = this.getExtension(path);
  17324. if (exs == "sk")
  17325. return EResType.sk;
  17326. if (exs == "ls" || exs == "lh" || exs == "lm")
  17327. return EResType.td;
  17328. else
  17329. return EResType.nromal;
  17330. }
  17331. getExtension(res) {
  17332. var index = res.lastIndexOf(".");
  17333. return res.substr(index + 1);
  17334. }
  17335. loadNromal(path) {
  17336. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17337. if (res) {
  17338. this.onLoad();
  17339. }
  17340. else
  17341. console.log("load res fail:" + path);
  17342. }), this.progressHander);
  17343. }
  17344. loadSk() {
  17345. }
  17346. loadTd(path) {
  17347. if (this.tdResMap[path]) {
  17348. this.onLoad();
  17349. return;
  17350. }
  17351. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17352. if (res) {
  17353. this.tdResMap[path] = res;
  17354. this.onLoad();
  17355. }
  17356. else
  17357. console.log("load res fail:" + path);
  17358. }));
  17359. }
  17360. onLoad() {
  17361. this.loadCount++;
  17362. this.onProgress(1);
  17363. if (this.loadCount >= this.resCount) {
  17364. this.completrCall.run();
  17365. }
  17366. }
  17367. onProgress(pro) {
  17368. let progress = (this.loadCount + pro) / this.resCount;
  17369. this.progressCall.runWith(progress);
  17370. }
  17371. }
  17372. var Handler$2 = Laya.Handler;
  17373. class ResInfo {
  17374. constructor() {
  17375. this.index = 0;
  17376. }
  17377. }
  17378. class ResMgr {
  17379. constructor() {
  17380. this.resList = [];
  17381. this.doneList = [];
  17382. this.resMap = {};
  17383. this.currentLoad = null;
  17384. this.completeHandler = new Handler$2(this, this.onComplete);
  17385. this.progressHandler = new Handler$2(this, this.onProgress);
  17386. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17387. }
  17388. static getInstance() {
  17389. if (ResMgr._instance == null) {
  17390. ResMgr._instance = new ResMgr();
  17391. }
  17392. return ResMgr._instance;
  17393. }
  17394. loadList(list, completeHandler, progressHandler) {
  17395. if (list.length < 1) {
  17396. completeHandler.run();
  17397. return;
  17398. }
  17399. let info = this.getResInfo();
  17400. info.resList = list;
  17401. info.completeHandler = completeHandler;
  17402. info.progressHandler = progressHandler;
  17403. this.resList.push(info);
  17404. this.startLoad();
  17405. }
  17406. loadFguiRes(list, completeHandler, progressHandler) {
  17407. Laya.loader.load(list, completeHandler, progressHandler);
  17408. }
  17409. loadAny(list, completeHandler, progressHandler) {
  17410. Laya.loader.load(list, completeHandler, progressHandler);
  17411. }
  17412. load(path, completeHandler, progressHandler) {
  17413. let count = this.resMap[path];
  17414. if (count && count > 0) {
  17415. if (completeHandler)
  17416. completeHandler.run();
  17417. }
  17418. else
  17419. this.loadList([path], completeHandler, progressHandler);
  17420. }
  17421. getRes(path) {
  17422. let res = this.resMap[path];
  17423. if (!res)
  17424. this.showLog("资源不存在:" + path);
  17425. else
  17426. return this.loader.getRes(path);
  17427. }
  17428. clearList(list, force = false) {
  17429. if (!list || list.length < 1)
  17430. return;
  17431. let cr = () => {
  17432. for (const k in list) {
  17433. let v = list[k];
  17434. if (!v)
  17435. continue;
  17436. if (force) {
  17437. this.loader.clearRes(v);
  17438. delete this.resMap[v];
  17439. }
  17440. else {
  17441. let count = this.resMap[v];
  17442. if (count && count > 1) {
  17443. count--;
  17444. this.resMap[v] = count;
  17445. }
  17446. else {
  17447. this.loader.clearRes(v);
  17448. delete this.resMap[v];
  17449. }
  17450. }
  17451. }
  17452. if (!window.hasOwnProperty("ks"))
  17453. Laya.Resource.destroyUnusedResources();
  17454. };
  17455. Laya.timer.clearAll(this);
  17456. Laya.timer.once(2000, this, cr);
  17457. }
  17458. clear3D() {
  17459. for (const k in this.loader.tdResMap) {
  17460. this.loader.clearRes(k);
  17461. if (this.resMap[k])
  17462. delete this.resMap[k];
  17463. }
  17464. if (!window.hasOwnProperty("ks"))
  17465. Laya.Resource.destroyUnusedResources();
  17466. }
  17467. clear(path, force = false) {
  17468. this.clearList([path], force);
  17469. }
  17470. getResInfo() {
  17471. if (this.doneList.length > 0)
  17472. return this.doneList.pop();
  17473. else
  17474. return new ResInfo();
  17475. }
  17476. startLoad() {
  17477. if (this.currentLoad)
  17478. return;
  17479. this.currentLoad = this.resList.pop();
  17480. if (this.currentLoad) {
  17481. this.loader.load(this.currentLoad.resList);
  17482. }
  17483. }
  17484. onComplete() {
  17485. if (!this.currentLoad)
  17486. return;
  17487. for (const k in this.currentLoad.resList) {
  17488. let v = this.currentLoad.resList[k];
  17489. let count = this.resMap[v];
  17490. if (count)
  17491. count++;
  17492. else
  17493. count = 1;
  17494. this.resMap[v] = count;
  17495. }
  17496. if (this.currentLoad.completeHandler)
  17497. this.currentLoad.completeHandler.run();
  17498. this.doneList.push(this.currentLoad);
  17499. this.currentLoad = null;
  17500. this.startLoad();
  17501. }
  17502. onProgress(pro) {
  17503. if (!this.currentLoad)
  17504. return;
  17505. if (this.currentLoad.progressHandler)
  17506. this.currentLoad.progressHandler.runWith(pro);
  17507. }
  17508. showLog(str, ...args) {
  17509. console.log("[ResLoader] " + str);
  17510. }
  17511. }
  17512. ResMgr._instance = null;
  17513. class EventMgr extends Laya.EventDispatcher {
  17514. }
  17515. let eventMgr = new EventMgr();
  17516. /*! *****************************************************************************
  17517. Copyright (c) Microsoft Corporation. All rights reserved.
  17518. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17519. this file except in compliance with the License. You may obtain a copy of the
  17520. License at http://www.apache.org/licenses/LICENSE-2.0
  17521. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17522. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17523. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17524. MERCHANTABLITY OR NON-INFRINGEMENT.
  17525. See the Apache Version 2.0 License for specific language governing permissions
  17526. and limitations under the License.
  17527. ***************************************************************************** */
  17528. /* global Reflect, Promise */
  17529. var extendStatics = function(d, b) {
  17530. extendStatics = Object.setPrototypeOf ||
  17531. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17532. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17533. return extendStatics(d, b);
  17534. };
  17535. function __extends(d, b) {
  17536. extendStatics(d, b);
  17537. function __() { this.constructor = d; }
  17538. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17539. }
  17540. var __assign = function() {
  17541. __assign = Object.assign || function __assign(t) {
  17542. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17543. s = arguments[i];
  17544. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17545. }
  17546. return t;
  17547. };
  17548. return __assign.apply(this, arguments);
  17549. };
  17550. function __rest(s, e) {
  17551. var t = {};
  17552. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17553. t[p] = s[p];
  17554. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17555. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17556. t[p[i]] = s[p[i]];
  17557. return t;
  17558. }
  17559. function __decorate(decorators, target, key, desc) {
  17560. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17561. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17562. 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;
  17563. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17564. }
  17565. function __param(paramIndex, decorator) {
  17566. return function (target, key) { decorator(target, key, paramIndex); }
  17567. }
  17568. function __metadata(metadataKey, metadataValue) {
  17569. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17570. }
  17571. function __awaiter(thisArg, _arguments, P, generator) {
  17572. return new (P || (P = Promise))(function (resolve, reject) {
  17573. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17574. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17575. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17576. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17577. });
  17578. }
  17579. function __generator(thisArg, body) {
  17580. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17581. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17582. function verb(n) { return function (v) { return step([n, v]); }; }
  17583. function step(op) {
  17584. if (f) throw new TypeError("Generator is already executing.");
  17585. while (_) try {
  17586. 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;
  17587. if (y = 0, t) op = [op[0] & 2, t.value];
  17588. switch (op[0]) {
  17589. case 0: case 1: t = op; break;
  17590. case 4: _.label++; return { value: op[1], done: false };
  17591. case 5: _.label++; y = op[1]; op = [0]; continue;
  17592. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17593. default:
  17594. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17595. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17596. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17597. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17598. if (t[2]) _.ops.pop();
  17599. _.trys.pop(); continue;
  17600. }
  17601. op = body.call(thisArg, _);
  17602. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17603. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17604. }
  17605. }
  17606. function __exportStar(m, exports) {
  17607. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17608. }
  17609. function __values(o) {
  17610. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17611. if (m) return m.call(o);
  17612. return {
  17613. next: function () {
  17614. if (o && i >= o.length) o = void 0;
  17615. return { value: o && o[i++], done: !o };
  17616. }
  17617. };
  17618. }
  17619. function __read(o, n) {
  17620. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17621. if (!m) return o;
  17622. var i = m.call(o), r, ar = [], e;
  17623. try {
  17624. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17625. }
  17626. catch (error) { e = { error: error }; }
  17627. finally {
  17628. try {
  17629. if (r && !r.done && (m = i["return"])) m.call(i);
  17630. }
  17631. finally { if (e) throw e.error; }
  17632. }
  17633. return ar;
  17634. }
  17635. function __spread() {
  17636. for (var ar = [], i = 0; i < arguments.length; i++)
  17637. ar = ar.concat(__read(arguments[i]));
  17638. return ar;
  17639. }
  17640. function __await(v) {
  17641. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17642. }
  17643. function __asyncGenerator(thisArg, _arguments, generator) {
  17644. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17645. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17646. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17647. 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); }); }; }
  17648. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17649. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17650. function fulfill(value) { resume("next", value); }
  17651. function reject(value) { resume("throw", value); }
  17652. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17653. }
  17654. function __asyncDelegator(o) {
  17655. var i, p;
  17656. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17657. 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; }
  17658. }
  17659. function __asyncValues(o) {
  17660. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17661. var m = o[Symbol.asyncIterator], i;
  17662. 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);
  17663. 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); }); }; }
  17664. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17665. }
  17666. function __makeTemplateObject(cooked, raw) {
  17667. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17668. return cooked;
  17669. };
  17670. function __importStar(mod) {
  17671. if (mod && mod.__esModule) return mod;
  17672. var result = {};
  17673. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17674. result.default = mod;
  17675. return result;
  17676. }
  17677. function __importDefault(mod) {
  17678. return (mod && mod.__esModule) ? mod : { default: mod };
  17679. }
  17680. class CustomAlert {
  17681. static show(title, content, buttons) {
  17682. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17683. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17684. return;
  17685. }
  17686. const bg = new Laya.Box();
  17687. bg.alpha = 0;
  17688. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17689. Laya.stage.addChild(bg);
  17690. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17691. const panel = new Laya.Box();
  17692. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17693. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17694. bg.addChild(panel);
  17695. const titleText = new Laya.Text();
  17696. titleText.text = title;
  17697. titleText.fontSize = 32;
  17698. titleText.color = "#333333";
  17699. titleText.bold = true;
  17700. titleText.pos(20, 20);
  17701. titleText.width = 360;
  17702. titleText.align = "center";
  17703. panel.addChild(titleText);
  17704. const contentText = new Laya.Text();
  17705. contentText.text = content;
  17706. contentText.fontSize = 21;
  17707. contentText.color = "#555555";
  17708. contentText.pos(20, 70);
  17709. contentText.width = 360;
  17710. contentText.wordWrap = true;
  17711. contentText.align = "center";
  17712. panel.addChild(contentText);
  17713. const buttonContainer = new Laya.Box();
  17714. buttonContainer.pos(20, 160);
  17715. panel.addChild(buttonContainer);
  17716. const btnWidth = 120;
  17717. const spacing = 30;
  17718. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17719. buttons.forEach((btn, index) => {
  17720. const button = new Laya.Button();
  17721. button.label = btn.label;
  17722. button.size(btnWidth, 40);
  17723. button.labelSize = 22;
  17724. button.pos(index * (btnWidth + spacing), 0);
  17725. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17726. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17727. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17728. button.alpha = 0.9;
  17729. });
  17730. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17731. button.alpha = 1;
  17732. });
  17733. button.on(Laya.Event.CLICK, this, () => {
  17734. btn.handler();
  17735. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17736. bg.removeSelf();
  17737. }));
  17738. });
  17739. buttonContainer.addChild(button);
  17740. });
  17741. buttonContainer.x = (panel.width - totalWidth) / 2;
  17742. }
  17743. }
  17744. class ConfigMgr {
  17745. constructor() {
  17746. this.httpReqCount = 4;
  17747. this.httpReqOkCount = 0;
  17748. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17749. try {
  17750. this.httpReqOkCount = 0;
  17751. let reqData = xGame.httpMgr.getReqData();
  17752. console.log('zh:第1个请求getClassicCfg');
  17753. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17754. this.classicCfg = classicCfg;
  17755. this.httpReqOkCount++;
  17756. console.log('zh:第2个请求getLevelCfg');
  17757. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17758. this.levelCfg = levelCfg;
  17759. this.httpReqOkCount++;
  17760. console.log('zh:第3个请求 getPlaceBallCfg');
  17761. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17762. this.placeBallCfg = placeBallCfg;
  17763. this.httpReqOkCount++;
  17764. console.log('zh:第4个请求 npc');
  17765. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17766. this.npcJson = npc.Data;
  17767. this.httpReqOkCount++;
  17768. console.log('zh:所有配置加载完成');
  17769. }
  17770. catch (error) {
  17771. console.error('❌请求失败:', error);
  17772. Laya.timer.once(5000, this, () => {
  17773. let retryCount = 0;
  17774. const maxRetries = 3;
  17775. const tryFetchConfig = () => {
  17776. try {
  17777. xGame.cfgMgr.getConfigFromServer();
  17778. }
  17779. catch (error) {
  17780. if (retryCount < maxRetries) {
  17781. retryCount++;
  17782. console.log(`🔄 第${retryCount}次重试获取配置...`);
  17783. Laya.timer.once(5000, this, tryFetchConfig);
  17784. }
  17785. else {
  17786. console.error("❌ 达到最大重试次数,配置获取失败");
  17787. }
  17788. }
  17789. };
  17790. tryFetchConfig();
  17791. });
  17792. }
  17793. finally {
  17794. if (this.httpReqCount > this.httpReqOkCount) {
  17795. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17796. {
  17797. label: "Okay", handler: () => {
  17798. console.log("zh:好的知道了");
  17799. JSBridgeUtils.instance.exitAndCloseGame();
  17800. }
  17801. }
  17802. ]);
  17803. }
  17804. }
  17805. });
  17806. this.sendPostAsync = (action, reqData) => {
  17807. return new Promise((resolve, reject) => {
  17808. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17809. try {
  17810. let code = res.code;
  17811. if (code == 200) {
  17812. const parsedData = JSON.parse(res.msg);
  17813. resolve(parsedData);
  17814. }
  17815. else {
  17816. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17817. reject(new Error(`Request failed with code: ${code}`));
  17818. }
  17819. }
  17820. catch (error) {
  17821. console.error(`ERROR=${error}`);
  17822. alert("Please check your network connection.");
  17823. reject(error);
  17824. }
  17825. finally {
  17826. console.log(`zh:${action}的请求处理完毕`);
  17827. }
  17828. });
  17829. });
  17830. };
  17831. }
  17832. static getInstance() {
  17833. if (!this._instance) {
  17834. this._instance = new ConfigMgr();
  17835. }
  17836. return this._instance;
  17837. }
  17838. init() {
  17839. this.getConfigFromServer();
  17840. }
  17841. test() {
  17842. let reqData = xGame.httpMgr.getReqData();
  17843. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17844. console.log('zh:1s');
  17845. try {
  17846. let code = res.code;
  17847. let data = res.data;
  17848. if (code == 200) {
  17849. const parsedData = JSON.parse(data);
  17850. this.classicCfg = parsedData;
  17851. }
  17852. else {
  17853. console.log('zh:res = ' + JSON.stringify(res));
  17854. }
  17855. }
  17856. catch (error) {
  17857. console.log('error=' + error);
  17858. alert("Please check your network connection.");
  17859. }
  17860. finally {
  17861. console.log('zh:1');
  17862. }
  17863. });
  17864. }
  17865. getUserInfoByIndex(index) {
  17866. return this.npcJson[index];
  17867. }
  17868. getRandomUserInfo() {
  17869. let index = xGame.tools.random(0, this.npcJson.length);
  17870. let rs = this.npcJson[index];
  17871. return rs;
  17872. }
  17873. getMaxBigMoveLength() {
  17874. return Object.keys(this.levelCfg).length;
  17875. }
  17876. getBigMoveLevelByIndex(index) {
  17877. let cfg = this.levelCfg;
  17878. cfg = cfg[index];
  17879. return cfg;
  17880. }
  17881. getRandomClassicLevel() {
  17882. let cfg = this.classicCfg;
  17883. let num = Object.keys(cfg).length;
  17884. let rand = xGame.common.randomNum(1, num);
  17885. return cfg[rand];
  17886. }
  17887. getPlaceBallByLevel(level) {
  17888. return this.placeBallCfg[level];
  17889. }
  17890. getMaxPlaceBall() {
  17891. return Object.keys(this.placeBallCfg).length;
  17892. }
  17893. }
  17894. class PoolD3Mgr {
  17895. constructor() {
  17896. this.pool = {};
  17897. }
  17898. static get ins() {
  17899. return this._ins || (this._ins = new PoolD3Mgr);
  17900. }
  17901. createList(key, prefab, parent) {
  17902. if (!this.pool[key]) {
  17903. this.pool[key] = {};
  17904. this.pool[key].prefab = prefab;
  17905. this.pool[key].list = [];
  17906. this.pool[key].parent = parent;
  17907. }
  17908. }
  17909. getItem(key) {
  17910. if (!this.pool[key]) {
  17911. return;
  17912. }
  17913. let temp;
  17914. if (this.pool[key].list.length > 0) {
  17915. temp = this.pool[key].list.pop();
  17916. }
  17917. else {
  17918. temp = this.pool[key].prefab.clone();
  17919. if (this.pool[key].parent) {
  17920. this.pool[key].parent.addChild(temp);
  17921. }
  17922. }
  17923. temp.active = true;
  17924. return temp;
  17925. }
  17926. putItem(key, obj) {
  17927. if (!this.pool[key]) {
  17928. return;
  17929. }
  17930. obj.active = false;
  17931. this.pool[key].list.push(obj);
  17932. }
  17933. }
  17934. let context$1 = context;
  17935. let uiMgr = UIMgr.inst;
  17936. let soundMgr = SoundMgr.getInstance();
  17937. let resMgr = ResMgr.getInstance();
  17938. let httpMgr = HttpMgr.getInstance();
  17939. let common = Common.getInstance();
  17940. let cfgMgr = ConfigMgr.getInstance();
  17941. let poolD3Mgr = PoolD3Mgr.ins;
  17942. let d3TexUrl = "res/d3Res/";
  17943. let d3ModeUrl = "res/unityRes/";
  17944. function setStageSize(view) {
  17945. if (view.width) {
  17946. view.width = Laya.stage.width;
  17947. view.height = Laya.stage.height;
  17948. }
  17949. }
  17950. function filledBg(view) {
  17951. let wh = Laya.stage.height / Laya.stage.width;
  17952. if (wh > 16 / 9) {
  17953. view.height = Laya.stage.height;
  17954. view.width = Laya.stage.height / 1334 * 750;
  17955. }
  17956. else {
  17957. view.width = Laya.stage.width;
  17958. view.height = Laya.stage.width / 750 * 1334;
  17959. }
  17960. }
  17961. function setNotch(view) {
  17962. if (view.height) {
  17963. view.y += context$1.notchHeight;
  17964. }
  17965. }
  17966. function showTip(str) {
  17967. uiMgr.Show(UIMsg, str);
  17968. }
  17969. function log(...args) {
  17970. console.log(args);
  17971. }
  17972. let xGame = {
  17973. context: context$1,
  17974. eventMgr,
  17975. resMgr,
  17976. uiMgr,
  17977. soundMgr,
  17978. define,
  17979. tools,
  17980. httpMgr,
  17981. d3TexUrl,
  17982. d3ModeUrl,
  17983. common,
  17984. cfgMgr,
  17985. poolD3Mgr,
  17986. setStageSize,
  17987. filledBg,
  17988. setNotch,
  17989. showTip,
  17990. log,
  17991. };
  17992. window["xGame"] = xGame;
  17993. let dataName = 'tBall_';
  17994. class UserData {
  17995. constructor() {
  17996. this.userId = "";
  17997. this.isAgree = false;
  17998. this.coinNum = 0;
  17999. this.gemNum = 0;
  18000. this.sound = true;
  18001. this.vibration = true;
  18002. this.currentDate = 0;
  18003. this.createTime = 0;
  18004. this.awardTime = 0;
  18005. this.roleId = 1;
  18006. this.roleList = [];
  18007. this.roleAds = [];
  18008. this.dressId = 101;
  18009. this.itemId = 201;
  18010. this.bigSkills = [1, 1, 1, 1, 1];
  18011. this.coin = 4000;
  18012. this.diamond = 0;
  18013. this.skillSuccessTimes = 0;
  18014. this.skillGuide = 0;
  18015. this.skillAccTimes = 0;
  18016. this.placeBallData = [];
  18017. this.shareDiamondTimes = 0;
  18018. this.dailyVideoShareTimes = 0;
  18019. this.secretary = [1, 0];
  18020. this.curSecretary = 0;
  18021. this.ballRod = [1, 0, 0, 0, 0, 1];
  18022. this.curBallRod = 5;
  18023. this.signData = 0;
  18024. this.signTime = 0;
  18025. this.drawTimes = 0;
  18026. this.drawAwardTimes = 0;
  18027. this.dailyfreeDrawTimes = 1;
  18028. this.power = 5;
  18029. this.powerTime = 0;
  18030. this.challengeTimes = 0;
  18031. this.extraSign = 0;
  18032. this.classicTimes = 0;
  18033. this.guideHelpLine = 0;
  18034. this.newUser = true;
  18035. this.rootBallFoul = 0;
  18036. this.timeoutFoul = 0;
  18037. this.roleList = [1];
  18038. }
  18039. saveData() {
  18040. let data = {};
  18041. for (let k in this) {
  18042. data[k.toString()] = this[k];
  18043. }
  18044. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18045. }
  18046. getData() {
  18047. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18048. if (ld) {
  18049. let localData = JSON.parse(ld);
  18050. if (localData) {
  18051. for (let k in this) {
  18052. let key = k.toString();
  18053. let data = localData[key];
  18054. if (data != undefined) {
  18055. this[k] = data;
  18056. }
  18057. }
  18058. }
  18059. }
  18060. }
  18061. }
  18062. class ItemData {
  18063. constructor() {
  18064. this.itemList = {};
  18065. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18066. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18067. }
  18068. saveData() {
  18069. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18070. }
  18071. getData() {
  18072. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18073. if (ld) {
  18074. let localData = JSON.parse(ld);
  18075. if (localData) {
  18076. this.itemList = localData;
  18077. }
  18078. }
  18079. }
  18080. }
  18081. class GameData {
  18082. constructor() {
  18083. this.curLevel = 0;
  18084. this.gameType = 1;
  18085. this.signIdx = 0;
  18086. this.signMax = 0;
  18087. this.rotaryTime = 0;
  18088. this.rotaryCount = 0;
  18089. this.rotaryList = [];
  18090. this.diyCount = 3;
  18091. this.awardIdx = 0;
  18092. this.shareNum = 2;
  18093. this.rankWeek = 0;
  18094. this.rankScore = 0;
  18095. this.gameCount = 0;
  18096. this.trySkill = -1;
  18097. this.tryTime = 0;
  18098. }
  18099. saveData() {
  18100. let data = {};
  18101. for (let k in this) {
  18102. data[k.toString()] = this[k];
  18103. }
  18104. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18105. }
  18106. getData() {
  18107. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18108. if (ld) {
  18109. let localData = JSON.parse(ld);
  18110. if (localData) {
  18111. for (let k in this) {
  18112. let key = k.toString();
  18113. let data = localData[key];
  18114. if (data != undefined) {
  18115. this[k] = data;
  18116. }
  18117. }
  18118. }
  18119. }
  18120. }
  18121. }
  18122. class Diy2025GameData {
  18123. constructor() {
  18124. this.challengeMode_overLev = 0;
  18125. this.xszyForClassic = false;
  18126. this.xszyForChallenge = false;
  18127. }
  18128. saveData() {
  18129. let data = {};
  18130. for (let k in this) {
  18131. data[k.toString()] = this[k];
  18132. }
  18133. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18134. }
  18135. getData() {
  18136. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18137. if (ld) {
  18138. let localData = JSON.parse(ld);
  18139. if (localData) {
  18140. for (let k in this) {
  18141. let key = k.toString();
  18142. let data = localData[key];
  18143. if (data != undefined) {
  18144. this[k] = data;
  18145. }
  18146. }
  18147. }
  18148. }
  18149. }
  18150. }
  18151. class DataMgr {
  18152. static Init() {
  18153. this.userData = new UserData();
  18154. this.gameData = new GameData();
  18155. this.itemData = new ItemData();
  18156. this.diyGameData = new Diy2025GameData();
  18157. this.userData.getData();
  18158. this.gameData.getData();
  18159. this.itemData.getData();
  18160. this.diyGameData.getData();
  18161. this.roleId = this.userData.roleId;
  18162. this.resetUse();
  18163. }
  18164. static isNewDay() {
  18165. Moyu.isNewDay(this, (isnew) => {
  18166. xGame.common.isNewDay = isnew;
  18167. if (!isnew)
  18168. return;
  18169. DataMgr.setShareDiamondTimes(0, false);
  18170. DataMgr.setDailyVideoShareTimes(0, false);
  18171. DataMgr.setDailyfreeDrawTimes(1);
  18172. DataMgr.setExtraSign(0);
  18173. });
  18174. }
  18175. static deletData() {
  18176. Laya.LocalStorage.clear();
  18177. }
  18178. static upRankData() {
  18179. let num = xGame.common.getAllStarNum();
  18180. if (num > 0)
  18181. Moyu.upRankData(xGame.common.curRankID, num);
  18182. }
  18183. static addItem(id, count = 1) {
  18184. let v = this.itemData.itemList[id];
  18185. if (!v)
  18186. v = { id: id, count: count, adnum: 0, active: true };
  18187. else {
  18188. if (v.active) {
  18189. v.count += count;
  18190. }
  18191. else {
  18192. v.count = count;
  18193. v.active = true;
  18194. }
  18195. }
  18196. this.itemData.itemList[id] = v;
  18197. xGame.soundMgr.playGetSound();
  18198. this.saveItemData();
  18199. }
  18200. static hasItem(id) {
  18201. let v = this.itemData.itemList[id];
  18202. if (v && v.active)
  18203. return true;
  18204. return false;
  18205. }
  18206. static getItem(id) {
  18207. let v = this.itemData.itemList[id];
  18208. return v;
  18209. }
  18210. static getItemCount(id) {
  18211. let v = this.itemData.itemList[id];
  18212. if (v && v.active)
  18213. return v.count;
  18214. return 0;
  18215. }
  18216. static getItemAd(id) {
  18217. let v = this.itemData.itemList[id];
  18218. if (v) {
  18219. return v.adnum;
  18220. }
  18221. return 0;
  18222. }
  18223. static onItemAd(id, num = 1) {
  18224. let v = this.itemData.itemList[id];
  18225. if (!v)
  18226. v = { id: id, count: 1, adnum: num, active: false };
  18227. else
  18228. v.adnum += num;
  18229. this.itemData.itemList[id] = v;
  18230. this.saveItemData();
  18231. }
  18232. static costItem(id, count) {
  18233. let v = this.itemData.itemList[id];
  18234. if (v && v.active) {
  18235. if (v.count < count)
  18236. return false;
  18237. else {
  18238. v.count -= count;
  18239. this.itemData.itemList[id] = v;
  18240. return true;
  18241. }
  18242. }
  18243. return false;
  18244. }
  18245. static resetUse() {
  18246. this.dressId = this.userData.dressId;
  18247. this.itemId = this.userData.itemId;
  18248. }
  18249. static passLevel() {
  18250. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18251. this.gameData.curLevel++;
  18252. this.curLevel = this.gameData.curLevel;
  18253. this.saveGameData();
  18254. }
  18255. static useRole(id) {
  18256. this.roleId = id;
  18257. if (this.hasRole(id)) {
  18258. this.userData.roleId = id;
  18259. this.saveUserData();
  18260. }
  18261. }
  18262. static addRole(id) {
  18263. if (this.hasRole(id))
  18264. return;
  18265. this.userData.roleList.push(id);
  18266. this.saveUserData();
  18267. }
  18268. static hasRole(id) {
  18269. return this.userData.roleList.indexOf(id) >= 0;
  18270. }
  18271. static gemEnough(num) {
  18272. return this.userData.gemNum >= num;
  18273. }
  18274. static roleHasAd(id) {
  18275. let count = this.userData.roleAds[id];
  18276. if (count != undefined && count >= 0)
  18277. return true;
  18278. else
  18279. return false;
  18280. }
  18281. static saveUserData(time = 500, event, arg) {
  18282. if (this.userSaving)
  18283. return;
  18284. this.userSaving = true;
  18285. Laya.timer.once(time, this, () => {
  18286. this.userSaving = false;
  18287. this.userData.saveData();
  18288. if (event)
  18289. xGame.eventMgr.event(event, arg);
  18290. });
  18291. }
  18292. static updateUserNickName(loginUserName) {
  18293. let kyeStr = 'moyudata_180';
  18294. console.log('zh:################### kyeStr=' + kyeStr);
  18295. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18296. if (moyudata) {
  18297. const obj = JSON.parse(moyudata);
  18298. obj.nickName = loginUserName;
  18299. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18300. console.log('zh:################### updateUserNickName');
  18301. }
  18302. }
  18303. static saveGameData() {
  18304. if (this.gameSaving)
  18305. return;
  18306. this.gameSaving = true;
  18307. Laya.timer.once(1000, this, () => {
  18308. this.gameSaving = false;
  18309. this.gameData.saveData();
  18310. });
  18311. }
  18312. static saveItemData() {
  18313. let fun = () => {
  18314. this.itemData.saveData();
  18315. };
  18316. Laya.timer.clear(this, fun);
  18317. Laya.timer.once(500, this, fun);
  18318. }
  18319. static saveData() {
  18320. this.saveUserData();
  18321. this.saveGameData();
  18322. }
  18323. static getBigSkillList() {
  18324. return this.userData.bigSkills;
  18325. }
  18326. static getBigSkillByIndex(index) {
  18327. return this.userData.bigSkills[index];
  18328. }
  18329. static setBigSkill(index, val, addUp = true) {
  18330. if (addUp) {
  18331. this.userData.bigSkills[index] += val;
  18332. }
  18333. else {
  18334. this.userData.bigSkills[index] = val;
  18335. }
  18336. this.saveUserData();
  18337. }
  18338. static coinEnough(need) {
  18339. if (typeof need != "number") {
  18340. console.error("金币格式错误");
  18341. return;
  18342. }
  18343. return this.userData.coin >= need;
  18344. }
  18345. static setCoin(val) {
  18346. if (typeof val != "number") {
  18347. return;
  18348. }
  18349. this.userData.coin += val;
  18350. this.saveUserData();
  18351. xGame.eventMgr.event(COIN_CHANGE);
  18352. this.updateUserInfo2Server("jb");
  18353. }
  18354. static setCoin2(val) {
  18355. if (typeof val != "number") {
  18356. return;
  18357. }
  18358. this.userData.coin = val;
  18359. this.saveUserData();
  18360. xGame.eventMgr.event(COIN_CHANGE);
  18361. }
  18362. static setCoinFormServer(val) {
  18363. if (typeof val != "number") {
  18364. return;
  18365. }
  18366. this.userData.coin = val;
  18367. this.saveUserData();
  18368. xGame.eventMgr.event(COIN_CHANGE);
  18369. }
  18370. static getCoin() {
  18371. return this.userData.coin;
  18372. }
  18373. static diamondEnough(need) {
  18374. if (typeof need != "number") {
  18375. console.error("金币格式错误");
  18376. return;
  18377. }
  18378. return this.userData.diamond >= need;
  18379. }
  18380. static setDiamond(val) {
  18381. if (typeof val != "number") {
  18382. return;
  18383. }
  18384. this.userData.diamond += val;
  18385. this.saveUserData();
  18386. xGame.eventMgr.event(DIAMOND_CHANGE);
  18387. this.updateUserInfo2Server("zs");
  18388. }
  18389. static setDiamond2(val) {
  18390. if (typeof val != "number") {
  18391. return;
  18392. }
  18393. this.userData.diamond = val;
  18394. this.saveUserData();
  18395. xGame.eventMgr.event(DIAMOND_CHANGE);
  18396. }
  18397. static setDiamondFormServer(val) {
  18398. if (typeof val != "number") {
  18399. return;
  18400. }
  18401. this.userData.diamond = val;
  18402. this.saveUserData();
  18403. xGame.eventMgr.event(DIAMOND_CHANGE);
  18404. }
  18405. static getDiamond() {
  18406. return this.userData.diamond;
  18407. }
  18408. static getSkillSuccessTimes() {
  18409. return this.userData.skillSuccessTimes;
  18410. }
  18411. static setSkillSuccessTimes(val, addUp = true) {
  18412. if (addUp)
  18413. this.userData.skillSuccessTimes += val;
  18414. else
  18415. this.userData.skillSuccessTimes = val;
  18416. this.saveUserData();
  18417. }
  18418. static getSkillAccTimes() {
  18419. return this.userData.skillAccTimes;
  18420. }
  18421. static setSkillAccTimes(val) {
  18422. this.userData.skillAccTimes += val;
  18423. this.saveUserData();
  18424. }
  18425. static getSkillGuide() {
  18426. if (!xGame.common.openGuide) {
  18427. return 1;
  18428. }
  18429. return this.userData.skillGuide;
  18430. }
  18431. static setSkillGuide(val) {
  18432. this.userData.skillGuide = val;
  18433. this.saveUserData();
  18434. }
  18435. static getPlaceBallLevelList() {
  18436. return this.userData.placeBallData;
  18437. }
  18438. static setPlaceBallLevelList(objStr) {
  18439. if (objStr) {
  18440. let obj = JSON.parse(objStr);
  18441. this.userData.placeBallData = obj;
  18442. this.saveUserData();
  18443. }
  18444. else {
  18445. this.userData.placeBallData = [];
  18446. this.saveUserData();
  18447. }
  18448. }
  18449. static getPlaceBallLevel(level) {
  18450. let arr = this.userData.placeBallData;
  18451. let index = level - 1;
  18452. let out;
  18453. if (arr[index]) {
  18454. out = arr[index];
  18455. }
  18456. else {
  18457. let max = arr.length;
  18458. if (max == index) {
  18459. out = {
  18460. star: 0,
  18461. play: true,
  18462. isCur: true,
  18463. getAward: false
  18464. };
  18465. }
  18466. else {
  18467. out = {
  18468. star: 0,
  18469. play: false,
  18470. getAward: false
  18471. };
  18472. }
  18473. }
  18474. return out;
  18475. }
  18476. static setPlaceBallLevel(level, star) {
  18477. let arr = this.userData.placeBallData;
  18478. let index = level - 1;
  18479. if (arr[index]) {
  18480. arr[index].star = Math.max(arr[index].star, star);
  18481. }
  18482. else {
  18483. let max = arr.length;
  18484. if (max == index) {
  18485. arr.push({
  18486. star: star,
  18487. play: true,
  18488. getAward: false
  18489. });
  18490. }
  18491. else {
  18492. console.error("关卡存储出错");
  18493. }
  18494. }
  18495. this.saveUserData();
  18496. }
  18497. static setPlaceBallAward(level) {
  18498. let arr = this.userData.placeBallData;
  18499. let index = level - 1;
  18500. if (arr[index]) {
  18501. arr[index].getAward = true;
  18502. }
  18503. this.saveUserData();
  18504. }
  18505. static getShareDiamondTimes() {
  18506. return this.userData.shareDiamondTimes;
  18507. }
  18508. static setShareDiamondTimes(val, addUp = true) {
  18509. if (addUp) {
  18510. this.userData.shareDiamondTimes += val;
  18511. }
  18512. else {
  18513. this.userData.shareDiamondTimes = val;
  18514. }
  18515. this.saveUserData();
  18516. }
  18517. static getDailyVideoShareTimes() {
  18518. return this.userData.dailyVideoShareTimes;
  18519. }
  18520. static setDailyVideoShareTimes(val, addUp = true) {
  18521. if (addUp) {
  18522. this.userData.dailyVideoShareTimes += val;
  18523. }
  18524. else {
  18525. this.userData.dailyVideoShareTimes = val;
  18526. }
  18527. this.saveUserData();
  18528. }
  18529. static getSecretary(index) {
  18530. return this.userData.secretary[index];
  18531. }
  18532. static setSecretary(index, val) {
  18533. this.userData.secretary[index] = val;
  18534. this.saveUserData();
  18535. }
  18536. static getCurSecretary() {
  18537. return this.userData.curSecretary;
  18538. }
  18539. static setCurSecretary(index) {
  18540. this.userData.curSecretary = index;
  18541. this.saveUserData();
  18542. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18543. }
  18544. static getBallRod(index) {
  18545. return this.userData.ballRod[index];
  18546. }
  18547. static setBallRod(index, val) {
  18548. this.userData.ballRod[index] = val;
  18549. this.saveUserData();
  18550. }
  18551. static setBallRodFormServer(haveQiuGanJsonStr) {
  18552. console.log('zh:haveQiuGanJsonStr = ' + haveQiuGanJsonStr);
  18553. if (!haveQiuGanJsonStr) {
  18554. console.log("setBallRodFormServer数据为空或未定义");
  18555. return;
  18556. }
  18557. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18558. const keys = Object.keys(haveQiuGanJsonObj);
  18559. keys.forEach(key => {
  18560. let v = haveQiuGanJsonObj[key];
  18561. let k = parseInt(key);
  18562. let idx = k - 1;
  18563. console.log('zh:开始更新IDX = ' + idx);
  18564. console.log('this.userData.ballRod[idx]===' + this.userData.ballRod[idx]);
  18565. this.userData.ballRod[idx] = v;
  18566. });
  18567. }
  18568. static getCurBallRod() {
  18569. return this.userData.curBallRod;
  18570. }
  18571. static setCurBallRod(index) {
  18572. this.userData.curBallRod = index;
  18573. this.saveUserData();
  18574. }
  18575. static setSignData(val) {
  18576. this.userData.signData = val;
  18577. this.saveUserData();
  18578. }
  18579. static getSignData() {
  18580. return this.userData.signData;
  18581. }
  18582. static setSignTime(val) {
  18583. this.userData.signTime = val;
  18584. this.saveUserData();
  18585. }
  18586. static getSignTime() {
  18587. return this.userData.signTime;
  18588. }
  18589. static getDrawTimes() {
  18590. return this.userData.drawTimes;
  18591. }
  18592. static setDrawTimes(val, addUp = true) {
  18593. if (addUp) {
  18594. this.userData.drawTimes += val;
  18595. }
  18596. else {
  18597. this.userData.drawTimes = val;
  18598. }
  18599. this.saveUserData();
  18600. }
  18601. static getDrawAwardTimes() {
  18602. return this.userData.drawAwardTimes;
  18603. }
  18604. static setDrawAwardTimes(val) {
  18605. this.userData.drawAwardTimes = val;
  18606. this.saveUserData();
  18607. }
  18608. static getDailyfreeDrawTimes() {
  18609. return this.userData.dailyfreeDrawTimes;
  18610. }
  18611. static setDailyfreeDrawTimes(val) {
  18612. this.userData.dailyfreeDrawTimes = val;
  18613. this.saveUserData();
  18614. }
  18615. static setPower(val, addUp = true) {
  18616. if (addUp)
  18617. this.userData.power += val;
  18618. else
  18619. this.userData.power = val;
  18620. if (this.userData.power >= xGame.common.maxPower) {
  18621. this.userData.power = xGame.common.maxPower;
  18622. }
  18623. xGame.eventMgr.event(POWER_CHANGE, val);
  18624. this.saveUserData();
  18625. }
  18626. static getPower() {
  18627. return this.userData.power;
  18628. }
  18629. static setPowerTime(val) {
  18630. this.userData.powerTime = val;
  18631. this.saveUserData();
  18632. }
  18633. static getPowerTime() {
  18634. return this.userData.powerTime;
  18635. }
  18636. static powerEnough() {
  18637. return this.getPower() > 0;
  18638. }
  18639. static getChallengeTimes() {
  18640. return this.userData.challengeTimes;
  18641. }
  18642. static setChallengeTimes(val) {
  18643. this.userData.challengeTimes += val;
  18644. this.saveUserData();
  18645. }
  18646. static getExtraSign() {
  18647. return this.userData.extraSign;
  18648. }
  18649. static setExtraSign(val) {
  18650. this.userData.extraSign = val;
  18651. this.saveUserData();
  18652. }
  18653. static getClassicTimes() {
  18654. return this.userData.classicTimes;
  18655. }
  18656. static setClassicTimes() {
  18657. this.userData.classicTimes += 1;
  18658. this.saveUserData();
  18659. }
  18660. static getGuideHelpLine() {
  18661. return this.userData.guideHelpLine;
  18662. }
  18663. static setGuideHelpLine() {
  18664. this.userData.guideHelpLine = 1;
  18665. this.saveUserData();
  18666. }
  18667. static getNewUser() {
  18668. return this.userData.newUser;
  18669. }
  18670. static setNewUser() {
  18671. this.userData.newUser = false;
  18672. this.saveUserData();
  18673. }
  18674. static getRootBallFoul() {
  18675. return this.userData.rootBallFoul;
  18676. }
  18677. static setRootBallFoul() {
  18678. this.userData.rootBallFoul = 1;
  18679. this.saveUserData();
  18680. }
  18681. static getTimeoutFoul() {
  18682. return this.userData.timeoutFoul;
  18683. }
  18684. static setTimeoutFoul() {
  18685. this.userData.timeoutFoul = 1;
  18686. this.saveUserData();
  18687. }
  18688. static saveDiyGameData() {
  18689. if (this.diyGameSaving)
  18690. return;
  18691. this.diyGameSaving = true;
  18692. Laya.timer.once(500, this, () => {
  18693. this.diyGameSaving = false;
  18694. this.diyGameData.saveData();
  18695. });
  18696. }
  18697. static getChallengeMode_overLev() {
  18698. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18699. return this.challengeMode_overLev;
  18700. }
  18701. static setChallengeMode_overLev(levNum) {
  18702. this.diyGameData.challengeMode_overLev = levNum;
  18703. this.saveDiyGameData();
  18704. }
  18705. static updateUserInfo2Server(type, count = 0) {
  18706. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18707. if (userInfoData == null) {
  18708. return;
  18709. }
  18710. let reqData = xGame.httpMgr.getReqData();
  18711. let rd = JSON.parse(reqData);
  18712. rd.dataType = type;
  18713. let dataValue = 0;
  18714. if (type == "zs") {
  18715. dataValue = this.getDiamond();
  18716. }
  18717. if (type == "jb") {
  18718. dataValue = this.getCoin();
  18719. }
  18720. rd.dataValue = dataValue;
  18721. reqData = JSON.stringify(rd);
  18722. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18723. try {
  18724. let code = res.code;
  18725. let data = res.data;
  18726. if (code == 401) {
  18727. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18728. console.log('zh:保存资产信息失败,请重新登录 ');
  18729. return;
  18730. }
  18731. if (code == 200) {
  18732. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18733. }
  18734. else {
  18735. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18736. }
  18737. }
  18738. catch (error) {
  18739. console.log('error=' + error);
  18740. alert("Please check your network connection.");
  18741. }
  18742. finally {
  18743. }
  18744. });
  18745. }
  18746. static getUserZiChanInfo() {
  18747. console.log('zh:开始获取用户资产信息');
  18748. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18749. if (userInfoData == null) {
  18750. return;
  18751. }
  18752. let reqData = xGame.httpMgr.getReqData();
  18753. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18754. try {
  18755. console.log('zh:buySp res = ' + JSON.stringify(res));
  18756. let code = res.code;
  18757. let msg = res.msg;
  18758. if (code == 401) {
  18759. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18760. alert(TIP_MSG_key.pleaseLoginIn);
  18761. return;
  18762. }
  18763. if (code == 200) {
  18764. let d = res.data;
  18765. let zuanShi = d.zuanShi;
  18766. let jinBi = d.jinBi;
  18767. let haveQiuGanJson = d.haveQiuGanJson;
  18768. let signData = d.signData;
  18769. let placeBallData = d.placeBallData;
  18770. DataMgr.setDiamondFormServer(zuanShi);
  18771. DataMgr.setCoinFormServer(jinBi);
  18772. console.log('zh:更新球杆信息');
  18773. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18774. console.log('zh:更新关卡信息');
  18775. DataMgr.setPlaceBallLevelList(placeBallData);
  18776. if (signData && signData > 0) {
  18777. DataMgr.setSignData(signData);
  18778. }
  18779. }
  18780. else {
  18781. alert(msg);
  18782. }
  18783. }
  18784. catch (error) {
  18785. console.log('error=' + error);
  18786. alert(error);
  18787. }
  18788. finally {
  18789. }
  18790. });
  18791. }
  18792. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  18793. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18794. console.log('zh:updateLocalUserData=' + userInfo);
  18795. if (userInfo != null) {
  18796. if (!userInfo.buySpids) {
  18797. userInfo.buySpids = { 1: false, 7: false };
  18798. }
  18799. else {
  18800. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  18801. }
  18802. userInfo.buySpids[spid] = isBuyOk;
  18803. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  18804. }
  18805. else {
  18806. }
  18807. }
  18808. static loadUserSpOrderForAd() {
  18809. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18810. if (userInfo == null) {
  18811. return;
  18812. }
  18813. console.log('zh:重新加载更新广告权利');
  18814. let reqData = xGame.httpMgr.getReqData();
  18815. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  18816. try {
  18817. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  18818. let code = res.code;
  18819. let msg = res.msg;
  18820. if (code == 401) {
  18821. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18822. return;
  18823. }
  18824. if (code == 200) {
  18825. let data = res.data;
  18826. let buy_spid1 = false;
  18827. let buy_spid7 = false;
  18828. for (let index = 0; index < data.length; index++) {
  18829. let element = data[index];
  18830. console.log('zh:list element.spid = ' + element.spid);
  18831. if (element.spid == 1) {
  18832. buy_spid1 = true;
  18833. }
  18834. if (element.spid == 7) {
  18835. buy_spid7 = true;
  18836. }
  18837. }
  18838. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  18839. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  18840. }
  18841. else {
  18842. }
  18843. }
  18844. catch (error) {
  18845. console.log('error=' + error);
  18846. alert(error);
  18847. }
  18848. finally {
  18849. }
  18850. });
  18851. }
  18852. }
  18853. DataMgr.isNewUser = false;
  18854. DataMgr.fristEnter = true;
  18855. DataMgr.levelType = 0;
  18856. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18857. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18858. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18859. DataMgr.challengeMode_overLev = 0;
  18860. DataMgr.xszyForClassic = false;
  18861. DataMgr.xszyForChallenge = false;
  18862. DataMgr.awardId = 0;
  18863. DataMgr.awardCoin = 0;
  18864. DataMgr.sceneId = -1;
  18865. DataMgr.tryId = 0;
  18866. DataMgr.curLevel = 1;
  18867. DataMgr.vipLevel = 0;
  18868. DataMgr.maxLevel = 0;
  18869. DataMgr.awardRatio = 1;
  18870. DataMgr.gameList = [];
  18871. DataMgr.rankList = [];
  18872. DataMgr.recoverTime = 480000;
  18873. DataMgr.minScore = 0;
  18874. DataMgr.rankDis = 0;
  18875. DataMgr.userSaving = false;
  18876. DataMgr.gameSaving = false;
  18877. DataMgr.diyGameSaving = false;
  18878. class D3Tween extends Laya.Script3D {
  18879. constructor() {
  18880. super();
  18881. this.isInited = false;
  18882. }
  18883. ;
  18884. init() {
  18885. if (this.isInited)
  18886. return;
  18887. this.isInited = true;
  18888. this.gameObj = this.owner;
  18889. this.transform = this.gameObj.transform;
  18890. }
  18891. get rotX() {
  18892. return this.transform.localRotationEulerX;
  18893. }
  18894. set rotX(v) {
  18895. this.transform.localRotationEulerX = v;
  18896. }
  18897. get rotY() {
  18898. return this.transform.localRotationEulerY;
  18899. }
  18900. set rotY(v) {
  18901. this.transform.localRotationEulerY = v;
  18902. }
  18903. get rotZ() {
  18904. return this.transform.localRotationEulerZ;
  18905. }
  18906. set rotZ(v) {
  18907. this.transform.localRotationEulerZ = v;
  18908. }
  18909. get posX() {
  18910. return this.transform.localPositionX;
  18911. }
  18912. set posX(v) {
  18913. this.transform.localPositionX = v;
  18914. }
  18915. get posY() {
  18916. return this.transform.localPositionY;
  18917. }
  18918. set posY(v) {
  18919. this.transform.localPositionY = v;
  18920. }
  18921. get posZ() {
  18922. return this.transform.localPositionZ;
  18923. }
  18924. set posZ(v) {
  18925. this.transform.localPositionZ = v;
  18926. }
  18927. get rotation() {
  18928. return this.transform.localRotation;
  18929. }
  18930. set rotation(v) {
  18931. this.transform.localRotation = v;
  18932. }
  18933. }
  18934. class D2Hole extends Laya.Script {
  18935. constructor() { super(); }
  18936. onTriggerEnter(collider) {
  18937. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18938. return;
  18939. }
  18940. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18941. if (collider.owner["mySrc"].isRunSkillAni) {
  18942. return;
  18943. }
  18944. if (collider.owner["mySrc"].number != 0) {
  18945. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18946. }
  18947. xGame.common.ballColliHole(collider);
  18948. xGame.common.recoverCameraView();
  18949. }
  18950. }
  18951. }
  18952. class Table extends Laya.Script3D {
  18953. constructor() {
  18954. super();
  18955. this.isSetBorder = false;
  18956. this.inited = false;
  18957. }
  18958. ;
  18959. onAwake() {
  18960. this.init();
  18961. }
  18962. init() {
  18963. if (this.inited)
  18964. return;
  18965. this.inited = true;
  18966. this.gameObj = this.owner;
  18967. this.border = this.gameObj.getChildByName("border");
  18968. }
  18969. setBorderPos() {
  18970. if (this.isSetBorder)
  18971. return;
  18972. this.isSetBorder = true;
  18973. let ui = xGame.common.gameUI.ui;
  18974. let bar1 = this.border.getChildByName("bar1");
  18975. let bar2 = this.border.getChildByName("bar2");
  18976. let bar3 = this.border.getChildByName("bar3");
  18977. let bar4 = this.border.getChildByName("bar4");
  18978. let bar5 = this.border.getChildByName("bar5");
  18979. let bar6 = this.border.getChildByName("bar6");
  18980. this.setInfo(bar1, ui.border.bar1, "box");
  18981. this.setInfo(bar2, ui.border.bar2, "box");
  18982. this.setInfo(bar3, ui.border.bar3, "box");
  18983. this.setInfo(bar4, ui.border.bar4, "box");
  18984. this.setInfo(bar5, ui.border.bar5, "box");
  18985. this.setInfo(bar6, ui.border.bar6, "box");
  18986. let circle1 = this.border.getChildByName("circle1");
  18987. let circle2 = this.border.getChildByName("circle2");
  18988. let circle3 = this.border.getChildByName("circle3");
  18989. let circle4 = this.border.getChildByName("circle4");
  18990. let circle5 = this.border.getChildByName("circle5");
  18991. let circle6 = this.border.getChildByName("circle6");
  18992. this.setInfo(circle1, ui.border.circle1, "circle");
  18993. this.setInfo(circle2, ui.border.circle2, "circle");
  18994. this.setInfo(circle3, ui.border.circle3, "circle");
  18995. this.setInfo(circle4, ui.border.circle4, "circle");
  18996. this.setInfo(circle5, ui.border.circle5, "circle");
  18997. this.setInfo(circle6, ui.border.circle6, "circle");
  18998. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18999. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19000. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19001. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19002. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19003. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19004. let arr = xGame.common.gameMgr.holePosList;
  19005. xGame.common.gameMgr.posObj = {
  19006. "1": arr[0],
  19007. "3": arr[2],
  19008. "4": arr[3],
  19009. "6": arr[5]
  19010. };
  19011. }
  19012. initHolePos(x, y) {
  19013. if (x < 300)
  19014. x += 25;
  19015. else if (x > 1000)
  19016. x -= 25;
  19017. else if (y > 200)
  19018. y -= 10;
  19019. else
  19020. y += 10;
  19021. if (y < 200)
  19022. y += 30;
  19023. else if (y > 500)
  19024. y -= 30;
  19025. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19026. }
  19027. setInfo(d3Obj, d2Obj, type) {
  19028. let ui = xGame.common.gameUI.ui;
  19029. let sprite = new Laya.Sprite();
  19030. ui.border.displayObject.addChild(sprite);
  19031. let colli = xGame.common.getCollider(type);
  19032. sprite.addComponentIntance(colli);
  19033. let rigy = xGame.common.getRigbody();
  19034. rigy.type = "static";
  19035. sprite.addComponentIntance(rigy);
  19036. let d3Pos = d3Obj.transform.position;
  19037. xGame.common.pos3to2Convert(d3Pos);
  19038. let scaleX = d3Obj.transform.localScaleX;
  19039. let scaleZ = d3Obj.transform.localScaleZ;
  19040. let width = xGame.common.scale3to2Convert(scaleZ);
  19041. let height = xGame.common.scale3to2Convert(scaleX);
  19042. sprite.pivotX = width / 2;
  19043. sprite.pivotY = height / 2;
  19044. sprite.x = d3Pos.x;
  19045. sprite.y = d3Pos.y;
  19046. sprite.width = width;
  19047. sprite.height = height;
  19048. d2Obj.x = d3Pos.x;
  19049. d2Obj.y = d3Pos.y;
  19050. d2Obj.width = width;
  19051. d2Obj.height = height;
  19052. if (type == "box") {
  19053. colli.width = width;
  19054. colli.height = height;
  19055. colli.isSensor = false;
  19056. colli.label = "border";
  19057. }
  19058. else {
  19059. colli.radius = width / 2;
  19060. colli.isSensor = true;
  19061. colli.label = "hole";
  19062. sprite.addComponent(D2Hole);
  19063. }
  19064. }
  19065. }
  19066. class D3World extends Laya.Script3D {
  19067. constructor() {
  19068. super();
  19069. this.loadNum = 0;
  19070. this.setLoadNum = 7;
  19071. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19072. }
  19073. onAwake() {
  19074. }
  19075. loadScene() {
  19076. this.scene = this.owner;
  19077. let url = `res/unityRes/root.lh`;
  19078. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19079. this.scene.addChild(prefab);
  19080. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19081. this.putCameraInfo();
  19082. this.camera.enableHDR = false;
  19083. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19084. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19085. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19086. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19087. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19088. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19089. this.knife.active = false;
  19090. this.loadD3Obj();
  19091. }));
  19092. }
  19093. putCameraInfo() {
  19094. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19095. this.cameraObj = new cameraType();
  19096. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19097. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19098. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19099. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19100. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19101. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19102. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19103. this.visitAngleChild.init();
  19104. this.visitRootObj.posX = this.visitAngleChild.posX;
  19105. this.visitRootObj.posY = this.visitAngleChild.posY;
  19106. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19107. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19108. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19109. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19110. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19111. xGame.common.showOneCamera("mainCamera");
  19112. }
  19113. loadD3Obj() {
  19114. this.loadTable();
  19115. this.loadRoom();
  19116. this.loadInHoleParticial();
  19117. this.loadIceParticial();
  19118. this.loadHitParticial();
  19119. this.loadFireworksParticial();
  19120. this.loadBall();
  19121. }
  19122. loadInHoleParticial() {
  19123. this.loadD3Res("inHoleEft", "", (prefab) => {
  19124. prefab.addComponent(Partical);
  19125. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19126. });
  19127. }
  19128. loadIceParticial() {
  19129. this.loadD3Res("iceEft", "", (prefab) => {
  19130. prefab.addComponent(Partical);
  19131. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19132. });
  19133. }
  19134. loadHitParticial() {
  19135. this.loadD3Res("hitEft", "", (prefab) => {
  19136. prefab.addComponent(Partical);
  19137. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19138. });
  19139. }
  19140. loadFireworksParticial() {
  19141. this.loadD3Res("fireworksEft", "", (prefab) => {
  19142. prefab.addComponent(Partical);
  19143. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19144. });
  19145. }
  19146. loadBall(index = 1) {
  19147. this.loadD3Res("ball", index, (prefab) => {
  19148. this.ballPrefab = prefab;
  19149. this.ballPrefab.addComponent(Ball);
  19150. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19151. });
  19152. }
  19153. loadTable(index = 1) {
  19154. this.loadD3Res("table", index, (prefab) => {
  19155. this.tableSrc = prefab.addComponent(Table);
  19156. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19157. this.d3Hand.init();
  19158. this.tableRoot.addChild(prefab);
  19159. });
  19160. }
  19161. loadRoom(index = 1) {
  19162. this.loadD3Res("room", index, (prefab) => {
  19163. this.roomRoot.addChild(prefab);
  19164. });
  19165. }
  19166. loadD3Res(type, index, callback) {
  19167. let url = `res/unityRes/${type}${index}.lh`;
  19168. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19169. callback && callback(prefab);
  19170. this.checkResLoad();
  19171. }));
  19172. }
  19173. checkResLoad() {
  19174. this.loadNum++;
  19175. if (this.loadNum >= this.setLoadNum) {
  19176. xGame.eventMgr.event(D3RES_LOADED);
  19177. }
  19178. }
  19179. prePlayEft() {
  19180. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19181. eft.transform.localPositionX = 0;
  19182. eft.transform.localPositionY = -5;
  19183. eft.transform.localPositionZ = 0;
  19184. eft.active = true;
  19185. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19186. ice.transform.localPositionX = 0;
  19187. ice.transform.localPositionY = -5;
  19188. ice.transform.localPositionZ = 0;
  19189. ice.active = true;
  19190. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19191. hit.transform.localPositionX = 0;
  19192. hit.transform.localPositionY = -5;
  19193. hit.transform.localPositionZ = 0;
  19194. hit.active = true;
  19195. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19196. fireworks.transform.localPositionX = 0;
  19197. fireworks.transform.localPositionY = -5;
  19198. fireworks.transform.localPositionZ = 0;
  19199. fireworks.active = true;
  19200. }
  19201. }
  19202. class cameraType {
  19203. }
  19204. class MoyuMgr$1 {
  19205. static initMoyu() {
  19206. this.moyuView = new MoyuView$1();
  19207. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19208. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19209. this.moyuView.ui.displayObject.zOrder = 1000;
  19210. this.moyuView.init();
  19211. this.moyuView.showTip(true);
  19212. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19213. window['XApk'] = this;
  19214. }
  19215. static showAge(show) {
  19216. if (this.moyuView)
  19217. this.moyuView.showAge(show);
  19218. }
  19219. static onPlatMsg(idx) {
  19220. if (!MoyuMgr$1.moyuView)
  19221. return;
  19222. if (idx == '0') {
  19223. MoyuMgr$1.moyuView.showTip(false);
  19224. }
  19225. }
  19226. static showAgree(call) {
  19227. if (this.moyuView)
  19228. this.moyuView.showAgree(call);
  19229. else
  19230. call && call();
  19231. }
  19232. static showXy(type = 1) {
  19233. if (this.moyuView)
  19234. this.moyuView.showXy(type);
  19235. }
  19236. }
  19237. MoyuMgr$1.isAdvise = false;
  19238. class MoyuView$1 {
  19239. constructor() {
  19240. this.ysxyNum = 1;
  19241. this.ysJson = null;
  19242. this.ui = ui_UIMoyu.createInstance();
  19243. }
  19244. init() {
  19245. this.ui.mainBg.visible = false;
  19246. this.ui.xyNode.visible = false;
  19247. this.ui.ageNode.visible = false;
  19248. this.ui.tipNode.visible = false;
  19249. this.ui.rnNode.visible = false;
  19250. this.ui.fcmNode.visible = false;
  19251. this.ui.ageTip.visible = false;
  19252. this.ui.msgNode.visible = false;
  19253. this.ui.visible = false;
  19254. this.ui.xyNode.xyList.setVirtual();
  19255. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19256. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19257. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19258. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19259. this.ui.xyNode.btnKnown.visible = false;
  19260. this.ui.xyNode.xy1.visible = false;
  19261. this.ui.xyNode.xy2.visible = false;
  19262. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19263. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19264. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19265. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19266. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19267. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19268. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19269. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19270. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19271. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19272. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19273. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19274. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19275. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19276. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19277. this.ysxyNum = 2;
  19278. }
  19279. }
  19280. onClick(obj) {
  19281. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19282. switch (obj) {
  19283. case this.ui.ageTip:
  19284. if (Moyu.isTTApk) {
  19285. this.ui.ageNode.visible = true;
  19286. this.ui.mainBg.visible = true;
  19287. }
  19288. break;
  19289. case this.ui.tipNode:
  19290. this.showTip(false);
  19291. break;
  19292. case this.ui.ageNode.btnAge:
  19293. this.ui.ageNode.visible = false;
  19294. this.ui.mainBg.visible = false;
  19295. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19296. this.ui.visible = false;
  19297. break;
  19298. case this.ui.xyNode.btnXy3:
  19299. case this.ui.xyNode.btnXy1:
  19300. this.loadXy(1);
  19301. break;
  19302. case this.ui.xyNode.btnXy2:
  19303. this.loadXy(2);
  19304. break;
  19305. case this.ui.xyNode.btnBack:
  19306. this.ui.xyNode.xy1.visible = true;
  19307. this.ui.xyNode.xy2.visible = false;
  19308. break;
  19309. case this.ui.xyNode.btnKnown:
  19310. this.ui.xyNode.visible = false;
  19311. this.ui.mainBg.visible = false;
  19312. this.ui.visible = false;
  19313. break;
  19314. case this.ui.rnNode.btnCheck:
  19315. this.check();
  19316. break;
  19317. case this.ui.rnNode.btnExit:
  19318. case this.ui.xyNode.btnNo:
  19319. this.ysxyNum--;
  19320. if (this.ysxyNum > 0)
  19321. this.showMsg("Refuse to quit the game once again");
  19322. else {
  19323. Moyu.userAgree(false);
  19324. Moyu.exit();
  19325. }
  19326. break;
  19327. case this.ui.xyNode.btnSure:
  19328. case this.ui.xyNode.btnYes:
  19329. DataMgr.userData.isAgree = true;
  19330. DataMgr.saveUserData();
  19331. this.onAgree();
  19332. break;
  19333. case this.ui.rnNode.btnDone:
  19334. this.ui.rnNode.visible = false;
  19335. this.ui.visible = false;
  19336. break;
  19337. case this.ui.fcmNode.btnRn:
  19338. this.showRn();
  19339. break;
  19340. }
  19341. }
  19342. showTip(show) {
  19343. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19344. return;
  19345. if (show) {
  19346. MoyuMgr$1.isAdvise = true;
  19347. this.ui.visible = true;
  19348. this.ui.tipNode.visible = true;
  19349. this.ui.tipNode.alpha = 1;
  19350. Laya.timer.once(1000, this, this.showTip, [false]);
  19351. }
  19352. else {
  19353. this.ui.tipNode.alpha = 1;
  19354. this.ui.tipNode.visible = true;
  19355. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19356. this.ui.tipNode.visible = false;
  19357. MoyuMgr$1.isAdvise = false;
  19358. }), 1000);
  19359. }
  19360. }
  19361. showAge(show, px = 0, py = 0) {
  19362. if (Moyu.platType > 10 && !Moyu.isIos) {
  19363. this.ui.ageTip.x = px;
  19364. this.ui.ageTip.y = py;
  19365. this.ui.ageTip.visible = show;
  19366. if (show)
  19367. this.ui.visible = true;
  19368. }
  19369. }
  19370. showAgree(call) {
  19371. this.agreeCall = call;
  19372. this.onAgree();
  19373. return;
  19374. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19375. this.showXy(0);
  19376. }
  19377. else
  19378. this.onAgree();
  19379. }
  19380. onAgree() {
  19381. if (!this.ui.ageNode.visible)
  19382. this.ui.visible = false;
  19383. this.ui.xyNode.visible = false;
  19384. Moyu.userAgree(true);
  19385. this.showAge(false);
  19386. this.agreeCall && this.agreeCall();
  19387. this.showRn();
  19388. }
  19389. showMsg(txt) {
  19390. this.ui.msgNode.txtMsg.text = txt;
  19391. this.ui.msgNode.visible = true;
  19392. this.ui.msgNode.alpha = 1;
  19393. this.ui.visible = true;
  19394. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19395. this.ui.msgNode.visible = false;
  19396. }), 2500, true);
  19397. }
  19398. showRn() {
  19399. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19400. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19401. this.ui.rnNode.rn1.visible = true;
  19402. this.ui.rnNode.rn2.visible = false;
  19403. this.ui.rnNode.rn3.visible = false;
  19404. this.ui.rnNode.rn4.visible = false;
  19405. this.ui.rnNode.visible = true;
  19406. this.ui.mainBg.visible = true;
  19407. this.ui.rnNode.btnDone.visible = false;
  19408. this.ui.rnNode.btnExit.visible = true;
  19409. this.ui.rnNode.btnCheck.visible = true;
  19410. this.ui.fcmNode.visible = false;
  19411. this.ui.visible = true;
  19412. return;
  19413. }
  19414. }
  19415. this.showFcm();
  19416. }
  19417. showFcm() {
  19418. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19419. Moyu.initFCM(true);
  19420. if (Moyu.gameTime < 1)
  19421. this.fcmLoop();
  19422. else if (Moyu.gameTime < 999)
  19423. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19424. }
  19425. }
  19426. fcmLoop() {
  19427. if (Moyu.gameTime < 1) {
  19428. this.ui.rnNode.visible = false;
  19429. this.ui.fcmNode.visible = true;
  19430. this.ui.mainBg.visible = true;
  19431. this.ui.visible = true;
  19432. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19433. Laya.timer.clear(this.ui, this.fcmLoop);
  19434. }
  19435. }
  19436. check() {
  19437. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19438. this.ui.rnNode.rn1.visible = false;
  19439. this.ui.rnNode.rn2.visible = false;
  19440. this.ui.rnNode.rn4.visible = true;
  19441. }
  19442. else if (this.ui.rnNode.rn4.visible) {
  19443. let name = this.ui.rnNode.inputName.text;
  19444. let code = this.ui.rnNode.inputCode.text;
  19445. if (code && code.length == 18) {
  19446. this.ui.rnNode.rn1.visible = false;
  19447. this.ui.rnNode.rn4.visible = false;
  19448. Moyu.authenticate(name, code, (res) => {
  19449. this.ui.rnNode.rn2.visible = !res;
  19450. this.ui.rnNode.rn3.visible = res;
  19451. this.ui.rnNode.btnDone.visible = res;
  19452. this.ui.rnNode.btnExit.visible = !res;
  19453. this.ui.rnNode.btnCheck.visible = !res;
  19454. if (res)
  19455. this.showFcm();
  19456. });
  19457. }
  19458. else
  19459. this.showMsg("信息填写不完整");
  19460. }
  19461. }
  19462. loadXy(type = 0) {
  19463. this.ui.xyNode.xy1.visible = false;
  19464. this.ui.xyNode.xy2.visible = true;
  19465. this.ui.xyNode.xyList.scrollToView(0);
  19466. if (type == 1) {
  19467. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19468. }
  19469. else if (type == 2) {
  19470. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19471. }
  19472. }
  19473. showXy(type = 0) {
  19474. this.xyBtn();
  19475. if (type == 0) {
  19476. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19477. this.ui.xyNode.btnSure.visible = true;
  19478. }
  19479. else {
  19480. this.ui.xyNode.btnYes.visible = true;
  19481. this.ui.xyNode.btnNo.visible = true;
  19482. }
  19483. }
  19484. else {
  19485. this.ui.xyNode.btnKnown.visible = true;
  19486. this.ui.mainBg.visible = true;
  19487. }
  19488. this.ui.xyNode.xy1.visible = true;
  19489. this.ui.xyNode.xy2.visible = false;
  19490. this.ui.xyNode.visible = true;
  19491. this.ui.visible = true;
  19492. }
  19493. xyBtn() {
  19494. this.ui.xyNode.btnSure.visible = false;
  19495. this.ui.xyNode.btnYes.visible = false;
  19496. this.ui.xyNode.btnNo.visible = false;
  19497. this.ui.xyNode.btnKnown.visible = false;
  19498. {
  19499. this.ui.xyNode.btnXy3.visible = false;
  19500. this.ui.xyNode.btnXy2.visible = true;
  19501. this.ui.xyNode.btnXy1.visible = true;
  19502. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19503. }
  19504. }
  19505. createXY(json) {
  19506. this.ysJson = json.content;
  19507. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19508. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19509. this.ui.xyNode.xy2.visible = true;
  19510. }
  19511. renderListItem(idx, cell) {
  19512. let xy = this.ysJson[idx];
  19513. cell.height = xy.line * 30;
  19514. cell.xyItem.text = xy.text;
  19515. }
  19516. onDestroy() {
  19517. this.agreeCall = null;
  19518. }
  19519. }
  19520. class UILoading extends UIBase {
  19521. constructor() {
  19522. super();
  19523. this.accTime = 0;
  19524. this.curNum = 0;
  19525. this.rate = 1;
  19526. this.loadSubOk = false;
  19527. this.loadResOK = false;
  19528. this.openLoading = true;
  19529. this.beginLoadRes = false;
  19530. this.finishD2 = false;
  19531. this.finishD3 = false;
  19532. }
  19533. onConstructor() {
  19534. this.ui = ui_UILoading.createInstance();
  19535. this.contentPane = this.ui;
  19536. this.isEject = false;
  19537. this._initUI();
  19538. this._addEvent();
  19539. }
  19540. _initUI() {
  19541. MoyuMgr$1.initMoyu();
  19542. }
  19543. _addEvent() {
  19544. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19545. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19546. }
  19547. show() {
  19548. super.show();
  19549. console.log('zh:加载分包资源');
  19550. loadSubRes(this.subResProgress.bind(this));
  19551. this.ui.txtLoad.text = "Loading...";
  19552. }
  19553. subResProgress(pro, finish) {
  19554. this.curNum = pro;
  19555. if (finish) {
  19556. this.curNum = 1;
  19557. this.loadSubOk = true;
  19558. }
  19559. }
  19560. laodD3Res() {
  19561. let scene3D = new Laya.Scene3D();
  19562. xGame.common.d3Scene = scene3D;
  19563. xGame.common.d3World = scene3D.addComponent(D3World);
  19564. xGame.common.d3World.loadScene();
  19565. }
  19566. loadD2Res() {
  19567. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19568. this.finishD2 = true;
  19569. this.checkLoadAll();
  19570. this.curNum = 1;
  19571. }), Laya.Handler.create(this, (pro) => {
  19572. this.curNum = pro;
  19573. }, null, false));
  19574. }
  19575. d3ResFinish() {
  19576. this.finishD3 = true;
  19577. this.checkLoadAll();
  19578. }
  19579. checkLoadAll() {
  19580. if (this.finishD2 && this.finishD3) {
  19581. this.loadResOK = true;
  19582. }
  19583. }
  19584. loadRes() {
  19585. this.laodD3Res();
  19586. this.loadD2Res();
  19587. }
  19588. myUpdate(dt) {
  19589. if (!this.openLoading)
  19590. return;
  19591. this.accTime += dt * this.rate;
  19592. if (this.accTime >= this.curNum)
  19593. this.accTime = this.curNum;
  19594. this.ui.loadinfo.value = this.accTime * 100;
  19595. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19596. if (!this.beginLoadRes) {
  19597. this.beginLoadRes = true;
  19598. this.ui.txtLoad.text = "Loading...";
  19599. this.curNum = 0;
  19600. this.accTime = 0;
  19601. this.loadRes();
  19602. }
  19603. if (this.loadResOK) {
  19604. this.openLoading = false;
  19605. Laya.timer.once(300, this, () => {
  19606. xGame.common.d3Scene.active = false;
  19607. MoyuMgr$1.showAgree(enterGame);
  19608. });
  19609. }
  19610. }
  19611. }
  19612. release() {
  19613. }
  19614. hide() {
  19615. super.hide();
  19616. this.release();
  19617. }
  19618. onClose() {
  19619. this.hide();
  19620. }
  19621. }
  19622. UILoading.uiName = "UILoading";
  19623. class UIRepentProp$1 extends UIBase {
  19624. constructor() {
  19625. super();
  19626. this.viewType = 0;
  19627. this.regretType = 0;
  19628. }
  19629. onConstructor() {
  19630. this.ui = ui_UIRepentProp.createInstance();
  19631. this.contentPane = this.ui;
  19632. this.isEject = false;
  19633. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19634. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19635. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19636. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19637. }
  19638. show(viewType, regretType, callback) {
  19639. PlatMgr.showInsert(true);
  19640. this.viewType = viewType;
  19641. this.regretType = regretType;
  19642. this.callback = callback;
  19643. super.show();
  19644. this.ui.t0.play();
  19645. this.ui.c1.selectedIndex = this.viewType;
  19646. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19647. if (this.viewType == 0) {
  19648. let guide = DataMgr.getGuideHelpLine();
  19649. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19650. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19651. }
  19652. xGame.common.gameMgr.gamePause = true;
  19653. }
  19654. hideSelf() {
  19655. xGame.common.gameMgr.gamePause = false;
  19656. this.callback && this.callback(false);
  19657. this.hide();
  19658. }
  19659. videoRegret() {
  19660. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19661. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19662. }
  19663. else {
  19664. console.log('zh:AD 失败,直接发放奖励');
  19665. this.qjff_AD_for_UIrepentProp_videoRegret();
  19666. }
  19667. }
  19668. qjff_AD_for_UIrepentProp_videoRegret() {
  19669. this.callback && this.callback(true);
  19670. this.hideSelf();
  19671. }
  19672. videoAddHelpLine() {
  19673. let guide = DataMgr.getGuideHelpLine();
  19674. if (guide == 0) {
  19675. this.callback && this.callback(true);
  19676. this.hideSelf();
  19677. DataMgr.setGuideHelpLine();
  19678. xGame.common.gameUI.ui.guideNode.visible = false;
  19679. }
  19680. else {
  19681. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19682. if (Laya.Browser.onAndroid) {
  19683. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19684. if (!boo) {
  19685. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19686. return;
  19687. }
  19688. }
  19689. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19690. }
  19691. else {
  19692. console.log('zh:AD 失败,直接发放奖励');
  19693. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19694. }
  19695. }
  19696. }
  19697. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19698. this.callback && this.callback(true);
  19699. this.hideSelf();
  19700. }
  19701. }
  19702. UIRepentProp$1.uiName = "UIRepentProp";
  19703. class UIRodMethod$1 extends UIBase {
  19704. constructor() {
  19705. super();
  19706. this.isPressd = false;
  19707. }
  19708. onConstructor() {
  19709. this.ui = ui_UIRodMethod.createInstance();
  19710. this.contentPane = this.ui;
  19711. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19712. this.moveDir = new Laya.Vector2();
  19713. this.moveDest = new Laya.Vector2();
  19714. this.centerPos = new Laya.Vector2();
  19715. xGame.common.uiRodMethod = this;
  19716. }
  19717. show() {
  19718. super.show();
  19719. xGame.common.gameMgr.gamePause = true;
  19720. this.openPressDotEvent();
  19721. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19722. this.centerPos.x = this.ui.white.x;
  19723. this.centerPos.y = this.ui.white.y;
  19724. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19725. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19726. this.setDot();
  19727. }
  19728. setDot() {
  19729. this.ui.dot.x = this.moveDest.x;
  19730. this.ui.dot.y = this.moveDest.y;
  19731. }
  19732. closeSelf() {
  19733. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19734. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19735. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19736. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19737. xGame.common.gameMgr.gamePause = false;
  19738. this.hide();
  19739. }
  19740. openPressDotEvent() {
  19741. this.closePressDotEvent();
  19742. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19743. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19744. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19745. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19746. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19747. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19748. }
  19749. closePressDotEvent() {
  19750. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19751. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19752. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19753. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19754. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19755. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19756. }
  19757. onDown(e) {
  19758. if (e.type == Laya.Event.MOUSE_DOWN)
  19759. this.isPressd = true;
  19760. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19761. this.isPressd = false;
  19762. if (!this.isPressd)
  19763. return;
  19764. this.moveDest.x = e.stageX;
  19765. this.moveDest.y = e.stageY;
  19766. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19767. if (dis > 6724) {
  19768. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19769. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19770. }
  19771. this.setDot();
  19772. }
  19773. resetRod() {
  19774. this.ui.dot.x = this.ui.white.x;
  19775. this.ui.dot.y = this.ui.white.y;
  19776. this.gameRod.dot.x = this.gameRod.bg.x;
  19777. this.gameRod.dot.y = this.gameRod.bg.y;
  19778. xGame.common.rodOffest.x = 0;
  19779. xGame.common.rodOffest.y = 0;
  19780. }
  19781. }
  19782. UIRodMethod$1.uiName = "UIRodMethod";
  19783. class UIMsg$1 extends UIBase {
  19784. constructor() {
  19785. super();
  19786. }
  19787. onConstructor() {
  19788. this.ui = ui_UIMsg.createInstance();
  19789. this.contentPane = this.ui;
  19790. this.isEject = false;
  19791. this.isMuti = true;
  19792. }
  19793. show(msg, callback) {
  19794. super.show();
  19795. this.ui.tipsNode.msgTxt.text = msg;
  19796. this.ui.alpha = 1;
  19797. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19798. this.hide();
  19799. callback && callback();
  19800. }), 1000);
  19801. }
  19802. }
  19803. UIMsg$1.uiName = "UIMsg";
  19804. class UITips$1 extends UIBase {
  19805. constructor() {
  19806. super();
  19807. this.type = 0;
  19808. }
  19809. onConstructor() {
  19810. this.ui = ui_UITips.createInstance();
  19811. this.contentPane = this.ui;
  19812. this.isEject = false;
  19813. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19814. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19815. }
  19816. show(tipsTxt, womanTxt, type) {
  19817. super.show();
  19818. this.ui.t0.play();
  19819. this.ui.myNode.tipsTxt.text = tipsTxt;
  19820. this.ui.myNode.womanTxt.text = womanTxt;
  19821. PlatMgr.showInsert(true);
  19822. this.ui.myNode.c1.selectedIndex = type;
  19823. this.type = type;
  19824. switch (this.type) {
  19825. case TipsType.exitGame:
  19826. xGame.common.gameMgr.gamePause = true;
  19827. break;
  19828. case TipsType.foul:
  19829. Laya.timer.once(200, this, () => {
  19830. xGame.common.gameMgr.gamePause = true;
  19831. });
  19832. break;
  19833. default:
  19834. break;
  19835. }
  19836. }
  19837. clickLeftBtn() {
  19838. this.hide();
  19839. xGame.common.gameMgr.gamePause = false;
  19840. switch (this.type) {
  19841. case TipsType.exitGame:
  19842. break;
  19843. case TipsType.foul:
  19844. break;
  19845. default:
  19846. break;
  19847. }
  19848. }
  19849. clickRightBtn() {
  19850. this.hide();
  19851. switch (this.type) {
  19852. case TipsType.exitGame:
  19853. xGame.eventMgr.event(RESET_GAME);
  19854. xGame.uiMgr.Show(UIMain$1);
  19855. Moyu.recordEnd(this, null);
  19856. xGame.common.longHelpLine = false;
  19857. break;
  19858. case TipsType.foul:
  19859. xGame.common.gameMgr.gamePause = false;
  19860. Laya.timer.clearAll(this);
  19861. break;
  19862. default:
  19863. break;
  19864. }
  19865. }
  19866. }
  19867. UITips$1.uiName = "UITips";
  19868. class UIGame$1 extends UIBase {
  19869. constructor() {
  19870. super();
  19871. this.powerNum = 0;
  19872. this.isD3Inited = false;
  19873. this.isPrePlay = false;
  19874. this.isMoveRod = false;
  19875. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19876. this.rulerDis = 20;
  19877. this.rulerOffset = 0;
  19878. }
  19879. onConstructor() {
  19880. this.ui = ui_UIGame.createInstance();
  19881. this.contentPane = this.ui;
  19882. this.ui.x += xGame.common.sysOffestNum;
  19883. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19884. this.isEject = false;
  19885. xGame.common.gameUI = this;
  19886. this.initSelf();
  19887. }
  19888. isTurnSelf() {
  19889. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19890. return true;
  19891. }
  19892. }
  19893. initSelf() {
  19894. let topUI = this.ui.topNode;
  19895. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19896. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19897. this.barInfo = {};
  19898. this.barInfo.curY = 0;
  19899. this.barInfo.height = this.ui.powerNode.height;
  19900. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19901. this.barInfo.powerStartY = this.ui.powerNode.y;
  19902. xGame.common.aiPlayer = new AIPlayer();
  19903. xGame.common.gameMgr = new GameMgr();
  19904. xGame.common.skillMgr = new SkillMgr();
  19905. xGame.common.wordsMgr = new WordsMgr();
  19906. xGame.common.talkMgr = new TalkMgr();
  19907. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19908. console.log("加载经典模式表情文件chenggon !");
  19909. });
  19910. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19911. console.log("挑战模式奖励模式spine加载成功!");
  19912. });
  19913. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19914. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19915. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19916. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19917. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19918. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19919. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19920. }
  19921. getGanZiImg() {
  19922. let index = DataMgr.getCurBallRod();
  19923. let data = cfgTable.ballrodData[index + 1];
  19924. let gan_url = xGame.common.getGameIconUrl(data.img);
  19925. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19926. this.ui.powerNode.showImg.url = gan_url;
  19927. console.log('zh:修改杆子图标O K');
  19928. }
  19929. returnHome() {
  19930. let tips = "Are you sure to exit the game?";
  19931. let woman = "Boss, why don't you play for a while longer?";
  19932. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19933. }
  19934. addRodMethodClick() {
  19935. if (this.isTurnSelf()) {
  19936. xGame.uiMgr.Show(UIRodMethod$1);
  19937. }
  19938. }
  19939. clickHelpLineBtn(force = false) {
  19940. if (!this.isTurnSelf())
  19941. return;
  19942. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19943. if (success) {
  19944. xGame.common.longHelpLine = true;
  19945. xGame.common.d2World.getHelpLine();
  19946. Moyu.sendDataEvent("guideNum");
  19947. }
  19948. else {
  19949. }
  19950. });
  19951. }
  19952. renderSelfDisplayBalls(index, target) {
  19953. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19954. target.myImg.url = xGame.common.getGameIconUrl(str);
  19955. }
  19956. renderAIDisplayBalls(index, target) {
  19957. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19958. target.myImg.url = xGame.common.getGameIconUrl(str);
  19959. ;
  19960. }
  19961. updateMode() {
  19962. if (xGame.common.gameMode == GameMode.classic) {
  19963. this.ui.topNode.scoreNode.visible = false;
  19964. }
  19965. else if (xGame.common.gameMode == GameMode.bigMove) {
  19966. this.ui.topNode.scoreNode.visible = true;
  19967. }
  19968. }
  19969. show() {
  19970. super.show();
  19971. console.log("zh:uigame show AADD");
  19972. this.ui.alpha = 0;
  19973. this.updateSelf();
  19974. xGame.common.gameMgr.gamePause = false;
  19975. xGame.common.gameUI.ui.blackAni.visible = false;
  19976. xGame.common.gameUI.ui.whiteAni.visible = false;
  19977. this.ui.powerEft.visible = false;
  19978. this.ui.colorNode.visible = false;
  19979. this.updateHead();
  19980. let curUse = DataMgr.getCurBallRod();
  19981. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19982. this.getGanZiImg();
  19983. }
  19984. updateSelf() {
  19985. if (xGame.common.gameMode == GameMode.classic) {
  19986. this.ui.c1.selectedIndex = 0;
  19987. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19988. this.ui.topNode.middleNode.visible = true;
  19989. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19990. }
  19991. else if (xGame.common.gameMode == GameMode.bigMove) {
  19992. this.ui.c1.selectedIndex = 0;
  19993. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19994. this.ui.topNode.middleNode.visible = false;
  19995. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19996. let rand = xGame.common.randomNum(1, max);
  19997. let guide = DataMgr.getSkillGuide();
  19998. if (guide == 0)
  19999. rand = 1;
  20000. xGame.common.bigMoveLevelIndex = rand;
  20001. }
  20002. else if (xGame.common.gameMode == GameMode.placeBall) {
  20003. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20004. this.ui.c1.selectedIndex = 1 + data.type;
  20005. this.ui.alpha = 1;
  20006. this.startGame();
  20007. }
  20008. this.updateMode();
  20009. this.initD3world();
  20010. this.initD2world();
  20011. }
  20012. startGame() {
  20013. this.ui.snowNode.visible = Math.random() <= 0.1;
  20014. this.ui.d2Node.visible = false;
  20015. xGame.common.d3World.d3Hand.gameObj.active = false;
  20016. xGame.common.d3World.tableSrc.init();
  20017. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20018. this.cameraViewChange(() => {
  20019. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20020. switch (xGame.common.gameMode) {
  20021. case GameMode.classic:
  20022. xGame.common.d3World.d3Hand.gameObj.active = true;
  20023. this.playPutBallD3Ani();
  20024. break;
  20025. case GameMode.bigMove:
  20026. this.enterGame();
  20027. Laya.timer.once(500, this, () => {
  20028. this.ui.topNode.middleNode.visible = true;
  20029. this.ui.topNode.middleNode.t0.play();
  20030. });
  20031. break;
  20032. case GameMode.placeBall:
  20033. this.enterGame();
  20034. break;
  20035. default:
  20036. break;
  20037. }
  20038. });
  20039. PlatMgr.showBanner(false);
  20040. }
  20041. enterGame() {
  20042. this.ui.d2Node.visible = true;
  20043. xGame.common.d3World.d3Hand.gameObj.active = false;
  20044. xGame.common.showOneCamera("mainCamera");
  20045. Moyu.recordGame(30, true);
  20046. if (!this.isPrePlay) {
  20047. this.isPrePlay = true;
  20048. xGame.common.d3World.prePlayEft();
  20049. }
  20050. xGame.common.gameMgr.gameReady();
  20051. this.openAllEvent();
  20052. this.ui.snowNode.visible = false;
  20053. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20054. this.ui.helpBtn.visible = condition;
  20055. }
  20056. showHelpLineGuide() {
  20057. let longGuide = DataMgr.getGuideHelpLine();
  20058. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20059. this.ui.helpBtn.visible = true;
  20060. this.ui.guideNode.visible = true;
  20061. }
  20062. }
  20063. setTurnAlpha(alpha) {
  20064. this.ui.keduNode.alpha = alpha;
  20065. this.ui.ganNode.alpha = alpha;
  20066. this.ui.rodMethodNode.alpha = alpha;
  20067. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20068. }
  20069. cameraViewChange(callback) {
  20070. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20071. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20072. xGame.common.showOneCamera("visitAngle");
  20073. cameraSrc.localRotationEulerY = 180;
  20074. cameraSrc.localRotationEulerZ = 0;
  20075. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20076. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20077. callback && callback();
  20078. }));
  20079. }));
  20080. }
  20081. playPutBallD3Ani() {
  20082. xGame.common.showOneCamera("mainCamera");
  20083. let handSrc = xGame.common.d3World.d3Hand;
  20084. handSrc.gameObj.active = true;
  20085. handSrc.transform.localPositionZ = 3;
  20086. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20087. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20088. handSrc.gameObj.active = false;
  20089. this.enterGame();
  20090. }), 400);
  20091. }));
  20092. }
  20093. updateHead() {
  20094. let user = Moyu.getUserInfo();
  20095. this.ui.topNode.selfNameTxt.text = user.nickName;
  20096. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20097. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20098. if (DataMgr.getSkillGuide() < 1) {
  20099. this.ui.topNode.aiNameTxt.text = 'billiards';
  20100. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20101. }
  20102. else {
  20103. this.ui.topNode.aiNameTxt.text = aiData.name;
  20104. let randNo = Math.floor(Math.random() * 10) + 1;
  20105. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20106. }
  20107. }
  20108. initD2world() {
  20109. let node = this.ui.d2Root.displayObject;
  20110. let src = node.getComponent(D2World);
  20111. if (!src) {
  20112. xGame.common.d2World = node.addComponent(D2World);
  20113. }
  20114. xGame.common.d2World.initSelf();
  20115. }
  20116. initD3world() {
  20117. if (this.isD3Inited)
  20118. return;
  20119. this.isD3Inited = true;
  20120. let scene3D = xGame.common.d3Scene;
  20121. this.ui.d3Root.displayObject.addChild(scene3D);
  20122. scene3D.active = true;
  20123. xGame.common.d3World.tableSrc.setBorderPos();
  20124. }
  20125. onRootMove(e) {
  20126. let rootBall = xGame.common.d2World.rootBall;
  20127. this.ui.moveNode.x = e.x;
  20128. this.ui.moveNode.y = e.y;
  20129. rootBall.gameObj.x = e.x;
  20130. rootBall.gameObj.y = e.y;
  20131. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20132. }
  20133. aiRootMove(move) {
  20134. if (move)
  20135. this.hideBallUI();
  20136. else {
  20137. this.showBallUI();
  20138. xGame.common.d2World.getHelpLine();
  20139. }
  20140. }
  20141. aiForce(type, force = 0) {
  20142. this.pressTarget = PressType.powerNode;
  20143. if (type == 1)
  20144. this.onEventUp({ force: true });
  20145. else if (type == 2)
  20146. this.onEventMove({ stageY: force, force: true });
  20147. }
  20148. onEventPress(e) {
  20149. if (e.stopPropagation)
  20150. e.stopPropagation();
  20151. if (!this.isTurnSelf())
  20152. return;
  20153. let target = e.target;
  20154. switch (target) {
  20155. case this.ui.myPowerNode.displayObject:
  20156. this.pressTarget = PressType.powerNode;
  20157. this.barInfo.curY = e.stageY;
  20158. this.updateBarInfo();
  20159. break;
  20160. case this.ui.moveNode.displayObject:
  20161. this.pressTarget = PressType.moveNode;
  20162. this.hideBallUI();
  20163. this.eventObj.curX = this.ui.moveNode.x;
  20164. this.eventObj.curY = this.ui.moveNode.y;
  20165. this.ui.moveNode.finger.visible = false;
  20166. this.eventObj.lastX = e.stageX;
  20167. this.eventObj.lastY = e.stageY;
  20168. break;
  20169. case this.ui.rulerClickNode.displayObject:
  20170. this.pressTarget = PressType.rulerNode;
  20171. this.eventObj.lastY = e.stageY;
  20172. break;
  20173. case this.ui.d2Root.displayObject:
  20174. this.pressTarget = PressType.d2Root;
  20175. this.eventObj.lastX = e.stageX;
  20176. this.eventObj.lastY = e.stageY;
  20177. this.eventObj.starX = e.stageX;
  20178. this.eventObj.starY = e.stageY;
  20179. this.eventObj.curX = 0;
  20180. this.eventObj.curY = 0;
  20181. xGame.common.d2World.d2Gan.setGanLastInfo();
  20182. this.rulerOffset = 0;
  20183. break;
  20184. default:
  20185. break;
  20186. }
  20187. }
  20188. onEventMove(e) {
  20189. if (e.stopPropagation)
  20190. e.stopPropagation();
  20191. if (e && e.force) {
  20192. }
  20193. else {
  20194. if (!this.isTurnSelf())
  20195. return;
  20196. }
  20197. switch (this.pressTarget) {
  20198. case PressType.powerNode:
  20199. this.barInfo.curY = e.stageY;
  20200. this.updateBarInfo();
  20201. this.isMoveRod = true;
  20202. break;
  20203. case PressType.moveNode:
  20204. let rootBall = xGame.common.d2World.rootBall;
  20205. let radius = rootBall.gameObj.width / 2;
  20206. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20207. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20208. let border = xGame.common.d2World.borderRect;
  20209. if (curX <= border.x + radius)
  20210. curX = border.x + radius;
  20211. else if (curX >= border.x + border.width - radius)
  20212. curX = border.x + border.width - radius;
  20213. if (curY <= border.y + radius)
  20214. curY = border.y + radius;
  20215. else if (curY >= border.y + border.height - radius)
  20216. curY = border.y + border.height - radius;
  20217. if (xGame.common.gameMgr.isOpenBall) {
  20218. if (curX >= border.x + border.openBallW - radius)
  20219. curX = border.x + border.openBallW - radius;
  20220. }
  20221. this.ui.moveNode.x = curX;
  20222. this.ui.moveNode.y = curY;
  20223. rootBall.gameObj.x = curX;
  20224. rootBall.gameObj.y = curY;
  20225. rootBall.d3BallSrc.setTransPos(curX, curY);
  20226. this.isMoveRod = true;
  20227. break;
  20228. case PressType.rulerNode:
  20229. let yy = e.stageY - this.eventObj.lastY;
  20230. this.eventObj.lastY = e.stageY;
  20231. let ruler1 = this.ui.rulerNode.img1;
  20232. let ruler2 = this.ui.rulerNode.img2;
  20233. ruler1.y += yy;
  20234. ruler2.y += yy;
  20235. this.rulerOffset += yy;
  20236. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20237. this.rulerOffset = 0;
  20238. xGame.soundMgr.playSound("inch", 1, 10);
  20239. }
  20240. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20241. let h = ruler1.height;
  20242. this.checkGuide();
  20243. this.isMoveRod = true;
  20244. if (ruler1.y >= h) {
  20245. ruler1.y = -h;
  20246. ruler2.y = 0;
  20247. return;
  20248. }
  20249. else if (ruler1.y <= -h) {
  20250. ruler1.y = h;
  20251. ruler2.y = 0;
  20252. return;
  20253. }
  20254. if (ruler2.y >= h) {
  20255. ruler2.y = -h;
  20256. ruler1.y = 0;
  20257. return;
  20258. }
  20259. else if (ruler2.y <= -h) {
  20260. ruler2.y = h;
  20261. ruler1.y = 0;
  20262. return;
  20263. }
  20264. break;
  20265. case PressType.d2Root:
  20266. this.eventObj.curX = e.stageX;
  20267. this.eventObj.curY = e.stageY;
  20268. let offset = this.checkRodMoveDir();
  20269. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20270. this.eventObj.lastX = e.stageX;
  20271. this.eventObj.lastY = e.stageY;
  20272. break;
  20273. default:
  20274. break;
  20275. }
  20276. }
  20277. onEventUp(e) {
  20278. if (e.stopPropagation)
  20279. e.stopPropagation();
  20280. if (e && e.force) {
  20281. }
  20282. else {
  20283. if (!this.isTurnSelf())
  20284. return;
  20285. }
  20286. switch (this.pressTarget) {
  20287. case PressType.powerNode:
  20288. this.ui.powerNode.value = 0;
  20289. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20290. this.ui.powerTxt.text = "";
  20291. if (this.powerNum > 0) {
  20292. xGame.eventMgr.event(BALL_SHOOT);
  20293. xGame.common.d2World.shoot(this.powerNum);
  20294. xGame.common.d2World.d2Gan.shoot();
  20295. xGame.common.d2World.d2HelpLine.shoot();
  20296. this.finishGuide();
  20297. this.ui.powerEft.visible = false;
  20298. this.ui.colorNode.visible = false;
  20299. let ganStr = "";
  20300. if (this.powerNum <= 30) {
  20301. ganStr = "gan_30";
  20302. }
  20303. else if (this.powerNum <= 60) {
  20304. ganStr = "gan_50";
  20305. }
  20306. else {
  20307. ganStr = "gan_80";
  20308. }
  20309. xGame.soundMgr.playSound(ganStr);
  20310. }
  20311. break;
  20312. case PressType.moveNode:
  20313. let rootBall = xGame.common.d2World.rootBall;
  20314. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20315. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20316. let isIntersect = this.judgeBallIntersect();
  20317. if (isIntersect) {
  20318. this.ui.moveNode.x = lastX;
  20319. this.ui.moveNode.y = lastY;
  20320. rootBall.gameObj.x = lastX;
  20321. rootBall.gameObj.y = lastY;
  20322. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20323. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20324. }
  20325. else {
  20326. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20327. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20328. }
  20329. this.showBallUI();
  20330. this.ui.moveNode.finger.visible = true;
  20331. xGame.common.d2World.getHelpLine();
  20332. break;
  20333. case PressType.rulerNode:
  20334. break;
  20335. case PressType.d2Root:
  20336. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20337. if (dis <= 25) {
  20338. this.moveToClickDot(e);
  20339. }
  20340. break;
  20341. default:
  20342. break;
  20343. }
  20344. this.pressTarget = -1;
  20345. }
  20346. checkGuide() {
  20347. let guide = DataMgr.getSkillGuide();
  20348. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20349. xGame.common.guideStep++;
  20350. xGame.common.gameUI.ui.guide2.visible = false;
  20351. xGame.common.gameUI.ui.guide3.visible = true;
  20352. }
  20353. }
  20354. finishGuide() {
  20355. let guide = DataMgr.getSkillGuide();
  20356. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20357. xGame.common.guideStep = 10;
  20358. this.closeAllGuide();
  20359. console.log('zh: 新手引导完毕');
  20360. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20361. }
  20362. }
  20363. closeAllGuide() {
  20364. xGame.common.gameUI.ui.guide1.visible = false;
  20365. xGame.common.gameUI.ui.guide2.visible = false;
  20366. xGame.common.gameUI.ui.guide3.visible = false;
  20367. }
  20368. updateBarInfo() {
  20369. let star = this.ui.powerNode.y;
  20370. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20371. if (rate >= 1)
  20372. rate = 1;
  20373. if (rate <= 0)
  20374. rate = 0;
  20375. this.powerNum = Math.ceil(rate * 100);
  20376. this.ui.powerNode.value = this.powerNum;
  20377. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20378. this.ui.colorNode.value = this.powerNum;
  20379. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20380. this.ui.powerEft.visible = this.powerNum != 0;
  20381. this.ui.colorNode.visible = this.powerNum != 0;
  20382. this.ui.powerTxt.text = this.powerNum + "";
  20383. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20384. }
  20385. forceCancel() {
  20386. this.ui.powerNode.value = 0;
  20387. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20388. this.ui.powerTxt.text = "";
  20389. }
  20390. checkRodMoveDir() {
  20391. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20392. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20393. if (tempX >= 0 && tempY <= 0) {
  20394. return this.checkDir();
  20395. }
  20396. else if (tempX < 0 && tempY < 0) {
  20397. return this.checkDir(1, -1);
  20398. }
  20399. else if (tempX < 0 && tempY > 0) {
  20400. return this.checkDir(-1, -1);
  20401. }
  20402. else {
  20403. return this.checkDir(-1, 1);
  20404. }
  20405. }
  20406. checkDir(flagX = 1, flagY = 1) {
  20407. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20408. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20409. if (offsetY == 0) {
  20410. return offsetX * flagX;
  20411. }
  20412. if (offsetX == 0) {
  20413. return offsetY * flagY;
  20414. }
  20415. let angle = offsetY / offsetX;
  20416. if (Math.abs(angle) >= 1) {
  20417. return offsetY * flagY;
  20418. }
  20419. else {
  20420. return offsetX * flagX;
  20421. }
  20422. }
  20423. judgeBallIntersect() {
  20424. let rootBall = xGame.common.d2World.rootBall;
  20425. let ballArr = xGame.common.d2World.ballArr;
  20426. let radius = rootBall.gameObj.width / 2;
  20427. let temp;
  20428. let isIntersect = false;
  20429. for (let index = 0; index < ballArr.length; index++) {
  20430. temp = ballArr[index];
  20431. if (temp.number == rootBall.number)
  20432. continue;
  20433. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20434. if (isIntersect) {
  20435. break;
  20436. }
  20437. }
  20438. return isIntersect;
  20439. }
  20440. hideBallUI() {
  20441. let d2Gan = xGame.common.d2World.d2Gan;
  20442. if (!d2Gan.ui.isDisposed)
  20443. d2Gan.ui.visible = false;
  20444. let d2Help = xGame.common.d2World.d2HelpLine;
  20445. if (!d2Help.ui.isDisposed)
  20446. d2Help.ui.visible = false;
  20447. let rootBall = xGame.common.d2World.rootBall;
  20448. if (!rootBall.destroyed) {
  20449. rootBall.gameObj.active = false;
  20450. }
  20451. }
  20452. showBallUI() {
  20453. let d2Gan = xGame.common.d2World.d2Gan;
  20454. if (!d2Gan.ui.isDisposed)
  20455. d2Gan.ui.visible = true;
  20456. let d2Help = xGame.common.d2World.d2HelpLine;
  20457. if (!d2Help.ui.isDisposed)
  20458. d2Help.ui.visible = true;
  20459. let rootBall = xGame.common.d2World.rootBall;
  20460. if (!rootBall.destroyed) {
  20461. rootBall.gameObj.active = true;
  20462. }
  20463. }
  20464. moveToClickDot(e) {
  20465. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20466. let root = xGame.common.d2World.rootBall.gameObj;
  20467. let xx = e.stageX - xGame.common.sysOffestNum;
  20468. let yy = e.stageY;
  20469. let x = xx - root.x;
  20470. let y = yy - root.y;
  20471. let angle = xGame.common.getfguiRotation(x, y);
  20472. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20473. xGame.common.d2World.getHelpLine();
  20474. }
  20475. this.isMoveRod = false;
  20476. xGame.common.clickedBall = false;
  20477. }
  20478. openAllEvent() {
  20479. this.closeAllEvent();
  20480. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20481. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20482. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20483. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20484. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20485. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20486. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20487. }
  20488. closeAllEvent() {
  20489. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20490. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20491. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20492. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20493. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20494. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20495. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20496. }
  20497. resetGame() {
  20498. this.closeAllEvent();
  20499. this.hideBallUI();
  20500. xGame.common.gameMgr.gamePause = true;
  20501. }
  20502. }
  20503. UIGame$1.uiName = "UIGame";
  20504. class UIAddCoin$1 extends UIBase {
  20505. constructor() {
  20506. super();
  20507. this.coinNum = 2000;
  20508. }
  20509. onConstructor() {
  20510. this.ui = ui_UIAddCoin.createInstance();
  20511. this.contentPane = this.ui;
  20512. this.isEject = false;
  20513. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20514. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20515. }
  20516. show() {
  20517. super.show();
  20518. this.ui.t0.play();
  20519. }
  20520. videoAddCoin() {
  20521. console.log('zh:qjff_AD_for_UIAddCoin');
  20522. if (Laya.Browser.onAndroid) {
  20523. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20524. if (!boo) {
  20525. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20526. return;
  20527. }
  20528. }
  20529. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20530. }
  20531. else {
  20532. console.log('zh:AD 失败,直接发放奖励');
  20533. this.qjff_AD_for_UIAddCoin();
  20534. }
  20535. }
  20536. qjff_AD_for_UIAddCoin() {
  20537. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20538. this.hide();
  20539. }
  20540. }
  20541. UIAddCoin$1.uiName = "UIAddCoin";
  20542. class UIInvitation$1 extends UIBase {
  20543. constructor() {
  20544. super();
  20545. }
  20546. onConstructor() {
  20547. this.ui = ui_UIInvitation.createInstance();
  20548. this.contentPane = this.ui;
  20549. this.isEject = false;
  20550. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20551. }
  20552. show() {
  20553. super.show();
  20554. }
  20555. enterGame() {
  20556. xGame.common.gameMode = GameMode.classic;
  20557. DataMgr.setChallengeTimes(1);
  20558. xGame.common.passAwardCoin = 2000;
  20559. let need = xGame.common.classicNiceNeddCoin;
  20560. if (DataMgr.coinEnough(need)) {
  20561. DataMgr.setCoin(-need);
  20562. xGame.eventMgr.event(RESTART_GAME, true);
  20563. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20564. }
  20565. else {
  20566. xGame.eventMgr.event(RESTART_GAME, true);
  20567. }
  20568. this.hide();
  20569. }
  20570. hide() {
  20571. super.hide();
  20572. }
  20573. }
  20574. UIInvitation$1.uiName = "UIInvitation";
  20575. class UIPower$1 extends UIBase {
  20576. constructor() {
  20577. super();
  20578. }
  20579. onConstructor() {
  20580. this.ui = ui_UIPower.createInstance();
  20581. this.contentPane = this.ui;
  20582. this.isEject = false;
  20583. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20584. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20585. }
  20586. show() {
  20587. super.show();
  20588. this.ui.t0.play();
  20589. }
  20590. videoGetPower() {
  20591. console.log('zh:qjff_AD_for_uipower');
  20592. if (Laya.Browser.onAndroid) {
  20593. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20594. if (!boo) {
  20595. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20596. return;
  20597. }
  20598. }
  20599. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20600. }
  20601. else {
  20602. console.log('zh:AD 失败,直接发放奖励');
  20603. this.qjff_AD_for_uipower();
  20604. }
  20605. }
  20606. qjff_AD_for_uipower() {
  20607. DataMgr.setPower(xGame.common.videoPower, true);
  20608. xGame.eventMgr.event(POWER_TIME);
  20609. this.hide();
  20610. }
  20611. }
  20612. UIPower$1.uiName = "UIPower";
  20613. class UIGameEnd$1 extends UIBase {
  20614. constructor() {
  20615. super();
  20616. this.success = false;
  20617. this.awardCoinNum = 1000;
  20618. this.awardDiamondNum = 10;
  20619. }
  20620. onConstructor() {
  20621. this.ui = ui_UIGameEnd.createInstance();
  20622. this.contentPane = this.ui;
  20623. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20624. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20625. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20626. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20627. this.ui.talkNode.visible = false;
  20628. if (Moyu.isKs)
  20629. this.ui.closeNode.closeBtn.x += 100;
  20630. }
  20631. updateType() {
  20632. switch (xGame.common.gameMode) {
  20633. case GameMode.classic:
  20634. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20635. this.ui.coinNode.visible = this.success;
  20636. if (!this.success) {
  20637. Laya.timer.once(500, this, () => {
  20638. xGame.uiMgr.Show(UIAddCoin$1);
  20639. });
  20640. }
  20641. else {
  20642. this.logEventForClassic_win();
  20643. }
  20644. this.logEventForClassic_complete();
  20645. this.ui.isGetAward.visible = false;
  20646. this.ui.leftBtn.c1.selectedIndex = 3;
  20647. this.ui.rightBtn.c1.selectedIndex = 0;
  20648. this.moneyNode.ui.c1.selectedIndex = 1;
  20649. break;
  20650. case GameMode.bigMove:
  20651. console.log('zh:招法模式 aaaaaa bigMove');
  20652. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20653. this.ui.coinNode.visible = this.success;
  20654. if (xGame.common.gameMode == GameMode.bigMove) {
  20655. if (this.success) {
  20656. DataMgr.setSkillSuccessTimes(1, true);
  20657. DataMgr.setSkillAccTimes(1);
  20658. }
  20659. else {
  20660. DataMgr.setSkillSuccessTimes(0, false);
  20661. }
  20662. }
  20663. this.logEventForRod_complete_N();
  20664. if (!this.success) {
  20665. Laya.timer.once(500, this, () => {
  20666. xGame.uiMgr.Show(UIAddCoin$1);
  20667. });
  20668. }
  20669. else {
  20670. this.logEventForRod_win();
  20671. }
  20672. this.ui.isGetAward.visible = false;
  20673. this.ui.leftBtn.c1.selectedIndex = 3;
  20674. this.ui.rightBtn.c1.selectedIndex = 0;
  20675. this.moneyNode.ui.c1.selectedIndex = 1;
  20676. break;
  20677. case GameMode.placeBall:
  20678. this.ui.coinNode.visible = false;
  20679. if (this.success) {
  20680. if (xGame.common.placeBallStarNum == 3) {
  20681. this.ui.c1.selectedIndex = 2;
  20682. }
  20683. else {
  20684. this.ui.c1.selectedIndex = 3;
  20685. }
  20686. let level = xGame.common.placeBallCurLevel;
  20687. if (level > 59) {
  20688. this.logEventForChallenge_level_complete(level);
  20689. }
  20690. else {
  20691. this.logEventForChallenge_level_N(level);
  20692. }
  20693. }
  20694. else {
  20695. this.ui.c1.selectedIndex = 4;
  20696. }
  20697. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20698. if (cfg.type == PlaceBallType.challenge) {
  20699. this.ui.c1.selectedIndex = 2;
  20700. }
  20701. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20702. this.updatePlaceBallBtn();
  20703. this.updatePlaceBallStarNum();
  20704. this.updatePlaceBallAwardState();
  20705. this.moneyNode.ui.c1.selectedIndex = 2;
  20706. this.moneyNode.checkPowerTime();
  20707. this.moneyNode.powerChange();
  20708. DataMgr.upRankData();
  20709. break;
  20710. default:
  20711. break;
  20712. }
  20713. }
  20714. logEventForRod_complete_N() {
  20715. let gfmsIdx = xGame.common.curPlayerSkillType;
  20716. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20717. let gfmc = 'Skyfall Shot';
  20718. if (gfmsIdx == 0) {
  20719. gfmc = 'Skyfall Shot';
  20720. }
  20721. if (gfmsIdx == 1) {
  20722. gfmc = 'Surging break';
  20723. }
  20724. if (gfmsIdx == 2) {
  20725. gfmc = 'Frost Lock';
  20726. }
  20727. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20728. console.log('zh:logEventForRod_complete_N level = ' + level);
  20729. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20730. let jsonStr = {
  20731. "count": 0,
  20732. "name": gfmc
  20733. };
  20734. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20735. const d = LocalStorageManager.getItem(keyStr);
  20736. jsonStr.count = d.count + 1;
  20737. LocalStorageManager.setItem(keyStr, jsonStr);
  20738. }
  20739. else {
  20740. LocalStorageManager.setItem(keyStr, jsonStr);
  20741. }
  20742. const d2 = LocalStorageManager.getItem(keyStr);
  20743. let count = d2.count;
  20744. console.log('zh:logEventForRod_complete_N count = ' + count);
  20745. if (count % 5 == 0) {
  20746. const reqStr = JSON.stringify(jsonStr);
  20747. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20748. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20749. }
  20750. }
  20751. logEventForRod_win() {
  20752. console.log('zh:logEventForRod_win,胜利');
  20753. let gfmsIdx = xGame.common.curPlayerSkillType;
  20754. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20755. let gfmc = 'Skyfall Shot';
  20756. if (gfmsIdx == 0) {
  20757. gfmc = 'Skyfall Shot';
  20758. }
  20759. if (gfmsIdx == 1) {
  20760. gfmc = 'Surging break';
  20761. }
  20762. if (gfmsIdx == 2) {
  20763. gfmc = 'Frost Lock';
  20764. }
  20765. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20766. console.log('zh:logEventForRod_win level = ' + level);
  20767. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20768. let jsonStr = {
  20769. "count": 1,
  20770. "name": gfmc + ' Lev' + level
  20771. };
  20772. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20773. const d = LocalStorageManager.getItem(keyStr);
  20774. jsonStr.count = d.count + 1;
  20775. LocalStorageManager.setItem(keyStr, jsonStr);
  20776. }
  20777. else {
  20778. LocalStorageManager.setItem(keyStr, jsonStr);
  20779. }
  20780. const reqStr = JSON.stringify(jsonStr);
  20781. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20782. }
  20783. logEventForClassic_win() {
  20784. console.log('zh:logEventForClassic_win,胜利');
  20785. let rtype = xGame.common.classicRoomType;
  20786. let msmc = '';
  20787. if (rtype == 1) {
  20788. msmc = 'beginner';
  20789. }
  20790. if (rtype == 2) {
  20791. msmc = 'expert';
  20792. }
  20793. if (rtype == 3) {
  20794. msmc = 'master';
  20795. }
  20796. let keyStr = 'sjmd_classic_win_' + rtype;
  20797. let jsonStr = {
  20798. "difficulty": msmc,
  20799. "classic_count": 1,
  20800. "difficulty_count": 1
  20801. };
  20802. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20803. const d = LocalStorageManager.getItem(keyStr);
  20804. jsonStr.classic_count = d.classic_count + 1;
  20805. jsonStr.difficulty_count = d.difficulty_count + 1;
  20806. LocalStorageManager.setItem(keyStr, jsonStr);
  20807. }
  20808. else {
  20809. LocalStorageManager.setItem(keyStr, jsonStr);
  20810. }
  20811. const reqStr = JSON.stringify(jsonStr);
  20812. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20813. }
  20814. logEventForClassic_complete() {
  20815. console.log('zh:logEventForClassic_complete,胜利');
  20816. let rtype = xGame.common.classicRoomType;
  20817. let msmc = '';
  20818. if (rtype == 1) {
  20819. msmc = 'beginner';
  20820. }
  20821. if (rtype == 2) {
  20822. msmc = 'expert';
  20823. }
  20824. if (rtype == 3) {
  20825. msmc = 'master';
  20826. }
  20827. let keyStr = 'sjmd_classic_complete_' + rtype;
  20828. let jsonStr = {
  20829. "msmc": msmc,
  20830. "count": 0
  20831. };
  20832. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20833. const d = LocalStorageManager.getItem(keyStr);
  20834. jsonStr.count = d.count + 1;
  20835. LocalStorageManager.setItem(keyStr, jsonStr);
  20836. }
  20837. else {
  20838. LocalStorageManager.setItem(keyStr, jsonStr);
  20839. }
  20840. if (jsonStr.count % 5 == 0) {
  20841. const reqStr = JSON.stringify(jsonStr);
  20842. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20843. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20844. }
  20845. }
  20846. updatePlaceBallBtn() {
  20847. this.ui.leftBtn.c1.selectedIndex = 5;
  20848. if (this.success) {
  20849. this.ui.rightBtn.c1.selectedIndex = 14;
  20850. }
  20851. else {
  20852. if (xGame.common.placeBallStarNum == 3) {
  20853. this.ui.rightBtn.c1.selectedIndex = 14;
  20854. }
  20855. else {
  20856. this.ui.rightBtn.c1.selectedIndex = 1;
  20857. }
  20858. }
  20859. }
  20860. updatePlaceBallStarNum() {
  20861. let starNum = xGame.common.placeBallStarNum;
  20862. if (starNum == 0)
  20863. this.ui.starNumNode.c1.selectedIndex = 3;
  20864. else {
  20865. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20866. }
  20867. }
  20868. updatePlaceBallAwardState() {
  20869. let level = xGame.common.placeBallCurLevel;
  20870. let starNum = xGame.common.placeBallStarNum;
  20871. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20872. let data = cfgTable.placeballData[level].award;
  20873. let cfg = cfgTable.placeballData[level];
  20874. this.awardDiamondNum = data[1];
  20875. this.awardCoinNum = data[0];
  20876. if (cfg.type == PlaceBallType.challenge) {
  20877. this.awardDiamondNum = 0;
  20878. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20879. }
  20880. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20881. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20882. if (cfg.type == PlaceBallType.challenge) {
  20883. this.ui.awardNode.coinNode.visible = true;
  20884. }
  20885. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20886. this.ui.awardNode.diamondNode.x = 265;
  20887. this.ui.awardNode.coinNode.x = 354;
  20888. }
  20889. else {
  20890. this.ui.awardNode.diamondNode.x = 291;
  20891. this.ui.awardNode.coinNode.x = 291;
  20892. }
  20893. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20894. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20895. if (this.awardCoinNum == 0) {
  20896. this.ui.awardNode.coinNode.numTxt.text = "";
  20897. }
  20898. if (getAward) {
  20899. this.ui.isGetAward.visible = true;
  20900. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20901. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20902. }
  20903. else {
  20904. this.ui.isGetAward.visible = false;
  20905. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20906. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20907. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20908. }
  20909. else {
  20910. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20911. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20912. }
  20913. }
  20914. }
  20915. show(success) {
  20916. super.show();
  20917. xGame.eventMgr.event(RESET_GAME);
  20918. this.success = success;
  20919. Laya.timer.clearAll(this);
  20920. this.playSecretaryAni();
  20921. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20922. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20923. offsetTime = Math.floor(offsetTime / 1000);
  20924. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20925. this.updateType();
  20926. Laya.timer.once(200, this, () => {
  20927. this.addAward(() => {
  20928. this.updateType();
  20929. Laya.timer.once(500, this, () => {
  20930. this.showChallengeLevel();
  20931. });
  20932. });
  20933. });
  20934. if (this.success) {
  20935. JSBridgeUtils.instance.showInternAd('gameend_success');
  20936. console.log('zh:game end 成功');
  20937. xGame.soundMgr.playSound('slots_roll01');
  20938. xGame.soundMgr.playSound("s_win");
  20939. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20940. this.diyGameDataUtilForGameWin();
  20941. this.updateGamePlaceBallData2Server();
  20942. }
  20943. else {
  20944. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20945. console.log('zh:game end失败');
  20946. xGame.soundMgr.playSound('matchwin01');
  20947. xGame.soundMgr.playSound("s_lose");
  20948. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20949. }
  20950. let challengeNum = DataMgr.getChallengeTimes();
  20951. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20952. DataMgr.setChallengeTimes(1);
  20953. }
  20954. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20955. DataMgr.setClassicTimes();
  20956. }
  20957. }
  20958. diyGameDataUtilForGameWin() {
  20959. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20960. switch (xGame.common.gameMode) {
  20961. case GameMode.classic:
  20962. console.log('zh:DiyGameDataUtilForGameWin 111');
  20963. case GameMode.bigMove:
  20964. console.log('zh:DiyGameDataUtilForGameWin 222');
  20965. this.restartGame();
  20966. break;
  20967. case GameMode.placeBall:
  20968. console.log('zh:DiyGameDataUtilForGameWin 333');
  20969. var level = xGame.common.placeBallCurLevel;
  20970. console.log('zh:练习模式 联系了多少LEV=' + level);
  20971. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20972. if (level > db_over_lev) {
  20973. DataMgr.setChallengeMode_overLev(level);
  20974. }
  20975. break;
  20976. default:
  20977. console.log('zh:DiyGameDataUtilForGameWin 444');
  20978. break;
  20979. }
  20980. }
  20981. updateGamePlaceBallData2Server() {
  20982. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  20983. if (userInfo == null) {
  20984. return;
  20985. }
  20986. let pbdObj = DataMgr.getPlaceBallLevelList();
  20987. let reqData = xGame.httpMgr.getReqData();
  20988. let pd = JSON.parse(reqData);
  20989. pd.placeBallData = JSON.stringify(pbdObj);
  20990. reqData = JSON.stringify(pd);
  20991. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  20992. try {
  20993. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  20994. let code = res.code;
  20995. let msg = res.msg;
  20996. if (code == 401) {
  20997. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  20998. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  20999. return;
  21000. }
  21001. if (code == 200) {
  21002. let data = res.data;
  21003. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21004. }
  21005. else {
  21006. xGame.uiMgr.Show(UIMsg$1, msg);
  21007. }
  21008. }
  21009. catch (error) {
  21010. console.log('error=' + error);
  21011. alert(error);
  21012. }
  21013. finally {
  21014. }
  21015. });
  21016. }
  21017. showChallengeLevel() {
  21018. if (DataMgr.getChallengeTimes() != 0)
  21019. return;
  21020. let skill = DataMgr.getSkillAccTimes();
  21021. let put = DataMgr.getPlaceBallLevelList().length;
  21022. if (skill >= 3 || put >= 5) {
  21023. xGame.uiMgr.Show(UIInvitation$1);
  21024. this.hide();
  21025. }
  21026. }
  21027. addAward(callback) {
  21028. if (!this.success) {
  21029. callback && callback();
  21030. return;
  21031. }
  21032. switch (xGame.common.gameMode) {
  21033. case GameMode.classic:
  21034. this.awardCoinNum = xGame.common.passAwardCoin;
  21035. this.awardDiamondNum = 0;
  21036. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21037. break;
  21038. case GameMode.bigMove:
  21039. this.awardCoinNum = xGame.common.passAwardCoin;
  21040. this.awardDiamondNum = 0;
  21041. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21042. callback && callback();
  21043. break;
  21044. case GameMode.placeBall:
  21045. let level = xGame.common.placeBallCurLevel;
  21046. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21047. if (xGame.common.placeBallStarNum != 3) {
  21048. callback && callback();
  21049. return;
  21050. }
  21051. else {
  21052. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21053. if (getAward) {
  21054. callback && callback();
  21055. return;
  21056. }
  21057. }
  21058. let cfg = cfgTable.placeballData[level];
  21059. let data = cfgTable.placeballData[level].award;
  21060. this.awardCoinNum = data[0];
  21061. this.awardDiamondNum = data[1];
  21062. if (cfg.type == PlaceBallType.challenge) {
  21063. this.awardDiamondNum = 0;
  21064. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21065. }
  21066. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21067. let diamondAward;
  21068. if (this.awardDiamondNum > 0) {
  21069. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21070. xGame.common.getAward([diamondAward, coinAward], callback);
  21071. }
  21072. else {
  21073. xGame.common.getAward([coinAward], callback);
  21074. }
  21075. if (cfg.type == PlaceBallType.normal) {
  21076. DataMgr.setPlaceBallAward(level);
  21077. }
  21078. break;
  21079. default:
  21080. break;
  21081. }
  21082. }
  21083. playSecretaryAni_old() {
  21084. let parent = this.ui.secretary.displayObject;
  21085. parent.destroyChildren();
  21086. let xx = this.ui.secretary.width / 2;
  21087. let yy = this.ui.secretary.height;
  21088. let scale = xGame.common.getSecretaryScale();
  21089. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21090. if (this.success) {
  21091. let rand = Math.random() <= 0.5 ? 2 : 3;
  21092. xGame.common.secretary.play(data, rand, false, parent, () => {
  21093. xGame.common.secretary.play(data, 1, true, parent);
  21094. });
  21095. }
  21096. else {
  21097. xGame.common.secretary.play(data, 0, true, parent);
  21098. }
  21099. }
  21100. playSecretaryAni() {
  21101. let parent = this.ui.secretary.displayObject;
  21102. parent.destroyChildren();
  21103. let xx = this.ui.secretary.width / 2;
  21104. let yy = this.ui.secretary.height;
  21105. let scale = xGame.common.getSecretaryScale();
  21106. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21107. if (this.success) {
  21108. let rand = 0;
  21109. xGame.common.secretary.play(data, 0, true, parent);
  21110. }
  21111. else {
  21112. xGame.common.secretary.play(data, 0, true, parent);
  21113. }
  21114. }
  21115. restartGame() {
  21116. switch (xGame.common.gameMode) {
  21117. case GameMode.classic:
  21118. xGame.eventMgr.event(RESTART_GAME);
  21119. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21120. break;
  21121. case GameMode.bigMove:
  21122. this.hide();
  21123. xGame.eventMgr.event(RESTART_GAME);
  21124. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21125. break;
  21126. default:
  21127. break;
  21128. }
  21129. }
  21130. hide() {
  21131. super.hide();
  21132. xGame.common.stopGirlPop(this.ui.talkNode);
  21133. PlatMgr.showBanner(false);
  21134. }
  21135. returnHome() {
  21136. this.hide();
  21137. let showFailWords = !this.success;
  21138. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21139. }
  21140. clickLeftBtn() {
  21141. switch (xGame.common.gameMode) {
  21142. case GameMode.classic:
  21143. case GameMode.bigMove:
  21144. this.returnHome();
  21145. break;
  21146. case GameMode.placeBall:
  21147. let level = xGame.common.placeBallCurLevel;
  21148. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21149. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21150. break;
  21151. default:
  21152. break;
  21153. }
  21154. }
  21155. powerStartPlaceBallLevel(level, btn) {
  21156. if (DataMgr.powerEnough()) {
  21157. btn.touchable = false;
  21158. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21159. btn.touchable = true;
  21160. DataMgr.setPower(-1);
  21161. xGame.eventMgr.event(POWER_TIME);
  21162. this.startPlaceBallLevel(level);
  21163. this.logEventForChallenge_level_start(level);
  21164. }));
  21165. }
  21166. else {
  21167. xGame.uiMgr.Show(UIPower$1, 0);
  21168. }
  21169. }
  21170. clickRightBtn() {
  21171. switch (xGame.common.gameMode) {
  21172. case GameMode.classic:
  21173. console.log('zh:clickRightBtn 111');
  21174. case GameMode.bigMove:
  21175. console.log('zh:clickRightBtn 222');
  21176. this.restartGame();
  21177. break;
  21178. case GameMode.placeBall:
  21179. console.log('zh:clickRightBtn 333');
  21180. let level = xGame.common.placeBallCurLevel;
  21181. let data = DataMgr.getPlaceBallLevel(level);
  21182. let curPss = data.play && !data.isCur;
  21183. if (curPss) {
  21184. console.log('zh:clickRightBtn 333-111');
  21185. console.log('zh:当前LV=' + level);
  21186. if (level == 60) {
  21187. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21188. Laya.timer.once(3000, this, () => {
  21189. this.returnHome();
  21190. });
  21191. }
  21192. else {
  21193. let lev = level + 1;
  21194. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21195. }
  21196. }
  21197. else {
  21198. console.log('zh:clickRightBtn 333-000');
  21199. Moyu.sendDataEvent("placeBallNextLevel");
  21200. console.log('zh:qjff_AD_for_uiGameEnd');
  21201. if (Laya.Browser.onAndroid) {
  21202. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21203. if (!boo) {
  21204. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21205. return;
  21206. }
  21207. }
  21208. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21209. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21210. }
  21211. else {
  21212. console.log('zh:AD 失败,直接发放奖励');
  21213. this.qjff_AD_for_uiGameEnd(level);
  21214. }
  21215. }
  21216. break;
  21217. default:
  21218. console.log('zh:clickRightBtn 444');
  21219. break;
  21220. }
  21221. }
  21222. logEventForChallenge_level_start(level) {
  21223. let keyStr = 'sjmd_challenge_level_start';
  21224. let jsonStr = {
  21225. "count": 0,
  21226. "gold_balance ": DataMgr.getCoin(),
  21227. "level": level,
  21228. "diamond_balance ": DataMgr.getDiamond()
  21229. };
  21230. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21231. const d = LocalStorageManager.getItem(keyStr);
  21232. if (level > d.level) {
  21233. jsonStr.count = d.count + 1;
  21234. LocalStorageManager.setItem(keyStr, jsonStr);
  21235. }
  21236. else {
  21237. }
  21238. }
  21239. else {
  21240. LocalStorageManager.setItem(keyStr, jsonStr);
  21241. }
  21242. const reqStr = JSON.stringify(jsonStr);
  21243. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21244. }
  21245. qjff_AD_for_uiGameEnd(level) {
  21246. DataMgr.setPlaceBallLevel(level, 1);
  21247. this.startPlaceBallLevel(level + 1);
  21248. }
  21249. startPlaceBallLevel(level) {
  21250. xGame.common.gameMode = GameMode.placeBall;
  21251. xGame.common.placeBallCurLevel = level;
  21252. xGame.uiMgr.Show(UIGame$1);
  21253. this.hide();
  21254. }
  21255. logEventForChallenge_level_complete(level) {
  21256. let keyStr = 'sjmd_challenge_level_complete';
  21257. let jsonStr = {
  21258. "count": 1,
  21259. "gold_balance ": DataMgr.getCoin(),
  21260. "level": level,
  21261. "diamond_balance ": DataMgr.getDiamond()
  21262. };
  21263. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21264. const d = LocalStorageManager.getItem(keyStr);
  21265. jsonStr.count = d.count + 1;
  21266. LocalStorageManager.setItem(keyStr, jsonStr);
  21267. }
  21268. else {
  21269. LocalStorageManager.setItem(keyStr, jsonStr);
  21270. }
  21271. const reqStr = JSON.stringify(jsonStr);
  21272. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21273. }
  21274. logEventForChallenge_level_N(level) {
  21275. console.log('zh:logEventForChallenge_level_N ' + level);
  21276. let keyStr = 'sjmd_challenge_level_N';
  21277. if (LocalStorageManager.hasKey(keyStr)) {
  21278. let lev = LocalStorageManager.getItem(keyStr);
  21279. if (level > lev) {
  21280. LocalStorageManager.setItem(keyStr, level);
  21281. }
  21282. if ((level) % 5 == 0) {
  21283. console.log('zh:每5关上报1次');
  21284. let sjmc = 'challenge_level_' + level;
  21285. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21286. let sjmcForFirebase = 'challenge_level_' + level;
  21287. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21288. }
  21289. else {
  21290. console.log('zh:5 no 上报');
  21291. }
  21292. }
  21293. else {
  21294. LocalStorageManager.setItem(keyStr, level);
  21295. }
  21296. }
  21297. }
  21298. UIGameEnd$1.uiName = "UIGameEnd";
  21299. class ShowItem$1 {
  21300. constructor() {
  21301. this.ui = ui_ShowItem.createInstance();
  21302. }
  21303. destroySelf() {
  21304. if (!this.ui.isDisposed) {
  21305. this.ui.removeFromParent();
  21306. this.ui.dispose();
  21307. }
  21308. }
  21309. setParent(parent) {
  21310. parent.addChild(this.ui);
  21311. }
  21312. setPos(x, y) {
  21313. this.ui.x = x;
  21314. this.ui.y = y;
  21315. }
  21316. setUrl(index) {
  21317. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21318. }
  21319. }
  21320. class UILevelProp$1 extends UIBase {
  21321. constructor() {
  21322. super();
  21323. this.firstPos = 385;
  21324. this.secondPos = 467;
  21325. this.showItemArr = [];
  21326. }
  21327. onFontLoaded() {
  21328. try {
  21329. this.ui.myNode.conditionTxt.font = "arial";
  21330. console.log("zh: onFontLoaded 设置arial字体成功");
  21331. }
  21332. catch (error) {
  21333. console.log("zh: constructor onFontLoaded加载arial字体失败");
  21334. }
  21335. }
  21336. onConstructor() {
  21337. this.ui = ui_UILevelProp.createInstance();
  21338. this.contentPane = this.ui;
  21339. this.isEject = false;
  21340. this.addUIClick(this.ui.closeBtn, this.hide);
  21341. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21342. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21343. }
  21344. show(level) {
  21345. super.show();
  21346. this.ui.t1.play();
  21347. this.level = level;
  21348. this.data = cfgTable.placeballData[this.level];
  21349. this.updateSelf();
  21350. this.showPreView();
  21351. this.moneyNode.ui.c1.selectedIndex = 2;
  21352. this.moneyNode.checkPowerTime();
  21353. this.moneyNode.powerChange();
  21354. }
  21355. showPreView() {
  21356. let item;
  21357. let data;
  21358. for (let index = 0; index < this.showItemArr.length; index++) {
  21359. item = this.showItemArr[index];
  21360. item.destroySelf();
  21361. }
  21362. this.showItemArr = [];
  21363. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21364. for (const key in cfgData) {
  21365. data = cfgData[key];
  21366. item = new ShowItem$1();
  21367. item.setParent(this.ui.myNode.displayRoot);
  21368. item.setPos(data.x, data.y);
  21369. item.setUrl(data.value);
  21370. this.showItemArr.push(item);
  21371. }
  21372. }
  21373. updateSelf() {
  21374. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21375. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21376. if (this.data.ball == -1) {
  21377. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21378. }
  21379. else {
  21380. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21381. }
  21382. let localData = DataMgr.getPlaceBallLevel(this.level);
  21383. let getAward = localData.getAward;
  21384. let cfg = cfgTable.placeballData[this.level];
  21385. let coin = this.data.award[0];
  21386. let diamond = this.data.award[1];
  21387. if (cfg.type == PlaceBallType.challenge) {
  21388. diamond = 0;
  21389. coin = 100;
  21390. }
  21391. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21392. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21393. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21394. if (cfg.type == PlaceBallType.challenge) {
  21395. this.ui.myNode.coinNode.numTxt.text = "";
  21396. }
  21397. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21398. if (coin > 0 && diamond > 0) {
  21399. this.ui.myNode.diamondNode.x = 385;
  21400. this.ui.myNode.coinNode.x = 467;
  21401. }
  21402. else {
  21403. this.ui.myNode.diamondNode.x = 385;
  21404. this.ui.myNode.coinNode.x = 385;
  21405. }
  21406. if (!getAward) {
  21407. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21408. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21409. }
  21410. else {
  21411. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21412. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21413. }
  21414. }
  21415. startGame() {
  21416. if (DataMgr.powerEnough()) {
  21417. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21418. this.ui.myNode.startBtn.touchable = false;
  21419. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21420. console.log('zh:startGame ');
  21421. this.ui.myNode.startBtn.touchable = true;
  21422. DataMgr.setPower(-1);
  21423. xGame.eventMgr.event(POWER_TIME);
  21424. xGame.common.gameMode = GameMode.placeBall;
  21425. xGame.common.placeBallCurLevel = this.level;
  21426. xGame.uiMgr.Show(UIGame$1);
  21427. this.logEventForChallenge_level_start(this.level);
  21428. xGame.uiMgr.Hide(UILevelDisplay$1);
  21429. xGame.uiMgr.Hide(UIMain$1);
  21430. this.hide();
  21431. }));
  21432. }
  21433. else {
  21434. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21435. xGame.uiMgr.Show(UIPower$1);
  21436. }
  21437. }
  21438. logEventForChallenge_level_start(level) {
  21439. let keyStr = 'sjmd_challenge_level_start';
  21440. let jsonStr = {
  21441. "count": 1,
  21442. "gold_balance ": DataMgr.getCoin(),
  21443. "level": level,
  21444. "diamond_balance ": DataMgr.getDiamond()
  21445. };
  21446. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21447. const d = LocalStorageManager.getItem(keyStr);
  21448. if (level > d.level) {
  21449. jsonStr.count = d.count + 1;
  21450. LocalStorageManager.setItem(keyStr, jsonStr);
  21451. }
  21452. else {
  21453. }
  21454. }
  21455. else {
  21456. LocalStorageManager.setItem(keyStr, jsonStr);
  21457. }
  21458. const reqStr = JSON.stringify(jsonStr);
  21459. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21460. }
  21461. hide() {
  21462. super.hide();
  21463. }
  21464. }
  21465. UILevelProp$1.uiName = "UILevelProp";
  21466. class PutBallLevelDisplay$1 {
  21467. constructor(ui, index) {
  21468. this.index = 0;
  21469. this.ui = ui;
  21470. this.index = index;
  21471. this.ui.onClick(this, this.clickSelf);
  21472. this.updateSelf();
  21473. this.ui.levelTxt.text = (this.index + 1) + "";
  21474. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21475. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21476. }
  21477. updateSelf() {
  21478. let level = this.index + 1;
  21479. this.data = DataMgr.getPlaceBallLevel(level);
  21480. this.ui.starNode.c1.selectedIndex = this.data.star;
  21481. let isChallenge = cfgTable.placeballData[level].type;
  21482. if (this.data.isCur) {
  21483. if (isChallenge) {
  21484. this.ui.c1.selectedIndex = 5;
  21485. }
  21486. else {
  21487. this.ui.c1.selectedIndex = 2;
  21488. }
  21489. }
  21490. else {
  21491. if (this.data.play) {
  21492. if (this.data.star == 3) {
  21493. this.ui.c1.selectedIndex = 0;
  21494. }
  21495. else {
  21496. this.ui.c1.selectedIndex = 1;
  21497. }
  21498. }
  21499. else {
  21500. if (isChallenge) {
  21501. this.ui.c1.selectedIndex = 4;
  21502. }
  21503. else {
  21504. this.ui.c1.selectedIndex = 3;
  21505. }
  21506. }
  21507. }
  21508. }
  21509. clickSelf() {
  21510. if (!this.data.play)
  21511. return;
  21512. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21513. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21514. }
  21515. }
  21516. class UILevelDisplay$1 extends UIBase {
  21517. constructor() {
  21518. super();
  21519. }
  21520. onConstructor() {
  21521. this.ui = ui_UILevelDisplay.createInstance();
  21522. this.contentPane = this.ui;
  21523. this.isEject = false;
  21524. this.myList = this.ui.myNode.myList;
  21525. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21526. this.levelItemArr = [];
  21527. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21528. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21529. this.myList.numItems = levelNum;
  21530. }
  21531. levelItemRender(index, target) {
  21532. let item = new PutBallLevelDisplay$1(target, index);
  21533. this.levelItemArr.push(item);
  21534. }
  21535. show() {
  21536. super.show();
  21537. this.updateLevel();
  21538. this.scrollToPlace();
  21539. }
  21540. updateLevel() {
  21541. let temp;
  21542. for (let index = 0; index < this.levelItemArr.length; index++) {
  21543. temp = this.levelItemArr[index];
  21544. temp.updateSelf();
  21545. }
  21546. }
  21547. scrollToPlace() {
  21548. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21549. let passArr = DataMgr.getPlaceBallLevelList();
  21550. let offest = passArr.length;
  21551. if (offest >= maxNum - 1)
  21552. offest = maxNum - 1;
  21553. this.myList.scrollToView(offest, true, true);
  21554. }
  21555. hide() {
  21556. super.hide();
  21557. }
  21558. }
  21559. UILevelDisplay$1.uiName = "UILevelDisplay";
  21560. class UIMatching$1 extends UIBase {
  21561. constructor() {
  21562. super();
  21563. }
  21564. onConstructor() {
  21565. this.ui = ui_UIMatching.createInstance();
  21566. this.contentPane = this.ui;
  21567. this.isEject = false;
  21568. }
  21569. show(callback) {
  21570. super.show();
  21571. PlatMgr.showBanner(true);
  21572. this.callback = callback;
  21573. let user = Moyu.getUserInfo();
  21574. if (!this.selfPot) {
  21575. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21576. }
  21577. if (!this.aiPot) {
  21578. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21579. }
  21580. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21581. this.ui.selfHead.nameTxt.text = user.nickName;
  21582. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21583. this.ui.aiHead.nameTxt.text = "???";
  21584. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21585. this.ui.selfHead.c1.selectedIndex = 0;
  21586. this.ui.aiHead.c1.selectedIndex = 0;
  21587. this.ui.selfHead.x = this.selfPot.x;
  21588. this.ui.selfHead.y = this.selfPot.y;
  21589. this.ui.aiHead.x = this.aiPot.x;
  21590. this.ui.aiHead.y = this.aiPot.y;
  21591. switch (xGame.common.gameMode) {
  21592. case GameMode.classic:
  21593. break;
  21594. case GameMode.bigMove:
  21595. this.initSkillData();
  21596. break;
  21597. default:
  21598. break;
  21599. }
  21600. this.ui.t1.play(Laya.Handler.create(this, () => {
  21601. this.ui.t2.play(Laya.Handler.create(this, () => {
  21602. switch (xGame.common.gameMode) {
  21603. case GameMode.classic:
  21604. this.waitingPeople();
  21605. break;
  21606. case GameMode.bigMove:
  21607. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21608. break;
  21609. default:
  21610. break;
  21611. }
  21612. }));
  21613. }));
  21614. }
  21615. initSkillData() {
  21616. this.skillSelectData = [];
  21617. let skillUrl = xGame.common.skillIconList;
  21618. let skillName = xGame.common.skillNameList;
  21619. let skillLevel = DataMgr.getBigSkillList();
  21620. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21621. for (let index = 0; index < 5; index++) {
  21622. let obj = {};
  21623. obj.skillImg = skillUrl[index];
  21624. obj.skillName = skillName[index];
  21625. obj.skillType = skillType[index];
  21626. obj.skillLevel = skillLevel[index];
  21627. this.skillSelectData.push(obj);
  21628. }
  21629. }
  21630. getAISkillLevel(myLevel) {
  21631. let video = xGame.common.upSkillLevel;
  21632. let aiLevel;
  21633. let temp;
  21634. if (video) {
  21635. temp = xGame.common.randomNum(-2, -1);
  21636. }
  21637. else {
  21638. if (myLevel <= 5) {
  21639. temp = xGame.common.randomNum(1, 3);
  21640. }
  21641. else if (myLevel <= 9) {
  21642. temp = xGame.common.randomNum(-2, 1);
  21643. }
  21644. else {
  21645. temp = xGame.common.randomNum(-4, 0);
  21646. }
  21647. }
  21648. aiLevel = temp + myLevel;
  21649. if (aiLevel <= 1)
  21650. aiLevel = 1;
  21651. if (aiLevel >= 10)
  21652. aiLevel = 10;
  21653. return aiLevel;
  21654. }
  21655. getAISkillType() {
  21656. return xGame.common.randomNum(1, 4);
  21657. let successTimes = DataMgr.getSkillSuccessTimes();
  21658. let info = cfgTable.aiskillData[successTimes];
  21659. if (!info) {
  21660. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21661. info = cfgTable.aiskillData[max];
  21662. }
  21663. let dataArr = info.skillselect;
  21664. let myCfg = {};
  21665. for (let index = 0; index < dataArr.length; index++) {
  21666. let temp = dataArr[index].split('-');
  21667. myCfg[temp[0]] = {};
  21668. myCfg[temp[0]].id = parseInt(temp[0]);
  21669. myCfg[temp[0]].weight = parseInt(temp[1]);
  21670. }
  21671. let aiCfg = xGame.common.initWeight(myCfg);
  21672. let curData = xGame.common.getRandomWeightData(aiCfg);
  21673. return parseInt(curData.id);
  21674. }
  21675. getAISkillData(index) {
  21676. let myLevel = this.skillSelectData[index].skillLevel;
  21677. let aiLevel = this.getAISkillLevel(myLevel);
  21678. let aiType = this.getAISkillType() - 1;
  21679. return { aiLevel, aiType } = { aiLevel, aiType };
  21680. }
  21681. skillSelectFinish(index) {
  21682. let aiInfo = this.getAISkillData(index);
  21683. xGame.common.gameMgr.selfCurSkill = index;
  21684. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21685. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21686. this.ui.selfHead.c1.selectedIndex = 1;
  21687. this.ui.aiHead.c1.selectedIndex = 1;
  21688. let myData = this.skillSelectData[index];
  21689. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21690. let guide = DataMgr.getSkillGuide();
  21691. if (guide == 0) {
  21692. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21693. }
  21694. else {
  21695. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21696. }
  21697. let aiData = this.skillSelectData[aiInfo.aiType];
  21698. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21699. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21700. this.waitingPeople();
  21701. }
  21702. waitingPeople() {
  21703. let time = xGame.common.randomNum(1000, 3000);
  21704. time += 1000;
  21705. Laya.timer.once(time, this, () => {
  21706. this.matchingSuccess();
  21707. });
  21708. }
  21709. matchingSuccess() {
  21710. let gameUI = xGame.common.gameUI;
  21711. let name = gameUI.ui.topNode.aiNameTxt.text;
  21712. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21713. this.ui.aiHead.nameTxt.text = name;
  21714. this.ui.aiHead.headImg.url = url;
  21715. name = gameUI.ui.topNode.selfNameTxt.text;
  21716. url = gameUI.ui.topNode.selfHeadLoader.url;
  21717. this.ui.selfHead.nameTxt.text = name;
  21718. this.ui.selfHead.headImg.url = url;
  21719. this.ui.t3.play(Laya.Handler.create(this, () => {
  21720. this.callback && this.callback();
  21721. this.ui.t4.play(Laya.Handler.create(this, () => {
  21722. this.destroySelf();
  21723. }));
  21724. }));
  21725. }
  21726. destroySelf() {
  21727. this.callback = null;
  21728. this.skillSelectData = null;
  21729. this.selfPot = null;
  21730. this.aiPot = null;
  21731. if (!this.ui.isDisposed) {
  21732. this.ui.removeFromParent();
  21733. this.ui.dispose();
  21734. }
  21735. xGame.uiMgr.destroyUI(this);
  21736. }
  21737. }
  21738. UIMatching$1.uiName = "UIMatching";
  21739. class SkillDisplay$1 {
  21740. constructor(ui, data, uiIndex) {
  21741. this.starX = 0;
  21742. this.starY = 0;
  21743. this.index = 0;
  21744. this.ui = ui;
  21745. this.data = data;
  21746. this.index = uiIndex;
  21747. this.initSelf();
  21748. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21749. }
  21750. initSelf() {
  21751. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21752. this.ui.nameTxt.text = this.data.name;
  21753. this.ui.describeTxt.text = this.data.describe;
  21754. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21755. this.ui.startBtn.onClick(this, this.startGame);
  21756. this.updateSelf();
  21757. }
  21758. updateSelf() {
  21759. this.checkTry();
  21760. let level = DataMgr.getBigSkillByIndex(this.index);
  21761. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21762. }
  21763. checkTry() {
  21764. let index = this.index;
  21765. let level = DataMgr.getBigSkillByIndex(index);
  21766. if (level == null) {
  21767. DataMgr.setBigSkill(index, 1, false);
  21768. level = 1;
  21769. }
  21770. this.ui.levelTxt.text = "LV." + level;
  21771. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21772. this.ui.tryNode.visible = true;
  21773. else
  21774. this.ui.tryNode.visible = false;
  21775. }
  21776. clickAddLevel() {
  21777. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21778. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21779. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21780. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21781. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21782. }
  21783. else {
  21784. console.log('zh:AD 失败,直接发放奖励');
  21785. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21786. }
  21787. }
  21788. qjff_AD_for_skilldisplay_clickAddLevel() {
  21789. DataMgr.setBigSkill(this.data.index, 1);
  21790. this.updateSelf();
  21791. xGame.common.upSkillLevel = true;
  21792. }
  21793. startGame() {
  21794. console.log('zh:rod skill startgame');
  21795. if (this.data.index == 3) {
  21796. alert('Coming soon!');
  21797. return;
  21798. }
  21799. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21800. let needCoin = xGame.common.bigMoveNeedCoin;
  21801. xGame.common.passAwardCoin = 2000;
  21802. let guide = DataMgr.getSkillGuide();
  21803. console.log('zh:startGame guide=' + guide);
  21804. xGame.common.temSelfLevel = 0;
  21805. if (guide == 0) {
  21806. needCoin = 0;
  21807. xGame.common.temSelfLevel = 100;
  21808. }
  21809. if (DataMgr.coinEnough(needCoin)) {
  21810. DataMgr.setCoin(-needCoin);
  21811. xGame.common.curPlayerSkillType = this.index;
  21812. if (guide == 0)
  21813. xGame.common.curPlayerSkillType = 0;
  21814. console.log('zh: skilldisplay 1');
  21815. xGame.uiMgr.Show(UIGame$1);
  21816. xGame.uiMgr.Hide(UIMain$1);
  21817. xGame.uiMgr.Show(UIMatching$1, () => {
  21818. xGame.common.gameUI.ui.alpha = 1;
  21819. xGame.common.gameUI.startGame();
  21820. xGame.uiMgr.Hide(UISkill$1);
  21821. });
  21822. this.logEventForRod_start();
  21823. }
  21824. else {
  21825. console.log('zh: skilldisplay 2');
  21826. xGame.uiMgr.Show(UIAddProp$1, 0);
  21827. Moyu.sendDataEvent("AddCoinVideo");
  21828. }
  21829. }
  21830. logEventForRod_start() {
  21831. let gfmsIdx = xGame.common.curPlayerSkillType;
  21832. console.log('zh:选择的技能=' + gfmsIdx);
  21833. let gfmc = 'Skyfall Shot';
  21834. if (gfmsIdx == 0) {
  21835. gfmc = 'Skyfall Shot';
  21836. }
  21837. if (gfmsIdx == 1) {
  21838. gfmc = 'Surging break';
  21839. }
  21840. if (gfmsIdx == 2) {
  21841. gfmc = 'Frost Lock';
  21842. }
  21843. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21844. let jsonStr = {
  21845. "count": 0,
  21846. "name": gfmc
  21847. };
  21848. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21849. const d = LocalStorageManager.getItem(keyStr);
  21850. jsonStr.count = d.count + 1;
  21851. LocalStorageManager.setItem(keyStr, jsonStr);
  21852. }
  21853. else {
  21854. LocalStorageManager.setItem(keyStr, jsonStr);
  21855. }
  21856. const reqStr = JSON.stringify(jsonStr);
  21857. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21858. }
  21859. }
  21860. class UISkill$1 extends UIBase {
  21861. constructor() {
  21862. super();
  21863. this.skillData = [];
  21864. }
  21865. onConstructor() {
  21866. this.ui = ui_UISkill.createInstance();
  21867. this.contentPane = this.ui;
  21868. this.isEject = false;
  21869. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21870. this.initSkillData();
  21871. console.log('zh:aaaaaa1111111111');
  21872. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21873. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21874. console.log('zh:aaaaaa22222222');
  21875. this.displayList = [];
  21876. this.ui.skillNode.skillList.numItems = 3;
  21877. this.addUIClick(this.ui, this.interuptSecretary);
  21878. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21879. this.ui.talkNode.visible = false;
  21880. if (Moyu.isKs)
  21881. this.ui.closeNode.closeBtn.x += 100;
  21882. }
  21883. show() {
  21884. super.show();
  21885. this.playSecretaryIdle();
  21886. this.moneyNode.ui.c1.selectedIndex = 1;
  21887. Laya.timer.clearAll(this);
  21888. xGame.soundMgr.playSound("s_start");
  21889. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21890. let guide = DataMgr.getSkillGuide();
  21891. this.ui.guideNode.visible = guide == 0;
  21892. let item = this.getSkillItemByUIIndex(0);
  21893. if (guide == 0) {
  21894. item.ui.c1.selectedIndex = 1;
  21895. }
  21896. else {
  21897. item.ui.c1.selectedIndex = 0;
  21898. }
  21899. this.ui.guideNode.guideBtn.visible = guide == 0;
  21900. for (let index = 0; index < this.displayList.length; index++) {
  21901. this.displayList[index].checkTry();
  21902. }
  21903. }
  21904. getSkillItemByUIIndex(cur) {
  21905. for (let index = 0; index < this.displayList.length; index++) {
  21906. if (this.displayList[index].index == cur) {
  21907. return this.displayList[index];
  21908. }
  21909. }
  21910. }
  21911. enterGuideLevel() {
  21912. let item = this.getSkillItemByUIIndex(0);
  21913. item.startGame();
  21914. if (DataMgr.getNewUser())
  21915. Moyu.sendDataEvent("gameStart1");
  21916. }
  21917. initSkillData() {
  21918. this.skillData = [];
  21919. let nameList = xGame.common.skillNameList;
  21920. let iconList = xGame.common.skillIconList;
  21921. let describeList = [
  21922. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21923. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21924. "The power of frost descends—freezing the flow and taking full control of the game!"
  21925. ];
  21926. console.log('zh:initSkillData 111111111');
  21927. let data;
  21928. for (let index = 0; index < nameList.length; index++) {
  21929. data = {};
  21930. data.name = nameList[index];
  21931. data.icon = iconList[index];
  21932. data.describe = describeList[index];
  21933. data.index = index;
  21934. this.skillData.push(data);
  21935. }
  21936. }
  21937. updateSkillItem(index, target) {
  21938. if (this.displayList[index] == null) {
  21939. let uiIndex;
  21940. switch (index) {
  21941. case 0:
  21942. uiIndex = 1;
  21943. break;
  21944. case 1:
  21945. uiIndex = 0;
  21946. break;
  21947. case 2:
  21948. uiIndex = 2;
  21949. break;
  21950. case 3:
  21951. uiIndex = 3;
  21952. break;
  21953. default:
  21954. break;
  21955. }
  21956. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21957. this.displayList.push(temp);
  21958. }
  21959. }
  21960. playSecretaryIdle() {
  21961. let parent = this.ui.secretary.displayObject;
  21962. parent.destroyChildren();
  21963. let xx = this.ui.secretary.width / 2;
  21964. let yy = this.ui.secretary.height;
  21965. let scale = xGame.common.getSecretaryScale();
  21966. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21967. xGame.common.secretary.play(data, 0, true, parent);
  21968. }
  21969. returnUIMain() {
  21970. this.hide();
  21971. xGame.common.stopGirlPop(this.ui.talkNode);
  21972. xGame.uiMgr.Show(UIMain$1);
  21973. }
  21974. interuptSecretary() {
  21975. Laya.timer.clearAll(this);
  21976. this.playSecretaryRandomSound();
  21977. }
  21978. playSecretaryRandomSound() {
  21979. if (this.isHide)
  21980. return;
  21981. let time = xGame.common.randomNum(45000, 60000);
  21982. Laya.timer.once(time, this, () => {
  21983. if (this.isHide)
  21984. return;
  21985. let index = xGame.common.randomNum(4, 7);
  21986. xGame.soundMgr.playSound("s_main0" + index);
  21987. let words = 1;
  21988. switch (index) {
  21989. case 4:
  21990. words = 5;
  21991. break;
  21992. case 5:
  21993. words = 3;
  21994. break;
  21995. case 6:
  21996. words = 6;
  21997. break;
  21998. case 7:
  21999. words = 7;
  22000. break;
  22001. default:
  22002. break;
  22003. }
  22004. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22005. this.playSecretaryRandomSound();
  22006. });
  22007. }
  22008. }
  22009. UISkill$1.uiName = "UISkill";
  22010. class UIAddProp$1 extends UIBase {
  22011. constructor() {
  22012. super();
  22013. this.curType = "";
  22014. }
  22015. onConstructor() {
  22016. this.ui = ui_UIAddProp.createInstance();
  22017. this.contentPane = this.ui;
  22018. this.isEject = false;
  22019. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22020. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22021. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22022. this.updateUI();
  22023. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22024. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22025. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22026. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22027. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22028. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22029. }
  22030. show(type) {
  22031. super.show();
  22032. this.curType = type == 0 ? "coin" : "diamond";
  22033. this.switchBtn("");
  22034. this.ui.t0.play();
  22035. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22036. PlatMgr.showInsert(true);
  22037. }
  22038. closeSelf() {
  22039. this.hide();
  22040. }
  22041. updateUI() {
  22042. let data = cfgTable.moneyData;
  22043. let temp;
  22044. let obj;
  22045. for (const key in data) {
  22046. temp = data[key];
  22047. obj = this.ui.myNode["node" + key];
  22048. if (parseInt(key) <= 2) {
  22049. obj.diamondTxt.text = "+" + temp.num;
  22050. }
  22051. else {
  22052. obj.coinTxt.text = temp.num;
  22053. obj.diamondTxt.text = temp.get.split('_')[1];
  22054. }
  22055. }
  22056. this.updateDiamondShare();
  22057. }
  22058. updateDiamondShare() {
  22059. let data = DataMgr.getShareDiamondTimes();
  22060. if (data >= xGame.common.maxShareDiamondTimes) {
  22061. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22062. this.ui.myNode.node1.touchable = false;
  22063. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22064. }
  22065. else {
  22066. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22067. this.ui.myNode.node1.touchable = true;
  22068. }
  22069. }
  22070. switchBtn(type) {
  22071. if (type == "")
  22072. type = this.curType;
  22073. else {
  22074. if (this.curType == type) {
  22075. return;
  22076. }
  22077. else {
  22078. this.curType = type;
  22079. }
  22080. }
  22081. if (type == "coin") {
  22082. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22083. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22084. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22085. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22086. this.ui.myNode.c1.selectedIndex = 0;
  22087. }
  22088. else {
  22089. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22090. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22091. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22092. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22093. this.ui.myNode.c1.selectedIndex = 1;
  22094. }
  22095. }
  22096. convertCoin(index) {
  22097. let data = cfgTable.moneyData[index];
  22098. let coinNum = data.num;
  22099. let str = data.get.split('_')[1];
  22100. let needDiamond = parseInt(str);
  22101. if (DataMgr.diamondEnough(needDiamond)) {
  22102. DataMgr.setDiamond(-needDiamond);
  22103. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22104. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22105. }
  22106. else {
  22107. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22108. this.switchBtn("diamond");
  22109. }
  22110. }
  22111. videoGetDiamond() {
  22112. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22113. if (Laya.Browser.onAndroid) {
  22114. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22115. if (!boo) {
  22116. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22117. return;
  22118. }
  22119. }
  22120. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22121. }
  22122. else {
  22123. console.log('zh:AD 失败,直接发放奖励');
  22124. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22125. }
  22126. }
  22127. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22128. let num = cfgTable.moneyData[2].num;
  22129. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22130. this.closeSelf();
  22131. }
  22132. videoGetCoin() {
  22133. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22134. if (Laya.Browser.onAndroid) {
  22135. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22136. if (!boo) {
  22137. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22138. return;
  22139. }
  22140. }
  22141. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22142. }
  22143. else {
  22144. console.log('zh:AD 失败,直接发放奖励');
  22145. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22146. }
  22147. }
  22148. qjff_AD_for_uiAddProp_videoGetCoin() {
  22149. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22150. this.closeSelf();
  22151. }
  22152. shareGetDiamond() {
  22153. let times = DataMgr.getShareDiamondTimes();
  22154. if (times >= xGame.common.maxShareDiamondTimes) {
  22155. console.log('zh: 233333333333 maxShareDiamondTimes');
  22156. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22157. }
  22158. else {
  22159. console.log('zh:33333333333333ad');
  22160. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22161. if (Laya.Browser.onAndroid) {
  22162. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22163. if (!boo) {
  22164. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22165. return;
  22166. }
  22167. }
  22168. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22169. }
  22170. else {
  22171. console.log('zh:AD 失败,直接发放奖励');
  22172. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22173. }
  22174. }
  22175. }
  22176. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22177. let diamond = xGame.common.randomNum(50, 100);
  22178. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22179. DataMgr.setShareDiamondTimes(1);
  22180. this.updateDiamondShare();
  22181. }
  22182. openPutBallView() {
  22183. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22184. let skill = xGame.uiMgr.getUI(UISkill$1);
  22185. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22186. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22187. if (end && !end.isHide) {
  22188. xGame.uiMgr.Hide(UIGameEnd$1);
  22189. xGame.uiMgr.Show(UIMain$1);
  22190. }
  22191. if (skill && !skill.isHide)
  22192. xGame.uiMgr.Hide(UISkill$1);
  22193. if (uigame && !uigame.isHide)
  22194. xGame.uiMgr.Hide(UIGame$1);
  22195. if (level && !level.isHide) {
  22196. }
  22197. else {
  22198. xGame.uiMgr.Show(UILevelDisplay$1);
  22199. }
  22200. this.closeSelf();
  22201. }
  22202. }
  22203. UIAddProp$1.uiName = "UIAddProp";
  22204. class MoneyNode$1 {
  22205. constructor(ui) {
  22206. this.leftTime = 0;
  22207. this.ui = ui;
  22208. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22209. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22210. this.ui.addPowerBtn.onClick(this, this.addPower);
  22211. this.ui.c1.selectedIndex = 1;
  22212. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22213. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22214. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22215. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22216. this.coinChange();
  22217. this.diamondChange();
  22218. this.powerChange();
  22219. }
  22220. addPower() {
  22221. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22222. xGame.uiMgr.Show(UIPower$1);
  22223. }
  22224. powerChange() {
  22225. let powerNum = DataMgr.getPower();
  22226. this.ui.powerTxt.text = powerNum + "";
  22227. }
  22228. checkPowerTime() {
  22229. let cur = new Date().getTime();
  22230. let last = DataMgr.getPowerTime();
  22231. if (last == 0) {
  22232. last = cur;
  22233. DataMgr.setPowerTime(cur);
  22234. }
  22235. let power = DataMgr.getPower();
  22236. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22237. Laya.timer.clearAll(this);
  22238. if (power >= xGame.common.natureMaxPower) {
  22239. this.ui.powerTimeTxt.text = "";
  22240. DataMgr.setPowerTime(cur);
  22241. return;
  22242. }
  22243. if (power + offset >= xGame.common.natureMaxPower) {
  22244. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22245. this.ui.powerTimeTxt.text = "";
  22246. DataMgr.setPowerTime(cur);
  22247. }
  22248. else {
  22249. if (offset > 0) {
  22250. DataMgr.setPower(offset);
  22251. DataMgr.setPowerTime(cur);
  22252. }
  22253. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22254. this.leftTime = xGame.common.powerRecoverNum - time;
  22255. if (this.leftTime <= 0)
  22256. this.leftTime = 0;
  22257. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22258. Laya.timer.loop(1000, this, this.updatePowerTime);
  22259. }
  22260. }
  22261. updatePowerTime() {
  22262. this.leftTime -= 1;
  22263. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22264. if (this.leftTime <= 0) {
  22265. this.checkPowerTime();
  22266. }
  22267. }
  22268. coinChange() {
  22269. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22270. }
  22271. diamondChange() {
  22272. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22273. }
  22274. addCoin() {
  22275. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22276. Moyu.sendDataEvent("AddCoinBtn");
  22277. xGame.uiMgr.Show(UIAddProp$1, 0);
  22278. }
  22279. addDiamond() {
  22280. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22281. Moyu.sendDataEvent("AddDiamondBtn");
  22282. xGame.uiMgr.Show(UIAddProp$1, 1);
  22283. }
  22284. }
  22285. class SettingNode$1 {
  22286. constructor(ui) {
  22287. this.showSetting = false;
  22288. this.openSound = true;
  22289. this.openShake = true;
  22290. this.ui = ui;
  22291. this.ui.soundBtn.onClick(this, this.switchSound);
  22292. this.ui.shakeBtn.onClick(this, this.switchShake);
  22293. this.ui.xyBtn.onClick(this, this.onXy);
  22294. this.ui.clickNode.onClick(this, this.changeSetting);
  22295. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22296. this.ui.xyBtn.visible = false;
  22297. this.ui.shakeBtn.visible = false;
  22298. }
  22299. changeSetting() {
  22300. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22301. this.showSetting = !this.showSetting;
  22302. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22303. }
  22304. switchSound() {
  22305. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22306. this.openSound = !this.openSound;
  22307. Moyu.onSetting(this.openSound, this.openShake);
  22308. xGame.soundMgr.onSetting(this.openSound);
  22309. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22310. }
  22311. switchShake() {
  22312. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22313. this.openShake = !this.openShake;
  22314. Moyu.onSetting(this.openSound, this.openShake);
  22315. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22316. }
  22317. onXy() {
  22318. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22319. MoyuMgr$1.showXy(1);
  22320. }
  22321. }
  22322. class UIDraw$1 extends UIBase {
  22323. constructor() {
  22324. super();
  22325. this.curKey = 0;
  22326. }
  22327. onConstructor() {
  22328. this.ui = ui_UIDraw.createInstance();
  22329. this.contentPane = this.ui;
  22330. this.isEject = false;
  22331. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22332. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22333. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22334. this.initDraw();
  22335. this.initUI();
  22336. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22337. }
  22338. show() {
  22339. super.show();
  22340. this.ui.t0.play();
  22341. this.playSecretaryIdle();
  22342. this.updateDraw();
  22343. this.checkFree();
  22344. if (PlatMgr.bannerDelay > 0) {
  22345. this.ui.closeNode.closeBtn.visible = false;
  22346. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22347. this.ui.closeNode.closeBtn.visible = true;
  22348. });
  22349. }
  22350. PlatMgr.showRateBanner();
  22351. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22352. }
  22353. hide() {
  22354. Laya.timer.clearAll(this);
  22355. super.hide();
  22356. }
  22357. checkFree() {
  22358. let isFree = DataMgr.getDailyfreeDrawTimes();
  22359. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22360. }
  22361. initDraw() {
  22362. this.drawObj = [];
  22363. let data = cfgTable.drawData;
  22364. let temp;
  22365. let weight = 0;
  22366. for (const key in data) {
  22367. temp = data[key];
  22368. weight += temp.weight;
  22369. this.drawObj.push(weight);
  22370. }
  22371. this.allWeight = weight;
  22372. }
  22373. initUI() {
  22374. let data = cfgTable.drawData;
  22375. let temp;
  22376. let img;
  22377. let txt;
  22378. for (const key in data) {
  22379. temp = data[key];
  22380. img = this.ui.myNode.rotNode["img" + key];
  22381. txt = this.ui.myNode.rotNode["txt" + key];
  22382. img.url = xGame.common.getGameIconUrl(temp.icon);
  22383. txt.visible = true;
  22384. if (temp.award > 2) {
  22385. img.rotation = 0;
  22386. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22387. }
  22388. else {
  22389. img.rotation = temp.rotation;
  22390. txt.text = temp.num;
  22391. }
  22392. }
  22393. }
  22394. getCurkey() {
  22395. let rand = Math.random() * this.allWeight;
  22396. let temp;
  22397. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22398. temp = this.drawObj[index];
  22399. if (index == 0) {
  22400. if (rand < temp) {
  22401. return index + 1;
  22402. }
  22403. }
  22404. else {
  22405. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22406. return index + 1;
  22407. }
  22408. }
  22409. }
  22410. return 2;
  22411. }
  22412. startDraw() {
  22413. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22414. if (freeTimes > 0) {
  22415. this.beginDraw();
  22416. DataMgr.setDailyfreeDrawTimes(0);
  22417. this.checkFree();
  22418. }
  22419. else {
  22420. if (Laya.Browser.onAndroid) {
  22421. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22422. if (!boo) {
  22423. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22424. return;
  22425. }
  22426. }
  22427. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22428. }
  22429. else {
  22430. console.log('zh:AD 失败,直接发放奖励');
  22431. this.qjff_chouJiang();
  22432. }
  22433. }
  22434. }
  22435. qjff_chouJiang() {
  22436. this.beginDraw();
  22437. }
  22438. beginDraw() {
  22439. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22440. this.ui.drawBtn.touchable = false;
  22441. this.curKey = this.getCurkey();
  22442. console.log("当前key", this.curKey);
  22443. let cell = 60;
  22444. let lap = 3;
  22445. let angle = cell * (this.curKey - 1) + lap * 360;
  22446. let target = this.ui.myNode.rotNode;
  22447. target.rotation = 0;
  22448. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22449. console.log("旋转完成");
  22450. this.ui.drawBtn.touchable = true;
  22451. this.getAward();
  22452. }));
  22453. }
  22454. getAward() {
  22455. let data = cfgTable.drawData[this.curKey];
  22456. let temp = new AwardType();
  22457. temp.type = data.award;
  22458. temp.num = data.num;
  22459. xGame.common.getAward([temp], () => {
  22460. DataMgr.setDrawTimes(1);
  22461. this.updateDraw();
  22462. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22463. });
  22464. }
  22465. updateDraw() {
  22466. let drawTimes = DataMgr.getDrawTimes();
  22467. let awardTimes = DataMgr.getDrawAwardTimes();
  22468. if (Math.floor(drawTimes / 3) > awardTimes) {
  22469. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22470. this.ui.extraNode.boxBtn.touchable = true;
  22471. this.ui.extraNode.tipsTxt.text = "3/3";
  22472. this.ui.extraNode.barNode.width = 265;
  22473. this.getExtraAward();
  22474. }
  22475. else {
  22476. this.ui.extraNode.boxBtn.t0.stop();
  22477. this.ui.extraNode.boxBtn.touchable = false;
  22478. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22479. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22480. }
  22481. let data = cfgTable.drawData[1];
  22482. if (awardTimes == 0) {
  22483. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22484. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22485. this.ui.myNode.rotNode.img1.rotation = 0;
  22486. }
  22487. else {
  22488. let award = data.nextid;
  22489. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22490. this.ui.myNode.rotNode.txt1.text = award[1];
  22491. this.ui.myNode.rotNode.img1.rotation = 0;
  22492. }
  22493. }
  22494. getExtraAward() {
  22495. let drawTimes = DataMgr.getDrawTimes();
  22496. let awardTimes = DataMgr.getDrawAwardTimes();
  22497. let data = cfgTable.drawData[1];
  22498. let award = new AwardType();
  22499. if (awardTimes == 0) {
  22500. award.num = data.num;
  22501. award.type = data.award;
  22502. xGame.common.getAward([award], () => {
  22503. let all = Math.floor(drawTimes / 3);
  22504. DataMgr.setDrawAwardTimes(all);
  22505. this.updateDraw();
  22506. });
  22507. }
  22508. else {
  22509. award.num = parseInt(data.nextid[1]);
  22510. award.type = parseInt(data.nextid[0]);
  22511. xGame.common.getAward([award], () => {
  22512. let all = Math.floor(drawTimes / 3);
  22513. DataMgr.setDrawAwardTimes(all);
  22514. this.updateDraw();
  22515. });
  22516. }
  22517. }
  22518. closeSelf() {
  22519. this.hide();
  22520. }
  22521. playSecretaryIdle() {
  22522. let parent = this.ui.secretary.displayObject;
  22523. parent.destroyChildren();
  22524. let xx = this.ui.secretary.width / 2;
  22525. let yy = this.ui.secretary.height;
  22526. let scale = xGame.common.getSecretaryScale();
  22527. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22528. xGame.common.secretary.play(data, 0, true, parent);
  22529. }
  22530. }
  22531. UIDraw$1.uiName = "UIDraw";
  22532. class UIRanking$1 extends UIBase {
  22533. constructor() {
  22534. super();
  22535. this.showSelf = true;
  22536. this.rankType = 1;
  22537. this.rankList = [];
  22538. this.topX = 10;
  22539. this.myIndex = this.topX + 1;
  22540. this.myStar = 0;
  22541. }
  22542. onConstructor() {
  22543. this.ui = ui_UIRanking.createInstance();
  22544. this.contentPane = this.ui;
  22545. this.isEject = false;
  22546. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22547. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22548. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22549. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22550. this.ui.myNode.myList.setVirtual();
  22551. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22552. }
  22553. show() {
  22554. super.show();
  22555. this.getPaiHangBangDataFormJosnFile();
  22556. this.updateSelf();
  22557. let self = Moyu.getUserInfo();
  22558. if (!self.isAuth) {
  22559. Moyu.initUser(this, () => {
  22560. DataMgr.upRankData();
  22561. });
  22562. }
  22563. }
  22564. getPaiHangBangDataFormJosnFile() {
  22565. const rankingList = cfgTable.paiHangBangData.list;
  22566. this.updateItemData(rankingList);
  22567. }
  22568. updateSelfItem() {
  22569. console.log('zh:Moyu.platType =' + Moyu.platType);
  22570. let self = Moyu.getUserInfo();
  22571. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22572. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22573. if (this.myIndex > this.topX) {
  22574. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22575. }
  22576. else {
  22577. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22578. }
  22579. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22580. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22581. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22582. }
  22583. updateItemData(data) {
  22584. this.myStar = xGame.common.getAllStarNum();
  22585. if (this.rankList.length < 2) {
  22586. this.rankList = data;
  22587. let self = Moyu.getUserInfo();
  22588. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22589. self.headIcon = self.headIcon;
  22590. for (let i = 0; i < data.length; i++) {
  22591. let data = this.rankList[i];
  22592. if (data.userId == self.userId) {
  22593. this.rankList.splice(i, 1);
  22594. break;
  22595. }
  22596. }
  22597. for (let i = 0; i < data.length; i++) {
  22598. let data = this.rankList[i];
  22599. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22600. this.myIndex = i + 1;
  22601. let user = { headIcon: self.headIcon, nickName: "myself" };
  22602. let ud = { user: user, data: {} };
  22603. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22604. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22605. if (Moyu.platType < 11) {
  22606. user.headIcon = self.headIcon;
  22607. user.nickName = self.nickName;
  22608. }
  22609. this.rankList.splice(i, 0, md);
  22610. break;
  22611. }
  22612. }
  22613. }
  22614. this.updateSelfItem();
  22615. this.ui.myNode.myList.numItems = this.rankList.length;
  22616. }
  22617. updateItemUI(index, obj) {
  22618. let data = this.rankList[index];
  22619. let userData = JSON.parse(data.userData).user;
  22620. obj.nameTxt.text = userData.nickName.toString();
  22621. obj.valueTxt.text = data.rankScore;
  22622. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22623. obj.rankTxt.text = index + 1;
  22624. switch (index) {
  22625. case 0:
  22626. this.setImg(obj, 1, 0, 0);
  22627. obj.rankTxt.color = "#FFC047";
  22628. break;
  22629. case 1:
  22630. this.setImg(obj, 0, 1, 0);
  22631. obj.rankTxt.color = "#ACACAC";
  22632. break;
  22633. case 2:
  22634. this.setImg(obj, 0, 0, 1);
  22635. obj.rankTxt.color = "#D09672";
  22636. break;
  22637. default:
  22638. this.setImg(obj, 0, 0, 0);
  22639. obj.rankTxt.color = "#496FAB";
  22640. break;
  22641. }
  22642. }
  22643. setImg(obj, a, b, c) {
  22644. obj.img1.visible = a ? true : false;
  22645. obj.img2.visible = b ? true : false;
  22646. obj.img3.visible = c ? true : false;
  22647. }
  22648. changeList(type) {
  22649. this.rankType = type;
  22650. this.updateSelf();
  22651. }
  22652. changeSelfNode() {
  22653. this.showSelf = !this.showSelf;
  22654. this.updateSelf();
  22655. }
  22656. updateSelf() {
  22657. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22658. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22659. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22660. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22661. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22662. }
  22663. }
  22664. UIRanking$1.uiName = "UIRanking";
  22665. class UISecretary$1 extends UIBase {
  22666. constructor() {
  22667. super();
  22668. this.curIndex = 1;
  22669. }
  22670. onConstructor() {
  22671. this.ui = ui_UISecretary.createInstance();
  22672. this.contentPane = this.ui;
  22673. this.isEject = false;
  22674. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22675. this.nodeObj = { left: null, right: null, cur: null };
  22676. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22677. }
  22678. show() {
  22679. super.show();
  22680. this.ui.t0.play();
  22681. this.updateData();
  22682. }
  22683. addSecretarySpine(node, spineName) {
  22684. if (spineName == "mishu") {
  22685. if (this.secretarySpine1) {
  22686. node.displayObject.destroyChildren();
  22687. this.playWoman(this.secretarySpine1, node.displayObject);
  22688. }
  22689. else {
  22690. let spine1 = new SpineMgr("mishu", () => {
  22691. this.secretarySpine1 = spine1;
  22692. this.playWoman(this.secretarySpine1, node.displayObject);
  22693. });
  22694. }
  22695. }
  22696. else {
  22697. if (this.secretarySpine2) {
  22698. node.displayObject.destroyChildren();
  22699. this.playWoman(this.secretarySpine2, node.displayObject);
  22700. }
  22701. else {
  22702. let spine2 = new SpineMgr("xiaomishu2", () => {
  22703. this.secretarySpine2 = spine2;
  22704. this.playWoman(this.secretarySpine2, node.displayObject);
  22705. });
  22706. }
  22707. }
  22708. }
  22709. playWoman(node, parent) {
  22710. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22711. let yy = this.ui.myNode.gameNode3.secretary.height;
  22712. let scale = 1.5;
  22713. if (node == this.secretarySpine2) {
  22714. scale = 1.2;
  22715. }
  22716. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22717. node.play(data, 0, true, parent);
  22718. }
  22719. turnLeft() {
  22720. this.curIndex--;
  22721. if (this.curIndex < 1) {
  22722. this.curIndex = 2;
  22723. }
  22724. let left = this.nodeObj.left;
  22725. let right = this.nodeObj.right;
  22726. let cur = this.nodeObj.cur;
  22727. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22728. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22729. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22730. this.updateData();
  22731. }));
  22732. this.ui.myNode.setChildIndex(right, 2);
  22733. this.nodeObj.left = cur;
  22734. this.nodeObj.right = left;
  22735. this.nodeObj.cur = right;
  22736. }
  22737. turnRight() {
  22738. this.curIndex++;
  22739. if (this.curIndex > 2) {
  22740. this.curIndex = 1;
  22741. }
  22742. let left = this.nodeObj.left;
  22743. let right = this.nodeObj.right;
  22744. let cur = this.nodeObj.cur;
  22745. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22746. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22747. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22748. this.updateData();
  22749. }));
  22750. this.ui.myNode.setChildIndex(left, 2);
  22751. this.nodeObj.left = right;
  22752. this.nodeObj.right = cur;
  22753. this.nodeObj.cur = left;
  22754. }
  22755. updateData() {
  22756. console.log('zh: updateData FFFFFFFFFF');
  22757. let data = cfgTable.secretaryshopData;
  22758. let children = this.ui.myNode._children;
  22759. let temp;
  22760. let curData;
  22761. for (let index = 0; index < children.length; index++) {
  22762. temp = children[index];
  22763. curData = data[1];
  22764. temp.heightTxt.text = curData.height;
  22765. temp.foodTxt.text = curData.food;
  22766. temp.historyTxt.text = curData.history;
  22767. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22768. this.addSecretarySpine(temp.secretary, curData.spine);
  22769. let womanIndex = curData.id - 1;
  22770. let getWoman = DataMgr.getSecretary(womanIndex);
  22771. let curUse = DataMgr.getCurSecretary();
  22772. if (getWoman) {
  22773. if (curUse == womanIndex) {
  22774. temp.purchaseBtn.c1.selectedIndex = 1;
  22775. }
  22776. else {
  22777. temp.purchaseBtn.c1.selectedIndex = 2;
  22778. }
  22779. }
  22780. else {
  22781. temp.purchaseBtn.c1.selectedIndex = 0;
  22782. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22783. }
  22784. temp.purchaseBtn.visible = false;
  22785. }
  22786. }
  22787. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22788. console.log('zh: 点击了clickSecretary ');
  22789. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22790. if (getWoman) {
  22791. if (curUse != womanIndex) {
  22792. console.log();
  22793. DataMgr.setCurSecretary(womanIndex);
  22794. this.updateData();
  22795. }
  22796. }
  22797. else {
  22798. console.log('zh:点击购买了');
  22799. let need = needDiamond;
  22800. if (DataMgr.diamondEnough(need)) {
  22801. DataMgr.setDiamond(-need);
  22802. DataMgr.setSecretary(womanIndex, 1);
  22803. DataMgr.setCurSecretary(womanIndex);
  22804. this.updateData();
  22805. }
  22806. else {
  22807. xGame.uiMgr.Show(UIAddProp$1, 1);
  22808. }
  22809. }
  22810. }
  22811. closeSelf() {
  22812. this.hide();
  22813. }
  22814. }
  22815. UISecretary$1.uiName = "UISecretary";
  22816. class BallRodDisplay$1 {
  22817. constructor(ui, index) {
  22818. this.index = 0;
  22819. this.uiIndex = 0;
  22820. this.ui = ui;
  22821. this.index = index;
  22822. this.initData();
  22823. }
  22824. initData() {
  22825. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22826. let data = cfgTable.ballrodData[this.index + 1];
  22827. this.ui.nameTxt.text = data.name;
  22828. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22829. this.ui.levelNode.c1.selectedIndex = data.quality;
  22830. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22831. if (data.spine) {
  22832. this.mySpine = new SpineMgr(data.spine, () => {
  22833. let xx = 150;
  22834. let yy = 70;
  22835. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22836. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22837. });
  22838. }
  22839. }
  22840. updateSelf() {
  22841. console.log('zh:updateSelf -------------- ');
  22842. let get = DataMgr.getBallRod(this.index);
  22843. if (get == null)
  22844. get = 1;
  22845. let curUse = DataMgr.getCurBallRod();
  22846. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22847. if (get) {
  22848. if (curUse == this.index) {
  22849. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22850. }
  22851. else {
  22852. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22853. }
  22854. }
  22855. else {
  22856. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22857. }
  22858. }
  22859. buyBallRod() {
  22860. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22861. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22862. switch (selectedIndex) {
  22863. case 0:
  22864. break;
  22865. case 1:
  22866. console.log('zh:点击了 USE THIS');
  22867. DataMgr.setCurBallRod(this.index);
  22868. let curUse = DataMgr.getCurBallRod();
  22869. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22870. let ui = xGame.uiMgr.getUI(UIShop$1);
  22871. ui.updateBallRod();
  22872. break;
  22873. case 2:
  22874. let data = cfgTable.ballrodData[this.index + 1];
  22875. let need = data.price;
  22876. if (DataMgr.diamondEnough(need)) {
  22877. this.buyQiuGan(data);
  22878. DataMgr.setDiamond(-need);
  22879. DataMgr.setBallRod(this.index, 1);
  22880. DataMgr.setCurBallRod(this.index);
  22881. let ui = xGame.uiMgr.getUI(UIShop$1);
  22882. ui.updateBallRod();
  22883. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22884. }
  22885. else {
  22886. xGame.uiMgr.Show(UIAddProp$1, 1);
  22887. }
  22888. break;
  22889. default:
  22890. break;
  22891. }
  22892. }
  22893. buyQiuGan(qgItem) {
  22894. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  22895. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22896. if (userInfo == null) {
  22897. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22898. return;
  22899. }
  22900. let reqData = xGame.httpMgr.getReqData();
  22901. let pd = JSON.parse(reqData);
  22902. pd.qiuGanData = qgItem;
  22903. reqData = JSON.stringify(pd);
  22904. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  22905. try {
  22906. console.log('zh:buySp res = ' + JSON.stringify(res));
  22907. let code = res.code;
  22908. let msg = res.msg;
  22909. if (code == 401) {
  22910. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22911. alert(TIP_MSG_key.loginTimeOut);
  22912. xGame.uiMgr.Show(UIMsg$1, msg);
  22913. return;
  22914. }
  22915. if (code == 200) {
  22916. xGame.uiMgr.Show(UIMsg$1, msg);
  22917. DataMgr.getUserZiChanInfo();
  22918. }
  22919. else {
  22920. xGame.uiMgr.Show(UIMsg$1, msg);
  22921. }
  22922. }
  22923. catch (error) {
  22924. console.log('error=' + error);
  22925. alert(error);
  22926. }
  22927. finally {
  22928. }
  22929. });
  22930. }
  22931. logEventForGouMaiGan(qiuGanName) {
  22932. const ev = {
  22933. value: qiuGanName
  22934. };
  22935. const jsonStr = JSON.stringify(ev);
  22936. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22937. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22938. }
  22939. }
  22940. class DaoJuDisplay$1 {
  22941. constructor(ui, index) {
  22942. this.index = 0;
  22943. this.uiIndex = 0;
  22944. this.ggSpid = "";
  22945. this.spid = 0;
  22946. this.ui = ui;
  22947. this.index = index;
  22948. this.initData();
  22949. }
  22950. initData() {
  22951. this.ui.btn_buy.onClick(this, this.gotoBuy);
  22952. let data = cfgTable.daoJuData[this.index + 1];
  22953. console.log('zh:' + JSON.stringify(data));
  22954. this.ui.nameTxt.text = data.spbt;
  22955. this.ui.n_jiaGe.text = data.spjg + "";
  22956. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22957. this.ggSpid = data.ggSpid;
  22958. this.spid = data.spid;
  22959. let baseUrl = "asset/sound/ogg/";
  22960. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  22961. }
  22962. gotoBuy() {
  22963. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22964. if (userInfo != null) {
  22965. let token = userInfo.token;
  22966. let ggSpid = this.ggSpid;
  22967. let spid = this.spid;
  22968. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  22969. console.log('zh:gotoBuy1 spid =' + spid);
  22970. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  22971. return;
  22972. }
  22973. else {
  22974. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22975. }
  22976. }
  22977. gotoBuy1() {
  22978. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22979. let djItem = cfgTable.daoJuData[this.index + 1];
  22980. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  22981. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22982. if (userInfo == null) {
  22983. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22984. return;
  22985. }
  22986. let reqData = xGame.httpMgr.getReqData();
  22987. let pd = JSON.parse(reqData);
  22988. pd.spItem = djItem;
  22989. reqData = JSON.stringify(pd);
  22990. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  22991. try {
  22992. console.log('zh:buySp res = ' + JSON.stringify(res));
  22993. let code = res.code;
  22994. let msg = res.msg;
  22995. if (code == 401) {
  22996. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22997. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22998. return;
  22999. }
  23000. if (code == 200) {
  23001. xGame.uiMgr.Show(UIMsg$1, msg);
  23002. DataMgr.getUserZiChanInfo();
  23003. }
  23004. else {
  23005. xGame.uiMgr.Show(UIMsg$1, msg);
  23006. }
  23007. }
  23008. catch (error) {
  23009. console.log('error=' + error);
  23010. alert(error);
  23011. }
  23012. finally {
  23013. }
  23014. });
  23015. }
  23016. }
  23017. class UIShop$1 extends UIBase {
  23018. constructor() {
  23019. super();
  23020. this.itemNums = 0;
  23021. this.itemNumsForDj = 0;
  23022. this.curType = "";
  23023. }
  23024. onConstructor() {
  23025. this.ui = ui_UIShop.createInstance();
  23026. this.contentPane = this.ui;
  23027. this.isEject = false;
  23028. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23029. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23030. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23031. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23032. this.addUIClick(this.ui, this.interuptSecretary);
  23033. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23034. this.ballRodArr = [];
  23035. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23036. this.ui.myNode.myList.numItems = this.itemNums;
  23037. this.loadDjdata_old();
  23038. }
  23039. loadDjdata_old() {
  23040. let fff = cfgTable.daoJuData;
  23041. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23042. this.daoJuArr = [];
  23043. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23044. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23045. }
  23046. getProductList() {
  23047. let reqData = xGame.httpMgr.getReqData();
  23048. let pd = JSON.parse(reqData);
  23049. pd.splx = "Consumable";
  23050. reqData = JSON.stringify(pd);
  23051. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23052. try {
  23053. let code = res.code;
  23054. let msg = res.msg;
  23055. if (code == 401) {
  23056. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23057. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23058. return;
  23059. }
  23060. if (code == 200) {
  23061. let data = res.data;
  23062. for (let index = 0; index < data.length; index++) {
  23063. let element = data[index];
  23064. cfgTable.daoJuData[element.spid] = element;
  23065. }
  23066. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23067. }
  23068. else {
  23069. xGame.uiMgr.Show(UIMsg, msg);
  23070. }
  23071. }
  23072. catch (error) {
  23073. console.log('error=' + error);
  23074. alert(error);
  23075. }
  23076. finally {
  23077. }
  23078. });
  23079. }
  23080. show(type) {
  23081. super.show();
  23082. this.curType = type == 0 ? "qiugan" : "daoju";
  23083. this.switchBtn("");
  23084. this.playSecretaryIdle();
  23085. this.updateBallRod();
  23086. }
  23087. test123() {
  23088. console.log('zh:test123 ');
  23089. }
  23090. switchBtn(type) {
  23091. console.log('zh:1111切換 sel type=' + type);
  23092. if (type == "") {
  23093. type = this.curType;
  23094. }
  23095. else {
  23096. if (this.curType == type) {
  23097. return;
  23098. }
  23099. else {
  23100. this.curType = type;
  23101. }
  23102. }
  23103. if (type == "qiugan") {
  23104. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23105. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23106. this.ui.myNode.c1.selectedIndex = 0;
  23107. this.ui.myNode.myList.visible = true;
  23108. this.ui.myNode.djList.visible = false;
  23109. }
  23110. else {
  23111. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23112. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23113. this.ui.myNode.c1.selectedIndex = 1;
  23114. this.ui.myNode.myList.visible = false;
  23115. this.ui.myNode.djList.visible = true;
  23116. }
  23117. }
  23118. updateBallRod() {
  23119. for (let index = 0; index < this.ballRodArr.length; index++) {
  23120. this.ballRodArr[index].updateSelf();
  23121. }
  23122. }
  23123. renderBallRod(sort, obj) {
  23124. let index = this.getIndexBySort(sort + 1) - 1;
  23125. let ballRod = new BallRodDisplay$1(obj, index);
  23126. this.ballRodArr.push(ballRod);
  23127. }
  23128. renderDaoJu(idx, obj) {
  23129. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23130. let b = new DaoJuDisplay$1(obj, index);
  23131. this.daoJuArr.push(b);
  23132. }
  23133. getIndexBySort(sort) {
  23134. let object = cfgTable.ballrodData;
  23135. for (const key in object) {
  23136. if (object[key].sort == sort) {
  23137. return parseInt(key);
  23138. }
  23139. }
  23140. }
  23141. getIndexBySortForDj(idx) {
  23142. let object = cfgTable.daoJuData;
  23143. for (const key in object) {
  23144. if (object[key].idx == idx) {
  23145. return parseInt(key);
  23146. }
  23147. }
  23148. }
  23149. playSecretaryIdle() {
  23150. let parent = this.ui.secretary.displayObject;
  23151. parent.destroyChildren();
  23152. let xx = this.ui.secretary.width / 2;
  23153. let yy = this.ui.secretary.height;
  23154. let scale = xGame.common.getSecretaryScale();
  23155. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23156. xGame.common.secretary.play(data, 0, true, parent);
  23157. }
  23158. interuptSecretary() {
  23159. Laya.timer.clearAll(this);
  23160. this.playSecretaryRandomSound();
  23161. }
  23162. playSecretaryRandomSound() {
  23163. if (this.isHide)
  23164. return;
  23165. let time = xGame.common.randomNum(45000, 60000);
  23166. Laya.timer.once(time, this, () => {
  23167. if (this.isHide)
  23168. return;
  23169. let index = xGame.common.randomNum(4, 7);
  23170. xGame.soundMgr.playSound("s_main0" + index);
  23171. let words = 1;
  23172. switch (index) {
  23173. case 4:
  23174. words = 5;
  23175. break;
  23176. case 5:
  23177. words = 3;
  23178. break;
  23179. case 6:
  23180. words = 6;
  23181. break;
  23182. case 7:
  23183. words = 7;
  23184. break;
  23185. default:
  23186. break;
  23187. }
  23188. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23189. this.playSecretaryRandomSound();
  23190. });
  23191. }
  23192. closeSelf() {
  23193. this.hide();
  23194. }
  23195. }
  23196. UIShop$1.uiName = "UIShop";
  23197. class SignMax$1 {
  23198. constructor(ui) {
  23199. this.ui = ui;
  23200. }
  23201. updateSelf(index, sameDay, curDayIndex) {
  23202. let data = cfgTable.signData[index + 1];
  23203. this.ui.titleTxt.text = data.title;
  23204. let arr1 = data.award[0].split('-');
  23205. let arr2 = data.award[1].split('-');
  23206. let num1 = parseInt(arr1[1]);
  23207. let num2 = parseInt(arr2[1]);
  23208. this.ui.numTxt1.text = num1 + "";
  23209. this.ui.numTxt2.text = num2 + "";
  23210. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23211. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23212. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23213. this.ui.numTxt1.visible = false;
  23214. }
  23215. else {
  23216. this.ui.numTxt1.visible = true;
  23217. }
  23218. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23219. this.ui.numTxt2.visible = false;
  23220. }
  23221. else {
  23222. this.ui.numTxt2.visible = true;
  23223. }
  23224. if (index < curDayIndex) {
  23225. this.ui.c1.selectedIndex = 1;
  23226. }
  23227. else if (index == curDayIndex) {
  23228. if (sameDay) {
  23229. this.ui.c1.selectedIndex = 2;
  23230. }
  23231. else {
  23232. this.ui.c1.selectedIndex = 2;
  23233. }
  23234. }
  23235. else {
  23236. this.ui.c1.selectedIndex = 0;
  23237. }
  23238. }
  23239. }
  23240. class SignNormal$1 {
  23241. constructor(ui) {
  23242. this.ui = ui;
  23243. }
  23244. updateSelf(index, sameDay, curDayIndex) {
  23245. let data = cfgTable.signData[index + 1];
  23246. this.ui.titleTxt.text = data.title;
  23247. let arr = data.award[0].split('-');
  23248. let type = parseInt(arr[0]);
  23249. let num = parseInt(arr[1]);
  23250. this.ui.numTxt.text = num + "";
  23251. if (type > 2) {
  23252. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23253. this.ui.myIcon.rotation = 0;
  23254. }
  23255. else {
  23256. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23257. this.ui.myIcon.rotation = 0;
  23258. }
  23259. if (xGame.common.signAwardContainsRod(data.award)) {
  23260. this.ui.numTxt.visible = false;
  23261. }
  23262. else {
  23263. this.ui.numTxt.visible = true;
  23264. }
  23265. if (index < curDayIndex) {
  23266. this.ui.c1.selectedIndex = 1;
  23267. }
  23268. else if (index == curDayIndex) {
  23269. if (sameDay) {
  23270. this.ui.c1.selectedIndex = 2;
  23271. }
  23272. else {
  23273. this.ui.c1.selectedIndex = 2;
  23274. }
  23275. }
  23276. else {
  23277. this.ui.c1.selectedIndex = 0;
  23278. }
  23279. }
  23280. }
  23281. class UISign$1 extends UIBase {
  23282. constructor() {
  23283. super();
  23284. this.curDayIndex = 0;
  23285. this.starX = 0;
  23286. }
  23287. onConstructor() {
  23288. this.ui = ui_UISign.createInstance();
  23289. this.contentPane = this.ui;
  23290. this.isEject = false;
  23291. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23292. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23293. this.initSignItem();
  23294. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23295. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23296. }
  23297. show() {
  23298. super.show();
  23299. this.ui.t0.play();
  23300. this.playSecretaryIdle();
  23301. this.updateSign();
  23302. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23303. }
  23304. initSignItem() {
  23305. this.signArr = [];
  23306. for (let index = 0; index < 6; index++) {
  23307. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23308. this.signArr.push(temp);
  23309. }
  23310. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23311. if (Moyu.isKs)
  23312. this.ui.closeNode.closeBtn.x += 100;
  23313. }
  23314. updateSign() {
  23315. let sameDay = xGame.common.judgeSameDay();
  23316. let max = 7;
  23317. this.curDayIndex = DataMgr.getSignData();
  23318. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23319. this.curDayIndex = 0;
  23320. if (!sameDay) {
  23321. this.ui.normalBtn.visible = true;
  23322. this.ui.tipsNode.visible = false;
  23323. this.ui.againBtn.visible = false;
  23324. }
  23325. else {
  23326. this.ui.normalBtn.visible = false;
  23327. let again = DataMgr.getExtraSign();
  23328. let isCurrency = false;
  23329. let index = this.curDayIndex;
  23330. if (index == 0)
  23331. index = 7;
  23332. let award = cfgTable.signData[index].award;
  23333. let num = award[0].split("-")[0];
  23334. if (num == "1" || num == "2")
  23335. isCurrency = true;
  23336. let showAgain = again == 0 && isCurrency;
  23337. this.ui.againBtn.visible = showAgain;
  23338. this.ui.tipsNode.visible = !showAgain;
  23339. }
  23340. for (let index = 0; index < this.signArr.length; index++) {
  23341. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23342. }
  23343. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23344. }
  23345. playSecretaryIdle() {
  23346. let parent = this.ui.secretary.displayObject;
  23347. parent.destroyChildren();
  23348. let xx = this.ui.secretary.width / 2;
  23349. let yy = this.ui.secretary.height;
  23350. let scale = xGame.common.getSecretaryScale();
  23351. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23352. xGame.common.secretary.play(data, 0, true, parent);
  23353. }
  23354. closeSelf() {
  23355. this.hide();
  23356. }
  23357. normalGetAward() {
  23358. let sameDay = xGame.common.judgeSameDay();
  23359. if (!sameDay) {
  23360. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23361. let temp;
  23362. let type;
  23363. let num;
  23364. let arr = [];
  23365. for (let index = 0; index < award.length; index++) {
  23366. temp = award[index].split("-");
  23367. type = parseInt(temp[0]);
  23368. num = parseInt(temp[1]);
  23369. let awardType = new AwardType();
  23370. awardType.num = num;
  23371. awardType.type = type;
  23372. arr.push(awardType);
  23373. }
  23374. xGame.common.getAward(arr, (watchVideo) => {
  23375. this.curDayIndex++;
  23376. if (this.curDayIndex > 7)
  23377. this.curDayIndex = 0;
  23378. DataMgr.setSignData(this.curDayIndex);
  23379. this.updateSignData2Server(this.curDayIndex);
  23380. DataMgr.setSignTime(new Date().getTime());
  23381. if (watchVideo) {
  23382. DataMgr.setExtraSign(1);
  23383. Moyu.sendDataEvent("signIn1");
  23384. }
  23385. this.updateSign();
  23386. });
  23387. }
  23388. }
  23389. againGetAward() {
  23390. Moyu.sendDataEvent("signIn2");
  23391. console.log('zh:qjff_AD_for_uisign');
  23392. if (Laya.Browser.onAndroid) {
  23393. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23394. if (!boo) {
  23395. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23396. return;
  23397. }
  23398. }
  23399. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23400. }
  23401. else {
  23402. console.log('zh:AD 失败,直接发放奖励');
  23403. this.qjff_AD_for_uisign();
  23404. }
  23405. }
  23406. qjff_AD_for_uisign() {
  23407. let index = this.curDayIndex;
  23408. if (index == 0)
  23409. index = 7;
  23410. let award = cfgTable.signData[index].award;
  23411. let temp;
  23412. let type;
  23413. let num;
  23414. for (let index = 0; index < award.length; index++) {
  23415. temp = award[index].split("-");
  23416. type = parseInt(temp[0]);
  23417. num = parseInt(temp[1]) * 3;
  23418. xGame.common.playObjFlyAnim(num, type);
  23419. }
  23420. DataMgr.setExtraSign(1);
  23421. this.updateSign();
  23422. }
  23423. updateSignData2Server(day) {
  23424. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23425. if (userInfo == null) {
  23426. return;
  23427. }
  23428. let reqData = xGame.httpMgr.getReqData();
  23429. let pd = JSON.parse(reqData);
  23430. pd.signData = day;
  23431. reqData = JSON.stringify(pd);
  23432. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  23433. try {
  23434. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  23435. let code = res.code;
  23436. let msg = res.msg;
  23437. if (code == 401) {
  23438. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23439. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23440. return;
  23441. }
  23442. if (code == 200) {
  23443. let data = res.data;
  23444. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  23445. }
  23446. else {
  23447. xGame.uiMgr.Show(UIMsg$1, msg);
  23448. }
  23449. }
  23450. catch (error) {
  23451. console.log('error=' + error);
  23452. alert(error);
  23453. }
  23454. finally {
  23455. }
  23456. });
  23457. }
  23458. }
  23459. UISign$1.uiName = "UISign";
  23460. class UIModeSelection$1 extends UIBase {
  23461. constructor() {
  23462. super();
  23463. }
  23464. onConstructor() {
  23465. this.ui = ui_UIModeSelection.createInstance();
  23466. this.contentPane = this.ui;
  23467. this.isEject = false;
  23468. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23469. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23470. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23471. this.addUIClick(this.ui.closeBtn, this.hide);
  23472. this.peopleArr = [65, 990, 580];
  23473. this.peopleOffest = [5, 10, 10];
  23474. }
  23475. show(callback) {
  23476. this.updateSelf();
  23477. super.show();
  23478. this.ui.t0.play();
  23479. this.callback = callback;
  23480. }
  23481. updateSelf() {
  23482. let cfg = cfgTable.modeselectData;
  23483. for (let index = 1; index <= 3; index++) {
  23484. let node = this.ui.myNode["type" + index];
  23485. node.need.text = cfg[index].need;
  23486. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23487. node.peopleTxt.text = this.getRandPeople(index - 1);
  23488. }
  23489. }
  23490. enterGame(type) {
  23491. console.log('zh: 进入经典模式 type: ' + type);
  23492. xGame.common.classicRoomType = type;
  23493. let cfg = cfgTable.modeselectData[type];
  23494. let need = cfg.need;
  23495. xGame.common.passAwardCoin = cfg.award;
  23496. if (DataMgr.coinEnough(need)) {
  23497. DataMgr.setCoin(-need);
  23498. this.ui.myNode["type" + type].t0.play();
  23499. Laya.timer.once(200, this, () => {
  23500. this.callback && this.callback();
  23501. });
  23502. this.logEventForClassic_start();
  23503. }
  23504. else {
  23505. Moyu.sendDataEvent("AddCoinVideo");
  23506. xGame.uiMgr.Show(UIAddProp$1, 0);
  23507. }
  23508. }
  23509. getRandPeople(index) {
  23510. let rand = this.peopleOffest[index];
  23511. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23512. }
  23513. logEventForClassic_start() {
  23514. let rtype = xGame.common.classicRoomType;
  23515. let msmc = '';
  23516. if (rtype == 1) {
  23517. msmc = 'beginner';
  23518. }
  23519. if (rtype == 2) {
  23520. msmc = 'expert';
  23521. }
  23522. if (rtype == 3) {
  23523. msmc = 'master';
  23524. }
  23525. let keyStr = 'sjmd_classic_start_' + rtype;
  23526. let jsonStr = {
  23527. "difficulty": msmc,
  23528. "classic_count": 1,
  23529. "difficulty_count": 1
  23530. };
  23531. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23532. const d = LocalStorageManager.getItem(keyStr);
  23533. jsonStr.classic_count = d.classic_count + 1;
  23534. jsonStr.difficulty_count = d.difficulty_count + 1;
  23535. LocalStorageManager.setItem(keyStr, jsonStr);
  23536. }
  23537. else {
  23538. LocalStorageManager.setItem(keyStr, jsonStr);
  23539. }
  23540. const reqStr = JSON.stringify(jsonStr);
  23541. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23542. }
  23543. }
  23544. UIModeSelection$1.uiName = "UIModeSelection";
  23545. class UILogin$1 extends UIBase {
  23546. constructor() {
  23547. super();
  23548. }
  23549. onConstructor() {
  23550. this.ui = ui_UILogin.createInstance();
  23551. this.contentPane = this.ui;
  23552. this.isEject = false;
  23553. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23554. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23555. this.addUIClick(this.ui.btn_login, this.userLogin);
  23556. }
  23557. show() {
  23558. super.show();
  23559. this.x = (Laya.stage.width - this.width) / 2;
  23560. this.y = (Laya.stage.height - this.height) / 2;
  23561. }
  23562. closeSelf() {
  23563. this.hide();
  23564. }
  23565. userLogin() {
  23566. let ua = this.ui.txt_ua.text;
  23567. let up = this.ui.txt_up.text;
  23568. if (ua && up) {
  23569. let reqData = JSON.stringify({
  23570. username: ua.trim(),
  23571. password: up.trim(),
  23572. fromMark: 'app_game'
  23573. });
  23574. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23575. try {
  23576. console.log('zh:res = ' + JSON.stringify(res));
  23577. let code = res.code;
  23578. let msg = res.msg;
  23579. if (code == 200) {
  23580. let keyStr = keyForLoginInfo;
  23581. let jsonStr = {
  23582. "username": res.username,
  23583. "token": res.token,
  23584. "buySpids": { 1: false, 7: false }
  23585. };
  23586. LocalStorageManager.setItem(keyStr, jsonStr);
  23587. let myu = Moyu.getUserInfo();
  23588. console.log('zh:myu = ' + JSON.stringify(myu));
  23589. DataMgr.updateUserNickName(res.username);
  23590. Moyu.updateUserInfo(res.username);
  23591. xGame.uiMgr.Show(UIMsg$1, msg);
  23592. DataMgr.loadUserSpOrderForAd();
  23593. DataMgr.getUserZiChanInfo();
  23594. xGame.eventMgr.event(LOGIN_IN);
  23595. this.closeSelf();
  23596. }
  23597. else {
  23598. xGame.uiMgr.Show(UIMsg$1, msg);
  23599. }
  23600. }
  23601. catch (error) {
  23602. console.log('error=' + error);
  23603. alert(error);
  23604. }
  23605. finally {
  23606. }
  23607. });
  23608. }
  23609. else {
  23610. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23611. }
  23612. }
  23613. gotoRegPage() {
  23614. this.closeSelf();
  23615. xGame.uiMgr.Show(UIReg$1);
  23616. }
  23617. }
  23618. UILogin$1.uiName = "UILogin";
  23619. class UIReg$1 extends UIBase {
  23620. constructor() {
  23621. super();
  23622. }
  23623. onConstructor() {
  23624. this.ui = ui_UIReg.createInstance();
  23625. this.contentPane = this.ui;
  23626. this.isEject = false;
  23627. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23628. this.addUIClick(this.ui.btn_reg, this.regUser);
  23629. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23630. }
  23631. show() {
  23632. super.show();
  23633. this.x = (Laya.stage.width - this.width) / 2;
  23634. this.y = (Laya.stage.height - this.height) / 2;
  23635. }
  23636. closeSelf() {
  23637. this.hide();
  23638. }
  23639. regUser() {
  23640. this.ui.lab_tip.visible = false;
  23641. let ua = this.ui.txt_ua.text;
  23642. let up1 = this.ui.txt_up1.text;
  23643. let up2 = this.ui.txt_up2.text;
  23644. if (ua && up1 && up2 && up1 == up2) {
  23645. let reqData = JSON.stringify({
  23646. username: ua.trim(),
  23647. password: up1.trim(),
  23648. fromMark: 'app_game'
  23649. });
  23650. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23651. try {
  23652. console.log('zh:res = ' + JSON.stringify(res));
  23653. let code = res.code;
  23654. let msg = res.msg;
  23655. xGame.uiMgr.Show(UIMsg$1, msg);
  23656. if (code == 200) {
  23657. this.ui.lab_tip.color = "#FFFFFF";
  23658. xGame.uiMgr.Show(UIMsg$1, msg);
  23659. this.closeSelf();
  23660. }
  23661. else {
  23662. this.ui.lab_tip.color = "#FF0000";
  23663. xGame.uiMgr.Show(UIMsg$1, msg);
  23664. }
  23665. }
  23666. catch (error) {
  23667. console.log('error=' + error);
  23668. alert(error);
  23669. }
  23670. finally {
  23671. }
  23672. });
  23673. }
  23674. else {
  23675. if (up1 != up2) {
  23676. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23677. }
  23678. else {
  23679. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23680. }
  23681. }
  23682. }
  23683. gotoLogin() {
  23684. this.closeSelf();
  23685. xGame.uiMgr.Show(UILogin$1);
  23686. }
  23687. }
  23688. UIReg$1.uiName = "UIReg";
  23689. class UIFuli1$1 extends UIBase {
  23690. constructor() {
  23691. super();
  23692. }
  23693. onConstructor() {
  23694. this.ui = ui_UIFuli1.createInstance();
  23695. this.contentPane = this.ui;
  23696. this.isEject = false;
  23697. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23698. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23699. }
  23700. show() {
  23701. super.show();
  23702. this.x = (Laya.stage.width - this.width) / 2;
  23703. this.y = (Laya.stage.height - this.height) / 2;
  23704. }
  23705. closeSelf() {
  23706. DataMgr.loadUserSpOrderForAd();
  23707. this.hide();
  23708. }
  23709. gotoBuy() {
  23710. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23711. if (userInfo != null) {
  23712. let token = userInfo.token;
  23713. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  23714. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  23715. return;
  23716. }
  23717. else {
  23718. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23719. }
  23720. }
  23721. gotoBuy2() {
  23722. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23723. if (userInfo == null) {
  23724. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23725. return;
  23726. }
  23727. let reqData = xGame.httpMgr.getReqData();
  23728. let pd = JSON.parse(reqData);
  23729. pd.productId = 1;
  23730. reqData = JSON.stringify(pd);
  23731. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23732. try {
  23733. console.log('zh:buySp res = ' + JSON.stringify(res));
  23734. let code = res.code;
  23735. let msg = res.msg;
  23736. if (code == 401) {
  23737. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23738. alert(TIP_MSG_key.loginTimeOut);
  23739. xGame.uiMgr.Show(UIMsg$1, msg);
  23740. return;
  23741. }
  23742. if (code == 200) {
  23743. xGame.uiMgr.Show(UIMsg$1, msg);
  23744. DataMgr.loadUserSpOrderForAd();
  23745. DataMgr.getUserZiChanInfo();
  23746. this.closeSelf();
  23747. }
  23748. else {
  23749. xGame.uiMgr.Show(UIMsg$1, msg);
  23750. }
  23751. }
  23752. catch (error) {
  23753. console.log('error=' + error);
  23754. alert(error);
  23755. }
  23756. finally {
  23757. }
  23758. });
  23759. }
  23760. }
  23761. UIFuli1$1.uiName = "UIFuli1";
  23762. class UIFuli2$1 extends UIBase {
  23763. constructor() {
  23764. super();
  23765. }
  23766. onConstructor() {
  23767. this.ui = ui_UIFuli2.createInstance();
  23768. this.contentPane = this.ui;
  23769. this.isEject = false;
  23770. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  23771. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  23772. }
  23773. show() {
  23774. super.show();
  23775. this.x = (Laya.stage.width - this.width) / 2;
  23776. this.y = (Laya.stage.height - this.height) / 2;
  23777. }
  23778. closeSelf() {
  23779. DataMgr.loadUserSpOrderForAd();
  23780. this.hide();
  23781. }
  23782. gotoBuy() {
  23783. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23784. if (userInfo != null) {
  23785. let token = userInfo.token;
  23786. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  23787. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  23788. return;
  23789. }
  23790. else {
  23791. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23792. }
  23793. }
  23794. gotoBuy1() {
  23795. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23796. if (userInfo == null) {
  23797. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23798. return;
  23799. }
  23800. let reqData = xGame.httpMgr.getReqData();
  23801. let pd = JSON.parse(reqData);
  23802. pd.productId = 2;
  23803. reqData = JSON.stringify(pd);
  23804. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23805. try {
  23806. console.log('zh:buySp res = ' + JSON.stringify(res));
  23807. let code = res.code;
  23808. let msg = res.msg;
  23809. if (code == 401) {
  23810. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23811. alert(TIP_MSG_key.loginTimeOut);
  23812. xGame.uiMgr.Show(UIMsg$1, msg);
  23813. return;
  23814. }
  23815. if (code == 200) {
  23816. xGame.uiMgr.Show(UIMsg$1, msg);
  23817. DataMgr.loadUserSpOrderForAd();
  23818. DataMgr.getUserZiChanInfo();
  23819. this.closeSelf();
  23820. }
  23821. else {
  23822. xGame.uiMgr.Show(UIMsg$1, msg);
  23823. }
  23824. }
  23825. catch (error) {
  23826. console.log('error=' + error);
  23827. alert(error);
  23828. }
  23829. finally {
  23830. }
  23831. });
  23832. }
  23833. }
  23834. UIFuli2$1.uiName = "UIFuli2";
  23835. class UITry$1 extends UIBase {
  23836. constructor() {
  23837. super();
  23838. this.closeTime = 0;
  23839. this.closeNum = 0;
  23840. this.skillUrl = xGame.common.skillIconList;
  23841. }
  23842. onConstructor() {
  23843. this.ui = ui_UITry.createInstance();
  23844. this.contentPane = this.ui;
  23845. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23846. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23847. }
  23848. show() {
  23849. super.show();
  23850. this.closeNum = 0;
  23851. this.closeTime = 15;
  23852. this.ui.t0.play();
  23853. PlatMgr.showRateBanner();
  23854. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23855. Laya.timer.loop(1000, this, this.updateTime);
  23856. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23857. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23858. xGame.common.gameMgr.gamePause = true;
  23859. }
  23860. updateTime() {
  23861. if (this.closeTime > 1) {
  23862. this.closeTime--;
  23863. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23864. }
  23865. else
  23866. this.hide();
  23867. }
  23868. hide() {
  23869. Laya.timer.clearAll(this);
  23870. Moyu.showBannerAd(false);
  23871. super.hide();
  23872. xGame.common.gameMgr.gamePause = false;
  23873. }
  23874. onTry() {
  23875. console.log('zh:qjff_AD_for_uitry');
  23876. if (Laya.Browser.onAndroid) {
  23877. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23878. if (!boo) {
  23879. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23880. return;
  23881. }
  23882. }
  23883. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  23884. }
  23885. else {
  23886. console.log('zh:AD 失败,直接发放奖励');
  23887. this.qjff_AD_for_uitry();
  23888. }
  23889. }
  23890. qjff_AD_for_uitry() {
  23891. let select = xGame.common.curPlayerSkillType;
  23892. DataMgr.gameData.trySkill = select;
  23893. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  23894. DataMgr.saveGameData();
  23895. DataMgr.setBigSkill(select, 1);
  23896. xGame.showTip("Trial Successful");
  23897. this.hide();
  23898. }
  23899. onCancel() {
  23900. if (this.closeNum > 0) {
  23901. this.closeNum--;
  23902. if (this.closeNum < 2)
  23903. this.hide();
  23904. return;
  23905. }
  23906. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  23907. this.onTry();
  23908. }
  23909. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  23910. this.closeNum = 3;
  23911. }
  23912. else
  23913. this.hide();
  23914. }
  23915. }
  23916. UITry$1.uiName = "UITry";
  23917. class UIGetAward$1 extends UIBase {
  23918. constructor() {
  23919. super();
  23920. this.showTriple = true;
  23921. }
  23922. onConstructor() {
  23923. this.ui = ui_UIGetAward.createInstance();
  23924. this.contentPane = this.ui;
  23925. this.isEject = false;
  23926. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  23927. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  23928. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  23929. }
  23930. show(arr, showTriple, callback) {
  23931. super.show();
  23932. this.ui.t0.play();
  23933. this.ui.eftNode.visible = true;
  23934. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  23935. this.ui.eftNode.visible = false;
  23936. }), 1, 0, 0, 0.9);
  23937. this.awardArr = arr;
  23938. this.showTriple = showTriple;
  23939. this.callback = callback;
  23940. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  23941. this.ui.myList.numItems = arr.length;
  23942. xGame.soundMgr.playSound("getaward");
  23943. }
  23944. updateSelf(index, obj) {
  23945. let temp = this.awardArr[index];
  23946. let icon = this.getIcon(temp.type);
  23947. let str = icon;
  23948. if (temp.type > 2) {
  23949. str = "s" + icon;
  23950. }
  23951. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  23952. obj.myIcon.rotation = 0;
  23953. obj.numTxt.text = temp.num + "";
  23954. obj.numTxt.visible = temp.type > 2 ? false : true;
  23955. obj.nameTxt.text = this.getNameStr(temp.type);
  23956. }
  23957. renderItem(index, obj) {
  23958. this.updateSelf(index, obj);
  23959. }
  23960. tripleGetAward() {
  23961. console.log('zh:qjff_AD_for_uigetAward');
  23962. if (Laya.Browser.onAndroid) {
  23963. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23964. if (!boo) {
  23965. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23966. return;
  23967. }
  23968. }
  23969. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  23970. }
  23971. else {
  23972. console.log('zh:AD 失败,直接发放奖励');
  23973. this.qjff_AD_for_uigetAward();
  23974. }
  23975. }
  23976. qjff_AD_for_uigetAward() {
  23977. this.getAward(3);
  23978. }
  23979. normalGetAward() {
  23980. if (PlatMgr.isMisVideo())
  23981. this.tripleGetAward();
  23982. else
  23983. this.getAward();
  23984. }
  23985. getAward(times = 1) {
  23986. this.hide();
  23987. for (let index = 0; index < this.awardArr.length; index++) {
  23988. this.awardArr[index].num *= times;
  23989. }
  23990. this.callback && this.callback(times != 1);
  23991. }
  23992. getIcon(type) {
  23993. switch (type) {
  23994. case Prop.diamond:
  23995. return "ty_zs";
  23996. case Prop.coin:
  23997. return "ty_jb";
  23998. case Prop.gan1:
  23999. return "qg1";
  24000. case Prop.gan2:
  24001. return "qg2";
  24002. case Prop.gan3:
  24003. return "qg3";
  24004. case Prop.gan4:
  24005. return "qg4";
  24006. default:
  24007. break;
  24008. }
  24009. }
  24010. getNameStr(type) {
  24011. switch (type) {
  24012. case Prop.diamond:
  24013. return "Diamond";
  24014. case Prop.coin:
  24015. return "Coins";
  24016. case Prop.gan1:
  24017. case Prop.gan2:
  24018. case Prop.gan3:
  24019. case Prop.gan4:
  24020. return cfgTable.ballrodData[type - 1].name;
  24021. default:
  24022. break;
  24023. }
  24024. }
  24025. }
  24026. UIGetAward$1.uiName = "UIGetAward";
  24027. class UIBox$1 extends UIBase {
  24028. constructor() {
  24029. super();
  24030. this.boxNum = 0;
  24031. this.boxMax = 10;
  24032. this.inAd = false;
  24033. this.isClose = false;
  24034. }
  24035. onConstructor() {
  24036. this.ui = ui_UIBox.createInstance();
  24037. this.contentPane = this.ui;
  24038. this.isEject = false;
  24039. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24040. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24041. Laya.timer.loop(1000, this, this.update);
  24042. }
  24043. update() {
  24044. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24045. this.boxNum -= 1;
  24046. this.upBar();
  24047. }
  24048. }
  24049. upBar() {
  24050. if (this.boxNum > this.boxMax)
  24051. this.boxNum = this.boxMax;
  24052. this.ui.bar.value = this.boxNum * 10;
  24053. }
  24054. show() {
  24055. super.show();
  24056. this.isClose = false;
  24057. this.boxNum = 0;
  24058. this.inAd = false;
  24059. this.upBar();
  24060. this.ui.t0.play();
  24061. this.ui.closeBtn.visible = false;
  24062. Laya.timer.once(3000, this, () => {
  24063. this.ui.closeBtn.visible = true;
  24064. this.ui.bar.alpha = 1;
  24065. });
  24066. Laya.timer.once(500, this, () => {
  24067. this.ui.t1.play();
  24068. });
  24069. }
  24070. hide() {
  24071. Laya.timer.clearAll(this);
  24072. Moyu.showBannerAd(false);
  24073. super.hide();
  24074. }
  24075. onOpenBox() {
  24076. this.boxNum++;
  24077. if (this.boxNum < this.boxMax) {
  24078. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24079. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24080. }
  24081. }
  24082. else if (this.boxNum == this.boxMax) {
  24083. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24084. this.ui.openBtn.c1.selectedIndex = 13;
  24085. this.inAd = true;
  24086. }
  24087. else
  24088. this.getAward();
  24089. }
  24090. else if (this.inAd) {
  24091. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24092. if (Laya.Browser.onAndroid) {
  24093. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24094. if (!boo) {
  24095. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24096. return;
  24097. }
  24098. }
  24099. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24100. }
  24101. else {
  24102. console.log('zh:AD 失败,直接发放奖励');
  24103. this.qjff_AD_for_UIBOX_onOpenBox();
  24104. }
  24105. }
  24106. this.upBar();
  24107. }
  24108. qjff_AD_for_UIBOX_onOpenBox() {
  24109. this.getAward();
  24110. }
  24111. onCloseBox() {
  24112. if (this.isClose)
  24113. this.hide();
  24114. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24115. this.isClose = true;
  24116. PlatMgr.showBanner(true, 0, 3000);
  24117. }
  24118. else
  24119. this.hide();
  24120. }
  24121. getAward() {
  24122. let str = "";
  24123. if (Math.random() < 0.5) {
  24124. let max = Moyu.isLegal ? 500 : 2500;
  24125. let num = xGame.tools.random(max, 500 + max);
  24126. DataMgr.setCoin(num);
  24127. str = "金币x" + num;
  24128. }
  24129. else {
  24130. let max = Moyu.isLegal ? 10 : 30;
  24131. let num = xGame.tools.random(max, 30 + max);
  24132. DataMgr.setDiamond(num);
  24133. str = "钻石x" + num;
  24134. }
  24135. xGame.showTip("恭喜获得-" + str);
  24136. this.hide();
  24137. }
  24138. }
  24139. UIBox$1.uiName = "UIBox";
  24140. class UIMain$1 extends UIBase {
  24141. constructor() {
  24142. super();
  24143. this.firstEnter = true;
  24144. }
  24145. nativeCallJs(msg) {
  24146. let t = msg;
  24147. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24148. switch (t) {
  24149. case 'qjff_chouJiang':
  24150. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24151. dui.qjff_chouJiang();
  24152. break;
  24153. case 'qjff_AD_for_uisign':
  24154. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24155. dui2.qjff_AD_for_uisign();
  24156. break;
  24157. case 'qjff_AD_for_uitry':
  24158. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24159. dui3.qjff_AD_for_uitry();
  24160. break;
  24161. case 'qjff_AD_for_uipower':
  24162. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24163. dui4.qjff_AD_for_uipower();
  24164. break;
  24165. case 'qjff_AD_for_uigetAward':
  24166. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24167. dui5.qjff_AD_for_uigetAward();
  24168. break;
  24169. case 'qjff_AD_for_uiGameEnd':
  24170. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24171. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24172. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24173. break;
  24174. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24175. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24176. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24177. break;
  24178. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24179. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24180. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24181. break;
  24182. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24183. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24184. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24185. break;
  24186. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24187. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24188. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24189. break;
  24190. case 'qjff_AD_for_UIBOX_onOpenBox':
  24191. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24192. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24193. break;
  24194. case 'qjff_AD_for_UIAddCoin':
  24195. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24196. dui12.qjff_AD_for_UIAddCoin();
  24197. break;
  24198. case '111a':
  24199. let dui14 = xGame.uiMgr.getUI(UISign$1);
  24200. dui14.qjff_AD_for_uisign();
  24201. break;
  24202. case '222a':
  24203. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24204. dui15.qjff_AD_for_uisign();
  24205. break;
  24206. case '333a':
  24207. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24208. dui16.qjff_AD_for_uisign();
  24209. break;
  24210. default:
  24211. console.log('zh:未知的方法名字' + t);
  24212. break;
  24213. }
  24214. }
  24215. onConstructor() {
  24216. console.log('zh: UIMain onConstructor');
  24217. this.ui = ui_UIMain.createInstance();
  24218. this.contentPane = this.ui;
  24219. this.isEject = false;
  24220. this.addEvent();
  24221. this.addClickSpine();
  24222. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24223. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24224. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24225. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24226. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24227. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24228. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24229. let curUse = DataMgr.getCurSecretary();
  24230. this.changeSecretary(curUse);
  24231. this.ui.talkNode.visible = false;
  24232. let guide = DataMgr.getSkillGuide();
  24233. if (xGame.common.isNewDay && guide == 1) {
  24234. xGame.common.isNewDay = false;
  24235. xGame.soundMgr.playSound("s_main01");
  24236. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24237. console.log("zh:播放小秘书每天语音");
  24238. }
  24239. this.onGetUserInfo();
  24240. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24241. DataMgr.getUserZiChanInfo();
  24242. }
  24243. this.ui.n83.visible = false;
  24244. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24245. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24246. let ua = d.username;
  24247. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24248. }
  24249. this.c_btn_for_user();
  24250. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24251. }
  24252. Logout() {
  24253. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24254. LocalStorageManager.removeItem(keyForLoginInfo);
  24255. this.freshUser();
  24256. }
  24257. JSBridgeUtils.instance.loginOutForApp();
  24258. this.setUserDefaultNickname();
  24259. DataMgr.setCoin2(4000);
  24260. DataMgr.setDiamond2(0);
  24261. this.setDefaultQiuGanInfo();
  24262. DataMgr.setPlaceBallLevelList("");
  24263. }
  24264. setDefaultQiuGanInfo() {
  24265. DataMgr.setBallRod(0, 1);
  24266. DataMgr.setBallRod(1, 0);
  24267. DataMgr.setBallRod(2, 0);
  24268. DataMgr.setBallRod(3, 0);
  24269. DataMgr.setBallRod(4, 0);
  24270. DataMgr.setBallRod(5, 1);
  24271. }
  24272. setUserDefaultNickname() {
  24273. let defUsername = "player";
  24274. this.ui.headNode.nameTxt.text = defUsername;
  24275. DataMgr.updateUserNickName(defUsername);
  24276. Moyu.updateUserInfo(defUsername);
  24277. }
  24278. gotoLogin() {
  24279. xGame.uiMgr.Show(UILogin$1);
  24280. }
  24281. gotoRegUser() {
  24282. xGame.uiMgr.Show(UIReg$1);
  24283. }
  24284. showFuLiSp1() {
  24285. console.log('zh:福利1');
  24286. this.checkForShowFuLi17(1);
  24287. }
  24288. showFuLiSp7() {
  24289. console.log('zh:福利7');
  24290. this.checkForShowFuLi17(7);
  24291. }
  24292. checkForShowFuLi17(spid) {
  24293. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24294. if (userInfo == null) {
  24295. if (spid === 1) {
  24296. xGame.uiMgr.Show(UIFuli1$1);
  24297. }
  24298. if (spid === 7) {
  24299. xGame.uiMgr.Show(UIFuli2$1);
  24300. }
  24301. return;
  24302. }
  24303. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  24304. let reqData = xGame.httpMgr.getReqData();
  24305. let pd = JSON.parse(reqData);
  24306. pd.productId = spid;
  24307. reqData = JSON.stringify(pd);
  24308. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  24309. try {
  24310. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  24311. let code = res.code;
  24312. let msg = res.msg;
  24313. if (code == 401) {
  24314. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  24315. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24316. return;
  24317. }
  24318. if (code == 200) {
  24319. let isBuyOk = res.data;
  24320. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  24321. if (isBuyOk === false) {
  24322. if (spid === 1) {
  24323. xGame.uiMgr.Show(UIFuli1$1);
  24324. }
  24325. if (spid === 7) {
  24326. xGame.uiMgr.Show(UIFuli2$1);
  24327. }
  24328. }
  24329. else {
  24330. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  24331. }
  24332. }
  24333. else {
  24334. xGame.uiMgr.Show(UIMsg$1, msg);
  24335. }
  24336. }
  24337. catch (error) {
  24338. console.log('error=' + error);
  24339. alert(error);
  24340. }
  24341. finally {
  24342. }
  24343. });
  24344. }
  24345. c_btn_for_user() {
  24346. this.ui.n_Logout.visible = false;
  24347. this.ui.n_dengLu.visible = false;
  24348. this.ui.n_zhuCe.visible = false;
  24349. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24350. this.ui.n_Logout.visible = true;
  24351. }
  24352. else {
  24353. this.ui.n_dengLu.visible = true;
  24354. }
  24355. }
  24356. changeSecretary(curUse) {
  24357. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24358. xGame.common.secretary && xGame.common.secretary.dispose();
  24359. this.addSecretarySpine(name);
  24360. }
  24361. addSecretarySpine(name) {
  24362. let spine = new SpineMgr(name, () => {
  24363. this.playSecretaryIdle();
  24364. });
  24365. xGame.common.secretary = spine;
  24366. }
  24367. addClickSpine() {
  24368. let clickSpine = new SpineMgr("dianji", () => {
  24369. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24370. let parent = Laya.stage;
  24371. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24372. clickSpine.play(data, 0, false, parent, (spine) => {
  24373. spine.destroy(true);
  24374. });
  24375. });
  24376. });
  24377. }
  24378. addEvent() {
  24379. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24380. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24381. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  24382. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24383. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24384. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24385. this.addUIClick(this.ui, this.interuptSecretary);
  24386. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24387. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24388. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24389. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24390. this.addUIClick(this.ui.signBtn, this.openSignView);
  24391. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24392. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24393. this.addUIClick(this.ui.n_Logout, this.Logout);
  24394. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24395. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  24396. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24397. }
  24398. show(showFailWords) {
  24399. super.show();
  24400. this.moneyNode.ui.c1.selectedIndex = 1;
  24401. this.playSecretaryIdle();
  24402. xGame.soundMgr.playMusic("caromhall01", 0);
  24403. Laya.timer.clearAll(this);
  24404. this.playSecretaryRandomSound();
  24405. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24406. if (showFailWords) {
  24407. console.log('zh:uimain.ts ');
  24408. setTimeout(() => {
  24409. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24410. let words = -1;
  24411. if (str == "s_main02") {
  24412. words = 2;
  24413. }
  24414. else {
  24415. words = 3;
  24416. }
  24417. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24418. xGame.soundMgr.playSound(str);
  24419. }, 300);
  24420. }
  24421. this.showGuide();
  24422. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24423. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24424. let guide = DataMgr.getSkillGuide();
  24425. if (guide == 1) {
  24426. let randTime = xGame.common.randomNum(300, 800);
  24427. if (this.firstEnter) {
  24428. console.log("zh: firstEnter");
  24429. this.firstEnter = false;
  24430. randTime += 900;
  24431. }
  24432. else {
  24433. console.log("zh: no firstEnter");
  24434. }
  24435. Laya.timer.once(randTime, this, () => {
  24436. });
  24437. Laya.timer.once(1000, this, () => {
  24438. console.log('zh: 1秒后 showFuLiSp1');
  24439. this.showFuLiSp1();
  24440. });
  24441. Laya.timer.once(10000, this, () => {
  24442. console.log('zh: 10秒后 showFuLiSp1');
  24443. this.showFuLiSp7();
  24444. });
  24445. }
  24446. }
  24447. checkActive(show) {
  24448. }
  24449. showGuide() {
  24450. let guide = DataMgr.getSkillGuide();
  24451. this.ui.guideBtn.visible = guide == 0;
  24452. this.ui.enterGuide.visible = false;
  24453. this.ui.secretaryGuide.visible = guide == 0;
  24454. if (guide == 0) {
  24455. console.log("zh:显示引导");
  24456. xGame.soundMgr.playSound("s_guide");
  24457. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24458. }
  24459. else {
  24460. console.log("zh:不需要显示引导");
  24461. }
  24462. }
  24463. ensureSecretary() {
  24464. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  24465. this.ui.secretaryGuide.visible = false;
  24466. this.ui.enterGuide.visible = true;
  24467. this.ui.wordsNode.t0.play();
  24468. if (DataMgr.getNewUser())
  24469. Moyu.sendDataEvent("gameReady");
  24470. }
  24471. playSecretaryIdle() {
  24472. let parent = this.ui.secretary.displayObject;
  24473. parent.destroyChildren();
  24474. let xx = this.ui.secretary.width / 2;
  24475. let yy = this.ui.secretary.height;
  24476. let scale = xGame.common.getSecretaryScale();
  24477. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24478. xGame.common.secretary.play(data, 0, true, parent);
  24479. }
  24480. startGame(type) {
  24481. if (!this.isReadyForLoadNetSource()) {
  24482. return;
  24483. }
  24484. xGame.common.gameMode = type;
  24485. Moyu.sendDataEvent("PlayGame", { type: type });
  24486. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  24487. switch (xGame.common.gameMode) {
  24488. case GameMode.classic:
  24489. console.log('zh:进入经典模式111111111');
  24490. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24491. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24492. console.log('zh:classic db_over_lev=', db_over_lev);
  24493. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24494. console.log('zh:判断是否可以玩该模式classic =NO');
  24495. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24496. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24497. return;
  24498. }
  24499. else {
  24500. console.log('zh:可以玩该模式classic 66666666666666');
  24501. this.beginGame();
  24502. }
  24503. }
  24504. else {
  24505. console.log('zh:不需要判断是否可以玩该classic');
  24506. let challengeTimes = DataMgr.getChallengeTimes();
  24507. if (challengeTimes == 0) {
  24508. xGame.uiMgr.Show(UIInvitation$1);
  24509. }
  24510. else {
  24511. this.beginGame();
  24512. }
  24513. break;
  24514. }
  24515. case GameMode.bigMove:
  24516. console.error('zh:bigMove check');
  24517. let guide = DataMgr.getSkillGuide();
  24518. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24519. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24520. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24521. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24522. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24523. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24524. return;
  24525. }
  24526. else {
  24527. console.log('zh:可以玩该模式 bigMove');
  24528. this.beginGame();
  24529. if (DataMgr.getNewUser())
  24530. Moyu.sendDataEvent("gameStart0");
  24531. }
  24532. }
  24533. else {
  24534. this.beginGame();
  24535. if (DataMgr.getNewUser())
  24536. Moyu.sendDataEvent("gameStart0");
  24537. }
  24538. break;
  24539. default:
  24540. console.error('zh:未知错误!!!!');
  24541. break;
  24542. }
  24543. }
  24544. beginGame(isNice = false) {
  24545. console.log('zh:beginGame ');
  24546. let guide = DataMgr.getSkillGuide();
  24547. if (guide == 1) {
  24548. console.log('zh:非新手引导,showInternAd ');
  24549. JSBridgeUtils.instance.showInternAd('beginGame');
  24550. }
  24551. else {
  24552. console.log('zh:新手引导,不显示AD ');
  24553. }
  24554. console.log('zh:beginGame 2 go');
  24555. if (xGame.common.gameMode == GameMode.classic) {
  24556. if (isNice) {
  24557. this.enterClassic();
  24558. }
  24559. else {
  24560. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24561. console.log('zh:BBBBBBBBBBBBBBB');
  24562. this.enterClassic();
  24563. });
  24564. }
  24565. }
  24566. else if (xGame.common.gameMode == GameMode.bigMove) {
  24567. this.ui.enterGuide.visible = false;
  24568. xGame.uiMgr.Show(UISkill$1);
  24569. }
  24570. }
  24571. enterClassic() {
  24572. xGame.uiMgr.Show(UIGame$1);
  24573. xGame.uiMgr.Show(UIMatching$1, () => {
  24574. if (!this.isHide)
  24575. this.hide();
  24576. xGame.common.gameUI.ui.alpha = 1;
  24577. xGame.common.gameUI.startGame();
  24578. xGame.uiMgr.Hide(UIGameEnd$1);
  24579. });
  24580. }
  24581. start_debug_for_moni_payOk() {
  24582. console.log('zh:start_debug_for_moni_payOk');
  24583. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24584. if (userInfo != null) {
  24585. let token = userInfo.token;
  24586. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24587. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  24588. alert('模拟支付OK');
  24589. return;
  24590. }
  24591. else {
  24592. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24593. }
  24594. }
  24595. startGlobal() {
  24596. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24597. }
  24598. startWeekly() {
  24599. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24600. }
  24601. zhouSaiMonth() {
  24602. console.log('zh: zhouSaiMonth 被调用');
  24603. }
  24604. isReadyForLoadNetSource() {
  24605. let reqCount = xGame.cfgMgr.httpReqCount;
  24606. let ok = xGame.cfgMgr.httpReqOkCount;
  24607. if (reqCount > ok) {
  24608. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24609. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24610. Laya.timer.once(5000, this, () => {
  24611. let retryCount = 0;
  24612. const maxRetries = 3;
  24613. const tryFetchConfig = () => {
  24614. try {
  24615. xGame.cfgMgr.getConfigFromServer();
  24616. }
  24617. catch (error) {
  24618. if (retryCount < maxRetries) {
  24619. retryCount++;
  24620. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24621. Laya.timer.once(5000, this, tryFetchConfig);
  24622. }
  24623. else {
  24624. console.error("❌ 达到最大重试次数,配置获取失败");
  24625. }
  24626. }
  24627. };
  24628. tryFetchConfig();
  24629. });
  24630. return false;
  24631. }
  24632. return true;
  24633. }
  24634. startPlaceBall() {
  24635. if (!this.isReadyForLoadNetSource()) {
  24636. return;
  24637. }
  24638. xGame.uiMgr.Show(UILevelDisplay$1);
  24639. }
  24640. hide() {
  24641. console.log('zh:uimain hide ...');
  24642. super.hide();
  24643. xGame.common.stopGirlPop(this.ui.talkNode);
  24644. }
  24645. onGetUserInfo(force = false) {
  24646. if (Moyu.isWx) {
  24647. let info = Moyu.getSystemInfo();
  24648. if (info)
  24649. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24650. }
  24651. else {
  24652. Moyu.initUser(this, this.freshUser, force);
  24653. }
  24654. this.freshUser();
  24655. console.log('zh:5秒后更新用戶資產信息');
  24656. setTimeout(() => {
  24657. console.log('setTimeout 5秒over 執行');
  24658. DataMgr.getUserZiChanInfo();
  24659. }, 5000);
  24660. }
  24661. event_login_in() {
  24662. console.log("zh:event_login_in被触发");
  24663. this.freshUser();
  24664. }
  24665. freshUser() {
  24666. let user = Moyu.getUserInfo();
  24667. if (!user.isAuth) {
  24668. user.headIcon = 'res/ty_touxiang.png';
  24669. }
  24670. else {
  24671. DataMgr.upRankData();
  24672. }
  24673. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24674. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24675. let keyStr = keyForLoginInfo;
  24676. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24677. const d = LocalStorageManager.getItem(keyStr);
  24678. let ua = d.username;
  24679. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24680. }
  24681. else {
  24682. }
  24683. this.c_btn_for_user();
  24684. }
  24685. interuptSecretary() {
  24686. Laya.timer.clearAll(this);
  24687. this.playSecretaryRandomSound();
  24688. }
  24689. playSecretaryRandomSound() {
  24690. if (this.isHide)
  24691. return;
  24692. let time = xGame.common.randomNum(45000, 60000);
  24693. Laya.timer.once(time, this, () => {
  24694. if (this.isHide)
  24695. return;
  24696. let index = xGame.common.randomNum(4, 7);
  24697. xGame.soundMgr.playSound("s_main0" + index);
  24698. let words = 1;
  24699. switch (index) {
  24700. case 4:
  24701. words = 5;
  24702. break;
  24703. case 5:
  24704. words = 3;
  24705. break;
  24706. case 6:
  24707. words = 6;
  24708. break;
  24709. case 7:
  24710. words = 7;
  24711. break;
  24712. default:
  24713. break;
  24714. }
  24715. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24716. this.playSecretaryRandomSound();
  24717. });
  24718. }
  24719. openSecretaryView() {
  24720. xGame.uiMgr.Show(UISecretary$1);
  24721. Moyu.sendDataEvent("secretary");
  24722. }
  24723. openShopView() {
  24724. xGame.uiMgr.Show(UIShop$1, 0);
  24725. }
  24726. openSignView() {
  24727. xGame.uiMgr.Show(UISign$1);
  24728. }
  24729. openDrawView() {
  24730. xGame.uiMgr.Show(UIDraw$1);
  24731. }
  24732. openRanking() {
  24733. console.log('zh:phb openRanking');
  24734. xGame.uiMgr.Show(UIRanking$1);
  24735. Moyu.sendDataEvent("rankingList");
  24736. }
  24737. }
  24738. UIMain$1.uiName = "UIMain";
  24739. function InitShader() {
  24740. }
  24741. function appInit() {
  24742. xGame.context.init(getLoadingResList(), initCallback);
  24743. }
  24744. function getLoadingResList() {
  24745. return [
  24746. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24747. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24748. ];
  24749. }
  24750. function getGameResList() {
  24751. return [
  24752. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24753. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24754. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24755. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24756. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24757. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24758. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24759. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24760. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24761. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24762. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24763. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24764. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24765. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24766. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24767. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24768. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24769. ];
  24770. }
  24771. function initCallback() {
  24772. window["DataMgr"] = DataMgr;
  24773. DataMgr.Init();
  24774. Moyu.init(getPlat(), this, () => {
  24775. DataMgr.isNewDay();
  24776. PlatMgr.initConfig();
  24777. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24778. }, true);
  24779. console.log('zh:开始sm init1 start');
  24780. xGame.soundMgr.init();
  24781. console.log('zh:开始sm init1 end');
  24782. xGame.uiMgr.init();
  24783. xGame.uiMgr.clearTempData();
  24784. xGame.uiMgr.bindFUI(fguiRes.loading);
  24785. xGame.uiMgr.Show(UILoading);
  24786. }
  24787. function loadSubRes(callback) {
  24788. var tab = ["asset", "res", "spine"];
  24789. let subDone = 0;
  24790. for (var i = 0; i < tab.length; i++) {
  24791. let sub = tab[i];
  24792. Moyu.loadSubRes(sub, (pro) => {
  24793. callback && callback(pro, false);
  24794. }).then(() => {
  24795. subDone++;
  24796. if (subDone >= tab.length)
  24797. callback && callback(1, true);
  24798. });
  24799. }
  24800. }
  24801. function enterGame() {
  24802. xGame.cfgMgr.init();
  24803. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24804. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24805. xGame.uiMgr.Hide(UILoading);
  24806. fgui.UIPackage.removePackage(fguiRes.loading);
  24807. xGame.uiMgr.bindFUI(fguiRes.game);
  24808. xGame.uiMgr.Show(UIMain$1);
  24809. if (DataMgr.getNewUser())
  24810. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24811. }
  24812. function getPlat() {
  24813. let cfg = new MoyuCfg();
  24814. cfg.plat = MoyuPlat.web;
  24815. cfg.myId = 180;
  24816. cfg.myKey = '8848a885774230a4';
  24817. cfg.version = 0;
  24818. if (window.hasOwnProperty("gamebox")) {
  24819. cfg.plat = MoyuPlat.f399;
  24820. cfg.version = 0;
  24821. }
  24822. else if (window.hasOwnProperty("ks")) {
  24823. cfg.plat = MoyuPlat.ks;
  24824. cfg.version = 0;
  24825. cfg.ads.ksVideoId = '2300002254_01';
  24826. cfg.ads.ksInsertId = '2300002254_02';
  24827. }
  24828. else if (Laya.Browser.onTTMiniGame) {
  24829. cfg.plat = MoyuPlat.tt;
  24830. cfg.version = 0;
  24831. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  24832. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  24833. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  24834. }
  24835. else if (Laya.Browser.onMiniGame) {
  24836. cfg.plat = MoyuPlat.wx;
  24837. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  24838. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  24839. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  24840. }
  24841. else if (Laya.Browser.onQQMiniGame) {
  24842. cfg.plat = MoyuPlat.qq;
  24843. }
  24844. else if (Laya.Browser.onQGMiniGame) {
  24845. cfg.plat = MoyuPlat.op;
  24846. cfg.ads.opVideoId = '455502';
  24847. cfg.ads.opBannerId = '455507';
  24848. }
  24849. else if (Laya.Browser.onVVMiniGame) {
  24850. cfg.plat = MoyuPlat.vv;
  24851. cfg.version = 0;
  24852. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  24853. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  24854. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  24855. }
  24856. else if (Laya.Browser.onHWMiniGame) {
  24857. cfg.plat = MoyuPlat.hw;
  24858. }
  24859. else if (window["mz"]) {
  24860. cfg.plat = MoyuPlat.mz;
  24861. }
  24862. else {
  24863. let cfg = window['conchConfig'];
  24864. if (cfg) {
  24865. var os = cfg.getOS();
  24866. if (os == "Conch-ios") {
  24867. cfg.plat = MoyuPlat.ios;
  24868. }
  24869. else if (os == "Conch-android") {
  24870. }
  24871. }
  24872. }
  24873. return cfg;
  24874. }
  24875. class Main {
  24876. constructor() {
  24877. if (window["Laya3D"])
  24878. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  24879. else {
  24880. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  24881. this.initMain();
  24882. }
  24883. }
  24884. initMain() {
  24885. Laya["Physics"] && Laya["Physics"].enable();
  24886. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  24887. Laya.stage.scaleMode = GameConfig.scaleMode;
  24888. Laya.stage.screenMode = GameConfig.screenMode;
  24889. Laya.stage.alignV = GameConfig.alignV;
  24890. Laya.stage.alignH = GameConfig.alignH;
  24891. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  24892. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  24893. Laya.enableDebugPanel();
  24894. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  24895. Laya["PhysicsDebugDraw"].enable();
  24896. if (GameConfig.stat)
  24897. Laya.Stat.show();
  24898. Laya.alertGlobalError(true);
  24899. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  24900. }
  24901. onVersionLoaded() {
  24902. appInit();
  24903. }
  24904. }
  24905. new Main();
  24906. }());
  24907. //# sourceMappingURL=bundle.js.map