bundle.js 983 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let LOGIN_OUT = "LOGIN_OUT";
  52. let LOGIN_IN = "LOGIN_IN";
  53. let keyForLoginInfo = "userInfo";
  54. let TIP_MSG_key = {
  55. loginTimeOut: "Login timed out, please log in again.",
  56. pleaseLoginIn: "Please log in."
  57. };
  58. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  59. let poolKey = {
  60. inHoleEft: "inHoleEft",
  61. d3ball: "d3ball",
  62. iceEft: "iceEft",
  63. hitEft: "hitEft",
  64. fireworksEft: "fireworksEft",
  65. };
  66. var GameMode;
  67. (function (GameMode) {
  68. GameMode[GameMode["classic"] = 0] = "classic";
  69. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  70. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  71. })(GameMode || (GameMode = {}));
  72. var SkillType;
  73. (function (SkillType) {
  74. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  75. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  76. SkillType[SkillType["ice"] = 2] = "ice";
  77. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  78. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  79. })(SkillType || (SkillType = {}));
  80. var ClassicWordsType;
  81. (function (ClassicWordsType) {
  82. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  83. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  84. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  85. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  86. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  87. })(ClassicWordsType || (ClassicWordsType = {}));
  88. var PressType;
  89. (function (PressType) {
  90. PressType[PressType["powerNode"] = 0] = "powerNode";
  91. PressType[PressType["d2Root"] = 1] = "d2Root";
  92. PressType[PressType["moveNode"] = 2] = "moveNode";
  93. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  94. })(PressType || (PressType = {}));
  95. var PlaceBallType;
  96. (function (PlaceBallType) {
  97. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  98. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  99. })(PlaceBallType || (PlaceBallType = {}));
  100. var EAdType;
  101. (function (EAdType) {
  102. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  103. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  104. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  105. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  106. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  107. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  108. EAdType[EAdType["sign"] = 6] = "sign";
  109. EAdType[EAdType["draw"] = 7] = "draw";
  110. EAdType[EAdType["triple"] = 8] = "triple";
  111. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  112. EAdType[EAdType["getPower"] = 10] = "getPower";
  113. EAdType[EAdType["box"] = 11] = "box";
  114. EAdType[EAdType["try"] = 12] = "try";
  115. EAdType[EAdType["againSign"] = 13] = "againSign";
  116. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  117. })(EAdType || (EAdType = {}));
  118. var Prop;
  119. (function (Prop) {
  120. Prop[Prop["diamond"] = 1] = "diamond";
  121. Prop[Prop["coin"] = 2] = "coin";
  122. Prop[Prop["gan1"] = 3] = "gan1";
  123. Prop[Prop["gan2"] = 4] = "gan2";
  124. Prop[Prop["gan3"] = 5] = "gan3";
  125. Prop[Prop["gan4"] = 6] = "gan4";
  126. })(Prop || (Prop = {}));
  127. var TipsType;
  128. (function (TipsType) {
  129. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  130. TipsType[TipsType["foul"] = 1] = "foul";
  131. })(TipsType || (TipsType = {}));
  132. class AwardType {
  133. constructor(type, num) {
  134. this.type = type;
  135. this.num = num;
  136. }
  137. }
  138. var define = /*#__PURE__*/Object.freeze({
  139. fguiRes: fguiRes,
  140. ballCamp: ballCamp,
  141. FoulType: FoulType,
  142. ALL_BALL_STOP: ALL_BALL_STOP,
  143. WAIT_SHOOT: WAIT_SHOOT,
  144. D3RES_LOADED: D3RES_LOADED,
  145. BALL_SHOOT: BALL_SHOOT,
  146. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  147. RESET_GAME: RESET_GAME,
  148. COIN_CHANGE: COIN_CHANGE,
  149. DIAMOND_CHANGE: DIAMOND_CHANGE,
  150. RESTART_GAME: RESTART_GAME,
  151. GET_USER_INFO: GET_USER_INFO,
  152. CHANGE_SECRETARY: CHANGE_SECRETARY,
  153. POWER_CHANGE: POWER_CHANGE,
  154. POWER_TIME: POWER_TIME,
  155. LOGIN_OUT: LOGIN_OUT,
  156. LOGIN_IN: LOGIN_IN,
  157. keyForLoginInfo: keyForLoginInfo,
  158. TIP_MSG_key: TIP_MSG_key,
  159. baseHeadUrl: baseHeadUrl,
  160. poolKey: poolKey,
  161. get GameMode () { return GameMode; },
  162. get SkillType () { return SkillType; },
  163. get ClassicWordsType () { return ClassicWordsType; },
  164. get PressType () { return PressType; },
  165. get PlaceBallType () { return PlaceBallType; },
  166. get EAdType () { return EAdType; },
  167. get Prop () { return Prop; },
  168. get TipsType () { return TipsType; },
  169. AwardType: AwardType
  170. });
  171. class CContext {
  172. constructor() {
  173. this.winSize = { width: 0, height: 0 };
  174. this.notchHeight = 0;
  175. this.bannerHeight = 0;
  176. }
  177. init(resList, callback) {
  178. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  179. this.notchHeight = this.getNotchHeight();
  180. this.bannerHeight = this.getBannerHeight();
  181. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  182. callback && callback();
  183. }));
  184. }
  185. getNotchHeight() {
  186. let notchHeight = 50;
  187. if (Laya.Browser.onMiniGame) {
  188. let deviceInfo = wx.getSystemInfoSync();
  189. if (Laya.Browser.onIOS) {
  190. if (deviceInfo.model.search('iPhone X') != -1) {
  191. notchHeight = deviceInfo.statusBarHeight - 10;
  192. }
  193. else {
  194. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  195. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  196. notchHeight = deviceInfo.statusBarHeight - 10;
  197. }
  198. }
  199. }
  200. else if (Laya.Browser.onAndroid) {
  201. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  202. notchHeight = deviceInfo.statusBarHeight;
  203. }
  204. }
  205. }
  206. return notchHeight;
  207. }
  208. getBannerHeight() {
  209. return 0;
  210. }
  211. }
  212. let context = new CContext();
  213. var Handler = Laya.Handler;
  214. var Tween = Laya.Tween;
  215. function playClickEffect(btn) {
  216. if (!btn)
  217. return;
  218. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  219. if (!btn)
  220. return;
  221. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  222. if (!btn)
  223. return;
  224. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  225. }), 0, true);
  226. }), 0, true);
  227. }
  228. function getNumList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split(',');
  233. for (var v in array) {
  234. dataList.push(Number(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getStrList(strList) {
  240. let dataList = [];
  241. if (strList) {
  242. let list = strList;
  243. let array = list.split('|');
  244. for (var v in array) {
  245. dataList.push(String(array[v]));
  246. }
  247. }
  248. return dataList;
  249. }
  250. function getRandStr(len) {
  251. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  252. let str = "";
  253. for (let i = 0; i < len; i++) {
  254. let rand = random(0, list.length);
  255. str += list[rand];
  256. }
  257. return str;
  258. }
  259. function getUserId() {
  260. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  261. return str;
  262. }
  263. function formatPos(pos, len = 2) {
  264. let v = Math.pow(10, len);
  265. pos.x = Math.floor(pos.x * v) / v;
  266. pos.y = Math.floor(pos.y * v) / v;
  267. if (pos.z)
  268. pos.z = Math.floor(pos.z * v) / v;
  269. return pos;
  270. }
  271. function setPosInt(pos) {
  272. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  273. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  274. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  275. return pos;
  276. }
  277. function random(min, max) {
  278. var rang = max - min;
  279. var rand = Math.random() * rang;
  280. return Math.floor(rand) + min;
  281. }
  282. function randomList(list, num) {
  283. if (list.length <= num)
  284. return list;
  285. let arry = [];
  286. list.forEach(item => {
  287. arry.push(item);
  288. });
  289. let nums = [];
  290. for (let i = 0; i < num; i++) {
  291. let rand = random(0, arry.length);
  292. let v = arry[rand];
  293. nums.push(v);
  294. arry.splice(rand, 1);
  295. }
  296. return nums;
  297. }
  298. function worldToScreen(camera, point, pos) {
  299. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  300. pos.x = pos.x / Laya.stage.clientScaleX;
  301. pos.y = pos.y / Laya.stage.clientScaleY;
  302. }
  303. function getStringLenght(str) {
  304. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. function reviseString(str, len) {
  307. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  308. if (ld > len) {
  309. let sl = Math.floor(len / 2);
  310. let rs = str.substring(0, sl);
  311. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  312. while (d + 2 < len) {
  313. sl++;
  314. rs = str.substring(0, sl);
  315. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  316. }
  317. return rs + "...";
  318. }
  319. return str;
  320. }
  321. function getCoinString(coin) {
  322. if (coin < 10000)
  323. return coin.toString();
  324. else if (coin < 1000000) {
  325. let vh = Math.ceil(coin / 100);
  326. return (vh / 10) + "k";
  327. }
  328. else if (coin < 1000000000) {
  329. var vh = Math.ceil(coin / 100000);
  330. return (vh / 10) + "m";
  331. }
  332. else if (coin < 1000000000000) {
  333. var vh = Math.ceil(coin / 100000000);
  334. return (vh / 10) + "b";
  335. }
  336. else if (coin < 1000000000000000) {
  337. var vh = Math.ceil(coin / 100000000000);
  338. return (vh / 10) + "t";
  339. }
  340. }
  341. function getV3Dest(pos, dir, dis, dest) {
  342. dir.x *= dis;
  343. dir.y *= dis;
  344. dir.z *= dis;
  345. Laya.Vector3.add(pos, dir, dest);
  346. return dest;
  347. }
  348. function getV2Dest(x1, y1, dir, dis, dest) {
  349. dest.x = x1 + dir.x * dis;
  350. dest.y = y1 + dir.y * dis;
  351. return dest;
  352. }
  353. function getV2Dir(x1, y1, x2, y2, dir) {
  354. dir.x = x2 - x1;
  355. dir.y = y2 - y1;
  356. Laya.Vector2.normalize(dir, dir);
  357. return dir;
  358. }
  359. function getV3Dir(p1, p2, dir) {
  360. Laya.Vector3.subtract(p1, p2, dir);
  361. Laya.Vector3.normalize(dir, dir);
  362. return dir;
  363. }
  364. function copyPos(ip, op) {
  365. op.x = ip.x;
  366. op.y = ip.y;
  367. if (ip.z)
  368. op.z = ip.z;
  369. return op;
  370. }
  371. function getScreenImg() {
  372. let gl = Laya.WebGLContext.mainContext;
  373. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  374. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  375. let w = gl.drawingBufferWidth;
  376. let h = gl.drawingBufferHeight;
  377. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  378. texture2d.setPixels(pixels);
  379. return new Laya.Texture(texture2d);
  380. }
  381. function playMoveByPositions(sp, positions, v, completeCallback) {
  382. let p;
  383. let play = () => {
  384. if (positions.length == 0) {
  385. completeCallback();
  386. return;
  387. }
  388. p = positions[0];
  389. positions.splice(0, 1);
  390. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  391. play();
  392. }));
  393. };
  394. play();
  395. }
  396. function setStarPos(node, num, max) {
  397. for (let i = 1; i <= 5; i++) {
  398. let img = node.getChildAt(i - 1);
  399. img.width = img.height = 30;
  400. img.pivotX = img.pivotY = 0.5;
  401. img.gray = i > num;
  402. img.visible = i <= max;
  403. if (max == 3) {
  404. img.x = node.width / 2 + (i - 2) * 30 - 15;
  405. img.y = node.height - 40;
  406. if (i == 2)
  407. img.y = node.height - 30;
  408. }
  409. else if (max == 5) {
  410. let ly = Math.abs(i - 3);
  411. img.x = node.width / 2 + (i - 3) * 20 - 15;
  412. img.y = node.height - ly * 8 - 30;
  413. }
  414. }
  415. }
  416. function playLoopAnimRotate(sp, time, clockwise = true) {
  417. let rotation;
  418. sp.rotation = sp.rotation % 360;
  419. if (clockwise) {
  420. rotation = -360;
  421. }
  422. else {
  423. rotation = 360;
  424. }
  425. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  426. this.playLoopAnimRotate(sp, time, clockwise);
  427. }));
  428. }
  429. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  430. let x, y;
  431. if (isBig) {
  432. x = valueXMin;
  433. y = valueYMin;
  434. }
  435. else {
  436. x = valueXMax;
  437. y = valueYMax;
  438. }
  439. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  440. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  441. }));
  442. }
  443. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  444. let scale;
  445. if (isBig) {
  446. scale = valueMin;
  447. }
  448. else {
  449. scale = valueMax;
  450. }
  451. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  452. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  453. }));
  454. }
  455. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  456. let value;
  457. if (isBig) {
  458. value = valueMin;
  459. }
  460. else {
  461. value = valueMax;
  462. }
  463. if (count) {
  464. count--;
  465. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  466. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  467. }));
  468. }
  469. else {
  470. sp.rotation = 0;
  471. }
  472. }
  473. function inRect(rect, p) {
  474. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  475. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  476. return true;
  477. }
  478. }
  479. return false;
  480. }
  481. function getNumberK(number) {
  482. if (number < 1000) {
  483. return number.toString();
  484. }
  485. else {
  486. return (number / 1000).toFixed(1) + "k";
  487. }
  488. }
  489. function pointInsideCircle(point, circle, r) {
  490. if (r === 0)
  491. return false;
  492. var dx = circle.x - point.x;
  493. var dy = circle.y - point.y;
  494. return dx * dx + dy * dy <= r * r;
  495. }
  496. function formatString(str, data) {
  497. if (!str || data == undefined) {
  498. return str;
  499. }
  500. if (typeof data === "object") {
  501. for (var key in data) {
  502. if (data.hasOwnProperty(key)) {
  503. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  504. }
  505. }
  506. }
  507. else {
  508. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  509. return str.replace(reg, function (match, index) {
  510. return args[index - (-1)];
  511. });
  512. }
  513. return str;
  514. }
  515. function getIntersection(a, b) {
  516. let t = [];
  517. for (var i = 0; i < a.length; i++) {
  518. for (var j = 0; j < b.length; j++) {
  519. if (a[i] == b[j]) {
  520. t.push(a[i]);
  521. }
  522. }
  523. }
  524. return t;
  525. }
  526. function getComplement(a, b) {
  527. let t = [];
  528. let count = false;
  529. for (var i = 0; i < a.length; i++) {
  530. count = false;
  531. for (var j = 0; j < b.length; j++) {
  532. if (a[i] == b[j]) {
  533. count = true;
  534. break;
  535. }
  536. }
  537. if (!count) {
  538. t.push(a[i]);
  539. }
  540. }
  541. return t;
  542. }
  543. function geSpriteStageRect(sp) {
  544. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  545. let rect = {
  546. x: point.x,
  547. y: point.y,
  548. width: sp.width * sp.globalScaleX,
  549. height: sp.height * sp.globalScaleY
  550. };
  551. return rect;
  552. }
  553. function touchButton(button) {
  554. let event = new Laya.Event();
  555. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  556. }
  557. function setColor(sprite, r, g, b) {
  558. var redMat = [
  559. r / 255, 0, 0, 0, 0,
  560. g / 255, 0, 0, 0, 0,
  561. b / 255, 0, 0, 0, 0,
  562. 0, 0, 0, 1, 0,
  563. ];
  564. var filter = new Laya.ColorFilter(redMat);
  565. sprite.filters = [filter];
  566. }
  567. function clone(obj, newobj = {}) {
  568. for (var attr in obj) {
  569. if (typeof obj[attr] == "object") {
  570. newobj[attr] = clone(obj[attr], newobj[attr]);
  571. }
  572. else {
  573. newobj[attr] = obj[attr];
  574. }
  575. }
  576. return newobj;
  577. }
  578. function _ms(arr, compare, begin, end) {
  579. const size = end - begin;
  580. if (size <= 1) {
  581. return;
  582. }
  583. const middle = (end + begin) >> 1;
  584. _ms(arr, compare, begin, middle);
  585. _ms(arr, compare, middle, end);
  586. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  587. return;
  588. }
  589. const merged = [];
  590. let leftIndex = begin, rightIndex = middle;
  591. while (merged.length < size) {
  592. if (leftIndex === middle) {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. else if (rightIndex === end) {
  596. merged.push(arr[leftIndex++]);
  597. }
  598. else {
  599. const c = compare(arr[leftIndex], arr[rightIndex]);
  600. if (c <= 0) {
  601. merged.push(arr[leftIndex++]);
  602. }
  603. else {
  604. merged.push(arr[rightIndex++]);
  605. }
  606. }
  607. }
  608. arr.splice(begin, size, ...merged);
  609. }
  610. function sort(arr, compare) {
  611. if (!Array.isArray(arr)) {
  612. throw new Error('sort的参数必须为数组');
  613. }
  614. _ms(arr, compare, 0, arr.length);
  615. return arr;
  616. }
  617. function getLanguage(id) {
  618. }
  619. function getLanguageByTip(id) {
  620. }
  621. function toWeights(array) {
  622. let max = 0;
  623. for (var i = 0; i < array.length; i++) {
  624. max = max + array[i];
  625. if (array[i] == 0) {
  626. array[i] = 0;
  627. }
  628. else {
  629. array[i] = max;
  630. }
  631. }
  632. return array;
  633. }
  634. function unique(array) {
  635. var n = {}, r = [], len = array.length, val, type;
  636. for (var i = 0; i < array.length; i++) {
  637. val = array[i];
  638. type = typeof val;
  639. if (!n[val]) {
  640. n[val] = [type];
  641. r.push(val);
  642. }
  643. else if (n[val].indexOf(type) < 0) {
  644. n[val].push(type);
  645. r.push(val);
  646. }
  647. }
  648. return r;
  649. }
  650. function unique1(array) {
  651. var r = [];
  652. for (var i = 0, l = array.length; i < l; i++) {
  653. for (var j = i + 1; j < l; j++)
  654. if (array[i] == array[j])
  655. j == ++i;
  656. r.push(array[i]);
  657. }
  658. return r;
  659. }
  660. function getDistance(x1, y1, x2, y2) {
  661. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  662. }
  663. function getV2Dis(pos1, pos2) {
  664. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  665. }
  666. function getV2SqDis(pos1, pos2) {
  667. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  668. }
  669. function getDis(x1, y1, x2, y2) {
  670. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  671. }
  672. function getDeltaxy(x1, y1, x2, y2) {
  673. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  674. }
  675. function getSymbolNumber(num) {
  676. if (num > 0) {
  677. return "+" + num;
  678. }
  679. else if (num < 0) {
  680. return num.toString();
  681. }
  682. return num.toString();
  683. }
  684. function fixNumber(num, length) {
  685. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  686. }
  687. function toThousands(num) {
  688. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  689. }
  690. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  691. function fmtMoney(money) {
  692. money = toThousands(money.replace(/^0+/, ''));
  693. if (money.length == 0) {
  694. money = "0";
  695. }
  696. let unit = 0;
  697. for (var i = 0; i < money.length; i++) {
  698. if (money.charAt(i) == ",") {
  699. unit++;
  700. }
  701. }
  702. if (unit == 0) {
  703. return money;
  704. }
  705. else {
  706. let idx = money.indexOf(",");
  707. if (idx) {
  708. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  709. }
  710. return money.replace(",", ".");
  711. }
  712. }
  713. function flatten(arr) {
  714. while (arr.some(item => Array.isArray(item))) {
  715. arr = [].concat(...arr);
  716. }
  717. return arr;
  718. }
  719. function getDistanceByPoint(p1, p2) {
  720. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  721. }
  722. function getAngleByPoint(p1, p2) {
  723. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  724. }
  725. function toIntByArray(array) {
  726. for (var index = 0; index < array.length; index++) {
  727. array[index] = parseInt(array[index]);
  728. }
  729. return array;
  730. }
  731. function getAngle0To360(angle) {
  732. while (angle < 0) {
  733. angle += 360;
  734. }
  735. while (angle >= 360) {
  736. angle -= 360;
  737. }
  738. return angle;
  739. }
  740. function toAngle(radian) {
  741. return radian * 180 / Math.PI;
  742. }
  743. function toRadian(angle) {
  744. return angle * Math.PI / 180;
  745. }
  746. function getArrayValueRandom(array) {
  747. return array[random(0, array.length - 1)];
  748. }
  749. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  750. }
  751. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  752. }
  753. function fmtTimeMMSS(time) {
  754. if (time < 0) {
  755. time = 0;
  756. }
  757. else
  758. time = Math.floor(time);
  759. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  760. }
  761. function fmtTimeMS(time) {
  762. if (time < 0) {
  763. time = 0;
  764. }
  765. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  766. }
  767. function fmtTimeHHMM(time) {
  768. if (time < 0) {
  769. time = 0;
  770. }
  771. time = Math.floor(time / 1000);
  772. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  773. }
  774. let severTime = 0;
  775. function getServerTime() {
  776. return new Date(new Date().getTime() - severTime);
  777. }
  778. function setServerTime(data) {
  779. severTime = (new Date().getTime() - data);
  780. }
  781. var tools = /*#__PURE__*/Object.freeze({
  782. playClickEffect: playClickEffect,
  783. getNumList: getNumList,
  784. getStrList: getStrList,
  785. getRandStr: getRandStr,
  786. getUserId: getUserId,
  787. formatPos: formatPos,
  788. setPosInt: setPosInt,
  789. random: random,
  790. randomList: randomList,
  791. worldToScreen: worldToScreen,
  792. getStringLenght: getStringLenght,
  793. reviseString: reviseString,
  794. getCoinString: getCoinString,
  795. getV3Dest: getV3Dest,
  796. getV2Dest: getV2Dest,
  797. getV2Dir: getV2Dir,
  798. getV3Dir: getV3Dir,
  799. copyPos: copyPos,
  800. getScreenImg: getScreenImg,
  801. playMoveByPositions: playMoveByPositions,
  802. setStarPos: setStarPos,
  803. playLoopAnimRotate: playLoopAnimRotate,
  804. playLoopAnimPosition: playLoopAnimPosition,
  805. playLoopAnimScale: playLoopAnimScale,
  806. playLoopAnimRotation: playLoopAnimRotation,
  807. inRect: inRect,
  808. getNumberK: getNumberK,
  809. pointInsideCircle: pointInsideCircle,
  810. formatString: formatString,
  811. getIntersection: getIntersection,
  812. getComplement: getComplement,
  813. geSpriteStageRect: geSpriteStageRect,
  814. touchButton: touchButton,
  815. setColor: setColor,
  816. clone: clone,
  817. sort: sort,
  818. getLanguage: getLanguage,
  819. getLanguageByTip: getLanguageByTip,
  820. toWeights: toWeights,
  821. unique: unique,
  822. unique1: unique1,
  823. getDistance: getDistance,
  824. getV2Dis: getV2Dis,
  825. getV2SqDis: getV2SqDis,
  826. getDis: getDis,
  827. getDeltaxy: getDeltaxy,
  828. getSymbolNumber: getSymbolNumber,
  829. fixNumber: fixNumber,
  830. toThousands: toThousands,
  831. fmtMoney: fmtMoney,
  832. flatten: flatten,
  833. getDistanceByPoint: getDistanceByPoint,
  834. getAngleByPoint: getAngleByPoint,
  835. toIntByArray: toIntByArray,
  836. getAngle0To360: getAngle0To360,
  837. toAngle: toAngle,
  838. toRadian: toRadian,
  839. getArrayValueRandom: getArrayValueRandom,
  840. promptByTip: promptByTip,
  841. promptByErrorCode: promptByErrorCode,
  842. fmtTimeMMSS: fmtTimeMMSS,
  843. fmtTimeMS: fmtTimeMS,
  844. fmtTimeHHMM: fmtTimeHHMM,
  845. getServerTime: getServerTime,
  846. setServerTime: setServerTime
  847. });
  848. class HttpMgr {
  849. constructor() {
  850. this.isDev = true;
  851. HttpMgr._instance = this;
  852. }
  853. static getInstance() {
  854. if (!this._instance) {
  855. this._instance = new HttpMgr();
  856. }
  857. return this._instance;
  858. }
  859. sendPost(url, data, call) {
  860. let httpObj = new Laya.HttpRequest();
  861. httpObj.http.timeout = 5000;
  862. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  863. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  864. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  865. function errorHandler(error) {
  866. console.log("errorHandler:" + error);
  867. alert("Please check your network connection.");
  868. }
  869. function completeHandler(data) {
  870. if (data && data.length > 0) {
  871. let jsonData = JSON.parse(data);
  872. if (call)
  873. call(jsonData);
  874. }
  875. }
  876. }
  877. getReqData() {
  878. let reqData = JSON.stringify({
  879. gameName: "TQ",
  880. gameUserName: "zhangSan",
  881. isDev: this.isDev
  882. });
  883. return reqData;
  884. }
  885. sendPost2025(reqUrl, data, call) {
  886. let isDev = this.isDev;
  887. let urlTop = "https://api.kessongame.site/";
  888. let urlMid = urlTop + "prod-api/api/";
  889. if (isDev) {
  890. urlTop = "http://192.168.1.13:8090/";
  891. urlMid = urlTop + "api/";
  892. console.log('zh:TEST环境');
  893. }
  894. else {
  895. console.log('zh:SC环境');
  896. }
  897. let url = urlMid + reqUrl;
  898. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  899. if (isDev) {
  900. url = urlTop + reqUrl;
  901. }
  902. else {
  903. url = urlTop + "prod-api/" + reqUrl;
  904. }
  905. }
  906. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  907. if (reqUrl.indexOf("/api/game/") >= 0) {
  908. }
  909. const keyForLoginInfo = "userInfo";
  910. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  911. if (userInfoData != null) {
  912. try {
  913. let bb = JSON.parse(userInfoData);
  914. if (bb) {
  915. let token = bb.token;
  916. headers.push("Authorization");
  917. headers.push(`Bearer ${token}`);
  918. }
  919. }
  920. catch (e) {
  921. }
  922. }
  923. let httpObj = new Laya.HttpRequest();
  924. httpObj.http.timeout = 5000;
  925. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  926. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  927. httpObj.send(url, data, 'post', 'text', headers);
  928. function errorHandler(error) {
  929. if (call) {
  930. call("{'msg':'Network exception','code':500}");
  931. }
  932. else {
  933. alert("Tip:Please check your network connection.");
  934. }
  935. }
  936. function completeHandler(data) {
  937. if (data && data.length > 0) {
  938. let jsonData = JSON.parse(data);
  939. if (call)
  940. call(jsonData);
  941. }
  942. }
  943. }
  944. sendGet(url, call) {
  945. let httpObj = new Laya.HttpRequest();
  946. httpObj.http.timeout = 5000;
  947. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  948. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  949. httpObj.send(url, '', 'get');
  950. function errorHandler(error) {
  951. console.log("errorHandler:" + error);
  952. }
  953. function completeHandler(data) {
  954. if (data && data.length > 0) {
  955. if (call)
  956. call(data);
  957. }
  958. }
  959. }
  960. }
  961. HttpMgr._instance = null;
  962. class LightShader extends Laya.Sprite {
  963. constructor() {
  964. super();
  965. this._time = 0;
  966. this._sin = 0;
  967. this.initShader();
  968. }
  969. initShader() {
  970. var vs = `
  971. #define FSHIGHPRECISION
  972. attribute vec4 posuv;
  973. uniform vec2 size;
  974. varying vec4 v_texcoord;
  975. void main() {
  976. vec4 pos = vec4(posuv.xy,0.,1.);
  977. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  978. gl_Position=pos1;
  979. v_texcoord.xy = posuv.xy;
  980. }
  981. `;
  982. var ps = `
  983. #define FSHIGHPRECISION
  984. precision highp float;
  985. varying vec4 v_texcoord;
  986. uniform vec2 size;
  987. uniform sampler2D texture;
  988. uniform float u_Time;
  989. void main() {
  990. vec4 color= texture2D(texture, v_texcoord.xy);
  991. float width = 0.2;
  992. float start = u_Time;
  993. float offset = 1.0;
  994. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  995. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  996. {
  997. color.r=1.1;
  998. color.g=1.1;
  999. color.b=1.1;
  1000. gl_FragColor = color;
  1001. } else {
  1002. gl_FragColor = color;
  1003. }
  1004. }
  1005. `;
  1006. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  1007. this.customRenderEnable = true;
  1008. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1009. }
  1010. customRender(context, x, y) {
  1011. this.onUpdate();
  1012. if (!this.texture)
  1013. return;
  1014. let xx = x - this.pivotX;
  1015. let yy = y - this.pivotY;
  1016. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1017. }
  1018. onUpdate() {
  1019. this._time += 2 * Laya.timer.delta * 0.001;
  1020. this._sin = Math.sin(this._time);
  1021. if (this._sin > 0.99) {
  1022. this._sin = 0;
  1023. this._time = 0;
  1024. }
  1025. this.shaderValue['u_Time'] = this._sin;
  1026. }
  1027. }
  1028. LightShader.DissolveSurfaceSaveName = 9997;
  1029. class UIBase extends fairygui.Window {
  1030. constructor() {
  1031. super();
  1032. this.isEject = true;
  1033. this.isHide = true;
  1034. this.showbanner = true;
  1035. this.className = "";
  1036. this.isMuti = false;
  1037. this.showbanner = false;
  1038. this.onConstructor();
  1039. }
  1040. checkActive(show) {
  1041. }
  1042. getUIName() {
  1043. return UIBase.uiName;
  1044. }
  1045. onConstructor() {
  1046. try {
  1047. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoadedForBase));
  1048. console.log("zh: base加载arial字体成功");
  1049. }
  1050. catch (error) {
  1051. console.log("zh: base加载arial字体失败");
  1052. }
  1053. }
  1054. onFontLoadedForBase() {
  1055. try {
  1056. Laya.Text.defaultFont = "arial";
  1057. console.log("zh: base 设置arial字体成功");
  1058. }
  1059. catch (error) {
  1060. console.log("zh: base 设置arial字体失败");
  1061. }
  1062. }
  1063. onInit() {
  1064. if (!!this.contentPane) {
  1065. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1066. }
  1067. this.setPivot(0.5, 0.5, false);
  1068. }
  1069. doShowAnimation() {
  1070. if (!this.isEject)
  1071. return;
  1072. super.doShowAnimation();
  1073. Laya.Tween.clearTween(this);
  1074. this.scaleX = this.scaleY = 0.8;
  1075. let tweenFunc1 = (func) => {
  1076. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1077. };
  1078. let tweenFunc2 = (func) => {
  1079. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1080. };
  1081. tweenFunc1(tweenFunc2);
  1082. }
  1083. show(...args) {
  1084. super.show();
  1085. this._openParam = args;
  1086. this.isHide = false;
  1087. xGame.uiMgr.checkUIState();
  1088. }
  1089. moveBannerButton() {
  1090. }
  1091. showBannerButton() {
  1092. this.bannerButton.visible = true;
  1093. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1094. this.bannerButton.touchable = true;
  1095. }));
  1096. }
  1097. hide() {
  1098. super.hide();
  1099. this.isHide = true;
  1100. xGame.uiMgr.checkUIState();
  1101. }
  1102. Dispose() {
  1103. super.dispose();
  1104. }
  1105. myUpdate(delay) {
  1106. }
  1107. refresh() { }
  1108. setGlobalFont(root) {
  1109. try {
  1110. console.log('zh: setGlobalFont start');
  1111. let fontName = "arial";
  1112. const setFont = (obj) => {
  1113. if (obj instanceof fairygui.GTextField) {
  1114. obj.font = fontName;
  1115. }
  1116. if (obj instanceof fairygui.GComponent) {
  1117. for (let i = 0; i < obj.numChildren; i++) {
  1118. setFont(obj.getChildAt(i));
  1119. }
  1120. }
  1121. };
  1122. const rootNode = root || this.contentPane;
  1123. if (rootNode) {
  1124. setFont(rootNode);
  1125. }
  1126. }
  1127. catch (error) {
  1128. console.log('zh: setGlobalFont error=' + error);
  1129. }
  1130. finally {
  1131. console.log('zh: setGlobalFont end');
  1132. }
  1133. }
  1134. addUIClick(obj, func, arr = null) {
  1135. obj.onClick(this, func, arr);
  1136. obj.onClick(this, this.playBtnSound);
  1137. }
  1138. offUIClick(obj, func) {
  1139. obj.offClick(this, func);
  1140. }
  1141. playBtnSound() {
  1142. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1143. }
  1144. }
  1145. UIBase.lastShowBanner = 0;
  1146. UIBase.showBannerNum = 0;
  1147. UIBase.uiName = "";
  1148. class ui_UIDraw extends fgui.GComponent {
  1149. static createInstance() {
  1150. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1151. }
  1152. onConstruct() {
  1153. this.n_bj = (this.getChild("n_bj"));
  1154. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  1155. this.myNode = (this.getChild("myNode"));
  1156. this.extraNode = (this.getChild("extraNode"));
  1157. this.closeNode = (this.getChild("closeNode"));
  1158. this.moneyNode = (this.getChild("moneyNode"));
  1159. this.n38 = (this.getChild("n38"));
  1160. this.talkNode = (this.getChild("talkNode"));
  1161. this.secretary = (this.getChild("secretary"));
  1162. this.drawBtn = (this.getChild("drawBtn"));
  1163. this.t0 = this.getTransition("t0");
  1164. }
  1165. }
  1166. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1167. class ui_UIBox extends fgui.GComponent {
  1168. static createInstance() {
  1169. return (fgui.UIPackage.createObject("game", "UIBox"));
  1170. }
  1171. onConstruct() {
  1172. this.n0 = (this.getChild("n0"));
  1173. this.n12 = (this.getChild("n12"));
  1174. this.n1 = (this.getChild("n1"));
  1175. this.n2 = (this.getChild("n2"));
  1176. this.bar = (this.getChild("bar"));
  1177. this.closeBtn = (this.getChild("closeBtn"));
  1178. this.openBtn = (this.getChild("openBtn"));
  1179. this.t0 = this.getTransition("t0");
  1180. this.t1 = this.getTransition("t1");
  1181. }
  1182. }
  1183. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1184. class LocalStorageManager {
  1185. test1() {
  1186. LocalStorageManager.setItem("playerName", "Tom");
  1187. LocalStorageManager.setItem("playerLevel", 5);
  1188. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  1189. const name = LocalStorageManager.getItem("playerName");
  1190. const level = LocalStorageManager.getItem("playerLevel");
  1191. const data = LocalStorageManager.getItem("playerData");
  1192. console.log(name);
  1193. console.log(level);
  1194. console.log(data);
  1195. LocalStorageManager.removeItem("playerLevel");
  1196. }
  1197. static setItem(key, value) {
  1198. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  1199. }
  1200. static getItem(key) {
  1201. const data = Laya.LocalStorage.getItem(key);
  1202. if (data === null)
  1203. return null;
  1204. try {
  1205. return JSON.parse(data);
  1206. }
  1207. catch (e) {
  1208. return data;
  1209. }
  1210. }
  1211. static removeItem(key) {
  1212. Laya.LocalStorage.removeItem(key);
  1213. }
  1214. static clear() {
  1215. Laya.LocalStorage.clear();
  1216. }
  1217. static hasJosnKey(key) {
  1218. var value = Laya.LocalStorage.getJSON(key);
  1219. if (value != null) {
  1220. return true;
  1221. }
  1222. else {
  1223. return false;
  1224. }
  1225. }
  1226. static hasKey(key) {
  1227. return Laya.LocalStorage.getItem(key) !== null;
  1228. }
  1229. }
  1230. class GlobalManager {
  1231. constructor() {
  1232. }
  1233. registerMethod(name, method) {
  1234. console.log('zh: 注册全局方法', name);
  1235. this[name] = method;
  1236. }
  1237. callMethod(name, ...args) {
  1238. console.log('zh: 调用全局方法', name);
  1239. if (this[name]) {
  1240. return this[name](...args);
  1241. }
  1242. else {
  1243. console.error(`zh: 全局方法 Method ${name} not found`);
  1244. }
  1245. }
  1246. }
  1247. GlobalManager.instance = new GlobalManager();
  1248. class JSBridgeUtils {
  1249. constructor() { }
  1250. static get instance() {
  1251. if (!this._instance) {
  1252. this._instance = new JSBridgeUtils();
  1253. }
  1254. return this._instance;
  1255. }
  1256. initBridge() {
  1257. if (!Laya.Browser.onAndroid) {
  1258. console.log('zh:非android dev');
  1259. return;
  1260. }
  1261. let cfg = window['conchConfig'];
  1262. if (cfg) {
  1263. var os = cfg.getOS();
  1264. if (os == "Conch-android") {
  1265. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1266. if (this.bridge) {
  1267. return true;
  1268. }
  1269. else {
  1270. return false;
  1271. }
  1272. }
  1273. else {
  1274. return false;
  1275. }
  1276. }
  1277. else {
  1278. return false;
  1279. }
  1280. }
  1281. testAd1() {
  1282. if (!Laya.Browser.onAndroid) {
  1283. console.log('zh:非android dev');
  1284. return;
  1285. }
  1286. if (!this.initBridge()) {
  1287. return;
  1288. }
  1289. let rs = this.bridge.call("testString", "hello");
  1290. console.log('zh:testString rs=' + rs);
  1291. }
  1292. testAdCallBack() {
  1293. if (!this.initBridge()) {
  1294. return;
  1295. }
  1296. console.log("zh:testAdCallBack start");
  1297. const defaultObj = { code: 200, msg: "req update Ui" };
  1298. const reqObj = { code: 300, msg: "hello java ui" };
  1299. this.bridge.callWithBack((rsStr) => {
  1300. const rsObj = JSON.parse(rsStr);
  1301. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1302. }, "testAsyncCallback", JSON.stringify(reqObj));
  1303. }
  1304. showInternAd(mark) {
  1305. let boo1 = this.checkAdForUserOrderForSpid17(1);
  1306. if (boo1) {
  1307. console.log('zh: VIP SPID = 1,免除插页AD');
  1308. return false;
  1309. }
  1310. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1311. if (boo7) {
  1312. console.log('zh: VIP SPID = 7,免除任何AD');
  1313. return false;
  1314. }
  1315. console.log('zh:showInternAd start');
  1316. if (!Laya.Browser.onAndroid) {
  1317. console.log('zh:showInternAd 非android dev');
  1318. return false;
  1319. }
  1320. if (!this.initBridge()) {
  1321. return false;
  1322. }
  1323. let rs = this.bridge.call("showInternAd", mark);
  1324. try {
  1325. const result = JSON.parse(rs);
  1326. if (result.code === 200) {
  1327. console.log("zh:showInternAd OK");
  1328. return true;
  1329. }
  1330. else {
  1331. console.warn("zh:showInternAd FAILL:", result.msg);
  1332. return false;
  1333. }
  1334. }
  1335. catch (e) {
  1336. console.error("zh:解析桥接返回值失败:", e);
  1337. return false;
  1338. }
  1339. }
  1340. exitAndCloseGame() {
  1341. if (!Laya.Browser.onAndroid) {
  1342. return;
  1343. }
  1344. if (!this.initBridge()) {
  1345. return;
  1346. }
  1347. console.log('zh:开始关闭游戏-');
  1348. this.bridge.call("exitAndCloseGame");
  1349. }
  1350. checkAdForUserOrderForSpid17(spid) {
  1351. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  1352. if (userInfo != null) {
  1353. if (!userInfo.buySpids) {
  1354. userInfo.buySpids = { 1: false, 7: false };
  1355. }
  1356. else {
  1357. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  1358. }
  1359. let boo = userInfo.buySpids[spid];
  1360. if (!boo) {
  1361. console.log('zh:刷新一下用户的AD权利');
  1362. DataMgr.loadUserSpOrderForAd();
  1363. }
  1364. console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
  1365. return boo;
  1366. }
  1367. return false;
  1368. }
  1369. showRewardAd(mark) {
  1370. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1371. if (boo7) {
  1372. console.log('zh: VIP SPID = 7,免除任何AD');
  1373. return false;
  1374. }
  1375. if (!Laya.Browser.onAndroid) {
  1376. return false;
  1377. }
  1378. if (!this.initBridge()) {
  1379. return false;
  1380. }
  1381. let rs = this.bridge.call("showRewardAd", mark);
  1382. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1383. try {
  1384. const result = JSON.parse(rs);
  1385. if (result.code === 200) {
  1386. console.log("zh:广告显示成功");
  1387. return true;
  1388. }
  1389. else {
  1390. console.warn("zh:广告显示失败:", result.msg);
  1391. return false;
  1392. }
  1393. }
  1394. catch (e) {
  1395. console.error("zh:解析桥接返回值失败:", e);
  1396. return false;
  1397. }
  1398. }
  1399. logEventForAdNoParams(eventName) {
  1400. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1401. if (!Laya.Browser.onAndroid) {
  1402. return;
  1403. }
  1404. if (!this.initBridge()) {
  1405. return;
  1406. }
  1407. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1408. this.bridge.call("logEventForAdNoParams", eventName);
  1409. }
  1410. logEventForAdHaveParams(eventName, jsonStr) {
  1411. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1412. if (!Laya.Browser.onAndroid) {
  1413. return;
  1414. }
  1415. if (!this.initBridge()) {
  1416. return;
  1417. }
  1418. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1419. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1420. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1421. }
  1422. logEventForFirebase(eventName, jsonStr) {
  1423. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1424. if (!Laya.Browser.onAndroid) {
  1425. return;
  1426. }
  1427. if (!this.initBridge()) {
  1428. return;
  1429. }
  1430. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1431. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1432. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1433. }
  1434. testNetTip() {
  1435. if (Laya.Browser.onAndroid) {
  1436. let boo = this.getNetworkAvailable();
  1437. this.showToast2("Network error, reward unavailable");
  1438. return;
  1439. }
  1440. }
  1441. getNetworkAvailable() {
  1442. if (!Laya.Browser.onAndroid) {
  1443. return;
  1444. }
  1445. if (!this.initBridge()) {
  1446. return;
  1447. }
  1448. let boo = this.bridge.call("getNetworkAvailable");
  1449. console.log("zh:getNetworkAvailable boo=" + boo);
  1450. return boo;
  1451. }
  1452. showToast2(msg) {
  1453. if (!Laya.Browser.onAndroid) {
  1454. return;
  1455. }
  1456. if (!this.initBridge()) {
  1457. return;
  1458. }
  1459. this.bridge.call("showToast2", msg);
  1460. }
  1461. showConfirmationDialogForExit(title, msg) {
  1462. if (!Laya.Browser.onAndroid) {
  1463. return;
  1464. }
  1465. if (!this.initBridge()) {
  1466. return;
  1467. }
  1468. this.bridge.call("showConfirmationDialogForExit", title, msg);
  1469. }
  1470. loginOutForApp() {
  1471. if (!Laya.Browser.onAndroid) {
  1472. return;
  1473. }
  1474. if (!this.initBridge()) {
  1475. return;
  1476. }
  1477. this.bridge.call("loginOutForApp");
  1478. }
  1479. startGgPay(token, ggSpid, spid) {
  1480. if (!Laya.Browser.onAndroid) {
  1481. return;
  1482. }
  1483. if (!this.initBridge()) {
  1484. return;
  1485. }
  1486. let jsonObj = {
  1487. token: token,
  1488. ggSpid: ggSpid,
  1489. spid: spid,
  1490. spsl: 1
  1491. };
  1492. let reqData = JSON.stringify(jsonObj);
  1493. console.log("zh:startGgPay ts reqData=" + reqData);
  1494. this.bridge.call("startGgPay", reqData);
  1495. }
  1496. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1497. if (!Laya.Browser.onAndroid) {
  1498. return;
  1499. }
  1500. if (!this.initBridge()) {
  1501. return;
  1502. }
  1503. let jsonObj = {
  1504. token: token,
  1505. ggSpid: ggSpid,
  1506. spid: spid,
  1507. spsl: 1
  1508. };
  1509. let reqData = JSON.stringify(jsonObj);
  1510. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1511. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1512. }
  1513. nativeCallJs(msg) {
  1514. console.log("zh:nativeCallJs received data: 1111", msg);
  1515. if (msg === 'Ad1') {
  1516. GlobalManager.instance.callMethod('Ad1');
  1517. console.log("zh: Ad1 奖励发送成功");
  1518. }
  1519. else if (msg === 'Ad2') {
  1520. GlobalManager.instance.callMethod('Ad2');
  1521. console.log("zh: Ad2 奖励发送成功");
  1522. }
  1523. else if (msg === 'Ad3') {
  1524. GlobalManager.instance.callMethod('Ad3');
  1525. console.log("zh: Ad3 奖励发送成功");
  1526. }
  1527. else if (msg === 'Ad4') {
  1528. GlobalManager.instance.callMethod('Ad4');
  1529. console.log("zh: Ad4 奖励发送成功");
  1530. }
  1531. else if (msg === 'Ad5') {
  1532. console.log("zh: Ad5 奖励发送成功");
  1533. GlobalManager.instance.callMethod('Ad5');
  1534. }
  1535. }
  1536. }
  1537. class UIBox extends UIBase {
  1538. constructor() {
  1539. super();
  1540. this.boxNum = 0;
  1541. this.boxMax = 10;
  1542. this.inAd = false;
  1543. this.isClose = false;
  1544. }
  1545. onConstructor() {
  1546. this.ui = ui_UIBox.createInstance();
  1547. this.contentPane = this.ui;
  1548. this.isEject = false;
  1549. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1550. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1551. Laya.timer.loop(1000, this, this.update);
  1552. }
  1553. update() {
  1554. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1555. this.boxNum -= 1;
  1556. this.upBar();
  1557. }
  1558. }
  1559. upBar() {
  1560. if (this.boxNum > this.boxMax)
  1561. this.boxNum = this.boxMax;
  1562. this.ui.bar.value = this.boxNum * 10;
  1563. }
  1564. show() {
  1565. super.show();
  1566. this.isClose = false;
  1567. this.boxNum = 0;
  1568. this.inAd = false;
  1569. this.upBar();
  1570. this.ui.t0.play();
  1571. this.ui.closeBtn.visible = false;
  1572. Laya.timer.once(3000, this, () => {
  1573. this.ui.closeBtn.visible = true;
  1574. this.ui.bar.alpha = 1;
  1575. });
  1576. Laya.timer.once(500, this, () => {
  1577. this.ui.t1.play();
  1578. });
  1579. this.setGlobalFont(this.ui);
  1580. }
  1581. hide() {
  1582. Laya.timer.clearAll(this);
  1583. Moyu.showBannerAd(false);
  1584. super.hide();
  1585. }
  1586. onOpenBox() {
  1587. this.boxNum++;
  1588. if (this.boxNum < this.boxMax) {
  1589. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1590. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1591. }
  1592. }
  1593. else if (this.boxNum == this.boxMax) {
  1594. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1595. this.ui.openBtn.c1.selectedIndex = 13;
  1596. this.inAd = true;
  1597. }
  1598. else
  1599. this.getAward();
  1600. }
  1601. else if (this.inAd) {
  1602. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1603. if (Laya.Browser.onAndroid) {
  1604. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1605. if (!boo) {
  1606. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1607. return;
  1608. }
  1609. }
  1610. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1611. }
  1612. else {
  1613. console.log('zh:AD 失败,直接发放奖励');
  1614. this.qjff_AD_for_UIBOX_onOpenBox();
  1615. }
  1616. }
  1617. this.upBar();
  1618. }
  1619. qjff_AD_for_UIBOX_onOpenBox() {
  1620. this.getAward();
  1621. }
  1622. onCloseBox() {
  1623. if (this.isClose)
  1624. this.hide();
  1625. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1626. this.isClose = true;
  1627. PlatMgr.showBanner(true, 0, 3000);
  1628. }
  1629. else
  1630. this.hide();
  1631. }
  1632. getAward() {
  1633. let str = "";
  1634. if (Math.random() < 0.5) {
  1635. let max = Moyu.isLegal ? 500 : 2500;
  1636. let num = xGame.tools.random(max, 500 + max);
  1637. DataMgr.setCoin(num);
  1638. str = "金币x" + num;
  1639. }
  1640. else {
  1641. let max = Moyu.isLegal ? 10 : 30;
  1642. let num = xGame.tools.random(max, 30 + max);
  1643. DataMgr.setDiamond(num);
  1644. str = "钻石x" + num;
  1645. }
  1646. xGame.showTip("恭喜获得-" + str);
  1647. this.hide();
  1648. }
  1649. }
  1650. UIBox.uiName = "UIBox";
  1651. class ui_UITry extends fgui.GComponent {
  1652. static createInstance() {
  1653. return (fgui.UIPackage.createObject("game", "UITry"));
  1654. }
  1655. onConstruct() {
  1656. this.n11 = (this.getChild("n11"));
  1657. this.myNode = (this.getChild("myNode"));
  1658. this.t0 = this.getTransition("t0");
  1659. }
  1660. }
  1661. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1662. class UITry extends UIBase {
  1663. constructor() {
  1664. super();
  1665. this.closeTime = 0;
  1666. this.closeNum = 0;
  1667. this.skillUrl = xGame.common.skillIconList;
  1668. }
  1669. onConstructor() {
  1670. this.ui = ui_UITry.createInstance();
  1671. this.contentPane = this.ui;
  1672. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1673. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1674. }
  1675. show() {
  1676. super.show();
  1677. this.closeNum = 0;
  1678. this.closeTime = 15;
  1679. this.ui.t0.play();
  1680. PlatMgr.showRateBanner();
  1681. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1682. Laya.timer.loop(1000, this, this.updateTime);
  1683. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1684. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1685. xGame.common.gameMgr.gamePause = true;
  1686. this.setGlobalFont(this.ui);
  1687. }
  1688. updateTime() {
  1689. if (this.closeTime > 1) {
  1690. this.closeTime--;
  1691. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1692. }
  1693. else
  1694. this.hide();
  1695. }
  1696. hide() {
  1697. Laya.timer.clearAll(this);
  1698. Moyu.showBannerAd(false);
  1699. super.hide();
  1700. xGame.common.gameMgr.gamePause = false;
  1701. }
  1702. onTry() {
  1703. console.log('zh:qjff_AD_for_uitry');
  1704. if (Laya.Browser.onAndroid) {
  1705. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1706. if (!boo) {
  1707. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1708. return;
  1709. }
  1710. }
  1711. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1712. }
  1713. else {
  1714. console.log('zh:AD 失败,直接发放奖励');
  1715. this.qjff_AD_for_uitry();
  1716. }
  1717. }
  1718. qjff_AD_for_uitry() {
  1719. let select = xGame.common.curPlayerSkillType;
  1720. DataMgr.gameData.trySkill = select;
  1721. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1722. DataMgr.saveGameData();
  1723. DataMgr.setBigSkill(select, 1);
  1724. xGame.showTip("Trial Successful");
  1725. this.hide();
  1726. }
  1727. onCancel() {
  1728. if (this.closeNum > 0) {
  1729. this.closeNum--;
  1730. if (this.closeNum < 2)
  1731. this.hide();
  1732. return;
  1733. }
  1734. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1735. this.onTry();
  1736. }
  1737. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1738. this.closeNum = 3;
  1739. }
  1740. else
  1741. this.hide();
  1742. }
  1743. }
  1744. UITry.uiName = "UITry";
  1745. class PlatMgr {
  1746. static initConfig() {
  1747. this.lastVt = 0;
  1748. if (!Moyu.platConfig)
  1749. return;
  1750. for (let k in Moyu.platConfig) {
  1751. let pd = this[k];
  1752. let pc = Moyu.platConfig[k];
  1753. if (pd != undefined && pc != undefined)
  1754. this[k] = pc;
  1755. }
  1756. Moyu.setBannerPos(0.5, 1);
  1757. }
  1758. static rand100(num) {
  1759. return xGame.tools.random(0, 100) < num;
  1760. }
  1761. static isMisVideo() {
  1762. let dt = Laya.timer.currTimer - this.lastVt;
  1763. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1764. this.lastVt = Laya.timer.currTimer;
  1765. return true;
  1766. }
  1767. else {
  1768. if (this.rand100(this.fullVideoRate)) {
  1769. console.log('zh:插屏 ad start');
  1770. JSBridgeUtils.instance.showInternAd('platMgr');
  1771. }
  1772. return false;
  1773. }
  1774. }
  1775. static showVideo(call, type) {
  1776. Moyu.showVideoAd(() => {
  1777. this.lastVt = Laya.timer.currTimer;
  1778. call && call();
  1779. }, type);
  1780. }
  1781. static showInsert(delay = false) {
  1782. if (this.getRand() < this.insertRate) {
  1783. let dt = delay ? this.insertDelay : 0;
  1784. console.log('zh:插屏 ad start');
  1785. JSBridgeUtils.instance.showInternAd('gameInsert');
  1786. }
  1787. }
  1788. static gameInsert() {
  1789. let t = this.getRand();
  1790. let r = this.gameInsertRate;
  1791. if (t < r) {
  1792. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1793. }
  1794. }
  1795. static showRateBanner() {
  1796. if (this.getRand() < this.bannerRate)
  1797. this.showBanner(true, this.bannerDelay, 3000);
  1798. }
  1799. static showBanner(show, delay = 0, hide = 0) {
  1800. if (2 > 1) {
  1801. console.log('zh:显示showBanner广告 直接返回');
  1802. return;
  1803. }
  1804. if (!show)
  1805. Moyu.showBannerAd(false);
  1806. else {
  1807. Laya.timer.clear(this, this.bannerShow);
  1808. if (delay > 0)
  1809. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1810. else
  1811. this.bannerShow(true);
  1812. if (hide > 0)
  1813. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1814. }
  1815. }
  1816. static bannerShow(show) {
  1817. if (2 > 1) {
  1818. console.log('zh:显示showBanner广告 直接返回');
  1819. return;
  1820. }
  1821. Moyu.showBannerAd(show);
  1822. console.log("showBanner" + show);
  1823. }
  1824. static getRand() {
  1825. return xGame.tools.random(0, 100);
  1826. }
  1827. static openBox() {
  1828. if (this.getRand() < this.boxRate)
  1829. xGame.uiMgr.Show(UIBox);
  1830. }
  1831. static openTry() {
  1832. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1833. return;
  1834. if (this.getRand() < this.tryRate)
  1835. xGame.uiMgr.Show(UITry);
  1836. else if (DataMgr.gameData.gameCount == 1)
  1837. xGame.uiMgr.Show(UITry);
  1838. }
  1839. }
  1840. PlatMgr.forceShare = 0;
  1841. PlatMgr.signAdRate = 0;
  1842. PlatMgr.forceVideoRate = 0;
  1843. PlatMgr.forceVideoGap = 0;
  1844. PlatMgr.fullVideoRate = 0;
  1845. PlatMgr.gameInsertRate = 0;
  1846. PlatMgr.insertGap = 0;
  1847. PlatMgr.insertDelay = 0;
  1848. PlatMgr.insertRate = 0;
  1849. PlatMgr.boxRate = 0;
  1850. PlatMgr.boxVideoRate = 0;
  1851. PlatMgr.boxInsertRate = 0;
  1852. PlatMgr.boxBannerRate = 0;
  1853. PlatMgr.tryRate = 0;
  1854. PlatMgr.tryClose3Rate = 0;
  1855. PlatMgr.tryVideoRate = 0;
  1856. PlatMgr.bannerRate = 0;
  1857. PlatMgr.lastVt = 0;
  1858. class ui_UIAddProp extends fgui.GComponent {
  1859. static createInstance() {
  1860. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1861. }
  1862. onConstruct() {
  1863. this.n11 = (this.getChild("n11"));
  1864. this.myNode = (this.getChild("myNode"));
  1865. this.closeBtn = (this.getChild("closeBtn"));
  1866. this.t0 = this.getTransition("t0");
  1867. }
  1868. }
  1869. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1870. class SpineMgr {
  1871. constructor(name, loadCb = null) {
  1872. this.loaded = false;
  1873. this.spineName = '';
  1874. this.loadedCallback = loadCb;
  1875. this.templet = new Laya.Templet();
  1876. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1877. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1878. if (name === 'mishu') {
  1879. this.templet.loadAni('spine/nvmishu.sk');
  1880. }
  1881. else {
  1882. this.templet.loadAni(`spine/${name}.sk`);
  1883. }
  1884. this.templet.lock = true;
  1885. this.spineName = name;
  1886. }
  1887. onError() {
  1888. console.log("zh:spine加载出错");
  1889. }
  1890. parseComplete() {
  1891. this.loaded = true;
  1892. this.loadedCallback && this.loadedCallback();
  1893. }
  1894. dispose() {
  1895. if (this.templet && !this.templet.destroyed) {
  1896. this.templet.destroy();
  1897. }
  1898. this.templet = null;
  1899. }
  1900. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1901. if (!this.loaded) {
  1902. return;
  1903. }
  1904. let spine;
  1905. if (mySpine) {
  1906. spine = mySpine;
  1907. }
  1908. else {
  1909. spine = this.createSpine(data, parent);
  1910. }
  1911. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1912. if (!isLoop) {
  1913. spine.on(Laya.Event.STOPPED, this, () => {
  1914. spine.offAll(Laya.Event.STOPPED);
  1915. callback && callback(spine);
  1916. });
  1917. }
  1918. return spine;
  1919. }
  1920. createSpine(data, parent, type = 1) {
  1921. let spine;
  1922. spine = this.templet.buildArmature(type);
  1923. spine.showSkinByIndex(0);
  1924. parent.addChild(spine);
  1925. spine.pos(data.x, data.y);
  1926. spine.scale(data.scaleX, data.scaleY, true);
  1927. return spine;
  1928. }
  1929. }
  1930. var AIState;
  1931. (function (AIState) {
  1932. AIState[AIState["none"] = 0] = "none";
  1933. AIState[AIState["idle"] = 1] = "idle";
  1934. AIState[AIState["reset"] = 2] = "reset";
  1935. AIState[AIState["move"] = 3] = "move";
  1936. AIState[AIState["wait"] = 4] = "wait";
  1937. AIState[AIState["select"] = 5] = "select";
  1938. AIState[AIState["turn"] = 6] = "turn";
  1939. AIState[AIState["shoot"] = 7] = "shoot";
  1940. AIState[AIState["leave"] = 8] = "leave";
  1941. })(AIState || (AIState = {}));
  1942. class AIPlayer {
  1943. constructor() {
  1944. this.dtime = 30;
  1945. this.awayTime = 0;
  1946. this.awayNum = 0;
  1947. this.hideTime = 0;
  1948. this.rootMoveTime = 0;
  1949. this.isGuide = false;
  1950. this.state = AIState.none;
  1951. this.waitTime = 0;
  1952. this.forceNum = 0;
  1953. this.forceMax = 0;
  1954. this.ballSize = 33;
  1955. this.selectNum = 0;
  1956. this.destRot = 0;
  1957. this.aiLv = 10;
  1958. this.kickBall = [];
  1959. this.lineBall = [];
  1960. this.scoreBall = [];
  1961. this.holeBall = [];
  1962. this.turnNum = 0;
  1963. this.setNum = 0;
  1964. this.setMax = 0;
  1965. this.setRate = 0;
  1966. this.rectL = 0;
  1967. this.rectR = 0;
  1968. this.rectT = 0;
  1969. this.rectB = 0;
  1970. this.rootPos = { x: 0, y: 0 };
  1971. this.bestForce = 0;
  1972. this.bestAngle = 180;
  1973. this.bestPos = { x: 0, y: 0 };
  1974. this.bestKick = { x: 0, y: 0 };
  1975. this.posList = [];
  1976. this.posIdx = 0;
  1977. this.chatTime = 3000;
  1978. this.tempDir1 = new Laya.Vector2();
  1979. this.tempDir2 = new Laya.Vector2();
  1980. this.tempDir3 = new Laya.Vector2();
  1981. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1982. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1983. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1984. this.gameSrc = xGame.common.gameUI;
  1985. this.hideTime = Laya.timer.currTimer;
  1986. Moyu.setOnTipCall((id) => {
  1987. if (id == 20012)
  1988. this.hideTime = Laya.timer.currTimer;
  1989. else
  1990. (id == 20011);
  1991. {
  1992. let dt = Laya.timer.currTimer - this.hideTime;
  1993. console.log("onshow" + dt);
  1994. if (dt > 30000 && this.state > AIState.none)
  1995. xGame.common.gameMgr.aiGameEnd(false);
  1996. }
  1997. }, this);
  1998. }
  1999. init() {
  2000. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  2001. this.awayTime = xGame.tools.random(5000, 10000);
  2002. this.awayNum = 0;
  2003. this.hideTime = Laya.timer.currTimer;
  2004. let rect = xGame.common.d2World.borderRect;
  2005. this.rectL = Math.ceil(rect.x) + 17;
  2006. this.rectT = Math.ceil(rect.y) + 17;
  2007. this.rectR = Math.floor(rect.x + rect.width) - 17;
  2008. this.rectB = Math.floor(rect.y + rect.height) - 17;
  2009. this.wBall = xGame.common.d2World.rootBall;
  2010. this.ballSize = this.wBall.gameObj.width - 1;
  2011. if (this.posList.length < 1) {
  2012. let dp = 40;
  2013. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  2014. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  2015. let dx = i < this.rectR ? i : this.rectR;
  2016. let dy = j < this.rectB ? j : this.rectB;
  2017. let order = xGame.tools.random(0, 1000);
  2018. this.posList.push({ x: dx, y: dy, order: order });
  2019. }
  2020. }
  2021. this.posList.sort(function (a, b) {
  2022. return a.order - b.order;
  2023. });
  2024. this.setMax = this.posList.length;
  2025. }
  2026. this.state = AIState.idle;
  2027. }
  2028. setAiLevel(num) {
  2029. this.aiLv = num;
  2030. }
  2031. initBall() {
  2032. this.rootPos.x = this.wBall.gameObj.x;
  2033. this.rootPos.y = this.wBall.gameObj.y;
  2034. this.initHoleBall();
  2035. }
  2036. initHoleBall() {
  2037. this.kickBall = [];
  2038. this.lineBall = [];
  2039. this.scoreBall = [];
  2040. this.holeBall = [];
  2041. this.selectNum = 0;
  2042. this.forceNum = 0;
  2043. this.forceMax = 0;
  2044. this.turnNum = 0;
  2045. let list = xGame.common.d2World.ballArr;
  2046. if (list.length < 20 && !this.isGuide) {
  2047. let holes = xGame.common.gameMgr.holePosList;
  2048. for (let i = 0; i < list.length; i++) {
  2049. let obj = list[i];
  2050. if (!obj)
  2051. continue;
  2052. obj.kickPos.x = 0;
  2053. obj.kickPos.y = 0;
  2054. obj.poleAngle = 0;
  2055. obj.hard = 0;
  2056. obj.borderDis = 0;
  2057. obj.kickAngle = 180;
  2058. if (obj.number == 0)
  2059. continue;
  2060. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  2061. continue;
  2062. if (obj.number == 8 && xGame.common.gameMode == 0) {
  2063. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  2064. continue;
  2065. }
  2066. let b = obj.gameObj;
  2067. let wbp = this.rootPos;
  2068. let bx = wbp.x - b.x;
  2069. let by = wbp.y - b.y;
  2070. obj.borderDis = xGame.tools.random(0, 100);
  2071. this.kickBall.push(obj);
  2072. if (!this.isLine(wbp, obj))
  2073. continue;
  2074. obj.kickAngle = xGame.tools.random(90, 180);
  2075. obj.kickPos.x = b.x;
  2076. obj.kickPos.y = b.y;
  2077. this.lineBall.push(obj);
  2078. let minDis = 999999;
  2079. let hole = false;
  2080. for (let j = 0; j < holes.length; j++) {
  2081. let hp = holes[j];
  2082. if (bx >= 0 && hp.x > b.x + 100)
  2083. continue;
  2084. if (bx <= 0 && hp.x < b.x - 100)
  2085. continue;
  2086. if (by < -10 && hp.y < wbp.y)
  2087. continue;
  2088. if (by > 10 && hp.y > wbp.y)
  2089. continue;
  2090. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2091. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2092. if (dis < minDis) {
  2093. let dx = b.x - this.tempDir1.x * this.ballSize;
  2094. let dy = b.y - this.tempDir1.y * this.ballSize;
  2095. this.tempDir3.x = this.tempDir1.x;
  2096. this.tempDir3.y = this.tempDir1.y;
  2097. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2098. obj.kickPos.x = dx;
  2099. obj.kickPos.y = dy;
  2100. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2101. if (num > 1)
  2102. num = 1;
  2103. obj.kickAngle = Math.acos(num) * 57.3;
  2104. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2105. dis = dis * 2;
  2106. if (Math.abs(hp.x - 600) < 100)
  2107. dis += 50;
  2108. obj.hard = dis + obj.kickAngle * 3;
  2109. hole = true;
  2110. }
  2111. }
  2112. }
  2113. }
  2114. if (hole) {
  2115. this.scoreBall.push(obj);
  2116. this.holeBall.push(obj);
  2117. }
  2118. }
  2119. this.scoreBall.sort(function (a, b) {
  2120. return a.hard - b.hard;
  2121. });
  2122. this.holeBall.sort(function (a, b) {
  2123. return a.kickAngle - b.kickAngle;
  2124. });
  2125. this.kickBall.sort(function (a, b) {
  2126. return a.borderDis - b.borderDis;
  2127. });
  2128. }
  2129. else {
  2130. let max = list.length - 1;
  2131. let i = xGame.tools.random(0, max);
  2132. for (i; i <= max; i++) {
  2133. let idx = i >= max ? i -= max : i;
  2134. let obj = list[idx];
  2135. if (obj && obj.number != 0) {
  2136. obj.kickAngle = xGame.tools.random(90, 180);
  2137. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2138. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2139. this.lineBall.push(obj);
  2140. break;
  2141. }
  2142. }
  2143. }
  2144. }
  2145. selectBall() {
  2146. let ball = null;
  2147. this.destRot = 0;
  2148. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2149. let ai = 110 - this.aiLv * 10;
  2150. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2151. let score = false;
  2152. if (this.scoreBall.length < 1) {
  2153. if (this.lineBall.length < 1) {
  2154. for (let i = 0; i < this.kickBall.length; i++) {
  2155. let list = [];
  2156. let bo = this.kickBall[i];
  2157. let bobj = bo.gameObj;
  2158. let rect = xGame.common.d2World.borderRect;
  2159. let mobj = this.wBall.gameObj;
  2160. let minb = bobj.y - rect.y - 20;
  2161. let minw = mobj.y - rect.y - 50;
  2162. if (minb > 0 && minw > 0) {
  2163. let dlenx = 0;
  2164. let dleny = mobj.y - rect.y;
  2165. let spx = mobj.x;
  2166. let spy = rect.y - dleny;
  2167. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2168. }
  2169. minb = rect.y + rect.height - bobj.y - 20;
  2170. minw = rect.y + rect.height - mobj.y - 50;
  2171. if (minb > 0 && minw > 0) {
  2172. let dlenx = 0;
  2173. let dleny = rect.y + rect.height - mobj.y;
  2174. let spx = mobj.x;
  2175. let spy = rect.y + rect.height + dleny;
  2176. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2177. }
  2178. minb = bobj.x - rect.x - 20;
  2179. minw = mobj.x - rect.x - 50;
  2180. if (minb > 0 && minw > 0) {
  2181. let dlenx = mobj.x - rect.x;
  2182. let dleny = 0;
  2183. let spx = rect.x - dlenx;
  2184. let spy = mobj.y;
  2185. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2186. }
  2187. minb = rect.x + rect.width - bobj.x - 20;
  2188. minw = rect.x + rect.width - mobj.x - 50;
  2189. if (minb > 0 && minw > 0) {
  2190. let dlenx = rect.x + rect.width - mobj.x;
  2191. let dleny = 0;
  2192. let spx = rect.x + rect.width + dlenx;
  2193. let spy = mobj.y;
  2194. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2195. }
  2196. list.sort(function (a, b) {
  2197. return a.order - b.order;
  2198. });
  2199. for (let i = 0; i < list.length; i++) {
  2200. let data = list[i];
  2201. let mx = mobj.x - bobj.x;
  2202. let my = mobj.y - bobj.y;
  2203. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2204. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2205. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2206. if (num > 1)
  2207. num = 1;
  2208. let cos = Math.acos(num);
  2209. if (cos > 1.57)
  2210. cos = 1.57;
  2211. else if (cos < 0.01)
  2212. cos = 0.01;
  2213. let tan = Math.tan(cos);
  2214. let dx = tan * data.dleny;
  2215. let dy = tan * data.dlenx;
  2216. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2217. if (Math.abs(bx - 667) < 40)
  2218. continue;
  2219. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2220. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2221. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2222. this.forceMax = dis * 0.08;
  2223. this.destRot += mis * 0.1;
  2224. this.setKick(bx, by);
  2225. return true;
  2226. }
  2227. }
  2228. }
  2229. }
  2230. else {
  2231. ball = xGame.common.getRandArrEle(this.lineBall);
  2232. }
  2233. }
  2234. else {
  2235. for (let i = 0; i < this.scoreBall.length; i++) {
  2236. if (i < this.scoreBall.length - 1) {
  2237. let rand = 70 + this.aiLv * 10 + i * 10;
  2238. if (xGame.tools.random(0, 100) < rand) {
  2239. ball = this.scoreBall[i];
  2240. break;
  2241. }
  2242. }
  2243. else {
  2244. ball = this.scoreBall[i];
  2245. break;
  2246. }
  2247. }
  2248. score = true;
  2249. this.selectNum++;
  2250. }
  2251. if (!ball)
  2252. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2253. if (this.selectNum >= max) {
  2254. let dx = ball.gameObj.x;
  2255. let dy = ball.gameObj.y;
  2256. let kickAngle = 0;
  2257. if (score) {
  2258. dx = ball.kickPos.x;
  2259. dy = ball.kickPos.y;
  2260. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2261. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2262. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2263. if (adot > 1)
  2264. adot = 1;
  2265. kickAngle = Math.acos(adot) * 57.3;
  2266. if (kickAngle > 45) {
  2267. let kdx = ball.kickPos.x - ball.gameObj.x;
  2268. let kdy = ball.kickPos.y - ball.gameObj.y;
  2269. dx = ball.kickPos.x - kdx * mis * 0.3;
  2270. dy = ball.kickPos.y - kdy * mis * 0.3;
  2271. }
  2272. else
  2273. this.destRot += mis;
  2274. }
  2275. else if (ball.poleAngle != 0) {
  2276. this.destRot += ball.poleAngle;
  2277. }
  2278. if (xGame.common.gameMode == 0) {
  2279. let af = kickAngle * 0.08;
  2280. this.forceMax = ball.hard * 0.1 + af * af;
  2281. }
  2282. this.setKick(dx, dy);
  2283. }
  2284. else {
  2285. let rand = this.aiLv * 5 + 40;
  2286. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2287. ball = xGame.common.getRandArrEle(this.scoreBall);
  2288. else
  2289. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2290. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2291. if (xGame.tools.random(0, 100) > rand) {
  2292. this.selectNum = max;
  2293. }
  2294. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2295. this.selectNum++;
  2296. }
  2297. ball.onClick(0, true);
  2298. }
  2299. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2300. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2301. let balls = xGame.common.d2World.ballArr;
  2302. let max = xGame.tools.getDis(hx, hy, bx, by);
  2303. for (let index = 0; index < balls.length; index++) {
  2304. let obj = balls[index];
  2305. if (obj.number == 0)
  2306. continue;
  2307. if (obj.number == bn || obj.number == dn)
  2308. continue;
  2309. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2310. if (dis * dis > max)
  2311. continue;
  2312. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2313. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2314. if (num > 1)
  2315. num = 1;
  2316. if (num < 0)
  2317. continue;
  2318. let gap = Math.sin(Math.acos(num)) * dis;
  2319. if (gap < this.ballSize)
  2320. return true;
  2321. }
  2322. return false;
  2323. }
  2324. isLine(xy, ball) {
  2325. let bx = xy.x;
  2326. let by = xy.y;
  2327. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2328. let dis = ball.getDestDis(xy);
  2329. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2330. let sin = Math.sin(angle);
  2331. let cos = Math.cos(angle);
  2332. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2333. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2334. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2335. let dx = bx + this.tempDir2.x * dis;
  2336. let dy = by + this.tempDir2.y * dis;
  2337. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2338. sin = Math.sin(-angle);
  2339. cos = Math.cos(-angle);
  2340. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2341. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2342. dx = bx + this.tempDir2.x * dis;
  2343. dy = by + this.tempDir2.y * dis;
  2344. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2345. if (isr && isl)
  2346. return false;
  2347. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2348. }
  2349. return true;
  2350. }
  2351. turnPole() {
  2352. this.turnNum++;
  2353. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2354. let dr = rot - this.destRot;
  2355. let abs = Math.abs(dr) % 360;
  2356. if (abs > 180) {
  2357. if (rot > 180)
  2358. rot -= 360;
  2359. if (this.destRot > 180)
  2360. this.destRot -= 360;
  2361. }
  2362. let max = this.turnNum * 5 + this.aiLv * 5;
  2363. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2364. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2365. let at = xGame.tools.random(1000, 2000);
  2366. if (!this.onAway(3))
  2367. at += xGame.tools.random(10000, 15000);
  2368. this.setState(AIState.shoot, at);
  2369. }
  2370. else {
  2371. let mr = 0;
  2372. if (abs > 3)
  2373. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2374. else if (Math.random() > 0.6)
  2375. mr = xGame.tools.random(1, 10) * 0.1;
  2376. mr = dr > 0 ? -mr : mr;
  2377. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2378. }
  2379. }
  2380. setKick(dx, dy) {
  2381. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2382. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2383. this.tempDir1.x = 0;
  2384. this.tempDir1.y = 1;
  2385. this.tempDir2.y = -this.tempDir2.y;
  2386. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2387. if (num > 1)
  2388. num = 1;
  2389. let rot = Math.acos(num) * 57.3;
  2390. if (this.tempDir2.x < 0)
  2391. rot = 360 - rot;
  2392. this.destRot += rot;
  2393. if (!xGame.common.gameMgr.finishOneShoot) {
  2394. this.forceMax += xGame.tools.random(10, 50);
  2395. this.forceMax -= this.aiLv * 2;
  2396. if (this.forceMax < 20)
  2397. this.forceMax = 20;
  2398. }
  2399. if (this.forceMax > 100)
  2400. this.forceMax = 101;
  2401. else if (this.forceMax < 10)
  2402. this.forceMax += xGame.tools.random(0, 10);
  2403. if (xGame.common.gameMode == 1)
  2404. this.forceMax = xGame.tools.random(80, 100);
  2405. else
  2406. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2407. let max = 2000 - this.aiLv * 100;
  2408. if (Math.random() > 0.8)
  2409. max += xGame.tools.random(100, 2000);
  2410. this.setState(AIState.turn, xGame.tools.random(500, max));
  2411. }
  2412. shoot() {
  2413. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2414. if (Math.random() > 0.8) {
  2415. this.gameSrc.aiForce(1);
  2416. this.setState(AIState.wait);
  2417. }
  2418. }
  2419. else {
  2420. let df = xGame.tools.random(3, 8);
  2421. if (this.forceNum < this.forceMax)
  2422. this.forceNum += df;
  2423. else
  2424. this.forceNum -= df;
  2425. let startY = this.gameSrc.ui.powerNode.y;
  2426. let height = this.gameSrc.ui.powerNode.height;
  2427. let force = startY + height * this.forceNum * 0.01;
  2428. this.gameSrc.aiForce(2, force);
  2429. }
  2430. }
  2431. reset() {
  2432. for (let i = 0; i < 4; i++) {
  2433. this.setRate--;
  2434. this.setNum++;
  2435. let pos = this.posList[this.posIdx];
  2436. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2437. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2438. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2439. this.rootPos.x = 387;
  2440. if (this.rootPos.x < this.rectL)
  2441. this.rootPos.x = this.rectL;
  2442. else if (this.rootPos.x > this.rectR)
  2443. this.rootPos.x = this.rectR;
  2444. if (this.rootPos.y < this.rectT)
  2445. this.rootPos.y = this.rectT;
  2446. else if (this.rootPos.y > this.rectB)
  2447. this.rootPos.y = this.rectB;
  2448. this.posIdx++;
  2449. let max = this.posList.length;
  2450. if (this.posIdx >= max)
  2451. this.posIdx -= max;
  2452. this.initHoleBall();
  2453. let ball = null;
  2454. if (this.scoreBall.length > 0)
  2455. ball = this.scoreBall[0];
  2456. else if (this.lineBall.length > 0)
  2457. ball = xGame.common.getRandArrEle(this.lineBall);
  2458. if (ball && ball.kickAngle < this.bestAngle) {
  2459. this.bestAngle = ball.kickAngle;
  2460. this.bestKick.x = ball.kickPos.x;
  2461. this.bestKick.y = ball.kickPos.y;
  2462. this.bestPos.x = this.rootPos.x;
  2463. this.bestPos.y = this.rootPos.y;
  2464. this.bestForce = ball.hard * 0.08;
  2465. }
  2466. }
  2467. if (this.setNum >= this.setMax)
  2468. this.setMax = 0;
  2469. if (this.setRate < 1) {
  2470. this.setState(AIState.move, 0);
  2471. this.rootMoveTime = Laya.timer.currTimer;
  2472. this.gameSrc.aiRootMove(true);
  2473. }
  2474. }
  2475. delayLine() {
  2476. this.gameSrc.aiRootMove(false);
  2477. }
  2478. move() {
  2479. if (this.bestPos.x < 1)
  2480. this.bestPos = this.rootPos;
  2481. let wObj = this.wBall.gameObj;
  2482. let destx = wObj.x;
  2483. let desty = wObj.y;
  2484. let dx = Math.abs(destx - this.bestPos.x);
  2485. let dy = Math.abs(desty - this.bestPos.y);
  2486. let mx = 3 + dx * 0.03;
  2487. let my = 3 + dy * 0.03;
  2488. if (dx < 4 && dy < 4) {
  2489. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2490. dt = dt < 1000 ? 1000 - dt : 0;
  2491. if (this.setMax > 0) {
  2492. let min = this.setMax * 0.3 + this.aiLv * 5;
  2493. this.setRate = xGame.tools.random(min, this.setMax);
  2494. this.setState(AIState.reset, 0);
  2495. }
  2496. else {
  2497. this.destRot = 0;
  2498. this.forceMax = this.bestForce;
  2499. this.setKick(this.bestKick.x, this.bestKick.y);
  2500. }
  2501. if (dt > 100) {
  2502. Laya.timer.clear(this, this.delayLine);
  2503. Laya.timer.once(dt, this, this.delayLine);
  2504. }
  2505. else
  2506. this.gameSrc.aiRootMove(false);
  2507. }
  2508. else {
  2509. if (dx > 4)
  2510. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2511. if (dy > 4)
  2512. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2513. this.gameSrc.onRootMove({ x: destx, y: desty });
  2514. }
  2515. }
  2516. resetRoot() {
  2517. this.bestAngle = 180;
  2518. this.bestForce = 0;
  2519. this.setMax = this.posList.length;
  2520. this.posIdx = xGame.tools.random(0, this.setMax);
  2521. let min = this.setMax * 0.3 + this.aiLv * 5;
  2522. this.setRate = xGame.tools.random(min, this.setMax);
  2523. let max = 2000 - this.aiLv * 100;
  2524. if (Math.random() > 0.8)
  2525. max += xGame.tools.random(100, 1000);
  2526. if (this.isGuide)
  2527. this.setState(AIState.select, 500);
  2528. else if (this.onAway(2))
  2529. this.setState(AIState.reset, xGame.tools.random(400, max));
  2530. else
  2531. this.setState(AIState.none);
  2532. if (xGame.common.gameMgr.finishOneShoot)
  2533. this.chat();
  2534. }
  2535. runAI() {
  2536. if (this.state > AIState.idle)
  2537. return;
  2538. this.initBall();
  2539. this.onGame(2500);
  2540. if (Math.random() > 0.6)
  2541. this.chat();
  2542. }
  2543. stopRun() {
  2544. this.setState(AIState.idle);
  2545. }
  2546. onGame(base) {
  2547. let max = base - this.aiLv * 100;
  2548. if (Math.random() > 0.8)
  2549. max += xGame.tools.random(100, 1000);
  2550. if (this.onAway(2))
  2551. this.setState(AIState.select, xGame.tools.random(500, max));
  2552. else
  2553. this.setState(AIState.none);
  2554. }
  2555. setState(sta, wt = 0) {
  2556. if (this.state == AIState.none)
  2557. return;
  2558. this.state = sta;
  2559. this.waitTime = wt;
  2560. }
  2561. onUpdate() {
  2562. if (this.state == AIState.none)
  2563. return;
  2564. this.awayTime -= this.dtime;
  2565. if (this.awayTime < 1) {
  2566. this.awayTime = xGame.tools.random(6000, 10000);
  2567. this.awayNum += (11 - this.aiLv);
  2568. this.onAway(1);
  2569. }
  2570. if (this.waitTime >= 0) {
  2571. this.waitTime -= this.dtime;
  2572. return;
  2573. }
  2574. switch (this.state) {
  2575. case AIState.idle:
  2576. this.chat();
  2577. break;
  2578. case AIState.reset:
  2579. this.reset();
  2580. break;
  2581. case AIState.move:
  2582. this.move();
  2583. break;
  2584. case AIState.leave:
  2585. this.state = AIState.none;
  2586. xGame.common.gameMgr.aiGameEnd(true);
  2587. break;
  2588. case AIState.select:
  2589. this.selectBall();
  2590. break;
  2591. case AIState.turn:
  2592. this.turnPole();
  2593. break;
  2594. case AIState.shoot:
  2595. this.shoot();
  2596. break;
  2597. }
  2598. }
  2599. onAway(type) {
  2600. if (type == 1) {
  2601. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2602. let num = this.awayNum + db * 20;
  2603. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2604. xGame.common.gameMgr.aiLeave();
  2605. this.setState(AIState.leave, 6666);
  2606. }
  2607. }
  2608. else if (type == 2) {
  2609. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2610. let num = this.awayNum + db * 30;
  2611. if (xGame.tools.random(0, 10000) < num)
  2612. return false;
  2613. }
  2614. else if (type == 3) {
  2615. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2616. let num = this.awayNum + db * 10;
  2617. if (xGame.tools.random(0, 4000) < num)
  2618. return false;
  2619. }
  2620. return true;
  2621. }
  2622. chat() {
  2623. if (this.chatTime > 0) {
  2624. this.chatTime -= this.dtime;
  2625. return;
  2626. }
  2627. this.chatTime = xGame.tools.random(2000, 10000);
  2628. let rand = xGame.tools.random(0, 100);
  2629. if (rand < 15)
  2630. this.talk();
  2631. else if (rand < 35)
  2632. this.emotion();
  2633. }
  2634. talk() {
  2635. xGame.common.talkMgr.showAITalk(0);
  2636. }
  2637. emotion() {
  2638. xGame.common.talkMgr.showAIEmotion(0);
  2639. }
  2640. resetAI() {
  2641. this.stopRun();
  2642. this.state = AIState.none;
  2643. }
  2644. }
  2645. class Partical extends Laya.Script3D {
  2646. constructor() {
  2647. super();
  2648. this.duration = 2000;
  2649. }
  2650. ;
  2651. onAwake() {
  2652. this.gameObj = this.owner;
  2653. }
  2654. onEnable() {
  2655. this.openTimer();
  2656. }
  2657. openTimer() {
  2658. Laya.timer.once(this.duration, this, this.disappear);
  2659. }
  2660. setCallback(obj, callback) {
  2661. this.obj = obj;
  2662. this.callback = callback;
  2663. Laya.timer.clearAll(this);
  2664. Laya.timer.once(this.duration, this, this.disappear);
  2665. }
  2666. disappear() {
  2667. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2668. this.callback && this.callback(this.obj);
  2669. }
  2670. }
  2671. class Ball extends Laya.Script3D {
  2672. constructor() {
  2673. super();
  2674. this.posV3 = new Laya.Vector3();
  2675. this.rotRate = 2.1;
  2676. this.rotSpeed = new Laya.Vector3();
  2677. this.myIndex = 0;
  2678. }
  2679. onAwake() {
  2680. this.gameObj = this.owner;
  2681. this.transform = this.gameObj.transform;
  2682. this.ballNode = this.gameObj.getChildByName("Ball");
  2683. this.shadowNode = this.gameObj.getChildByName("shadow");
  2684. }
  2685. initSelf(index, x, y, owner) {
  2686. this.d2BallSrc = owner;
  2687. this.myIndex = index;
  2688. this.setAlbedoTexture();
  2689. this.setTransPos(x, y);
  2690. this.setScale();
  2691. this.ballNode.transform.localRotationEulerX = 90;
  2692. if (index == 0) {
  2693. }
  2694. }
  2695. setAlbedoTexture(isIce = false) {
  2696. let url;
  2697. if (isIce) {
  2698. url = `res/d3Res/ballTexture/ice.jpg`;
  2699. }
  2700. else {
  2701. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2702. }
  2703. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2704. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2705. }));
  2706. }
  2707. runFireworks(obj, delay, callback) {
  2708. Laya.timer.clearAll(this);
  2709. Laya.timer.once(delay + 1, this, () => {
  2710. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2711. fire.transform.localPositionX = this.transform.localPositionX;
  2712. fire.transform.localPositionY = this.transform.localPositionY;
  2713. fire.transform.localPositionZ = this.transform.localPositionZ;
  2714. let src = fire.getComponent(Partical);
  2715. src.duration = 1000;
  2716. src.setCallback(obj, callback);
  2717. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2718. eft.transform.localPositionX = this.transform.localPositionX;
  2719. eft.transform.localPositionY = this.transform.localPositionY;
  2720. eft.transform.localPositionZ = this.transform.localPositionZ;
  2721. });
  2722. }
  2723. setTransPos(x, y) {
  2724. this.setRotation();
  2725. xGame.common.pos2to3Convert(x, y, this.posV3);
  2726. this.transform.localPositionX = this.posV3.x;
  2727. this.transform.localPositionY = 0;
  2728. this.transform.localPositionZ = this.posV3.z;
  2729. this.transform.localRotationEulerX = 0;
  2730. this.transform.localRotationEulerY = 0;
  2731. this.transform.localRotationEulerZ = 0;
  2732. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2733. this.shadowNode.transform.localPositionY = 0.1;
  2734. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2735. }
  2736. setRotation() {
  2737. if (this.d2BallSrc.canRot) {
  2738. let speed = this.d2BallSrc.rigy.linearVelocity;
  2739. this.rotSpeed.x = speed.x * this.rotRate;
  2740. this.rotSpeed.z = speed.y * this.rotRate;
  2741. this.rotSpeed.y = this.d2BallSrc.rotY;
  2742. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2743. }
  2744. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2745. this.rotSpeed.x = this.rotSpeed.y = 0;
  2746. this.rotSpeed.y = this.d2BallSrc.rotY;
  2747. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2748. }
  2749. }
  2750. setScale() {
  2751. let radius = xGame.common.d2World.rootBall.ui.width;
  2752. let scale = xGame.common.scale2to3Convert(radius);
  2753. this.transform.localScaleX = scale;
  2754. this.transform.localScaleY = scale;
  2755. this.transform.localScaleZ = scale;
  2756. }
  2757. playInHoleEft() {
  2758. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2759. eft.transform.position = this.transform.position;
  2760. }
  2761. playIceEft() {
  2762. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2763. eft.transform.position = this.transform.position;
  2764. }
  2765. get scaleXYZ() {
  2766. return this.transform.localScaleX;
  2767. }
  2768. set scaleXYZ(val) {
  2769. this.transform.localScaleX = val;
  2770. this.transform.localScaleY = val;
  2771. this.transform.localScaleZ = val;
  2772. }
  2773. get posX() {
  2774. return this.transform.localPositionX;
  2775. }
  2776. set posX(val) {
  2777. this.transform.localPositionX = val;
  2778. }
  2779. get posY() {
  2780. return this.transform.localPositionY;
  2781. }
  2782. set posY(val) {
  2783. this.transform.localPositionY = val;
  2784. }
  2785. get posZ() {
  2786. return this.transform.localPositionZ;
  2787. }
  2788. set posZ(val) {
  2789. this.transform.localPositionZ = val;
  2790. }
  2791. destroySelf() {
  2792. this.posV3 = null;
  2793. this.rotSpeed = null;
  2794. this.d2BallSrc = null;
  2795. this.ballNode = null;
  2796. this.gameObj.destroy(true);
  2797. this.transform = null;
  2798. this.destroy();
  2799. }
  2800. }
  2801. class ui_D2Ball extends fgui.GComponent {
  2802. static createInstance() {
  2803. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2804. }
  2805. onConstruct() {
  2806. this.myIcon = (this.getChild("myIcon"));
  2807. this.inner = (this.getChild("inner"));
  2808. this.n8 = (this.getChild("n8"));
  2809. this.n4 = (this.getChild("n4"));
  2810. this.wrongTips = (this.getChild("wrongTips"));
  2811. this.rightTips = (this.getChild("rightTips"));
  2812. this.breathAni = this.getTransition("breathAni");
  2813. }
  2814. }
  2815. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2816. class D2BallSrc extends Laya.Script {
  2817. constructor() {
  2818. super();
  2819. this.number = 0;
  2820. this.startX = 0;
  2821. this.startY = 0;
  2822. this.angleV2 = new Laya.Vector2();
  2823. this.isRootBall = false;
  2824. this.isBlackBall = false;
  2825. this.ballType = "";
  2826. this.canRot = true;
  2827. this.rotY = 0;
  2828. this.poleAngle = 0;
  2829. this.kickPos = { x: 0, y: 0 };
  2830. this.hard = 0;
  2831. this.kickAngle = 0;
  2832. this.borderDis = 0;
  2833. this.speedP10 = 5.6;
  2834. this.lastSpeed = { x: 0, y: 0 };
  2835. this.stillSpeed = 0.12;
  2836. this.ballFunc = "normal";
  2837. this.isRunSkillAni = false;
  2838. this.isInHole = false;
  2839. this.iceOwner = "";
  2840. this.forceRun = false;
  2841. this.myUNID = "";
  2842. this.rectL = 0;
  2843. this.rectR = 0;
  2844. this.rectT = 0;
  2845. this.rectB = 0;
  2846. this.forceVec = new Laya.Vector2();
  2847. this.lastDis = 0;
  2848. this.helpOut = { type: "", x: 0, y: 0 };
  2849. }
  2850. initSelf(number, x, y, d3Ball) {
  2851. if (!this.gameObj)
  2852. this.gameObj = this.owner;
  2853. this.number = number;
  2854. this.startX = x;
  2855. this.startY = y;
  2856. this.d3Ball = d3Ball;
  2857. this.isRootBall = false;
  2858. this.isBlackBall = false;
  2859. this.ballType = "";
  2860. if (number == 0) {
  2861. this.isRootBall = true;
  2862. }
  2863. else if (number == 8) {
  2864. this.isBlackBall = true;
  2865. }
  2866. else {
  2867. if (number <= 7) {
  2868. this.ballType = ballCamp.full;
  2869. }
  2870. else {
  2871. this.ballType = ballCamp.flower;
  2872. }
  2873. }
  2874. this.setInfo();
  2875. this.setD3Ball();
  2876. this.owner["mySrc"] = this;
  2877. this.rigy.linearDamping = 1;
  2878. D2BallSrc._unid++;
  2879. this.myUNID = "d2ball" + D2BallSrc._unid;
  2880. let rect = xGame.common.d2World.borderRect;
  2881. this.rectL = Math.ceil(rect.x) + 20;
  2882. this.rectT = Math.ceil(rect.y) + 20;
  2883. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2884. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2885. }
  2886. setInfo() {
  2887. this.gameObj.x = this.startX;
  2888. this.gameObj.y = this.startY;
  2889. let radius = this.ui.width / 2;
  2890. this.gameObj.width = radius * 2;
  2891. this.gameObj.height = radius * 2;
  2892. if (xGame.common.showDebug) {
  2893. this.ui.myIcon.alpha = 1;
  2894. this.ui.inner.alpha = 1;
  2895. }
  2896. else {
  2897. this.ui.myIcon.alpha = 0;
  2898. this.ui.inner.alpha = 0;
  2899. }
  2900. }
  2901. setD3Ball() {
  2902. this.d3Ball = this.d3Ball;
  2903. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2904. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2905. }
  2906. onUpdate() {
  2907. if (xGame.common.gameMgr.gamePause)
  2908. return;
  2909. if (this.isInHole)
  2910. return;
  2911. if (!xGame.common.d2World.openCheckStill)
  2912. return;
  2913. this.runBall();
  2914. }
  2915. runBall() {
  2916. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2917. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2918. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2919. this.judgeBorder();
  2920. }
  2921. getDestDis(dest) {
  2922. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2923. }
  2924. setmyXY(x, y) {
  2925. this.d3BallSrc.setTransPos(x, y);
  2926. }
  2927. getSpeed() {
  2928. let speed = this.rigy.linearVelocity;
  2929. return speed.x * speed.x + speed.y * speed.y;
  2930. }
  2931. onTriggerEnter(collider) {
  2932. if (!collider || !collider.owner)
  2933. return;
  2934. let coll = "collide";
  2935. let speed = this.getSpeed();
  2936. let sv2 = this.speedP10 * this.speedP10;
  2937. if (collider.label == "ball") {
  2938. if (speed < 9 && this.number != 0)
  2939. coll = "";
  2940. else if (speed < sv2)
  2941. coll = "collide_4";
  2942. else if (speed < sv2 * 6.2)
  2943. coll = "collide_3";
  2944. else if (speed < sv2 * 25)
  2945. coll = "collide_2";
  2946. else if (speed < sv2 * 56)
  2947. coll = "collide_1";
  2948. xGame.soundMgr.playSound(coll);
  2949. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2950. if (collider.owner) {
  2951. let rig = collider.owner.getComponent(D2BallSrc);
  2952. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2953. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2954. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2955. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2956. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2957. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2958. let rx = 0;
  2959. let ry = 0;
  2960. if (this.gameObj.x < this.rectL)
  2961. rx = vx;
  2962. else if (this.gameObj.x > this.rectR)
  2963. rx = -vx;
  2964. else if (this.gameObj.y < this.rectT)
  2965. ry = vy;
  2966. else if (this.gameObj.y > this.rectB)
  2967. ry = -vy;
  2968. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2969. }
  2970. }
  2971. if (this.number != 0) {
  2972. return;
  2973. }
  2974. else {
  2975. if (this.forceRun) {
  2976. console.log("randon force");
  2977. this.applyForce(collider);
  2978. }
  2979. }
  2980. if (xGame.common.d2World.isOnSameLine) {
  2981. xGame.common.d2World.isOnSameLine = false;
  2982. this.rigy.linearVelocity = { x: 0, y: 0 };
  2983. }
  2984. if (xGame.common.gameMgr.firstColliObj == null) {
  2985. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2986. xGame.common.gameMgr.isTouchedBall = true;
  2987. }
  2988. }
  2989. else {
  2990. xGame.common.recoverCameraView();
  2991. let wallStr = "";
  2992. if (speed < 9) { }
  2993. else if (speed < sv2) { }
  2994. else if (speed < sv2 * 6.2)
  2995. wallStr = "wall_30";
  2996. else if (speed < sv2 * 25)
  2997. wallStr = "wall_50";
  2998. else if (speed < sv2 * 56)
  2999. wallStr = "wall_80";
  3000. xGame.soundMgr.playSound(wallStr);
  3001. }
  3002. }
  3003. applyForce(collider) {
  3004. let src = collider.owner.mySrc;
  3005. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  3006. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  3007. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  3008. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  3009. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  3010. }
  3011. checkWrongBall(playEft = true) {
  3012. if (this.isInHole)
  3013. return;
  3014. xGame.common.gameMgr.inHoleBalls.push(this.number);
  3015. if (this.number != 0 && playEft)
  3016. this.d3BallSrc.playInHoleEft();
  3017. let coll = "inpocket_1";
  3018. let speed = this.getSpeed();
  3019. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  3020. if (speed < 9 && this.number != 0)
  3021. coll = "";
  3022. else if (speed < sv2 * 6.2)
  3023. coll = "inpocket_4";
  3024. else if (speed < sv2 * 25)
  3025. coll = "collide_3";
  3026. else if (speed < sv2 * 56)
  3027. coll = "collide_2";
  3028. xGame.soundMgr.playSound(coll);
  3029. this.isInHole = true;
  3030. if (this.number == 0) {
  3031. console.log("白球进了。。");
  3032. this.reset();
  3033. this.rigy.linearVelocity = { x: 0, y: 0 };
  3034. this.hideSelf();
  3035. xGame.common.gameUI.ui.whiteAni.visible = true;
  3036. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  3037. xGame.common.gameUI.ui.whiteAni.visible = false;
  3038. }));
  3039. }
  3040. else {
  3041. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  3042. xGame.common.d2World.removeOneBall(this);
  3043. this.destroySelf();
  3044. xGame.common.playHappySound(this.number);
  3045. this.runFlyEft();
  3046. }
  3047. }
  3048. runFlyEft() {
  3049. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  3050. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  3051. }
  3052. }
  3053. hideSelf() {
  3054. if (this.d3Ball)
  3055. this.d3Ball.active = false;
  3056. }
  3057. showSelf() {
  3058. this.isInHole = false;
  3059. if (this.d3Ball && !this.d3Ball.active)
  3060. this.d3Ball.active = true;
  3061. }
  3062. isStill() {
  3063. let speed = this.rigy.linearVelocity;
  3064. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  3065. this.rigy.linearVelocity = { x: 0, y: 0 };
  3066. return true;
  3067. }
  3068. return false;
  3069. }
  3070. reset() {
  3071. }
  3072. destroySelf() {
  3073. this.d3BallSrc.destroySelf();
  3074. if (!this.ui.isDisposed) {
  3075. this.ui.removeFromParent();
  3076. this.ui.dispose();
  3077. this.ui = null;
  3078. }
  3079. this.outColli = null;
  3080. this.innerColli = null;
  3081. this.rigy = null;
  3082. this.d3Ball = null;
  3083. this.d3BallSrc = null;
  3084. this.angleV2 = null;
  3085. this.gameObj.destroy(true);
  3086. this.destroy();
  3087. }
  3088. judgeBorder() {
  3089. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3090. return;
  3091. }
  3092. if (this.destroyed)
  3093. return;
  3094. if (xGame.common.gameMode == GameMode.classic)
  3095. return;
  3096. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3097. if (isOver) {
  3098. this.checkWrongBall();
  3099. }
  3100. }
  3101. onClick(e, force = false) {
  3102. if (this.number == 0)
  3103. return;
  3104. if (force) {
  3105. }
  3106. else {
  3107. if (xGame.common.d2World.openCheckStill)
  3108. return;
  3109. if (!xGame.common.gameMgr.selfTurn) {
  3110. return;
  3111. }
  3112. }
  3113. if (!xGame.common.gameMgr.finishOneShoot)
  3114. return;
  3115. let root = xGame.common.d2World.rootBall.gameObj;
  3116. let x = this.gameObj.x - root.x;
  3117. let y = this.gameObj.y - root.y;
  3118. let angle = xGame.common.getfguiRotation(x, y);
  3119. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3120. xGame.common.d2World.getHelpLine();
  3121. xGame.common.clickedBall = true;
  3122. this.checkGuide();
  3123. }
  3124. checkGuide() {
  3125. let guide = DataMgr.getSkillGuide();
  3126. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3127. xGame.common.guideStep++;
  3128. xGame.common.gameUI.ui.guide1.visible = false;
  3129. xGame.common.gameUI.ui.guide2.visible = true;
  3130. }
  3131. }
  3132. checkDistance(disX, disY, angle) {
  3133. let diameter = this.gameObj.width - 1;
  3134. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3135. if (!this.lastDis)
  3136. this.lastDis = dis;
  3137. else {
  3138. if (dis > this.lastDis) {
  3139. this.helpOut.type = "remove";
  3140. return this.helpOut;
  3141. }
  3142. }
  3143. if (dis <= Math.pow(diameter, 2)) {
  3144. let del = 0.01;
  3145. let offest = 0;
  3146. let realX = disX - this.gameObj.x;
  3147. let realY = disY - this.gameObj.y;
  3148. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3149. offest += del;
  3150. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3151. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3152. }
  3153. this.helpOut.type = "ok";
  3154. this.helpOut.x = realX + this.gameObj.x;
  3155. this.helpOut.y = realY + this.gameObj.y;
  3156. return this.helpOut;
  3157. }
  3158. else {
  3159. this.helpOut.type = "no";
  3160. return this.helpOut;
  3161. }
  3162. }
  3163. clearBallEft() {
  3164. this.clearBallRightEft();
  3165. this.clearBallWrongEft();
  3166. }
  3167. clearBallRightEft() {
  3168. this.ui.breathAni.stop();
  3169. this.ui.rightTips.visible = false;
  3170. }
  3171. clearBallWrongEft() {
  3172. this.ui.wrongTips.visible = false;
  3173. }
  3174. showWrongEft() {
  3175. if (!xGame.common.gameMgr.selfTurn)
  3176. return;
  3177. this.ui.wrongTips.visible = true;
  3178. }
  3179. showRightEft() {
  3180. if (!xGame.common.gameMgr.selfTurn)
  3181. return;
  3182. this.ui.rightTips.visible = true;
  3183. this.ui.rightTips.scaleX = 1;
  3184. this.ui.rightTips.scaleY = 1;
  3185. this.ui.breathAni.play();
  3186. }
  3187. setBallFunc(type, owner) {
  3188. if (type == "ice") {
  3189. this.ballFunc = type;
  3190. this.d3BallSrc.setAlbedoTexture(true);
  3191. this.rigy.type = "static";
  3192. this.iceOwner = owner;
  3193. }
  3194. else {
  3195. if (owner == this.iceOwner) {
  3196. this.ballFunc = type;
  3197. this.d3BallSrc.setAlbedoTexture(false);
  3198. this.rigy.type = "dynamic";
  3199. }
  3200. }
  3201. }
  3202. }
  3203. D2BallSrc._unid = 0;
  3204. class D2RootBallSrc extends D2BallSrc {
  3205. constructor() {
  3206. super();
  3207. this.maxSpeed = 0;
  3208. this.classicMaxSpeed = 2.2;
  3209. this.bigSkillMaxSpeed = 4;
  3210. this.angle = 0;
  3211. this.allPercent = 0;
  3212. this.linearPercent = 0;
  3213. this.anglePercent = 0;
  3214. this.maxAngleRate = 0.6;
  3215. this.baseRot = 7;
  3216. this.angleMax = 0;
  3217. this.speed = new Laya.Vector2();
  3218. this.rotSpeed = new Laya.Vector2();
  3219. }
  3220. isStill() {
  3221. let speed = this.rigy.linearVelocity;
  3222. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3223. if (this.anglePercent <= 0.1) {
  3224. this.rigy.linearVelocity = { x: 0, y: 0 };
  3225. return true;
  3226. }
  3227. }
  3228. return false;
  3229. }
  3230. reset() {
  3231. this.linearPercent = 0;
  3232. this.anglePercent = 0;
  3233. }
  3234. setSpeed(percent, angle) {
  3235. this.allPercent = percent;
  3236. this.angle = angle;
  3237. this.setAngleSpeed();
  3238. this.setLinearSpeed();
  3239. let hit = "hit";
  3240. if (percent < 25)
  3241. hit = "hit03";
  3242. else if (percent < 50)
  3243. hit = "hit02";
  3244. else if (percent < 75)
  3245. hit = "hit01";
  3246. xGame.soundMgr.playSound(hit);
  3247. }
  3248. setAngleSpeed() {
  3249. let offest = xGame.common.rodOffest;
  3250. let radius = 82;
  3251. let rate = Math.abs(offest.y / radius) * 0.5;
  3252. if (offest.y > 0)
  3253. this.angleMax = -this.baseRot * 2;
  3254. else
  3255. this.angleMax = this.baseRot;
  3256. this.rotY = -offest.x / radius * 100;
  3257. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3258. this.linearPercent = this.allPercent - this.anglePercent;
  3259. }
  3260. setLinearSpeed() {
  3261. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3262. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3263. if (!xGame.common.longHelpLine) {
  3264. let offset = -150 + xGame.common.randomNum(0, 300);
  3265. offset /= 100;
  3266. this.angle += offset;
  3267. }
  3268. }
  3269. }
  3270. let sin = Math.sin(this.angle * Math.PI / 180);
  3271. let cos = Math.cos(this.angle * Math.PI / 180);
  3272. switch (xGame.common.gameMode) {
  3273. case GameMode.classic:
  3274. this.maxSpeed = this.classicMaxSpeed;
  3275. break;
  3276. case GameMode.bigMove:
  3277. this.maxSpeed = this.bigSkillMaxSpeed;
  3278. break;
  3279. case GameMode.placeBall:
  3280. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3281. if (data.type == 1) {
  3282. this.maxSpeed = this.bigSkillMaxSpeed;
  3283. }
  3284. else {
  3285. this.maxSpeed = this.classicMaxSpeed;
  3286. }
  3287. break;
  3288. default:
  3289. break;
  3290. }
  3291. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3292. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3293. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3294. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3295. this.rigy.applyLinearImpulseToCenter(this.speed);
  3296. }
  3297. onUpdate() {
  3298. if (this.anglePercent > 0.1) {
  3299. this.anglePercent *= 0.97;
  3300. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3301. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3302. this.rigy.applyForceToCenter(this.rotSpeed);
  3303. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3304. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3305. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3306. if (num > 0.9)
  3307. this.canRot = true;
  3308. }
  3309. else
  3310. this.canRot = true;
  3311. if (Math.abs(this.rotY) > 0.1)
  3312. this.rotY *= 0.98;
  3313. super.onUpdate();
  3314. }
  3315. destroySelf() {
  3316. super.destroySelf();
  3317. this.speed = null;
  3318. }
  3319. }
  3320. class D2Ball extends Laya.Sprite {
  3321. constructor(isRootBall = false) {
  3322. super();
  3323. this.ui = ui_D2Ball.createInstance();
  3324. this.pivotX = this.ui.width / 2;
  3325. this.pivotY = this.ui.width / 2;
  3326. this.x = 0;
  3327. this.y = 0;
  3328. this.addChild(this.ui.displayObject);
  3329. this.ui.displayObject.x += this.ui.width / 2;
  3330. this.ui.displayObject.y += this.ui.width / 2;
  3331. if (isRootBall) {
  3332. this.d2Src = this.addComponent(D2RootBallSrc);
  3333. }
  3334. else {
  3335. this.d2Src = this.addComponent(D2BallSrc);
  3336. }
  3337. this.d2Src.ui = this.ui;
  3338. this.addCircleCollider();
  3339. this.addInnerCircleCollider();
  3340. this.addRigyBody();
  3341. }
  3342. addCircleCollider() {
  3343. let colli = xGame.common.getCollider("circle");
  3344. colli.radius = this.ui.width / 2;
  3345. this.addComponentIntance(colli);
  3346. this.d2Src.outColli = colli;
  3347. colli.label = "ball";
  3348. }
  3349. addInnerCircleCollider() {
  3350. let colli = xGame.common.getCollider("circle");
  3351. colli.radius = this.ui.inner.width / 2;
  3352. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3353. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3354. this.addComponentIntance(colli);
  3355. this.d2Src.innerColli = colli;
  3356. colli.label = "inner";
  3357. }
  3358. addRigyBody() {
  3359. let rigy = xGame.common.getRigbody();
  3360. rigy.type = "dynamic";
  3361. this.addComponentIntance(rigy);
  3362. this.d2Src.rigy = rigy;
  3363. }
  3364. disposeSelf() {
  3365. if (!this.ui.isDisposed) {
  3366. this.ui.dispose();
  3367. this.ui.removeFromParent();
  3368. this.ui = null;
  3369. }
  3370. }
  3371. }
  3372. class ui_D2Gan extends fgui.GComponent {
  3373. static createInstance() {
  3374. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3375. }
  3376. onConstruct() {
  3377. this.myIcon = (this.getChild("myIcon"));
  3378. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3379. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3380. this.self = (this.getChild("self"));
  3381. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3382. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3383. this.ai = (this.getChild("ai"));
  3384. }
  3385. }
  3386. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3387. class D2Gan {
  3388. constructor() {
  3389. this.offset = 0.15;
  3390. this.cell = 1.5;
  3391. this.onBallCell = 0.4;
  3392. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3393. this.moveNum = 70;
  3394. this.rulerRate = 0.1;
  3395. this.ui = ui_D2Gan.createInstance();
  3396. this.changeSelfRod();
  3397. this.changeAIRod();
  3398. }
  3399. changeSelfRod() {
  3400. let index = DataMgr.getCurBallRod();
  3401. let data = cfgTable.ballrodData[index + 1];
  3402. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3403. this.selfMySpine && this.selfMySpine.dispose();
  3404. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3405. if (data.spine) {
  3406. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3407. this.selfMySpine = new SpineMgr(data.spine, () => {
  3408. let xx = this.ui.selfEftRoot.width / 2;
  3409. let yy = this.ui.selfEftRoot.height / 2;
  3410. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3411. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3412. outSpine.rotation = -90;
  3413. });
  3414. }
  3415. }
  3416. changeAIRod() {
  3417. let length = Object.keys(cfgTable.ballrodData).length;
  3418. let rand = Math.floor(length * Math.random()) + 1;
  3419. let data = cfgTable.ballrodData[rand];
  3420. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3421. this.aiMySpine && this.aiMySpine.dispose();
  3422. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3423. if (data.spine) {
  3424. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3425. this.aiMySpine = new SpineMgr(data.spine, () => {
  3426. let xx = this.ui.aiEftRoot.width / 2;
  3427. let yy = this.ui.aiEftRoot.height / 2;
  3428. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3429. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3430. outSpine.rotation = -90;
  3431. });
  3432. }
  3433. }
  3434. setGanLastInfo() {
  3435. this.lastInfo.rotation = this.ui.rotation;
  3436. this.lastInfo.x = this.ui.x;
  3437. this.lastInfo.y = this.ui.y;
  3438. }
  3439. rotateSelf(flag, isRuler = false) {
  3440. let angle;
  3441. flag = flag * this.offset;
  3442. if (xGame.common.d2World.isHelpLineOnBall) {
  3443. angle = flag * this.onBallCell;
  3444. }
  3445. else {
  3446. angle = flag * this.cell;
  3447. }
  3448. if (isRuler) {
  3449. angle *= this.rulerRate;
  3450. }
  3451. this.ui.rotation += angle;
  3452. xGame.common.d2World.getHelpLine();
  3453. }
  3454. checkDistance() {
  3455. let target = xGame.common.d2World.targetBall;
  3456. let root = xGame.common.d2World.rootBall;
  3457. if (target == null) {
  3458. return 1;
  3459. }
  3460. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3461. if (dis <= 2500) {
  3462. return 5;
  3463. }
  3464. return 1;
  3465. }
  3466. rotDest(rot) {
  3467. this.ui.rotation = rot;
  3468. xGame.common.d2World.getHelpLine();
  3469. }
  3470. storagePower(powerNum) {
  3471. let pos = (powerNum / 100) * this.moveNum;
  3472. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3473. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3474. this.ui.x = this.lastInfo.x + xx;
  3475. this.ui.y = this.lastInfo.y + yy;
  3476. }
  3477. shoot() {
  3478. this.storagePower(0);
  3479. this.ui.visible = false;
  3480. }
  3481. destroySelf() {
  3482. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3483. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3484. this.selfMySpine && this.selfMySpine.dispose();
  3485. this.aiMySpine && this.aiMySpine.dispose();
  3486. this.lastInfo = null;
  3487. if (!this.ui.isDisposed) {
  3488. this.ui.removeFromParent();
  3489. this.ui.dispose();
  3490. }
  3491. }
  3492. }
  3493. class ui_HelpLine extends fgui.GComponent {
  3494. static createInstance() {
  3495. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3496. }
  3497. onConstruct() {
  3498. this.n10 = (this.getChild("n10"));
  3499. this.rect = (this.getChild("rect"));
  3500. this.dir11 = (this.getChild("dir11"));
  3501. this.dir = (this.getChild("dir"));
  3502. this.rootDir = (this.getChild("rootDir"));
  3503. this.dirDot = (this.getChild("dirDot"));
  3504. }
  3505. }
  3506. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3507. class D2HelpLine {
  3508. constructor() {
  3509. this.starX = 0;
  3510. this.starY = 0;
  3511. this.ui = ui_HelpLine.createInstance();
  3512. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3513. this.starX = this.ui.rect.x;
  3514. this.starY = this.ui.rect.y;
  3515. }
  3516. shoot() {
  3517. this.ui.visible = false;
  3518. }
  3519. destroySelf() {
  3520. if (this.ui.isDisposed) {
  3521. this.ui.removeFromParent();
  3522. this.ui.dispose();
  3523. }
  3524. }
  3525. }
  3526. class D2World extends Laya.Script {
  3527. constructor() {
  3528. super();
  3529. this.ballArr = [];
  3530. this.openCheckStill = false;
  3531. this.checkArr = [];
  3532. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3533. this.isHelpLineOnBall = false;
  3534. this.isOnSameLine = false;
  3535. this.reflectAngle = 0;
  3536. this.powerPercent = 0;
  3537. this.inHolesSpeed = [];
  3538. this.outDir = new Laya.Vector2();
  3539. this.rootDir = new Laya.Vector2();
  3540. this.aiLv = 0;
  3541. this.rootPos = new Laya.Vector2();
  3542. this.tempDir1 = new Laya.Vector2();
  3543. this.tempDir2 = new Laya.Vector2();
  3544. this.tempDir3 = new Laya.Vector2();
  3545. this.ballSize = 33;
  3546. this.destRot = 0;
  3547. }
  3548. initSelf() {
  3549. this.createBalls();
  3550. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3551. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3552. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3553. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3554. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3555. }
  3556. setBorderRect() {
  3557. let ui = xGame.common.gameUI.ui;
  3558. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3559. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3560. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3561. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3562. this.borderRect.x = starX;
  3563. this.borderRect.y = starY;
  3564. this.borderRect.width = width;
  3565. this.borderRect.height = height;
  3566. }
  3567. resetGame() {
  3568. this.openCheckStill = false;
  3569. let temp;
  3570. for (let index = 0; index < this.ballArr.length; index++) {
  3571. temp = this.ballArr[index];
  3572. temp.destroySelf();
  3573. }
  3574. xGame.common.d3World.ballRoot.destroyChildren();
  3575. xGame.common.gameUI.ui.ballNode.removeChildren();
  3576. console.log("进入摧毁逻辑");
  3577. this.d2Gan.destroySelf();
  3578. this.d2HelpLine.destroySelf();
  3579. this.ballArr = [];
  3580. }
  3581. setD2Gan() {
  3582. let ballNode = this.rootBall.ui;
  3583. let d2Gan = new D2Gan();
  3584. this.d2Gan = d2Gan;
  3585. let ganNode = d2Gan.ui;
  3586. ballNode.addChild(ganNode);
  3587. ganNode.pivotX = ganNode.pivotX;
  3588. ganNode.pivotY = ganNode.pivotY;
  3589. ganNode.x = ganNode.myIcon.width / 2;
  3590. ganNode.y = this.rootBall.gameObj.width;
  3591. d2Gan.setGanLastInfo();
  3592. }
  3593. setHelpLine() {
  3594. let d2Help = new D2HelpLine();
  3595. this.d2HelpLine = d2Help;
  3596. }
  3597. createBalls() {
  3598. let cfg;
  3599. switch (xGame.common.gameMode) {
  3600. case GameMode.classic:
  3601. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3602. break;
  3603. case GameMode.bigMove:
  3604. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3605. break;
  3606. case GameMode.placeBall:
  3607. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3608. break;
  3609. default:
  3610. break;
  3611. }
  3612. cfg = JSON.parse(JSON.stringify(cfg));
  3613. for (const key in cfg) {
  3614. if (cfg[key].value == 0) {
  3615. this.createRootBall(cfg[key]);
  3616. delete cfg[key];
  3617. break;
  3618. }
  3619. }
  3620. this.createOtherBalls(cfg);
  3621. }
  3622. createRootBall(data) {
  3623. let root = new D2Ball(true);
  3624. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3625. this.rootBall = root.d2Src;
  3626. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3627. let d3BallSrc = d3Ball.getComponent(Ball);
  3628. xGame.common.d3World.rootBall = d3Ball;
  3629. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3630. let xx = data.x;
  3631. let yy = data.y;
  3632. let numer = data.value;
  3633. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3634. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3635. this.ballArr.push(this.rootBall);
  3636. this.setD2Gan();
  3637. this.setHelpLine();
  3638. }
  3639. createOtherBalls(cfg) {
  3640. let temp;
  3641. let src;
  3642. let data;
  3643. for (const key in cfg) {
  3644. data = cfg[key];
  3645. temp = new D2Ball();
  3646. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3647. src = temp.d2Src;
  3648. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3649. src.initSelf(data.value, data.x, data.y, d3Ball);
  3650. this.ballArr.push(src);
  3651. }
  3652. }
  3653. shoot(percent) {
  3654. this.powerPercent = percent;
  3655. this.openCheckStill = true;
  3656. let d2Angle = this.d2Gan.ui.rotation;
  3657. this.rootBall.setSpeed(percent, d2Angle);
  3658. this.clearBallAllEft();
  3659. this.changePlayerView();
  3660. }
  3661. onUpdate() {
  3662. if (!this.openCheckStill)
  3663. return;
  3664. this.checkStill();
  3665. }
  3666. checkStill() {
  3667. for (let index = 0; index < this.ballArr.length; index++) {
  3668. if (!this.ballArr[index].isStill()) {
  3669. return;
  3670. }
  3671. }
  3672. xGame.eventMgr.event(ALL_BALL_STOP);
  3673. }
  3674. allBallStop() {
  3675. this.openCheckStill = false;
  3676. xGame.common.recoverCameraView();
  3677. }
  3678. waitShoot() {
  3679. if (!this.d2Gan.ui.isDisposed) {
  3680. this.d2Gan.ui.visible = true;
  3681. }
  3682. if (!this.d2HelpLine.ui.isDisposed) {
  3683. this.d2HelpLine.ui.visible = true;
  3684. }
  3685. this.clearBallAllEft();
  3686. this.showBallRightEft();
  3687. this.getHelpLine();
  3688. this.inHolesSpeed = [];
  3689. this.selectOneBall();
  3690. }
  3691. _getAllBallArr() {
  3692. let arr = this.ballArr;
  3693. let outArr = [];
  3694. for (let index = 0; index < arr.length; index++) {
  3695. if (arr[index] instanceof D2RootBallSrc)
  3696. continue;
  3697. if (arr[index].ballFunc == "ice")
  3698. continue;
  3699. if (arr[index].destroyed)
  3700. continue;
  3701. outArr.push(arr[index]);
  3702. }
  3703. return outArr;
  3704. }
  3705. _getBlackObj() {
  3706. let arr = this.ballArr;
  3707. for (let index = 0; index < arr.length; index++) {
  3708. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3709. return arr[index];
  3710. }
  3711. }
  3712. }
  3713. selectOneBall() {
  3714. let all = this._getAllBallArr();
  3715. let target;
  3716. switch (xGame.common.gameMode) {
  3717. case GameMode.classic:
  3718. if (xGame.common.gameMgr.selfTurn) {
  3719. let self = xGame.common.gameMgr.selfBallArr;
  3720. let black = this._getBlackObj();
  3721. if (xGame.common.gameMgr.ensureBallType) {
  3722. if (self.length > 0) {
  3723. let out = [];
  3724. for (let j = 0; j < all.length; j++) {
  3725. if (self.indexOf(all[j].number) > -1) {
  3726. out.push(all[j]);
  3727. }
  3728. }
  3729. target = this.selectBestEnterOne(out);
  3730. }
  3731. else {
  3732. target = this.selectBestEnterOne([black]);
  3733. }
  3734. }
  3735. else {
  3736. target = this.selectBestEnterOne(all);
  3737. }
  3738. }
  3739. else {
  3740. target = this.selectBestEnterOne(all);
  3741. }
  3742. break;
  3743. case GameMode.bigMove:
  3744. target = this.selectBestEnterOne(all);
  3745. break;
  3746. case GameMode.placeBall:
  3747. if (all.length > 0) {
  3748. target = this.selectBestEnterOne(all);
  3749. }
  3750. break;
  3751. default:
  3752. break;
  3753. }
  3754. if (target && !target.destroyed && target.onClick) {
  3755. target.onClick(0, true);
  3756. let num = -200 + xGame.common.randomNum(0, 400);
  3757. num /= 150;
  3758. if (xGame.common.longHelpLine) {
  3759. num = 0;
  3760. }
  3761. this.destRot += num;
  3762. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3763. }
  3764. }
  3765. removeOneBall(ball) {
  3766. for (let index = 0; index < this.ballArr.length; index++) {
  3767. if (this.ballArr[index].id == ball.id) {
  3768. this.ballArr.splice(index, 1);
  3769. break;
  3770. }
  3771. }
  3772. }
  3773. getHelpLine() {
  3774. this.d2HelpLine.ui.dirDot.visible = false;
  3775. this.isOnSameLine = false;
  3776. let startX = this.rootBall.gameObj.x;
  3777. let startY = this.rootBall.gameObj.y;
  3778. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3779. if (dis == null) {
  3780. this.d2HelpLine.ui.visible = false;
  3781. console.error("辅助线异常");
  3782. return;
  3783. }
  3784. this.d2HelpLine.ui.visible = true;
  3785. let angle = this.d2Gan.ui.rotation;
  3786. let radius = 16.5;
  3787. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3788. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3789. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3790. if (colliObj == null) {
  3791. this.getColliPos(disX, disY, radius, angle);
  3792. xGame.common.d2World.isHelpLineOnBall = false;
  3793. this.targetBall = null;
  3794. this.reflectAngle = 0;
  3795. this.showBallWrongEft();
  3796. }
  3797. else {
  3798. let target = colliObj.src;
  3799. let radius = 16.5;
  3800. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3801. dis1 = Math.sqrt(dis1);
  3802. let realDis = colliObj.disHon - dis1;
  3803. let dir = colliObj.dir;
  3804. let xx = startX + dir.x * realDis;
  3805. let yy = startY + dir.y * realDis;
  3806. this.getColliPos(xx, yy, radius, angle);
  3807. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3808. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3809. let offset = xGame.common.rodOffest;
  3810. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3811. this.isOnSameLine = true;
  3812. }
  3813. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3814. xGame.common.d2World.isHelpLineOnBall = true;
  3815. this.targetBall = target;
  3816. this.reflectAngle = reflectAngle;
  3817. this.showBallWrongEft();
  3818. if (xGame.common.longHelpLine) {
  3819. this.delayReflectLine(target, reflectAngle);
  3820. }
  3821. }
  3822. }
  3823. getBorderDot(startX, startY, angle) {
  3824. let radius = 17;
  3825. let distance;
  3826. let isDone;
  3827. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3828. isDone = this.judgeUpDown(distance, angle, startX);
  3829. if (isDone != null) {
  3830. return isDone;
  3831. }
  3832. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3833. isDone = this.judgeUpDown(distance, angle, startX);
  3834. if (isDone != null) {
  3835. return isDone;
  3836. }
  3837. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3838. isDone = this.judgeLeftRight(distance, angle, startY);
  3839. if (isDone != null) {
  3840. return isDone;
  3841. }
  3842. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3843. isDone = this.judgeLeftRight(distance, angle, startY);
  3844. if (isDone != null) {
  3845. return isDone;
  3846. }
  3847. }
  3848. judgeUpDown(distance, angle, startX) {
  3849. let flag = Math.sin(angle * Math.PI / 180);
  3850. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3851. if (distance >= 0) {
  3852. if (flag > 0) {
  3853. if (temp < this.borderRect.x + this.borderRect.width) {
  3854. return distance;
  3855. }
  3856. }
  3857. else {
  3858. if (temp > this.borderRect.x) {
  3859. return distance;
  3860. }
  3861. }
  3862. }
  3863. }
  3864. judgeLeftRight(distance, angle, starY) {
  3865. let flag = -Math.cos(angle * Math.PI / 180);
  3866. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3867. if (distance >= 0) {
  3868. if (flag > 0) {
  3869. if (temp < this.borderRect.y + this.borderRect.height) {
  3870. return distance;
  3871. }
  3872. }
  3873. else {
  3874. if (temp > this.borderRect.y) {
  3875. return distance;
  3876. }
  3877. }
  3878. }
  3879. }
  3880. clearBallAllEft() {
  3881. let temp;
  3882. for (let index = 0; index < this.ballArr.length; index++) {
  3883. temp = this.ballArr[index];
  3884. temp.clearBallEft();
  3885. }
  3886. }
  3887. showBallRightEft() {
  3888. let gameMgr = xGame.common.gameMgr;
  3889. let temp;
  3890. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3891. if (targetArr.length <= 0)
  3892. return;
  3893. for (let index = 0; index < this.ballArr.length; index++) {
  3894. temp = this.ballArr[index];
  3895. if (targetArr.indexOf(temp.number) > -1) {
  3896. temp.showRightEft();
  3897. }
  3898. }
  3899. }
  3900. showBallWrongEft() {
  3901. let gameMgr = xGame.common.gameMgr;
  3902. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3903. if (targetArr.length <= 0)
  3904. return;
  3905. let temp;
  3906. for (let index = 0; index < this.ballArr.length; index++) {
  3907. temp = this.ballArr[index];
  3908. if (this.targetBall && this.targetBall.number == temp.number) {
  3909. if (targetArr.indexOf(temp.number) <= -1) {
  3910. temp.showWrongEft();
  3911. }
  3912. else {
  3913. temp.clearBallWrongEft();
  3914. }
  3915. }
  3916. else {
  3917. temp.clearBallWrongEft();
  3918. }
  3919. }
  3920. }
  3921. getColliPos(x, y, radius, angle) {
  3922. this.d2HelpLine.ui.x = x;
  3923. this.d2HelpLine.ui.y = y;
  3924. let dirX = x - this.rootBall.gameObj.x;
  3925. let dirY = y - this.rootBall.gameObj.y;
  3926. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3927. if (rectH <= 0)
  3928. rectH = 0;
  3929. this.d2HelpLine.ui.rect.height = 0;
  3930. this.d2HelpLine.ui.rect.height = rectH;
  3931. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3932. if (rectH < this.rootBall.gameObj.width) {
  3933. this.d2HelpLine.ui.rect.visible = false;
  3934. }
  3935. else {
  3936. this.d2HelpLine.ui.rect.visible = true;
  3937. }
  3938. this.d2HelpLine.ui.dir.visible = false;
  3939. this.d2HelpLine.ui.rootDir.visible = false;
  3940. }
  3941. getReflectLine(x, y, radius, target) {
  3942. this.d2HelpLine.ui.dir.visible = true;
  3943. let dirX = target.x - x;
  3944. let dirY = target.y - y;
  3945. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3946. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3947. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3948. this.d2HelpLine.ui.dir.height = 48;
  3949. this.d2HelpLine.ui.dir.rotation = angle;
  3950. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3951. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3952. return angle;
  3953. }
  3954. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3955. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3956. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3957. let targetX = target.gameObj.x;
  3958. let targetY = target.gameObj.y;
  3959. this.outDir.setValue(targetX - xx, targetY - yy);
  3960. this.rootDir.setValue(rtX - xx, rtY - yy);
  3961. let ver = Math.PI / 2;
  3962. let sin = Math.sin(ver);
  3963. let cos = Math.cos(ver);
  3964. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3965. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3966. this.outDir.setValue(outX, outY);
  3967. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3968. Laya.Vector2.normalize(this.outDir, this.outDir);
  3969. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3970. if (Math.abs(result) <= 0.08) {
  3971. this.d2HelpLine.ui.rootDir.visible = false;
  3972. return;
  3973. }
  3974. if (result > 0) {
  3975. angle += 90;
  3976. }
  3977. else if (result < 0) {
  3978. angle -= 90;
  3979. }
  3980. this.d2HelpLine.ui.rootDir.visible = true;
  3981. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3982. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3983. this.d2HelpLine.ui.rootDir.rotation = angle;
  3984. }
  3985. delayReflectLine(obj, angle) {
  3986. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3987. return;
  3988. }
  3989. this.isOnSameLine = false;
  3990. let startX = obj.gameObj.x;
  3991. let startY = obj.gameObj.y;
  3992. let dis = this.getBorderDot(startX, startY, angle);
  3993. if (dis == null) {
  3994. this.d2HelpLine.ui.dirDot.visible = false;
  3995. return;
  3996. }
  3997. this.d2HelpLine.ui.visible = true;
  3998. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3999. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4000. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  4001. if (colliObj == null) {
  4002. this.setDelayLine(disX, disY, obj, angle);
  4003. }
  4004. else {
  4005. let radius = 16;
  4006. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  4007. dis1 = Math.sqrt(dis1);
  4008. let realDis = colliObj.disHon - dis1;
  4009. let dir = colliObj.dir;
  4010. let xx = startX + dir.x * realDis;
  4011. let yy = startY + dir.y * realDis;
  4012. this.setDelayLine(xx, yy, obj, angle);
  4013. }
  4014. }
  4015. setDelayLine(x, y, obj, angle) {
  4016. let dirX = x - obj.gameObj.x;
  4017. let dirY = y - obj.gameObj.y;
  4018. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  4019. if (rectH <= 0)
  4020. rectH = 0;
  4021. this.d2HelpLine.ui.dir.height = rectH;
  4022. this.d2HelpLine.ui.dirDot.visible = true;
  4023. this.d2HelpLine.ui.dirDot.x = 17;
  4024. this.d2HelpLine.ui.dirDot.y = 17;
  4025. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  4026. ;
  4027. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  4028. }
  4029. changePlayerView() {
  4030. if (Math.random() >= 0.7)
  4031. return;
  4032. if (!this.targetBall) {
  4033. return;
  4034. }
  4035. if (!xGame.common.gameMgr.selfTurn)
  4036. return;
  4037. switch (xGame.common.gameMode) {
  4038. case GameMode.classic:
  4039. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  4040. if (this.targetBall.number != 8) {
  4041. return;
  4042. }
  4043. }
  4044. break;
  4045. case GameMode.bigMove:
  4046. return;
  4047. case GameMode.placeBall:
  4048. break;
  4049. default:
  4050. break;
  4051. }
  4052. let startX = this.targetBall.gameObj.x;
  4053. let startY = this.targetBall.gameObj.y;
  4054. let angle = this.reflectAngle;
  4055. let dis = this.getBorderDot(startX, startY, angle);
  4056. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4057. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4058. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  4059. if (colliObj) {
  4060. return;
  4061. }
  4062. let offset = 40;
  4063. let posObj = xGame.common.gameMgr.posObj;
  4064. let temp;
  4065. let radius;
  4066. let tarX, tarY;
  4067. for (const key in posObj) {
  4068. temp = posObj[key];
  4069. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4070. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4071. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4072. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4073. xGame.common.showOneCamera("angle" + key);
  4074. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4075. Laya.physicsTimer.scale = 0.7;
  4076. break;
  4077. }
  4078. }
  4079. }
  4080. selectBestEnterOne(arr) {
  4081. this.aiLv = xGame.tools.random(1, 11);
  4082. this.aiLv = 10;
  4083. this.wBall = xGame.common.d2World.rootBall;
  4084. this.rootPos.x = this.wBall.gameObj.x;
  4085. this.rootPos.y = this.wBall.gameObj.y;
  4086. this.initHoleBall(arr);
  4087. return this.selectBall();
  4088. }
  4089. selectBall() {
  4090. let ball = null;
  4091. this.destRot = 0;
  4092. let ai = 110 - this.aiLv * 10;
  4093. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4094. let score = false;
  4095. if (this.scoreBall.length < 1) {
  4096. if (this.lineBall.length < 1) {
  4097. for (let i = 0; i < this.kickBall.length; i++) {
  4098. let list = [];
  4099. let bo = this.kickBall[i];
  4100. let bobj = bo.gameObj;
  4101. let rect = xGame.common.d2World.borderRect;
  4102. let mobj = this.wBall.gameObj;
  4103. let minb = bobj.y - rect.y - 20;
  4104. let minw = mobj.y - rect.y - 50;
  4105. if (minb > 0 && minw > 0) {
  4106. let dlenx = 0;
  4107. let dleny = mobj.y - rect.y;
  4108. let spx = mobj.x;
  4109. let spy = rect.y - dleny;
  4110. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4111. }
  4112. minb = rect.y + rect.height - bobj.y - 20;
  4113. minw = rect.y + rect.height - mobj.y - 50;
  4114. if (minb > 0 && minw > 0) {
  4115. let dlenx = 0;
  4116. let dleny = rect.y + rect.height - mobj.y;
  4117. let spx = mobj.x;
  4118. let spy = rect.y + rect.height + dleny;
  4119. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4120. }
  4121. minb = bobj.x - rect.x - 20;
  4122. minw = mobj.x - rect.x - 50;
  4123. if (minb > 0 && minw > 0) {
  4124. let dlenx = mobj.x - rect.x;
  4125. let dleny = 0;
  4126. let spx = rect.x - dlenx;
  4127. let spy = mobj.y;
  4128. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4129. }
  4130. minb = rect.x + rect.width - bobj.x - 20;
  4131. minw = rect.x + rect.width - mobj.x - 50;
  4132. if (minb > 0 && minw > 0) {
  4133. let dlenx = rect.x + rect.width - mobj.x;
  4134. let dleny = 0;
  4135. let spx = rect.x + rect.width + dlenx;
  4136. let spy = mobj.y;
  4137. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4138. }
  4139. list.sort(function (a, b) {
  4140. return a.order - b.order;
  4141. });
  4142. for (let i = 0; i < list.length; i++) {
  4143. let data = list[i];
  4144. let mx = mobj.x - bobj.x;
  4145. let my = mobj.y - bobj.y;
  4146. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4147. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4148. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4149. if (num > 1)
  4150. num = 1;
  4151. let cos = Math.acos(num);
  4152. if (cos > 1.57)
  4153. cos = 1.57;
  4154. else if (cos < 0.01)
  4155. cos = 0.01;
  4156. let tan = Math.tan(cos);
  4157. let dx = tan * data.dleny;
  4158. let dy = tan * data.dlenx;
  4159. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4160. if (Math.abs(bx - 667) < 40)
  4161. continue;
  4162. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4163. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4164. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4165. this.forceMax = dis * 0.08;
  4166. this.destRot += mis * 0.1;
  4167. this.setKick(bx, by);
  4168. return true;
  4169. }
  4170. }
  4171. }
  4172. }
  4173. else {
  4174. ball = xGame.common.getRandArrEle(this.lineBall);
  4175. }
  4176. }
  4177. else {
  4178. for (let i = 0; i < this.scoreBall.length; i++) {
  4179. if (i < this.scoreBall.length - 1) {
  4180. let rand = 70 + this.aiLv * 10 + i * 10;
  4181. if (xGame.tools.random(0, 100) < rand) {
  4182. ball = this.scoreBall[i];
  4183. break;
  4184. }
  4185. }
  4186. else {
  4187. ball = this.scoreBall[i];
  4188. break;
  4189. }
  4190. }
  4191. score = true;
  4192. this.selectNum++;
  4193. }
  4194. if (!ball)
  4195. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4196. let dx = ball.gameObj.x;
  4197. let dy = ball.gameObj.y;
  4198. let kickAngle = 0;
  4199. if (score) {
  4200. dx = ball.kickPos.x;
  4201. dy = ball.kickPos.y;
  4202. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4203. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4204. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4205. if (adot > 1)
  4206. adot = 1;
  4207. kickAngle = Math.acos(adot) * 57.3;
  4208. if (kickAngle > 45) {
  4209. let kdx = ball.kickPos.x - ball.gameObj.x;
  4210. let kdy = ball.kickPos.y - ball.gameObj.y;
  4211. dx = ball.kickPos.x - kdx * mis * 0.3;
  4212. dy = ball.kickPos.y - kdy * mis * 0.3;
  4213. }
  4214. else
  4215. this.destRot += mis;
  4216. }
  4217. else if (ball.poleAngle != 0) {
  4218. this.destRot += ball.poleAngle;
  4219. }
  4220. if (xGame.common.gameMode == 0) {
  4221. let af = kickAngle * 0.08;
  4222. this.forceMax = ball.hard * 0.1 + af * af;
  4223. }
  4224. this.setKick(dx, dy);
  4225. return ball;
  4226. }
  4227. initHoleBall(arr) {
  4228. this.kickBall = [];
  4229. this.lineBall = [];
  4230. this.scoreBall = [];
  4231. this.holeBall = [];
  4232. this.selectNum = 0;
  4233. this.forceNum = 0;
  4234. this.forceMax = 0;
  4235. this.turnNum = 0;
  4236. let list = arr;
  4237. let holes = xGame.common.gameMgr.holePosList;
  4238. let self = xGame.common.aiPlayer;
  4239. for (let i = 0; i < list.length; i++) {
  4240. let obj = list[i];
  4241. if (!obj)
  4242. continue;
  4243. obj.kickPos.x = 0;
  4244. obj.kickPos.y = 0;
  4245. obj.poleAngle = 0;
  4246. obj.hard = 0;
  4247. obj.borderDis = 0;
  4248. obj.kickAngle = 180;
  4249. let b = obj.gameObj;
  4250. let wbp = this.rootPos;
  4251. let bx = wbp.x - b.x;
  4252. let by = wbp.y - b.y;
  4253. obj.borderDis = xGame.tools.random(0, 100);
  4254. this.kickBall.push(obj);
  4255. if (!this.isLine(wbp, obj))
  4256. continue;
  4257. obj.kickAngle = xGame.tools.random(90, 180);
  4258. obj.kickPos.x = b.x;
  4259. obj.kickPos.y = b.y;
  4260. this.lineBall.push(obj);
  4261. let minDis = 999999;
  4262. let hole = false;
  4263. for (let j = 0; j < holes.length; j++) {
  4264. let hp = holes[j];
  4265. if (bx >= 0 && hp.x > b.x + 100)
  4266. continue;
  4267. if (bx <= 0 && hp.x < b.x - 100)
  4268. continue;
  4269. if (by < -10 && hp.y < wbp.y)
  4270. continue;
  4271. if (by > 10 && hp.y > wbp.y)
  4272. continue;
  4273. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4274. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4275. if (dis < minDis) {
  4276. let dx = b.x - this.tempDir1.x * this.ballSize;
  4277. let dy = b.y - this.tempDir1.y * this.ballSize;
  4278. this.tempDir3.x = this.tempDir1.x;
  4279. this.tempDir3.y = this.tempDir1.y;
  4280. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4281. obj.kickPos.x = dx;
  4282. obj.kickPos.y = dy;
  4283. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4284. if (num > 1)
  4285. num = 1;
  4286. obj.kickAngle = Math.acos(num) * 57.3;
  4287. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4288. dis = dis * 2;
  4289. if (Math.abs(hp.x - 600) < 100)
  4290. dis += 50;
  4291. obj.hard = dis + obj.kickAngle * 3;
  4292. hole = true;
  4293. }
  4294. }
  4295. }
  4296. }
  4297. if (hole) {
  4298. this.scoreBall.push(obj);
  4299. this.holeBall.push(obj);
  4300. }
  4301. }
  4302. this.scoreBall.sort(function (a, b) {
  4303. return a.hard - b.hard;
  4304. });
  4305. this.holeBall.sort(function (a, b) {
  4306. return a.kickAngle - b.kickAngle;
  4307. });
  4308. this.kickBall.sort(function (a, b) {
  4309. return a.borderDis - b.borderDis;
  4310. });
  4311. }
  4312. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4313. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4314. let balls = xGame.common.d2World.ballArr;
  4315. let max = xGame.tools.getDis(hx, hy, bx, by);
  4316. for (let index = 0; index < balls.length; index++) {
  4317. let obj = balls[index];
  4318. if (obj.number == 0)
  4319. continue;
  4320. if (obj.number == bn || obj.number == dn)
  4321. continue;
  4322. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4323. if (dis * dis > max)
  4324. continue;
  4325. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4326. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4327. if (num > 1)
  4328. num = 1;
  4329. if (num < 0)
  4330. continue;
  4331. let gap = Math.sin(Math.acos(num)) * dis;
  4332. if (gap < this.ballSize)
  4333. return true;
  4334. }
  4335. return false;
  4336. }
  4337. isLine(xy, ball) {
  4338. let bx = xy.x;
  4339. let by = xy.y;
  4340. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4341. let dis = ball.getDestDis(xy);
  4342. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4343. let sin = Math.sin(angle);
  4344. let cos = Math.cos(angle);
  4345. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4346. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4347. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4348. let dx = bx + this.tempDir2.x * dis;
  4349. let dy = by + this.tempDir2.y * dis;
  4350. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4351. sin = Math.sin(-angle);
  4352. cos = Math.cos(-angle);
  4353. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4354. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4355. dx = bx + this.tempDir2.x * dis;
  4356. dy = by + this.tempDir2.y * dis;
  4357. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4358. if (isr && isl)
  4359. return false;
  4360. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4361. }
  4362. return true;
  4363. }
  4364. setKick(dx, dy) {
  4365. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4366. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4367. this.tempDir1.x = 0;
  4368. this.tempDir1.y = 1;
  4369. this.tempDir2.y = -this.tempDir2.y;
  4370. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4371. if (num > 1)
  4372. num = 1;
  4373. let rot = Math.acos(num) * 57.3;
  4374. if (this.tempDir2.x < 0)
  4375. rot = 360 - rot;
  4376. this.destRot += rot;
  4377. }
  4378. }
  4379. class ui_UIGame extends fgui.GComponent {
  4380. static createInstance() {
  4381. return (fgui.UIPackage.createObject("game", "UIGame"));
  4382. }
  4383. onConstruct() {
  4384. this.c1 = this.getController("c1");
  4385. this.d3Root = (this.getChild("d3Root"));
  4386. this.clickNode = (this.getChild("clickNode"));
  4387. this.d2Root = (this.getChild("d2Root"));
  4388. this.topNode = (this.getChild("topNode"));
  4389. this.n72 = (this.getChild("n72"));
  4390. this.n40 = (this.getChild("n40"));
  4391. this.rulerNode = (this.getChild("rulerNode"));
  4392. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4393. this.n50 = (this.getChild("n50"));
  4394. this.keduNode = (this.getChild("keduNode"));
  4395. this.powerTxt = (this.getChild("powerTxt"));
  4396. this.powerNode = (this.getChild("powerNode"));
  4397. this.colorNode = (this.getChild("colorNode"));
  4398. this.powerEft = (this.getChild("powerEft"));
  4399. this.myPowerNode = (this.getChild("myPowerNode"));
  4400. this.ganNode = (this.getChild("ganNode"));
  4401. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4402. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4403. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4404. this.skillRod = (this.getChild("skillRod"));
  4405. this.border = (this.getChild("border"));
  4406. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4407. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4408. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4409. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4410. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4411. this.guanyuNode = (this.getChild("guanyuNode"));
  4412. this.helpBtn = (this.getChild("helpBtn"));
  4413. this.wordsBtn = (this.getChild("wordsBtn"));
  4414. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4415. this.returnBtn = (this.getChild("returnBtn"));
  4416. this.ballNode = (this.getChild("ballNode"));
  4417. this.whiteAni = (this.getChild("whiteAni"));
  4418. this.blackAni = (this.getChild("blackAni"));
  4419. this.selfTurn = (this.getChild("selfTurn"));
  4420. this.aiTurn = (this.getChild("aiTurn"));
  4421. this.deskNode = (this.getChild("deskNode"));
  4422. this.moveNode = (this.getChild("moveNode"));
  4423. this.selfTalk = (this.getChild("selfTalk"));
  4424. this.aiTalk = (this.getChild("aiTalk"));
  4425. this.d2Node = (this.getChild("d2Node"));
  4426. this.snowNode = (this.getChild("snowNode"));
  4427. this.guide2 = (this.getChild("guide2"));
  4428. this.guide1 = (this.getChild("guide1"));
  4429. this.guide3 = (this.getChild("guide3"));
  4430. this.guideNode = (this.getChild("guideNode"));
  4431. }
  4432. }
  4433. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4434. class ui_UIGameEnd extends fgui.GComponent {
  4435. static createInstance() {
  4436. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4437. }
  4438. onConstruct() {
  4439. this.c1 = this.getController("c1");
  4440. this.n22 = (this.getChild("n22"));
  4441. this.n2 = (this.getChild("n2"));
  4442. this.n52 = (this.getChild("n52"));
  4443. this.n53 = (this.getChild("n53"));
  4444. this.coinNode = (this.getChild("coinNode"));
  4445. this.closeNode = (this.getChild("closeNode"));
  4446. this.moneyNode = (this.getChild("moneyNode"));
  4447. this.secretary = (this.getChild("secretary"));
  4448. this.n27 = (this.getChild("n27"));
  4449. this.n29 = (this.getChild("n29"));
  4450. this.talkNode = (this.getChild("talkNode"));
  4451. this.n38 = (this.getChild("n38"));
  4452. this.n39 = (this.getChild("n39"));
  4453. this.n40 = (this.getChild("n40"));
  4454. this.awardNode = (this.getChild("awardNode"));
  4455. this.starNumNode = (this.getChild("starNumNode"));
  4456. this.n47 = (this.getChild("n47"));
  4457. this.conditionNode = (this.getChild("conditionNode"));
  4458. this.isGetAward = (this.getChild("isGetAward"));
  4459. this.leftBtn = (this.getChild("leftBtn"));
  4460. this.rightBtn = (this.getChild("rightBtn"));
  4461. this.btnNode = (this.getChild("btnNode"));
  4462. }
  4463. }
  4464. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4465. class ui_UIAddCoin extends fgui.GComponent {
  4466. static createInstance() {
  4467. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4468. }
  4469. onConstruct() {
  4470. this.n11 = (this.getChild("n11"));
  4471. this.myNode = (this.getChild("myNode"));
  4472. this.t0 = this.getTransition("t0");
  4473. }
  4474. }
  4475. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4476. class UIAddCoin extends UIBase {
  4477. constructor() {
  4478. super();
  4479. this.coinNum = 2000;
  4480. }
  4481. onConstructor() {
  4482. this.ui = ui_UIAddCoin.createInstance();
  4483. this.contentPane = this.ui;
  4484. this.isEject = false;
  4485. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4486. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4487. }
  4488. show() {
  4489. super.show();
  4490. this.ui.t0.play();
  4491. this.setGlobalFont(this.ui);
  4492. }
  4493. videoAddCoin() {
  4494. console.log('zh:qjff_AD_for_UIAddCoin');
  4495. if (Laya.Browser.onAndroid) {
  4496. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4497. if (!boo) {
  4498. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4499. return;
  4500. }
  4501. }
  4502. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4503. }
  4504. else {
  4505. console.log('zh:AD 失败,直接发放奖励');
  4506. this.qjff_AD_for_UIAddCoin();
  4507. }
  4508. }
  4509. qjff_AD_for_UIAddCoin() {
  4510. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4511. this.hide();
  4512. }
  4513. }
  4514. UIAddCoin.uiName = "UIAddCoin";
  4515. class ui_UIInvitation extends fgui.GComponent {
  4516. static createInstance() {
  4517. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4518. }
  4519. onConstruct() {
  4520. this.n14 = (this.getChild("n14"));
  4521. this.myNode = (this.getChild("myNode"));
  4522. this.t0 = this.getTransition("t0");
  4523. }
  4524. }
  4525. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4526. class UIInvitation extends UIBase {
  4527. constructor() {
  4528. super();
  4529. }
  4530. onConstructor() {
  4531. this.ui = ui_UIInvitation.createInstance();
  4532. this.contentPane = this.ui;
  4533. this.isEject = false;
  4534. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4535. }
  4536. show() {
  4537. super.show();
  4538. this.setGlobalFont(this.ui);
  4539. }
  4540. enterGame() {
  4541. xGame.common.gameMode = GameMode.classic;
  4542. DataMgr.setChallengeTimes(1);
  4543. xGame.common.passAwardCoin = 2000;
  4544. let need = xGame.common.classicNiceNeddCoin;
  4545. if (DataMgr.coinEnough(need)) {
  4546. DataMgr.setCoin(-need);
  4547. xGame.eventMgr.event(RESTART_GAME, true);
  4548. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4549. }
  4550. else {
  4551. xGame.eventMgr.event(RESTART_GAME, true);
  4552. }
  4553. this.hide();
  4554. }
  4555. hide() {
  4556. super.hide();
  4557. }
  4558. }
  4559. UIInvitation.uiName = "UIInvitation";
  4560. class ui_UIMain extends fgui.GComponent {
  4561. static createInstance() {
  4562. return (fgui.UIPackage.createObject("game", "UIMain"));
  4563. }
  4564. onConstruct() {
  4565. this.n47 = (this.getChild("n47"));
  4566. this.n10 = (this.getChild("n10"));
  4567. this.secretary = (this.getChild("secretary"));
  4568. this.moneyNode = (this.getChild("moneyNode"));
  4569. this.headNode = (this.getChild("headNode"));
  4570. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4571. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4572. this.classicBtn = (this.getChild("classicBtn"));
  4573. this.globalBtn = (this.getChild("globalBtn"));
  4574. this.n44 = (this.getChild("n44"));
  4575. this.n_dengLu = (this.getChild("n_dengLu"));
  4576. this.settingNode = (this.getChild("settingNode"));
  4577. this.drawBtn = (this.getChild("drawBtn"));
  4578. this.signBtn = (this.getChild("signBtn"));
  4579. this.shopBtn = (this.getChild("shopBtn"));
  4580. this.n45 = (this.getChild("n45"));
  4581. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4582. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4583. this.rankBtn = (this.getChild("rankBtn"));
  4584. this.n46 = (this.getChild("n46"));
  4585. this.liucheng1 = (this.getChild("liucheng1"));
  4586. this.rightBtn = (this.getChild("rightBtn"));
  4587. this.n75 = (this.getChild("n75"));
  4588. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4589. this.liucheng2 = (this.getChild("liucheng2"));
  4590. this.guideBtn = (this.getChild("guideBtn"));
  4591. this.n73 = (this.getChild("n73"));
  4592. this.wordsNode = (this.getChild("wordsNode"));
  4593. this.enterGuide = (this.getChild("enterGuide"));
  4594. this.talkNode = (this.getChild("talkNode"));
  4595. this.n83 = (this.getChild("n83"));
  4596. this.n84 = (this.getChild("n84"));
  4597. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4598. }
  4599. }
  4600. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4601. class ui_UIMoyu extends fgui.GComponent {
  4602. static createInstance() {
  4603. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4604. }
  4605. onConstruct() {
  4606. this.ageTip = (this.getChild("ageTip"));
  4607. this.mainBg = (this.getChild("mainBg"));
  4608. this.xyNode = (this.getChild("xyNode"));
  4609. this.rnNode = (this.getChild("rnNode"));
  4610. this.fcmNode = (this.getChild("fcmNode"));
  4611. this.ageNode = (this.getChild("ageNode"));
  4612. this.tipNode = (this.getChild("tipNode"));
  4613. this.msgNode = (this.getChild("msgNode"));
  4614. }
  4615. }
  4616. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4617. class MoyuMgr {
  4618. static initMoyu() {
  4619. this.moyuView = new MoyuView();
  4620. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4621. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4622. this.moyuView.ui.displayObject.zOrder = 1000;
  4623. this.moyuView.init();
  4624. this.moyuView.showTip(true);
  4625. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4626. window['XApk'] = this;
  4627. }
  4628. static showAge(show) {
  4629. if (this.moyuView)
  4630. this.moyuView.showAge(show);
  4631. }
  4632. static onPlatMsg(idx) {
  4633. if (!MoyuMgr.moyuView)
  4634. return;
  4635. if (idx == '0') {
  4636. MoyuMgr.moyuView.showTip(false);
  4637. }
  4638. }
  4639. static showAgree(call) {
  4640. if (this.moyuView)
  4641. this.moyuView.showAgree(call);
  4642. else
  4643. call && call();
  4644. }
  4645. static showXy(type = 1) {
  4646. if (this.moyuView)
  4647. this.moyuView.showXy(type);
  4648. }
  4649. }
  4650. MoyuMgr.isAdvise = false;
  4651. class MoyuView {
  4652. constructor() {
  4653. this.ysxyNum = 1;
  4654. this.ysJson = null;
  4655. this.ui = ui_UIMoyu.createInstance();
  4656. }
  4657. init() {
  4658. this.ui.mainBg.visible = false;
  4659. this.ui.xyNode.visible = false;
  4660. this.ui.ageNode.visible = false;
  4661. this.ui.tipNode.visible = false;
  4662. this.ui.rnNode.visible = false;
  4663. this.ui.fcmNode.visible = false;
  4664. this.ui.ageTip.visible = false;
  4665. this.ui.msgNode.visible = false;
  4666. this.ui.visible = false;
  4667. this.ui.xyNode.xyList.setVirtual();
  4668. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4669. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4670. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4671. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4672. this.ui.xyNode.btnKnown.visible = false;
  4673. this.ui.xyNode.xy1.visible = false;
  4674. this.ui.xyNode.xy2.visible = false;
  4675. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4676. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4677. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4678. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4679. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4680. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4681. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4682. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4683. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4684. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4685. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4686. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4687. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4688. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4689. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4690. this.ysxyNum = 2;
  4691. }
  4692. }
  4693. onClick(obj) {
  4694. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4695. switch (obj) {
  4696. case this.ui.ageTip:
  4697. if (Moyu.isTTApk) {
  4698. this.ui.ageNode.visible = true;
  4699. this.ui.mainBg.visible = true;
  4700. }
  4701. break;
  4702. case this.ui.tipNode:
  4703. this.showTip(false);
  4704. break;
  4705. case this.ui.ageNode.btnAge:
  4706. this.ui.ageNode.visible = false;
  4707. this.ui.mainBg.visible = false;
  4708. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4709. this.ui.visible = false;
  4710. break;
  4711. case this.ui.xyNode.btnXy3:
  4712. case this.ui.xyNode.btnXy1:
  4713. this.loadXy(1);
  4714. break;
  4715. case this.ui.xyNode.btnXy2:
  4716. this.loadXy(2);
  4717. break;
  4718. case this.ui.xyNode.btnBack:
  4719. this.ui.xyNode.xy1.visible = true;
  4720. this.ui.xyNode.xy2.visible = false;
  4721. break;
  4722. case this.ui.xyNode.btnKnown:
  4723. this.ui.xyNode.visible = false;
  4724. this.ui.mainBg.visible = false;
  4725. this.ui.visible = false;
  4726. break;
  4727. case this.ui.rnNode.btnCheck:
  4728. this.check();
  4729. break;
  4730. case this.ui.rnNode.btnExit:
  4731. case this.ui.xyNode.btnNo:
  4732. this.ysxyNum--;
  4733. if (this.ysxyNum > 0)
  4734. this.showMsg("Refuse to quit the game once again");
  4735. else {
  4736. Moyu.userAgree(false);
  4737. Moyu.exit();
  4738. }
  4739. break;
  4740. case this.ui.xyNode.btnSure:
  4741. case this.ui.xyNode.btnYes:
  4742. DataMgr.userData.isAgree = true;
  4743. DataMgr.saveUserData();
  4744. this.onAgree();
  4745. break;
  4746. case this.ui.rnNode.btnDone:
  4747. this.ui.rnNode.visible = false;
  4748. this.ui.visible = false;
  4749. break;
  4750. case this.ui.fcmNode.btnRn:
  4751. this.showRn();
  4752. break;
  4753. }
  4754. }
  4755. showTip(show) {
  4756. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4757. return;
  4758. if (show) {
  4759. MoyuMgr.isAdvise = true;
  4760. this.ui.visible = true;
  4761. this.ui.tipNode.visible = true;
  4762. this.ui.tipNode.alpha = 1;
  4763. Laya.timer.once(1000, this, this.showTip, [false]);
  4764. }
  4765. else {
  4766. this.ui.tipNode.alpha = 1;
  4767. this.ui.tipNode.visible = true;
  4768. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4769. this.ui.tipNode.visible = false;
  4770. MoyuMgr.isAdvise = false;
  4771. }), 1000);
  4772. }
  4773. }
  4774. showAge(show, px = 0, py = 0) {
  4775. if (Moyu.platType > 10 && !Moyu.isIos) {
  4776. this.ui.ageTip.x = px;
  4777. this.ui.ageTip.y = py;
  4778. this.ui.ageTip.visible = show;
  4779. if (show)
  4780. this.ui.visible = true;
  4781. }
  4782. }
  4783. showAgree(call) {
  4784. this.agreeCall = call;
  4785. this.onAgree();
  4786. return;
  4787. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4788. this.showXy(0);
  4789. }
  4790. else
  4791. this.onAgree();
  4792. }
  4793. onAgree() {
  4794. if (!this.ui.ageNode.visible)
  4795. this.ui.visible = false;
  4796. this.ui.xyNode.visible = false;
  4797. Moyu.userAgree(true);
  4798. this.showAge(false);
  4799. this.agreeCall && this.agreeCall();
  4800. this.showRn();
  4801. }
  4802. showMsg(txt) {
  4803. this.ui.msgNode.txtMsg.text = txt;
  4804. this.ui.msgNode.visible = true;
  4805. this.ui.msgNode.alpha = 1;
  4806. this.ui.visible = true;
  4807. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4808. this.ui.msgNode.visible = false;
  4809. }), 2500, true);
  4810. }
  4811. showRn() {
  4812. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4813. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4814. this.ui.rnNode.rn1.visible = true;
  4815. this.ui.rnNode.rn2.visible = false;
  4816. this.ui.rnNode.rn3.visible = false;
  4817. this.ui.rnNode.rn4.visible = false;
  4818. this.ui.rnNode.visible = true;
  4819. this.ui.mainBg.visible = true;
  4820. this.ui.rnNode.btnDone.visible = false;
  4821. this.ui.rnNode.btnExit.visible = true;
  4822. this.ui.rnNode.btnCheck.visible = true;
  4823. this.ui.fcmNode.visible = false;
  4824. this.ui.visible = true;
  4825. return;
  4826. }
  4827. }
  4828. this.showFcm();
  4829. }
  4830. showFcm() {
  4831. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4832. Moyu.initFCM(true);
  4833. if (Moyu.gameTime < 1)
  4834. this.fcmLoop();
  4835. else if (Moyu.gameTime < 999)
  4836. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4837. }
  4838. }
  4839. fcmLoop() {
  4840. if (Moyu.gameTime < 1) {
  4841. this.ui.rnNode.visible = false;
  4842. this.ui.fcmNode.visible = true;
  4843. this.ui.mainBg.visible = true;
  4844. this.ui.visible = true;
  4845. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4846. Laya.timer.clear(this.ui, this.fcmLoop);
  4847. }
  4848. }
  4849. check() {
  4850. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4851. this.ui.rnNode.rn1.visible = false;
  4852. this.ui.rnNode.rn2.visible = false;
  4853. this.ui.rnNode.rn4.visible = true;
  4854. }
  4855. else if (this.ui.rnNode.rn4.visible) {
  4856. let name = this.ui.rnNode.inputName.text;
  4857. let code = this.ui.rnNode.inputCode.text;
  4858. if (code && code.length == 18) {
  4859. this.ui.rnNode.rn1.visible = false;
  4860. this.ui.rnNode.rn4.visible = false;
  4861. Moyu.authenticate(name, code, (res) => {
  4862. this.ui.rnNode.rn2.visible = !res;
  4863. this.ui.rnNode.rn3.visible = res;
  4864. this.ui.rnNode.btnDone.visible = res;
  4865. this.ui.rnNode.btnExit.visible = !res;
  4866. this.ui.rnNode.btnCheck.visible = !res;
  4867. if (res)
  4868. this.showFcm();
  4869. });
  4870. }
  4871. else
  4872. this.showMsg("信息填写不完整");
  4873. }
  4874. }
  4875. loadXy(type = 0) {
  4876. this.ui.xyNode.xy1.visible = false;
  4877. this.ui.xyNode.xy2.visible = true;
  4878. this.ui.xyNode.xyList.scrollToView(0);
  4879. if (type == 1) {
  4880. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4881. }
  4882. else if (type == 2) {
  4883. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4884. }
  4885. }
  4886. showXy(type = 0) {
  4887. this.xyBtn();
  4888. if (type == 0) {
  4889. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4890. this.ui.xyNode.btnSure.visible = true;
  4891. }
  4892. else {
  4893. this.ui.xyNode.btnYes.visible = true;
  4894. this.ui.xyNode.btnNo.visible = true;
  4895. }
  4896. }
  4897. else {
  4898. this.ui.xyNode.btnKnown.visible = true;
  4899. this.ui.mainBg.visible = true;
  4900. }
  4901. this.ui.xyNode.xy1.visible = true;
  4902. this.ui.xyNode.xy2.visible = false;
  4903. this.ui.xyNode.visible = true;
  4904. this.ui.visible = true;
  4905. }
  4906. xyBtn() {
  4907. this.ui.xyNode.btnSure.visible = false;
  4908. this.ui.xyNode.btnYes.visible = false;
  4909. this.ui.xyNode.btnNo.visible = false;
  4910. this.ui.xyNode.btnKnown.visible = false;
  4911. {
  4912. this.ui.xyNode.btnXy3.visible = false;
  4913. this.ui.xyNode.btnXy2.visible = true;
  4914. this.ui.xyNode.btnXy1.visible = true;
  4915. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4916. }
  4917. }
  4918. createXY(json) {
  4919. this.ysJson = json.content;
  4920. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4921. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4922. this.ui.xyNode.xy2.visible = true;
  4923. }
  4924. renderListItem(idx, cell) {
  4925. let xy = this.ysJson[idx];
  4926. cell.height = xy.line * 30;
  4927. cell.xyItem.text = xy.text;
  4928. }
  4929. onDestroy() {
  4930. this.agreeCall = null;
  4931. }
  4932. }
  4933. class SettingNode {
  4934. constructor(ui) {
  4935. this.showSetting = false;
  4936. this.openSound = true;
  4937. this.openShake = true;
  4938. this.ui = ui;
  4939. this.ui.soundBtn.onClick(this, this.switchSound);
  4940. this.ui.shakeBtn.onClick(this, this.switchShake);
  4941. this.ui.xyBtn.onClick(this, this.onXy);
  4942. this.ui.clickNode.onClick(this, this.changeSetting);
  4943. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4944. this.ui.xyBtn.visible = false;
  4945. this.ui.shakeBtn.visible = false;
  4946. }
  4947. changeSetting() {
  4948. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4949. this.showSetting = !this.showSetting;
  4950. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4951. }
  4952. switchSound() {
  4953. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4954. this.openSound = !this.openSound;
  4955. Moyu.onSetting(this.openSound, this.openShake);
  4956. xGame.soundMgr.onSetting(this.openSound);
  4957. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4958. }
  4959. switchShake() {
  4960. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4961. this.openShake = !this.openShake;
  4962. Moyu.onSetting(this.openSound, this.openShake);
  4963. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4964. }
  4965. onXy() {
  4966. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4967. MoyuMgr.showXy(1);
  4968. }
  4969. }
  4970. class ui_UILevelDisplay extends fgui.GComponent {
  4971. static createInstance() {
  4972. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4973. }
  4974. onConstruct() {
  4975. this.n9 = (this.getChild("n9"));
  4976. this.myNode = (this.getChild("myNode"));
  4977. this.closeNode = (this.getChild("closeNode"));
  4978. }
  4979. }
  4980. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4981. class ui_UILevelProp extends fgui.GComponent {
  4982. static createInstance() {
  4983. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4984. }
  4985. onConstruct() {
  4986. this.n16 = (this.getChild("n16"));
  4987. this.myNode = (this.getChild("myNode"));
  4988. this.closeBtn = (this.getChild("closeBtn"));
  4989. this.moneyNode = (this.getChild("moneyNode"));
  4990. this.t1 = this.getTransition("t1");
  4991. }
  4992. }
  4993. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4994. class ui_ShowItem extends fgui.GComponent {
  4995. static createInstance() {
  4996. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4997. }
  4998. onConstruct() {
  4999. this.myImg = (this.getChild("myImg"));
  5000. }
  5001. }
  5002. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  5003. class ShowItem {
  5004. constructor() {
  5005. this.ui = ui_ShowItem.createInstance();
  5006. }
  5007. destroySelf() {
  5008. if (!this.ui.isDisposed) {
  5009. this.ui.removeFromParent();
  5010. this.ui.dispose();
  5011. }
  5012. }
  5013. setParent(parent) {
  5014. parent.addChild(this.ui);
  5015. }
  5016. setPos(x, y) {
  5017. this.ui.x = x;
  5018. this.ui.y = y;
  5019. }
  5020. setUrl(index) {
  5021. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  5022. }
  5023. }
  5024. class ui_UIPower extends fgui.GComponent {
  5025. static createInstance() {
  5026. return (fgui.UIPackage.createObject("game", "UIPower"));
  5027. }
  5028. onConstruct() {
  5029. this.n11 = (this.getChild("n11"));
  5030. this.myNode = (this.getChild("myNode"));
  5031. this.t0 = this.getTransition("t0");
  5032. }
  5033. }
  5034. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  5035. class UIPower extends UIBase {
  5036. constructor() {
  5037. super();
  5038. }
  5039. onConstructor() {
  5040. this.ui = ui_UIPower.createInstance();
  5041. this.contentPane = this.ui;
  5042. this.isEject = false;
  5043. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  5044. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  5045. }
  5046. show() {
  5047. super.show();
  5048. this.ui.t0.play();
  5049. this.setGlobalFont(this.ui);
  5050. }
  5051. videoGetPower() {
  5052. console.log('zh:qjff_AD_for_uipower');
  5053. if (Laya.Browser.onAndroid) {
  5054. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  5055. if (!boo) {
  5056. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  5057. return;
  5058. }
  5059. }
  5060. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  5061. }
  5062. else {
  5063. console.log('zh:AD 失败,直接发放奖励');
  5064. this.qjff_AD_for_uipower();
  5065. }
  5066. }
  5067. qjff_AD_for_uipower() {
  5068. DataMgr.setPower(xGame.common.videoPower, true);
  5069. xGame.eventMgr.event(POWER_TIME);
  5070. this.hide();
  5071. }
  5072. }
  5073. UIPower.uiName = "UIPower";
  5074. class UILevelProp extends UIBase {
  5075. constructor() {
  5076. super();
  5077. this.firstPos = 385;
  5078. this.secondPos = 467;
  5079. this.showItemArr = [];
  5080. }
  5081. onConstructor() {
  5082. this.ui = ui_UILevelProp.createInstance();
  5083. this.contentPane = this.ui;
  5084. this.isEject = false;
  5085. this.addUIClick(this.ui.closeBtn, this.hide);
  5086. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5087. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5088. }
  5089. show(level) {
  5090. super.show();
  5091. this.ui.t1.play();
  5092. this.level = level;
  5093. this.data = cfgTable.placeballData[this.level];
  5094. this.updateSelf();
  5095. this.showPreView();
  5096. this.moneyNode.ui.c1.selectedIndex = 2;
  5097. this.moneyNode.checkPowerTime();
  5098. this.moneyNode.powerChange();
  5099. this.setGlobalFont(this.ui);
  5100. }
  5101. showPreView() {
  5102. let item;
  5103. let data;
  5104. for (let index = 0; index < this.showItemArr.length; index++) {
  5105. item = this.showItemArr[index];
  5106. item.destroySelf();
  5107. }
  5108. this.showItemArr = [];
  5109. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5110. for (const key in cfgData) {
  5111. data = cfgData[key];
  5112. item = new ShowItem();
  5113. item.setParent(this.ui.myNode.displayRoot);
  5114. item.setPos(data.x, data.y);
  5115. item.setUrl(data.value);
  5116. this.showItemArr.push(item);
  5117. }
  5118. }
  5119. updateSelf() {
  5120. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5121. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5122. if (this.data.ball == -1) {
  5123. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5124. }
  5125. else {
  5126. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5127. }
  5128. let localData = DataMgr.getPlaceBallLevel(this.level);
  5129. let getAward = localData.getAward;
  5130. let cfg = cfgTable.placeballData[this.level];
  5131. let coin = this.data.award[0];
  5132. let diamond = this.data.award[1];
  5133. if (cfg.type == PlaceBallType.challenge) {
  5134. diamond = 0;
  5135. coin = 100;
  5136. }
  5137. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5138. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5139. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5140. if (cfg.type == PlaceBallType.challenge) {
  5141. this.ui.myNode.coinNode.numTxt.text = "";
  5142. }
  5143. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5144. if (coin > 0 && diamond > 0) {
  5145. this.ui.myNode.diamondNode.x = 385;
  5146. this.ui.myNode.coinNode.x = 467;
  5147. }
  5148. else {
  5149. this.ui.myNode.diamondNode.x = 385;
  5150. this.ui.myNode.coinNode.x = 385;
  5151. }
  5152. if (!getAward) {
  5153. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5154. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5155. }
  5156. else {
  5157. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5158. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5159. }
  5160. }
  5161. startGame() {
  5162. if (DataMgr.powerEnough()) {
  5163. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5164. this.ui.myNode.startBtn.touchable = false;
  5165. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5166. console.log('zh:startGame ');
  5167. this.ui.myNode.startBtn.touchable = true;
  5168. DataMgr.setPower(-1);
  5169. xGame.eventMgr.event(POWER_TIME);
  5170. xGame.common.gameMode = GameMode.placeBall;
  5171. xGame.common.placeBallCurLevel = this.level;
  5172. xGame.uiMgr.Show(UIGame);
  5173. this.logEventForChallenge_level_start(this.level);
  5174. xGame.uiMgr.Hide(UILevelDisplay);
  5175. xGame.uiMgr.Hide(UIMain);
  5176. this.hide();
  5177. }));
  5178. }
  5179. else {
  5180. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5181. xGame.uiMgr.Show(UIPower);
  5182. }
  5183. }
  5184. logEventForChallenge_level_start(level) {
  5185. let keyStr = 'sjmd_challenge_level_start';
  5186. let jsonStr = {
  5187. "count": 1,
  5188. "gold_balance ": DataMgr.getCoin(),
  5189. "level": level,
  5190. "diamond_balance ": DataMgr.getDiamond()
  5191. };
  5192. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5193. const d = LocalStorageManager.getItem(keyStr);
  5194. if (level > d.level) {
  5195. jsonStr.count = d.count + 1;
  5196. LocalStorageManager.setItem(keyStr, jsonStr);
  5197. }
  5198. else {
  5199. }
  5200. }
  5201. else {
  5202. LocalStorageManager.setItem(keyStr, jsonStr);
  5203. }
  5204. const reqStr = JSON.stringify(jsonStr);
  5205. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5206. }
  5207. hide() {
  5208. super.hide();
  5209. }
  5210. }
  5211. UILevelProp.uiName = "UILevelProp";
  5212. class PutBallLevelDisplay {
  5213. constructor(ui, index) {
  5214. this.index = 0;
  5215. this.ui = ui;
  5216. this.index = index;
  5217. this.ui.onClick(this, this.clickSelf);
  5218. this.updateSelf();
  5219. this.ui.levelTxt.text = (this.index + 1) + "";
  5220. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5221. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5222. }
  5223. updateSelf() {
  5224. let level = this.index + 1;
  5225. this.data = DataMgr.getPlaceBallLevel(level);
  5226. this.ui.starNode.c1.selectedIndex = this.data.star;
  5227. let isChallenge = cfgTable.placeballData[level].type;
  5228. if (this.data.isCur) {
  5229. if (isChallenge) {
  5230. this.ui.c1.selectedIndex = 5;
  5231. }
  5232. else {
  5233. this.ui.c1.selectedIndex = 2;
  5234. }
  5235. }
  5236. else {
  5237. if (this.data.play) {
  5238. if (this.data.star == 3) {
  5239. this.ui.c1.selectedIndex = 0;
  5240. }
  5241. else {
  5242. this.ui.c1.selectedIndex = 1;
  5243. }
  5244. }
  5245. else {
  5246. if (isChallenge) {
  5247. this.ui.c1.selectedIndex = 4;
  5248. }
  5249. else {
  5250. this.ui.c1.selectedIndex = 3;
  5251. }
  5252. }
  5253. }
  5254. }
  5255. clickSelf() {
  5256. if (!this.data.play)
  5257. return;
  5258. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5259. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5260. }
  5261. }
  5262. class UILevelDisplay extends UIBase {
  5263. constructor() {
  5264. super();
  5265. }
  5266. onConstructor() {
  5267. this.ui = ui_UILevelDisplay.createInstance();
  5268. this.contentPane = this.ui;
  5269. this.isEject = false;
  5270. this.myList = this.ui.myNode.myList;
  5271. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5272. this.levelItemArr = [];
  5273. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5274. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5275. this.myList.numItems = levelNum;
  5276. }
  5277. levelItemRender(index, target) {
  5278. let item = new PutBallLevelDisplay(target, index);
  5279. this.levelItemArr.push(item);
  5280. }
  5281. show() {
  5282. super.show();
  5283. this.updateLevel();
  5284. this.scrollToPlace();
  5285. this.setGlobalFont(this.ui);
  5286. }
  5287. updateLevel() {
  5288. let temp;
  5289. for (let index = 0; index < this.levelItemArr.length; index++) {
  5290. temp = this.levelItemArr[index];
  5291. temp.updateSelf();
  5292. }
  5293. }
  5294. scrollToPlace() {
  5295. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5296. let passArr = DataMgr.getPlaceBallLevelList();
  5297. let offest = passArr.length;
  5298. if (offest >= maxNum - 1)
  5299. offest = maxNum - 1;
  5300. this.myList.scrollToView(offest, true, true);
  5301. }
  5302. hide() {
  5303. super.hide();
  5304. }
  5305. }
  5306. UILevelDisplay.uiName = "UILevelDisplay";
  5307. class ui_UIMatching extends fgui.GComponent {
  5308. static createInstance() {
  5309. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5310. }
  5311. onConstruct() {
  5312. this.n5 = (this.getChild("n5"));
  5313. this.n49 = (this.getChild("n49"));
  5314. this.n51 = (this.getChild("n51"));
  5315. this.n64 = (this.getChild("n64"));
  5316. this.n2 = (this.getChild("n2"));
  5317. this.n53 = (this.getChild("n53"));
  5318. this.n54 = (this.getChild("n54"));
  5319. this.n56 = (this.getChild("n56"));
  5320. this.n58 = (this.getChild("n58"));
  5321. this.n59 = (this.getChild("n59"));
  5322. this.n57 = (this.getChild("n57"));
  5323. this.n60 = (this.getChild("n60"));
  5324. this.n62 = (this.getChild("n62"));
  5325. this.awardTxt = (this.getChild("awardTxt"));
  5326. this.n61 = (this.getChild("n61"));
  5327. this.selfHead = (this.getChild("selfHead"));
  5328. this.aiHead = (this.getChild("aiHead"));
  5329. this.n82 = (this.getChild("n82"));
  5330. this.n84 = (this.getChild("n84"));
  5331. this.n83 = (this.getChild("n83"));
  5332. this.t1 = this.getTransition("t1");
  5333. this.t2 = this.getTransition("t2");
  5334. this.t3 = this.getTransition("t3");
  5335. this.t4 = this.getTransition("t4");
  5336. }
  5337. }
  5338. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5339. class UIMatching extends UIBase {
  5340. constructor() {
  5341. super();
  5342. }
  5343. onConstructor() {
  5344. this.ui = ui_UIMatching.createInstance();
  5345. this.contentPane = this.ui;
  5346. this.isEject = false;
  5347. }
  5348. show(callback) {
  5349. super.show();
  5350. PlatMgr.showBanner(true);
  5351. this.callback = callback;
  5352. let user = Moyu.getUserInfo();
  5353. if (!this.selfPot) {
  5354. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5355. }
  5356. if (!this.aiPot) {
  5357. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5358. }
  5359. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5360. this.ui.selfHead.nameTxt.text = user.nickName;
  5361. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5362. this.ui.aiHead.nameTxt.text = "???";
  5363. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5364. this.ui.selfHead.c1.selectedIndex = 0;
  5365. this.ui.aiHead.c1.selectedIndex = 0;
  5366. this.ui.selfHead.x = this.selfPot.x;
  5367. this.ui.selfHead.y = this.selfPot.y;
  5368. this.ui.aiHead.x = this.aiPot.x;
  5369. this.ui.aiHead.y = this.aiPot.y;
  5370. switch (xGame.common.gameMode) {
  5371. case GameMode.classic:
  5372. break;
  5373. case GameMode.bigMove:
  5374. this.initSkillData();
  5375. break;
  5376. default:
  5377. break;
  5378. }
  5379. this.ui.t1.play(Laya.Handler.create(this, () => {
  5380. this.ui.t2.play(Laya.Handler.create(this, () => {
  5381. switch (xGame.common.gameMode) {
  5382. case GameMode.classic:
  5383. this.waitingPeople();
  5384. break;
  5385. case GameMode.bigMove:
  5386. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5387. break;
  5388. default:
  5389. break;
  5390. }
  5391. }));
  5392. }));
  5393. this.setGlobalFont(this.ui);
  5394. }
  5395. initSkillData() {
  5396. this.skillSelectData = [];
  5397. let skillUrl = xGame.common.skillIconList;
  5398. let skillName = xGame.common.skillNameList;
  5399. let skillLevel = DataMgr.getBigSkillList();
  5400. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5401. for (let index = 0; index < 5; index++) {
  5402. let obj = {};
  5403. obj.skillImg = skillUrl[index];
  5404. obj.skillName = skillName[index];
  5405. obj.skillType = skillType[index];
  5406. obj.skillLevel = skillLevel[index];
  5407. this.skillSelectData.push(obj);
  5408. }
  5409. }
  5410. getAISkillLevel(myLevel) {
  5411. let video = xGame.common.upSkillLevel;
  5412. let aiLevel;
  5413. let temp;
  5414. if (video) {
  5415. temp = xGame.common.randomNum(-2, -1);
  5416. }
  5417. else {
  5418. if (myLevel <= 5) {
  5419. temp = xGame.common.randomNum(1, 3);
  5420. }
  5421. else if (myLevel <= 9) {
  5422. temp = xGame.common.randomNum(-2, 1);
  5423. }
  5424. else {
  5425. temp = xGame.common.randomNum(-4, 0);
  5426. }
  5427. }
  5428. aiLevel = temp + myLevel;
  5429. if (aiLevel <= 1)
  5430. aiLevel = 1;
  5431. if (aiLevel >= 10)
  5432. aiLevel = 10;
  5433. return aiLevel;
  5434. }
  5435. getAISkillType() {
  5436. return xGame.common.randomNum(1, 4);
  5437. let successTimes = DataMgr.getSkillSuccessTimes();
  5438. let info = cfgTable.aiskillData[successTimes];
  5439. if (!info) {
  5440. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5441. info = cfgTable.aiskillData[max];
  5442. }
  5443. let dataArr = info.skillselect;
  5444. let myCfg = {};
  5445. for (let index = 0; index < dataArr.length; index++) {
  5446. let temp = dataArr[index].split('-');
  5447. myCfg[temp[0]] = {};
  5448. myCfg[temp[0]].id = parseInt(temp[0]);
  5449. myCfg[temp[0]].weight = parseInt(temp[1]);
  5450. }
  5451. let aiCfg = xGame.common.initWeight(myCfg);
  5452. let curData = xGame.common.getRandomWeightData(aiCfg);
  5453. return parseInt(curData.id);
  5454. }
  5455. getAISkillData(index) {
  5456. let myLevel = this.skillSelectData[index].skillLevel;
  5457. let aiLevel = this.getAISkillLevel(myLevel);
  5458. let aiType = this.getAISkillType() - 1;
  5459. return { aiLevel, aiType } = { aiLevel, aiType };
  5460. }
  5461. skillSelectFinish(index) {
  5462. let aiInfo = this.getAISkillData(index);
  5463. xGame.common.gameMgr.selfCurSkill = index;
  5464. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5465. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5466. this.ui.selfHead.c1.selectedIndex = 1;
  5467. this.ui.aiHead.c1.selectedIndex = 1;
  5468. let myData = this.skillSelectData[index];
  5469. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5470. let guide = DataMgr.getSkillGuide();
  5471. if (guide == 0) {
  5472. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5473. }
  5474. else {
  5475. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5476. }
  5477. let aiData = this.skillSelectData[aiInfo.aiType];
  5478. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5479. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5480. this.waitingPeople();
  5481. }
  5482. waitingPeople() {
  5483. let time = xGame.common.randomNum(1000, 3000);
  5484. time += 1000;
  5485. Laya.timer.once(time, this, () => {
  5486. this.matchingSuccess();
  5487. });
  5488. }
  5489. matchingSuccess() {
  5490. let gameUI = xGame.common.gameUI;
  5491. let name = gameUI.ui.topNode.aiNameTxt.text;
  5492. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5493. this.ui.aiHead.nameTxt.text = name;
  5494. this.ui.aiHead.headImg.url = url;
  5495. name = gameUI.ui.topNode.selfNameTxt.text;
  5496. url = gameUI.ui.topNode.selfHeadLoader.url;
  5497. this.ui.selfHead.nameTxt.text = name;
  5498. this.ui.selfHead.headImg.url = url;
  5499. this.ui.t3.play(Laya.Handler.create(this, () => {
  5500. this.callback && this.callback();
  5501. this.ui.t4.play(Laya.Handler.create(this, () => {
  5502. this.destroySelf();
  5503. }));
  5504. }));
  5505. }
  5506. destroySelf() {
  5507. this.callback = null;
  5508. this.skillSelectData = null;
  5509. this.selfPot = null;
  5510. this.aiPot = null;
  5511. if (!this.ui.isDisposed) {
  5512. this.ui.removeFromParent();
  5513. this.ui.dispose();
  5514. }
  5515. xGame.uiMgr.destroyUI(this);
  5516. }
  5517. }
  5518. UIMatching.uiName = "UIMatching";
  5519. class ui_UIRanking extends fgui.GComponent {
  5520. static createInstance() {
  5521. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5522. }
  5523. onConstruct() {
  5524. this.n26 = (this.getChild("n26"));
  5525. this.myNode = (this.getChild("myNode"));
  5526. }
  5527. }
  5528. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5529. class UIRanking extends UIBase {
  5530. constructor() {
  5531. super();
  5532. this.showSelf = true;
  5533. this.rankType = 1;
  5534. this.rankList = [];
  5535. this.topX = 10;
  5536. this.myIndex = this.topX + 1;
  5537. this.myStar = 0;
  5538. }
  5539. onConstructor() {
  5540. this.ui = ui_UIRanking.createInstance();
  5541. this.contentPane = this.ui;
  5542. this.isEject = false;
  5543. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5544. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5545. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5546. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5547. this.ui.myNode.myList.setVirtual();
  5548. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5549. }
  5550. show() {
  5551. super.show();
  5552. this.getPaiHangBangDataFormJosnFile();
  5553. this.updateSelf();
  5554. let self = Moyu.getUserInfo();
  5555. if (!self.isAuth) {
  5556. Moyu.initUser(this, () => {
  5557. DataMgr.upRankData();
  5558. });
  5559. }
  5560. this.setGlobalFont(this.ui);
  5561. }
  5562. getPaiHangBangDataFormJosnFile() {
  5563. const rankingList = cfgTable.paiHangBangData.list;
  5564. this.updateItemData(rankingList);
  5565. }
  5566. updateSelfItem() {
  5567. console.log('zh:Moyu.platType =' + Moyu.platType);
  5568. let self = Moyu.getUserInfo();
  5569. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5570. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5571. if (this.myIndex > this.topX) {
  5572. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5573. }
  5574. else {
  5575. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5576. }
  5577. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5578. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5579. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5580. }
  5581. updateItemData(data) {
  5582. this.myStar = xGame.common.getAllStarNum();
  5583. if (this.rankList.length < 2) {
  5584. this.rankList = data;
  5585. let self = Moyu.getUserInfo();
  5586. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5587. self.headIcon = self.headIcon;
  5588. for (let i = 0; i < data.length; i++) {
  5589. let data = this.rankList[i];
  5590. if (data.userId == self.userId) {
  5591. this.rankList.splice(i, 1);
  5592. break;
  5593. }
  5594. }
  5595. for (let i = 0; i < data.length; i++) {
  5596. let data = this.rankList[i];
  5597. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5598. this.myIndex = i + 1;
  5599. let user = { headIcon: self.headIcon, nickName: "myself" };
  5600. let ud = { user: user, data: {} };
  5601. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5602. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5603. if (Moyu.platType < 11) {
  5604. user.headIcon = self.headIcon;
  5605. user.nickName = self.nickName;
  5606. }
  5607. this.rankList.splice(i, 0, md);
  5608. break;
  5609. }
  5610. }
  5611. }
  5612. this.updateSelfItem();
  5613. this.ui.myNode.myList.numItems = this.rankList.length;
  5614. }
  5615. updateItemUI(index, obj) {
  5616. let data = this.rankList[index];
  5617. let userData = JSON.parse(data.userData).user;
  5618. obj.nameTxt.text = userData.nickName.toString();
  5619. obj.valueTxt.text = data.rankScore;
  5620. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5621. obj.rankTxt.text = index + 1;
  5622. switch (index) {
  5623. case 0:
  5624. this.setImg(obj, 1, 0, 0);
  5625. obj.rankTxt.color = "#FFC047";
  5626. break;
  5627. case 1:
  5628. this.setImg(obj, 0, 1, 0);
  5629. obj.rankTxt.color = "#ACACAC";
  5630. break;
  5631. case 2:
  5632. this.setImg(obj, 0, 0, 1);
  5633. obj.rankTxt.color = "#D09672";
  5634. break;
  5635. default:
  5636. this.setImg(obj, 0, 0, 0);
  5637. obj.rankTxt.color = "#496FAB";
  5638. break;
  5639. }
  5640. }
  5641. setImg(obj, a, b, c) {
  5642. obj.img1.visible = a ? true : false;
  5643. obj.img2.visible = b ? true : false;
  5644. obj.img3.visible = c ? true : false;
  5645. }
  5646. changeList(type) {
  5647. this.rankType = type;
  5648. this.updateSelf();
  5649. }
  5650. changeSelfNode() {
  5651. this.showSelf = !this.showSelf;
  5652. this.updateSelf();
  5653. }
  5654. updateSelf() {
  5655. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5656. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5657. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5658. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5659. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5660. }
  5661. }
  5662. UIRanking.uiName = "UIRanking";
  5663. class ui_UISecretary extends fgui.GComponent {
  5664. static createInstance() {
  5665. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5666. }
  5667. onConstruct() {
  5668. this.n0 = (this.getChild("n0"));
  5669. this.myNode = (this.getChild("myNode"));
  5670. this.closeBtn = (this.getChild("closeBtn"));
  5671. this.t0 = this.getTransition("t0");
  5672. }
  5673. }
  5674. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5675. class UISecretary extends UIBase {
  5676. constructor() {
  5677. super();
  5678. this.curIndex = 1;
  5679. }
  5680. onConstructor() {
  5681. this.ui = ui_UISecretary.createInstance();
  5682. this.contentPane = this.ui;
  5683. this.isEject = false;
  5684. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5685. this.nodeObj = { left: null, right: null, cur: null };
  5686. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5687. }
  5688. show() {
  5689. super.show();
  5690. this.ui.t0.play();
  5691. this.updateData();
  5692. this.setGlobalFont(this.ui);
  5693. }
  5694. addSecretarySpine(node, spineName) {
  5695. if (spineName == "mishu") {
  5696. if (this.secretarySpine1) {
  5697. node.displayObject.destroyChildren();
  5698. this.playWoman(this.secretarySpine1, node.displayObject);
  5699. }
  5700. else {
  5701. let spine1 = new SpineMgr("mishu", () => {
  5702. this.secretarySpine1 = spine1;
  5703. this.playWoman(this.secretarySpine1, node.displayObject);
  5704. });
  5705. }
  5706. }
  5707. else {
  5708. if (this.secretarySpine2) {
  5709. node.displayObject.destroyChildren();
  5710. this.playWoman(this.secretarySpine2, node.displayObject);
  5711. }
  5712. else {
  5713. let spine2 = new SpineMgr("xiaomishu2", () => {
  5714. this.secretarySpine2 = spine2;
  5715. this.playWoman(this.secretarySpine2, node.displayObject);
  5716. });
  5717. }
  5718. }
  5719. }
  5720. playWoman(node, parent) {
  5721. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5722. let yy = this.ui.myNode.gameNode3.secretary.height;
  5723. let scale = 1.5;
  5724. if (node == this.secretarySpine2) {
  5725. scale = 1.2;
  5726. }
  5727. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5728. node.play(data, 0, true, parent);
  5729. }
  5730. turnLeft() {
  5731. this.curIndex--;
  5732. if (this.curIndex < 1) {
  5733. this.curIndex = 2;
  5734. }
  5735. let left = this.nodeObj.left;
  5736. let right = this.nodeObj.right;
  5737. let cur = this.nodeObj.cur;
  5738. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5739. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5740. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5741. this.updateData();
  5742. }));
  5743. this.ui.myNode.setChildIndex(right, 2);
  5744. this.nodeObj.left = cur;
  5745. this.nodeObj.right = left;
  5746. this.nodeObj.cur = right;
  5747. }
  5748. turnRight() {
  5749. this.curIndex++;
  5750. if (this.curIndex > 2) {
  5751. this.curIndex = 1;
  5752. }
  5753. let left = this.nodeObj.left;
  5754. let right = this.nodeObj.right;
  5755. let cur = this.nodeObj.cur;
  5756. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5757. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5758. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5759. this.updateData();
  5760. }));
  5761. this.ui.myNode.setChildIndex(left, 2);
  5762. this.nodeObj.left = right;
  5763. this.nodeObj.right = cur;
  5764. this.nodeObj.cur = left;
  5765. }
  5766. updateData() {
  5767. console.log('zh: updateData FFFFFFFFFF');
  5768. let data = cfgTable.secretaryshopData;
  5769. let children = this.ui.myNode._children;
  5770. let temp;
  5771. let curData;
  5772. for (let index = 0; index < children.length; index++) {
  5773. temp = children[index];
  5774. curData = data[1];
  5775. temp.heightTxt.text = curData.height;
  5776. temp.foodTxt.text = curData.food;
  5777. temp.historyTxt.text = curData.history;
  5778. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5779. this.addSecretarySpine(temp.secretary, curData.spine);
  5780. let womanIndex = curData.id - 1;
  5781. let getWoman = DataMgr.getSecretary(womanIndex);
  5782. let curUse = DataMgr.getCurSecretary();
  5783. if (getWoman) {
  5784. if (curUse == womanIndex) {
  5785. temp.purchaseBtn.c1.selectedIndex = 1;
  5786. }
  5787. else {
  5788. temp.purchaseBtn.c1.selectedIndex = 2;
  5789. }
  5790. }
  5791. else {
  5792. temp.purchaseBtn.c1.selectedIndex = 0;
  5793. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5794. }
  5795. temp.purchaseBtn.visible = false;
  5796. }
  5797. }
  5798. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5799. console.log('zh: 点击了clickSecretary ');
  5800. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5801. if (getWoman) {
  5802. if (curUse != womanIndex) {
  5803. console.log();
  5804. DataMgr.setCurSecretary(womanIndex);
  5805. this.updateData();
  5806. }
  5807. }
  5808. else {
  5809. console.log('zh:点击购买了');
  5810. let need = needDiamond;
  5811. if (DataMgr.diamondEnough(need)) {
  5812. DataMgr.setDiamond(-need);
  5813. DataMgr.setSecretary(womanIndex, 1);
  5814. DataMgr.setCurSecretary(womanIndex);
  5815. this.updateData();
  5816. }
  5817. else {
  5818. xGame.uiMgr.Show(UIAddProp, 1);
  5819. }
  5820. }
  5821. }
  5822. closeSelf() {
  5823. this.hide();
  5824. }
  5825. }
  5826. UISecretary.uiName = "UISecretary";
  5827. class ui_UIShop extends fgui.GComponent {
  5828. static createInstance() {
  5829. return (fgui.UIPackage.createObject("game", "UIShop"));
  5830. }
  5831. onConstruct() {
  5832. this.n48 = (this.getChild("n48"));
  5833. this.n0 = (this.getChild("n0"));
  5834. this.secretary = (this.getChild("secretary"));
  5835. this.talkNode = (this.getChild("talkNode"));
  5836. this.closeNode = (this.getChild("closeNode"));
  5837. this.moneyNode = (this.getChild("moneyNode"));
  5838. this.myNode = (this.getChild("myNode"));
  5839. }
  5840. }
  5841. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5842. class ui_UIMsg extends fgui.GComponent {
  5843. static createInstance() {
  5844. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5845. }
  5846. onConstruct() {
  5847. this.tipsNode = (this.getChild("tipsNode"));
  5848. }
  5849. }
  5850. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5851. class UIMsg extends UIBase {
  5852. constructor() {
  5853. super();
  5854. }
  5855. onConstructor() {
  5856. this.ui = ui_UIMsg.createInstance();
  5857. this.contentPane = this.ui;
  5858. this.isEject = false;
  5859. this.isMuti = true;
  5860. }
  5861. show(msg, callback) {
  5862. super.show();
  5863. this.ui.tipsNode.msgTxt.text = msg;
  5864. this.ui.alpha = 1;
  5865. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5866. this.hide();
  5867. callback && callback();
  5868. }), 1000);
  5869. this.setGlobalFont(this.ui);
  5870. }
  5871. }
  5872. UIMsg.uiName = "UIMsg";
  5873. class BallRodDisplay {
  5874. constructor(ui, index) {
  5875. this.index = 0;
  5876. this.uiIndex = 0;
  5877. this.ui = ui;
  5878. this.index = index;
  5879. this.initData();
  5880. }
  5881. initData() {
  5882. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5883. let data = cfgTable.ballrodData[this.index + 1];
  5884. this.ui.nameTxt.text = data.name;
  5885. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5886. this.ui.levelNode.c1.selectedIndex = data.quality;
  5887. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5888. if (data.spine) {
  5889. this.mySpine = new SpineMgr(data.spine, () => {
  5890. let xx = 150;
  5891. let yy = 70;
  5892. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5893. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5894. });
  5895. }
  5896. }
  5897. updateSelf() {
  5898. let get = DataMgr.getBallRod(this.index);
  5899. if (get == null)
  5900. get = 1;
  5901. let curUse = DataMgr.getCurBallRod();
  5902. if (get) {
  5903. if (curUse == this.index) {
  5904. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5905. }
  5906. else {
  5907. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5908. }
  5909. }
  5910. else {
  5911. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5912. }
  5913. }
  5914. buyBallRod() {
  5915. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5916. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5917. switch (selectedIndex) {
  5918. case 0:
  5919. break;
  5920. case 1:
  5921. console.log('zh:点击了 USE THIS');
  5922. DataMgr.setCurBallRod(this.index);
  5923. let curUse = DataMgr.getCurBallRod();
  5924. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5925. let ui = xGame.uiMgr.getUI(UIShop);
  5926. ui.updateBallRod();
  5927. break;
  5928. case 2:
  5929. let data = cfgTable.ballrodData[this.index + 1];
  5930. let need = data.price;
  5931. if (DataMgr.diamondEnough(need)) {
  5932. this.buyQiuGan(data);
  5933. DataMgr.setDiamond(-need);
  5934. DataMgr.setBallRod(this.index, 1);
  5935. DataMgr.setCurBallRod(this.index);
  5936. let ui = xGame.uiMgr.getUI(UIShop);
  5937. ui.updateBallRod();
  5938. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5939. }
  5940. else {
  5941. xGame.uiMgr.Show(UIAddProp, 1);
  5942. }
  5943. break;
  5944. default:
  5945. break;
  5946. }
  5947. }
  5948. buyQiuGan(qgItem) {
  5949. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5950. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5951. if (userInfo == null) {
  5952. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5953. return;
  5954. }
  5955. let reqData = xGame.httpMgr.getReqData();
  5956. let pd = JSON.parse(reqData);
  5957. pd.qiuGanData = qgItem;
  5958. reqData = JSON.stringify(pd);
  5959. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5960. try {
  5961. console.log('zh:buySp res = ' + JSON.stringify(res));
  5962. let code = res.code;
  5963. let msg = res.msg;
  5964. if (code == 401) {
  5965. Laya.LocalStorage.removeItem(keyForLoginInfo);
  5966. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.loginTimeOut);
  5967. return;
  5968. }
  5969. if (code == 200) {
  5970. xGame.uiMgr.Show(UIMsg, msg);
  5971. DataMgr.getUserZiChanInfo(false);
  5972. }
  5973. else {
  5974. xGame.uiMgr.Show(UIMsg, msg);
  5975. }
  5976. }
  5977. catch (error) {
  5978. console.log('error=' + error);
  5979. alert(error);
  5980. }
  5981. finally {
  5982. }
  5983. });
  5984. }
  5985. logEventForGouMaiGan(qiuGanName) {
  5986. const ev = {
  5987. value: qiuGanName
  5988. };
  5989. const jsonStr = JSON.stringify(ev);
  5990. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5991. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5992. }
  5993. }
  5994. class DaoJuDisplay {
  5995. constructor(ui, index) {
  5996. this.index = 0;
  5997. this.uiIndex = 0;
  5998. this.ggSpid = "";
  5999. this.spid = 0;
  6000. this.ui = ui;
  6001. this.index = index;
  6002. this.initData();
  6003. }
  6004. initData() {
  6005. this.ui.btn_buy.onClick(this, this.gotoBuy);
  6006. let data = cfgTable.daoJuData[this.index + 1];
  6007. this.ui.nameTxt.text = data.spbt;
  6008. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  6009. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  6010. this.ggSpid = data.ggSpid;
  6011. this.spid = data.spid;
  6012. let baseUrl = "asset/sound/ogg/";
  6013. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  6014. }
  6015. gotoBuy() {
  6016. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6017. if (userInfo != null) {
  6018. let token = userInfo.token;
  6019. let ggSpid = this.ggSpid;
  6020. let spid = this.spid;
  6021. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  6022. console.log('zh:gotoBuy1 spid =' + spid);
  6023. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  6024. return;
  6025. }
  6026. else {
  6027. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6028. }
  6029. }
  6030. gotoBuy1() {
  6031. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6032. let djItem = cfgTable.daoJuData[this.index + 1];
  6033. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  6034. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6035. if (userInfo == null) {
  6036. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6037. return;
  6038. }
  6039. let reqData = xGame.httpMgr.getReqData();
  6040. let pd = JSON.parse(reqData);
  6041. pd.spItem = djItem;
  6042. reqData = JSON.stringify(pd);
  6043. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  6044. try {
  6045. console.log('zh:buySp res = ' + JSON.stringify(res));
  6046. let code = res.code;
  6047. let msg = res.msg;
  6048. if (code == 401) {
  6049. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6050. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6051. return;
  6052. }
  6053. if (code == 200) {
  6054. xGame.uiMgr.Show(UIMsg, msg);
  6055. DataMgr.getUserZiChanInfo(false);
  6056. }
  6057. else {
  6058. xGame.uiMgr.Show(UIMsg, msg);
  6059. }
  6060. }
  6061. catch (error) {
  6062. console.log('error=' + error);
  6063. alert(error);
  6064. }
  6065. finally {
  6066. }
  6067. });
  6068. }
  6069. }
  6070. class UIShop extends UIBase {
  6071. constructor() {
  6072. super();
  6073. this.itemNums = 0;
  6074. this.itemNumsForDj = 0;
  6075. this.curType = "";
  6076. }
  6077. onConstructor() {
  6078. this.ui = ui_UIShop.createInstance();
  6079. this.contentPane = this.ui;
  6080. this.isEject = false;
  6081. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6082. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6083. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6084. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6085. this.addUIClick(this.ui, this.interuptSecretary);
  6086. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6087. this.ballRodArr = [];
  6088. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6089. this.ui.myNode.myList.numItems = this.itemNums;
  6090. this.loadDjdata_old();
  6091. }
  6092. loadDjdata_old() {
  6093. let fff = cfgTable.daoJuData;
  6094. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6095. this.daoJuArr = [];
  6096. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6097. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6098. }
  6099. getProductList() {
  6100. let reqData = xGame.httpMgr.getReqData();
  6101. let pd = JSON.parse(reqData);
  6102. pd.splx = "Consumable";
  6103. reqData = JSON.stringify(pd);
  6104. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6105. try {
  6106. let code = res.code;
  6107. let msg = res.msg;
  6108. if (code == 401) {
  6109. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6110. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6111. return;
  6112. }
  6113. if (code == 200) {
  6114. let data = res.data;
  6115. for (let index = 0; index < data.length; index++) {
  6116. let element = data[index];
  6117. cfgTable.daoJuData[element.spid] = element;
  6118. }
  6119. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6120. }
  6121. else {
  6122. xGame.uiMgr.Show(UIMsg, msg);
  6123. }
  6124. }
  6125. catch (error) {
  6126. console.log('error=' + error);
  6127. alert(error);
  6128. }
  6129. finally {
  6130. }
  6131. });
  6132. }
  6133. show(type) {
  6134. super.show();
  6135. this.curType = type == 0 ? "qiugan" : "daoju";
  6136. this.switchBtn("");
  6137. this.playSecretaryIdle();
  6138. this.updateBallRod();
  6139. this.setGlobalFont(this.ui);
  6140. }
  6141. test123() {
  6142. console.log('zh:test123 ');
  6143. }
  6144. switchBtn(type) {
  6145. console.log('zh:1111切換 sel type=' + type);
  6146. if (type == "") {
  6147. type = this.curType;
  6148. }
  6149. else {
  6150. if (this.curType == type) {
  6151. return;
  6152. }
  6153. else {
  6154. this.curType = type;
  6155. }
  6156. }
  6157. if (type == "qiugan") {
  6158. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6159. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6160. this.ui.myNode.c1.selectedIndex = 0;
  6161. this.ui.myNode.myList.visible = true;
  6162. this.ui.myNode.djList.visible = false;
  6163. }
  6164. else {
  6165. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6166. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6167. this.ui.myNode.c1.selectedIndex = 1;
  6168. this.ui.myNode.myList.visible = false;
  6169. this.ui.myNode.djList.visible = true;
  6170. }
  6171. }
  6172. updateBallRod() {
  6173. for (let index = 0; index < this.ballRodArr.length; index++) {
  6174. this.ballRodArr[index].updateSelf();
  6175. }
  6176. }
  6177. renderBallRod(sort, obj) {
  6178. let index = this.getIndexBySort(sort + 1) - 1;
  6179. let ballRod = new BallRodDisplay(obj, index);
  6180. this.ballRodArr.push(ballRod);
  6181. }
  6182. renderDaoJu(idx, obj) {
  6183. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6184. let b = new DaoJuDisplay(obj, index);
  6185. this.daoJuArr.push(b);
  6186. }
  6187. getIndexBySort(sort) {
  6188. let object = cfgTable.ballrodData;
  6189. for (const key in object) {
  6190. if (object[key].sort == sort) {
  6191. return parseInt(key);
  6192. }
  6193. }
  6194. }
  6195. getIndexBySortForDj(idx) {
  6196. let object = cfgTable.daoJuData;
  6197. for (const key in object) {
  6198. if (object[key].idx == idx) {
  6199. return parseInt(key);
  6200. }
  6201. }
  6202. }
  6203. playSecretaryIdle() {
  6204. let parent = this.ui.secretary.displayObject;
  6205. parent.destroyChildren();
  6206. let xx = this.ui.secretary.width / 2;
  6207. let yy = this.ui.secretary.height;
  6208. let scale = xGame.common.getSecretaryScale();
  6209. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6210. xGame.common.secretary.play(data, 0, true, parent);
  6211. }
  6212. interuptSecretary() {
  6213. Laya.timer.clearAll(this);
  6214. this.playSecretaryRandomSound();
  6215. }
  6216. playSecretaryRandomSound() {
  6217. if (this.isHide)
  6218. return;
  6219. let time = xGame.common.randomNum(45000, 60000);
  6220. Laya.timer.once(time, this, () => {
  6221. if (this.isHide)
  6222. return;
  6223. let index = xGame.common.randomNum(4, 7);
  6224. xGame.soundMgr.playSound("s_main0" + index);
  6225. let words = 1;
  6226. switch (index) {
  6227. case 4:
  6228. words = 5;
  6229. break;
  6230. case 5:
  6231. words = 3;
  6232. break;
  6233. case 6:
  6234. words = 6;
  6235. break;
  6236. case 7:
  6237. words = 7;
  6238. break;
  6239. default:
  6240. break;
  6241. }
  6242. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6243. this.playSecretaryRandomSound();
  6244. });
  6245. }
  6246. closeSelf() {
  6247. this.hide();
  6248. }
  6249. }
  6250. UIShop.uiName = "UIShop";
  6251. class ui_UISign extends fgui.GComponent {
  6252. static createInstance() {
  6253. return (fgui.UIPackage.createObject("game", "UISign"));
  6254. }
  6255. onConstruct() {
  6256. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6257. this.n6 = (this.getChild("n6"));
  6258. this.closeNode = (this.getChild("closeNode"));
  6259. this.myNode = (this.getChild("myNode"));
  6260. this.moneyNode = (this.getChild("moneyNode"));
  6261. this.secretary = (this.getChild("secretary"));
  6262. this.talkNode = (this.getChild("talkNode"));
  6263. this.tripleBtn = (this.getChild("tripleBtn"));
  6264. this.normalBtn = (this.getChild("normalBtn"));
  6265. this.tipsNode = (this.getChild("tipsNode"));
  6266. this.againBtn = (this.getChild("againBtn"));
  6267. this.t0 = this.getTransition("t0");
  6268. }
  6269. }
  6270. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6271. class SignMax {
  6272. constructor(ui) {
  6273. this.ui = ui;
  6274. }
  6275. updateSelf(index, sameDay, curDayIndex) {
  6276. let data = cfgTable.signData[index + 1];
  6277. this.ui.titleTxt.text = data.title;
  6278. let arr1 = data.award[0].split('-');
  6279. let arr2 = data.award[1].split('-');
  6280. let num1 = parseInt(arr1[1]);
  6281. let num2 = parseInt(arr2[1]);
  6282. this.ui.numTxt1.text = num1 + "";
  6283. this.ui.numTxt2.text = num2 + "";
  6284. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6285. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6286. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6287. this.ui.numTxt1.visible = false;
  6288. }
  6289. else {
  6290. this.ui.numTxt1.visible = true;
  6291. }
  6292. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6293. this.ui.numTxt2.visible = false;
  6294. }
  6295. else {
  6296. this.ui.numTxt2.visible = true;
  6297. }
  6298. if (index < curDayIndex) {
  6299. this.ui.c1.selectedIndex = 1;
  6300. }
  6301. else if (index == curDayIndex) {
  6302. if (sameDay) {
  6303. this.ui.c1.selectedIndex = 2;
  6304. }
  6305. else {
  6306. this.ui.c1.selectedIndex = 2;
  6307. }
  6308. }
  6309. else {
  6310. this.ui.c1.selectedIndex = 0;
  6311. }
  6312. }
  6313. }
  6314. class SignNormal {
  6315. constructor(ui) {
  6316. this.ui = ui;
  6317. }
  6318. updateSelf(index, sameDay, curDayIndex) {
  6319. let data = cfgTable.signData[index + 1];
  6320. this.ui.titleTxt.text = data.title;
  6321. let arr = data.award[0].split('-');
  6322. let type = parseInt(arr[0]);
  6323. let num = parseInt(arr[1]);
  6324. this.ui.numTxt.text = num + "";
  6325. if (type > 2) {
  6326. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6327. this.ui.myIcon.rotation = 0;
  6328. }
  6329. else {
  6330. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6331. this.ui.myIcon.rotation = 0;
  6332. }
  6333. if (xGame.common.signAwardContainsRod(data.award)) {
  6334. this.ui.numTxt.visible = false;
  6335. }
  6336. else {
  6337. this.ui.numTxt.visible = true;
  6338. }
  6339. if (index < curDayIndex) {
  6340. this.ui.c1.selectedIndex = 1;
  6341. }
  6342. else if (index == curDayIndex) {
  6343. if (sameDay) {
  6344. this.ui.c1.selectedIndex = 2;
  6345. }
  6346. else {
  6347. this.ui.c1.selectedIndex = 2;
  6348. }
  6349. }
  6350. else {
  6351. this.ui.c1.selectedIndex = 0;
  6352. }
  6353. }
  6354. }
  6355. class UISign extends UIBase {
  6356. constructor() {
  6357. super();
  6358. this.curDayIndex = 0;
  6359. this.starX = 0;
  6360. }
  6361. onConstructor() {
  6362. this.ui = ui_UISign.createInstance();
  6363. this.contentPane = this.ui;
  6364. this.isEject = false;
  6365. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6366. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6367. this.initSignItem();
  6368. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6369. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6370. }
  6371. show() {
  6372. super.show();
  6373. this.ui.t0.play();
  6374. this.playSecretaryIdle();
  6375. this.updateSign();
  6376. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6377. this.setGlobalFont(this.ui);
  6378. }
  6379. initSignItem() {
  6380. this.signArr = [];
  6381. for (let index = 0; index < 6; index++) {
  6382. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6383. this.signArr.push(temp);
  6384. }
  6385. this.signMax = new SignMax(this.ui.myNode.day7);
  6386. if (Moyu.isKs)
  6387. this.ui.closeNode.closeBtn.x += 100;
  6388. }
  6389. updateSign() {
  6390. let sameDay = xGame.common.judgeSameDay();
  6391. let max = 7;
  6392. this.curDayIndex = DataMgr.getSignData();
  6393. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6394. this.curDayIndex = 0;
  6395. if (!sameDay) {
  6396. this.ui.normalBtn.visible = true;
  6397. this.ui.tipsNode.visible = false;
  6398. this.ui.againBtn.visible = false;
  6399. }
  6400. else {
  6401. this.ui.normalBtn.visible = false;
  6402. let again = DataMgr.getExtraSign();
  6403. let isCurrency = false;
  6404. let index = this.curDayIndex;
  6405. if (index == 0)
  6406. index = 7;
  6407. let award = cfgTable.signData[index].award;
  6408. let num = award[0].split("-")[0];
  6409. if (num == "1" || num == "2")
  6410. isCurrency = true;
  6411. let showAgain = again == 0 && isCurrency;
  6412. this.ui.againBtn.visible = showAgain;
  6413. this.ui.tipsNode.visible = !showAgain;
  6414. }
  6415. for (let index = 0; index < this.signArr.length; index++) {
  6416. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6417. }
  6418. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6419. }
  6420. playSecretaryIdle() {
  6421. let parent = this.ui.secretary.displayObject;
  6422. parent.destroyChildren();
  6423. let xx = this.ui.secretary.width / 2;
  6424. let yy = this.ui.secretary.height;
  6425. let scale = xGame.common.getSecretaryScale();
  6426. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6427. xGame.common.secretary.play(data, 0, true, parent);
  6428. }
  6429. closeSelf() {
  6430. this.hide();
  6431. }
  6432. normalGetAward() {
  6433. let sameDay = xGame.common.judgeSameDay();
  6434. if (!sameDay) {
  6435. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6436. let temp;
  6437. let type;
  6438. let num;
  6439. let arr = [];
  6440. for (let index = 0; index < award.length; index++) {
  6441. temp = award[index].split("-");
  6442. type = parseInt(temp[0]);
  6443. num = parseInt(temp[1]);
  6444. let awardType = new AwardType();
  6445. awardType.num = num;
  6446. awardType.type = type;
  6447. arr.push(awardType);
  6448. }
  6449. xGame.common.getAward(arr, (watchVideo) => {
  6450. this.curDayIndex++;
  6451. if (this.curDayIndex > 7)
  6452. this.curDayIndex = 0;
  6453. DataMgr.setSignData(this.curDayIndex);
  6454. this.updateSignData2Server(this.curDayIndex);
  6455. DataMgr.setSignTime(new Date().getTime());
  6456. if (watchVideo) {
  6457. DataMgr.setExtraSign(1);
  6458. Moyu.sendDataEvent("signIn1");
  6459. }
  6460. this.updateSign();
  6461. });
  6462. }
  6463. }
  6464. againGetAward() {
  6465. Moyu.sendDataEvent("signIn2");
  6466. console.log('zh:qjff_AD_for_uisign');
  6467. if (Laya.Browser.onAndroid) {
  6468. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6469. if (!boo) {
  6470. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6471. return;
  6472. }
  6473. }
  6474. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6475. }
  6476. else {
  6477. console.log('zh:AD 失败,直接发放奖励');
  6478. this.qjff_AD_for_uisign();
  6479. }
  6480. }
  6481. qjff_AD_for_uisign() {
  6482. let index = this.curDayIndex;
  6483. if (index == 0)
  6484. index = 7;
  6485. let award = cfgTable.signData[index].award;
  6486. let temp;
  6487. let type;
  6488. let num;
  6489. for (let index = 0; index < award.length; index++) {
  6490. temp = award[index].split("-");
  6491. type = parseInt(temp[0]);
  6492. num = parseInt(temp[1]) * 3;
  6493. xGame.common.playObjFlyAnim(num, type);
  6494. }
  6495. DataMgr.setExtraSign(1);
  6496. this.updateSign();
  6497. }
  6498. updateSignData2Server(day) {
  6499. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6500. if (userInfo == null) {
  6501. return;
  6502. }
  6503. let reqData = xGame.httpMgr.getReqData();
  6504. let pd = JSON.parse(reqData);
  6505. pd.signData = day;
  6506. reqData = JSON.stringify(pd);
  6507. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6508. try {
  6509. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6510. let code = res.code;
  6511. let msg = res.msg;
  6512. if (code == 401) {
  6513. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6514. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6515. return;
  6516. }
  6517. if (code == 200) {
  6518. let data = res.data;
  6519. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6520. }
  6521. else {
  6522. xGame.uiMgr.Show(UIMsg, msg);
  6523. }
  6524. }
  6525. catch (error) {
  6526. console.log('error=' + error);
  6527. alert(error);
  6528. }
  6529. finally {
  6530. }
  6531. });
  6532. }
  6533. }
  6534. UISign.uiName = "UISign";
  6535. class ui_UISkill extends fgui.GComponent {
  6536. static createInstance() {
  6537. return (fgui.UIPackage.createObject("game", "UISkill"));
  6538. }
  6539. onConstruct() {
  6540. this.n48 = (this.getChild("n48"));
  6541. this.n0 = (this.getChild("n0"));
  6542. this.secretary = (this.getChild("secretary"));
  6543. this.talkNode = (this.getChild("talkNode"));
  6544. this.closeNode = (this.getChild("closeNode"));
  6545. this.moneyNode = (this.getChild("moneyNode"));
  6546. this.skillNode = (this.getChild("skillNode"));
  6547. this.guideNode = (this.getChild("guideNode"));
  6548. }
  6549. }
  6550. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6551. class SkillDisplay {
  6552. constructor(ui, data, uiIndex) {
  6553. this.starX = 0;
  6554. this.starY = 0;
  6555. this.index = 0;
  6556. this.ui = ui;
  6557. this.data = data;
  6558. this.index = uiIndex;
  6559. this.initSelf();
  6560. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6561. }
  6562. initSelf() {
  6563. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6564. this.ui.nameTxt.text = this.data.name;
  6565. this.ui.describeTxt.text = this.data.describe;
  6566. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6567. this.ui.startBtn.onClick(this, this.startGame);
  6568. this.updateSelf();
  6569. }
  6570. updateSelf() {
  6571. this.checkTry();
  6572. let level = DataMgr.getBigSkillByIndex(this.index);
  6573. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6574. }
  6575. checkTry() {
  6576. let index = this.index;
  6577. let level = DataMgr.getBigSkillByIndex(index);
  6578. if (level == null) {
  6579. DataMgr.setBigSkill(index, 1, false);
  6580. level = 1;
  6581. }
  6582. this.ui.levelTxt.text = "LV." + level;
  6583. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6584. this.ui.tryNode.visible = true;
  6585. else
  6586. this.ui.tryNode.visible = false;
  6587. }
  6588. clickAddLevel() {
  6589. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6590. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6591. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6592. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6593. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6594. }
  6595. else {
  6596. console.log('zh:AD 失败,直接发放奖励');
  6597. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6598. }
  6599. }
  6600. qjff_AD_for_skilldisplay_clickAddLevel() {
  6601. DataMgr.setBigSkill(this.data.index, 1);
  6602. this.updateSelf();
  6603. xGame.common.upSkillLevel = true;
  6604. }
  6605. startGame() {
  6606. console.log('zh:rod skill startgame');
  6607. if (this.data.index == 3) {
  6608. alert('Coming soon!');
  6609. return;
  6610. }
  6611. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6612. let needCoin = xGame.common.bigMoveNeedCoin;
  6613. xGame.common.passAwardCoin = 2000;
  6614. let guide = DataMgr.getSkillGuide();
  6615. console.log('zh:startGame guide=' + guide);
  6616. xGame.common.temSelfLevel = 0;
  6617. if (guide == 0) {
  6618. needCoin = 0;
  6619. xGame.common.temSelfLevel = 100;
  6620. }
  6621. if (DataMgr.coinEnough(needCoin)) {
  6622. DataMgr.setCoin(-needCoin);
  6623. xGame.common.curPlayerSkillType = this.index;
  6624. if (guide == 0)
  6625. xGame.common.curPlayerSkillType = 0;
  6626. console.log('zh: skilldisplay 1');
  6627. xGame.uiMgr.Show(UIGame);
  6628. xGame.uiMgr.Hide(UIMain);
  6629. xGame.uiMgr.Show(UIMatching, () => {
  6630. xGame.common.gameUI.ui.alpha = 1;
  6631. xGame.common.gameUI.startGame();
  6632. xGame.uiMgr.Hide(UISkill);
  6633. });
  6634. this.logEventForRod_start();
  6635. }
  6636. else {
  6637. console.log('zh: skilldisplay 2');
  6638. xGame.uiMgr.Show(UIAddProp, 0);
  6639. Moyu.sendDataEvent("AddCoinVideo");
  6640. }
  6641. }
  6642. logEventForRod_start() {
  6643. let gfmsIdx = xGame.common.curPlayerSkillType;
  6644. console.log('zh:选择的技能=' + gfmsIdx);
  6645. let gfmc = 'Skyfall Shot';
  6646. if (gfmsIdx == 0) {
  6647. gfmc = 'Skyfall Shot';
  6648. }
  6649. if (gfmsIdx == 1) {
  6650. gfmc = 'Surging break';
  6651. }
  6652. if (gfmsIdx == 2) {
  6653. gfmc = 'Frost Lock';
  6654. }
  6655. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6656. let jsonStr = {
  6657. "count": 0,
  6658. "name": gfmc
  6659. };
  6660. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6661. const d = LocalStorageManager.getItem(keyStr);
  6662. jsonStr.count = d.count + 1;
  6663. LocalStorageManager.setItem(keyStr, jsonStr);
  6664. }
  6665. else {
  6666. LocalStorageManager.setItem(keyStr, jsonStr);
  6667. }
  6668. const reqStr = JSON.stringify(jsonStr);
  6669. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6670. }
  6671. }
  6672. class UISkill extends UIBase {
  6673. constructor() {
  6674. super();
  6675. this.skillData = [];
  6676. }
  6677. onConstructor() {
  6678. this.ui = ui_UISkill.createInstance();
  6679. this.contentPane = this.ui;
  6680. this.isEject = false;
  6681. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6682. this.initSkillData();
  6683. console.log('zh:aaaaaa1111111111');
  6684. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6685. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6686. console.log('zh:aaaaaa22222222');
  6687. this.displayList = [];
  6688. this.ui.skillNode.skillList.numItems = 3;
  6689. this.addUIClick(this.ui, this.interuptSecretary);
  6690. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6691. this.ui.talkNode.visible = false;
  6692. if (Moyu.isKs)
  6693. this.ui.closeNode.closeBtn.x += 100;
  6694. }
  6695. show() {
  6696. super.show();
  6697. this.playSecretaryIdle();
  6698. this.moneyNode.ui.c1.selectedIndex = 1;
  6699. Laya.timer.clearAll(this);
  6700. xGame.soundMgr.playSound("s_start");
  6701. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6702. let guide = DataMgr.getSkillGuide();
  6703. this.ui.guideNode.visible = guide == 0;
  6704. let item = this.getSkillItemByUIIndex(0);
  6705. if (guide == 0) {
  6706. item.ui.c1.selectedIndex = 1;
  6707. }
  6708. else {
  6709. item.ui.c1.selectedIndex = 0;
  6710. }
  6711. this.ui.guideNode.guideBtn.visible = guide == 0;
  6712. for (let index = 0; index < this.displayList.length; index++) {
  6713. this.displayList[index].checkTry();
  6714. }
  6715. this.setGlobalFont(this.ui);
  6716. }
  6717. getSkillItemByUIIndex(cur) {
  6718. for (let index = 0; index < this.displayList.length; index++) {
  6719. if (this.displayList[index].index == cur) {
  6720. return this.displayList[index];
  6721. }
  6722. }
  6723. }
  6724. enterGuideLevel() {
  6725. let item = this.getSkillItemByUIIndex(0);
  6726. item.startGame();
  6727. if (DataMgr.getNewUser())
  6728. Moyu.sendDataEvent("gameStart1");
  6729. }
  6730. initSkillData() {
  6731. this.skillData = [];
  6732. let nameList = xGame.common.skillNameList;
  6733. let iconList = xGame.common.skillIconList;
  6734. let describeList = [
  6735. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6736. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6737. "The power of frost descends—freezing the flow and taking full control of the game!"
  6738. ];
  6739. console.log('zh:initSkillData 111111111');
  6740. let data;
  6741. for (let index = 0; index < nameList.length; index++) {
  6742. data = {};
  6743. data.name = nameList[index];
  6744. data.icon = iconList[index];
  6745. data.describe = describeList[index];
  6746. data.index = index;
  6747. this.skillData.push(data);
  6748. }
  6749. }
  6750. updateSkillItem(index, target) {
  6751. if (this.displayList[index] == null) {
  6752. let uiIndex;
  6753. switch (index) {
  6754. case 0:
  6755. uiIndex = 1;
  6756. break;
  6757. case 1:
  6758. uiIndex = 0;
  6759. break;
  6760. case 2:
  6761. uiIndex = 2;
  6762. break;
  6763. case 3:
  6764. uiIndex = 3;
  6765. break;
  6766. default:
  6767. break;
  6768. }
  6769. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6770. this.displayList.push(temp);
  6771. }
  6772. }
  6773. playSecretaryIdle() {
  6774. let parent = this.ui.secretary.displayObject;
  6775. parent.destroyChildren();
  6776. let xx = this.ui.secretary.width / 2;
  6777. let yy = this.ui.secretary.height;
  6778. let scale = xGame.common.getSecretaryScale();
  6779. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6780. xGame.common.secretary.play(data, 0, true, parent);
  6781. }
  6782. returnUIMain() {
  6783. this.hide();
  6784. xGame.common.stopGirlPop(this.ui.talkNode);
  6785. xGame.uiMgr.Show(UIMain);
  6786. }
  6787. interuptSecretary() {
  6788. Laya.timer.clearAll(this);
  6789. this.playSecretaryRandomSound();
  6790. }
  6791. playSecretaryRandomSound() {
  6792. if (this.isHide)
  6793. return;
  6794. let time = xGame.common.randomNum(45000, 60000);
  6795. Laya.timer.once(time, this, () => {
  6796. if (this.isHide)
  6797. return;
  6798. let index = xGame.common.randomNum(4, 7);
  6799. xGame.soundMgr.playSound("s_main0" + index);
  6800. let words = 1;
  6801. switch (index) {
  6802. case 4:
  6803. words = 5;
  6804. break;
  6805. case 5:
  6806. words = 3;
  6807. break;
  6808. case 6:
  6809. words = 6;
  6810. break;
  6811. case 7:
  6812. words = 7;
  6813. break;
  6814. default:
  6815. break;
  6816. }
  6817. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6818. this.playSecretaryRandomSound();
  6819. });
  6820. }
  6821. }
  6822. UISkill.uiName = "UISkill";
  6823. class ui_UIModeSelection extends fgui.GComponent {
  6824. static createInstance() {
  6825. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6826. }
  6827. onConstruct() {
  6828. this.n19 = (this.getChild("n19"));
  6829. this.closeBtn = (this.getChild("closeBtn"));
  6830. this.myNode = (this.getChild("myNode"));
  6831. this.t0 = this.getTransition("t0");
  6832. }
  6833. }
  6834. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6835. class UIModeSelection extends UIBase {
  6836. constructor() {
  6837. super();
  6838. }
  6839. onConstructor() {
  6840. this.ui = ui_UIModeSelection.createInstance();
  6841. this.contentPane = this.ui;
  6842. this.isEject = false;
  6843. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6844. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6845. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6846. this.addUIClick(this.ui.closeBtn, this.hide);
  6847. this.peopleArr = [65, 990, 580];
  6848. this.peopleOffest = [5, 10, 10];
  6849. }
  6850. show(callback) {
  6851. this.updateSelf();
  6852. super.show();
  6853. this.ui.t0.play();
  6854. this.callback = callback;
  6855. this.setGlobalFont(this.ui);
  6856. }
  6857. updateSelf() {
  6858. let cfg = cfgTable.modeselectData;
  6859. for (let index = 1; index <= 3; index++) {
  6860. let node = this.ui.myNode["type" + index];
  6861. node.need.text = cfg[index].need;
  6862. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6863. node.peopleTxt.text = this.getRandPeople(index - 1);
  6864. }
  6865. }
  6866. enterGame(type) {
  6867. console.log('zh: 进入经典模式 type: ' + type);
  6868. xGame.common.classicRoomType = type;
  6869. let cfg = cfgTable.modeselectData[type];
  6870. let need = cfg.need;
  6871. xGame.common.passAwardCoin = cfg.award;
  6872. if (DataMgr.coinEnough(need)) {
  6873. DataMgr.setCoin(-need);
  6874. this.ui.myNode["type" + type].t0.play();
  6875. Laya.timer.once(200, this, () => {
  6876. this.callback && this.callback();
  6877. });
  6878. this.logEventForClassic_start();
  6879. }
  6880. else {
  6881. Moyu.sendDataEvent("AddCoinVideo");
  6882. xGame.uiMgr.Show(UIAddProp, 0);
  6883. }
  6884. }
  6885. getRandPeople(index) {
  6886. let rand = this.peopleOffest[index];
  6887. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6888. }
  6889. logEventForClassic_start() {
  6890. let rtype = xGame.common.classicRoomType;
  6891. let msmc = '';
  6892. if (rtype == 1) {
  6893. msmc = 'beginner';
  6894. }
  6895. if (rtype == 2) {
  6896. msmc = 'expert';
  6897. }
  6898. if (rtype == 3) {
  6899. msmc = 'master';
  6900. }
  6901. let keyStr = 'sjmd_classic_start_' + rtype;
  6902. let jsonStr = {
  6903. "difficulty": msmc,
  6904. "classic_count": 1,
  6905. "difficulty_count": 1
  6906. };
  6907. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6908. const d = LocalStorageManager.getItem(keyStr);
  6909. jsonStr.classic_count = d.classic_count + 1;
  6910. jsonStr.difficulty_count = d.difficulty_count + 1;
  6911. LocalStorageManager.setItem(keyStr, jsonStr);
  6912. }
  6913. else {
  6914. LocalStorageManager.setItem(keyStr, jsonStr);
  6915. }
  6916. const reqStr = JSON.stringify(jsonStr);
  6917. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6918. }
  6919. }
  6920. UIModeSelection.uiName = "UIModeSelection";
  6921. class ui_UIReg extends fgui.GComponent {
  6922. static createInstance() {
  6923. return (fgui.UIPackage.createObject("game", "UIReg"));
  6924. }
  6925. onConstruct() {
  6926. this.n38 = (this.getChild("n38"));
  6927. this.n51 = (this.getChild("n51"));
  6928. this.closeBtn = (this.getChild("closeBtn"));
  6929. this.lab_tip = (this.getChild("lab_tip"));
  6930. this.txt_ua = (this.getChild("txt_ua"));
  6931. this.txt_up1 = (this.getChild("txt_up1"));
  6932. this.txt_up2 = (this.getChild("txt_up2"));
  6933. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6934. this.btn_reg = (this.getChild("btn_reg"));
  6935. }
  6936. }
  6937. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6938. class ui_UILogin extends fgui.GComponent {
  6939. static createInstance() {
  6940. return (fgui.UIPackage.createObject("game", "UILogin"));
  6941. }
  6942. onConstruct() {
  6943. this.c1 = this.getController("c1");
  6944. this.n18 = (this.getChild("n18"));
  6945. this.n21 = (this.getChild("n21"));
  6946. this.closeBtn = (this.getChild("closeBtn"));
  6947. this.txt_ua = (this.getChild("txt_ua"));
  6948. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6949. this.btn_login = (this.getChild("btn_login"));
  6950. this.txt_up = (this.getChild("txt_up"));
  6951. }
  6952. }
  6953. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6954. class UILogin extends UIBase {
  6955. constructor() {
  6956. super();
  6957. this.fontStr = 'big-john-woff2-2';
  6958. try {
  6959. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  6960. console.log("zh: constructor加载arial字体成功");
  6961. }
  6962. catch (error) {
  6963. console.log("zh: constructor加载arial字体失败");
  6964. }
  6965. }
  6966. onFontLoaded() {
  6967. try {
  6968. Laya.Text.defaultFont = this.fontStr;
  6969. this.ui.txt_ua.font = this.fontStr;
  6970. this.ui.txt_up.font = this.fontStr;
  6971. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  6972. }
  6973. catch (error) {
  6974. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  6975. }
  6976. }
  6977. onConstructor() {
  6978. this.ui = ui_UILogin.createInstance();
  6979. this.contentPane = this.ui;
  6980. this.isEject = false;
  6981. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6982. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6983. this.addUIClick(this.ui.btn_login, this.userLogin);
  6984. }
  6985. show() {
  6986. super.show();
  6987. this.x = (Laya.stage.width - this.width) / 2;
  6988. this.y = (Laya.stage.height - this.height) / 2;
  6989. this.onFontLoaded();
  6990. }
  6991. closeSelf() {
  6992. this.hide();
  6993. }
  6994. userLogin() {
  6995. let ua = this.ui.txt_ua.text;
  6996. let up = this.ui.txt_up.text;
  6997. console.log('zh:ua font' + this.ui.txt_ua.font);
  6998. if (ua && up) {
  6999. let reqData = JSON.stringify({
  7000. username: ua.trim(),
  7001. password: up.trim(),
  7002. fromMark: 'app_game'
  7003. });
  7004. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  7005. try {
  7006. console.log('zh:res = ' + JSON.stringify(res));
  7007. let code = res.code;
  7008. let msg = res.msg;
  7009. if (code == 200) {
  7010. let keyStr = keyForLoginInfo;
  7011. let jsonStr = {
  7012. "username": res.username,
  7013. "token": res.token,
  7014. "buySpids": { 1: false, 7: false }
  7015. };
  7016. LocalStorageManager.setItem(keyStr, jsonStr);
  7017. let myu = Moyu.getUserInfo();
  7018. console.log('zh:myu = ' + JSON.stringify(myu));
  7019. DataMgr.updateUserNickName(res.username);
  7020. Moyu.updateUserInfo(res.username);
  7021. xGame.uiMgr.Show(UIMsg, msg);
  7022. DataMgr.loadUserSpOrderForAd();
  7023. DataMgr.getUserZiChanInfo(false);
  7024. xGame.eventMgr.event(LOGIN_IN);
  7025. this.closeSelf();
  7026. }
  7027. else {
  7028. xGame.uiMgr.Show(UIMsg, msg);
  7029. }
  7030. }
  7031. catch (error) {
  7032. console.log('error=' + error);
  7033. alert(error);
  7034. }
  7035. finally {
  7036. }
  7037. });
  7038. }
  7039. else {
  7040. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7041. }
  7042. }
  7043. gotoRegPage() {
  7044. this.closeSelf();
  7045. xGame.uiMgr.Show(UIReg);
  7046. }
  7047. }
  7048. UILogin.uiName = "UILogin";
  7049. class UIReg extends UIBase {
  7050. constructor() {
  7051. super();
  7052. this.fontStr = 'big-john-woff2-2';
  7053. try {
  7054. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7055. console.log("zh: constructor加载arial字体成功");
  7056. }
  7057. catch (error) {
  7058. console.log("zh: constructor加载arial字体失败");
  7059. }
  7060. }
  7061. onFontLoaded() {
  7062. try {
  7063. Laya.Text.defaultFont = this.fontStr;
  7064. this.ui.txt_ua.font = this.fontStr;
  7065. this.ui.txt_up1.font = this.fontStr;
  7066. this.ui.txt_up2.font = this.fontStr;
  7067. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7068. }
  7069. catch (error) {
  7070. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7071. }
  7072. }
  7073. onConstructor() {
  7074. this.ui = ui_UIReg.createInstance();
  7075. this.contentPane = this.ui;
  7076. this.isEject = false;
  7077. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7078. this.addUIClick(this.ui.btn_reg, this.regUser);
  7079. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  7080. }
  7081. show() {
  7082. super.show();
  7083. this.x = (Laya.stage.width - this.width) / 2;
  7084. this.y = (Laya.stage.height - this.height) / 2;
  7085. this.onFontLoaded();
  7086. }
  7087. closeSelf() {
  7088. this.hide();
  7089. }
  7090. regUser() {
  7091. this.ui.lab_tip.visible = false;
  7092. let ua = this.ui.txt_ua.text;
  7093. let up1 = this.ui.txt_up1.text;
  7094. let up2 = this.ui.txt_up2.text;
  7095. if (ua && up1 && up2 && up1 == up2) {
  7096. let reqData = JSON.stringify({
  7097. username: ua.trim(),
  7098. password: up1.trim(),
  7099. fromMark: 'app_game'
  7100. });
  7101. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7102. try {
  7103. console.log('zh:res = ' + JSON.stringify(res));
  7104. let code = res.code;
  7105. let msg = res.msg;
  7106. xGame.uiMgr.Show(UIMsg, msg);
  7107. if (code == 200) {
  7108. this.ui.lab_tip.color = "#FFFFFF";
  7109. xGame.uiMgr.Show(UIMsg, msg);
  7110. this.closeSelf();
  7111. }
  7112. else {
  7113. this.ui.lab_tip.color = "#FF0000";
  7114. xGame.uiMgr.Show(UIMsg, msg);
  7115. }
  7116. }
  7117. catch (error) {
  7118. console.log('error=' + error);
  7119. alert(error);
  7120. }
  7121. finally {
  7122. }
  7123. });
  7124. }
  7125. else {
  7126. if (up1 != up2) {
  7127. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7128. }
  7129. else {
  7130. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7131. }
  7132. }
  7133. }
  7134. gotoLogin() {
  7135. this.closeSelf();
  7136. xGame.uiMgr.Show(UILogin);
  7137. }
  7138. }
  7139. UIReg.uiName = "UIReg";
  7140. class ui_UIFuli1 extends fgui.GComponent {
  7141. static createInstance() {
  7142. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  7143. }
  7144. onConstruct() {
  7145. this.n1 = (this.getChild("n1"));
  7146. this.n2 = (this.getChild("n2"));
  7147. }
  7148. }
  7149. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  7150. class UIFuli1 extends UIBase {
  7151. constructor() {
  7152. super();
  7153. this.jiage = 4.99;
  7154. }
  7155. onConstructor() {
  7156. this.ui = ui_UIFuli1.createInstance();
  7157. this.contentPane = this.ui;
  7158. this.isEject = false;
  7159. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7160. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7161. }
  7162. show() {
  7163. super.show();
  7164. this.x = (Laya.stage.width - this.width) / 2;
  7165. this.y = (Laya.stage.height - this.height) / 2;
  7166. this.ui.n2.txt_price.text = "$" + this.jiage;
  7167. this.ui.n2.n_zzq_fl1.url = 'res/fuli1.png';
  7168. this.setGlobalFont(this.ui);
  7169. }
  7170. closeSelf() {
  7171. DataMgr.loadUserSpOrderForAd();
  7172. this.hide();
  7173. }
  7174. gotoBuy() {
  7175. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7176. if (userInfo != null) {
  7177. let token = userInfo.token;
  7178. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  7179. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  7180. DataMgr.loadUserSpOrderForAd();
  7181. return;
  7182. }
  7183. else {
  7184. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7185. }
  7186. }
  7187. gotoBuy2() {
  7188. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7189. if (userInfo == null) {
  7190. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7191. return;
  7192. }
  7193. let reqData = xGame.httpMgr.getReqData();
  7194. let pd = JSON.parse(reqData);
  7195. pd.productId = 1;
  7196. reqData = JSON.stringify(pd);
  7197. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7198. try {
  7199. console.log('zh:buySp res = ' + JSON.stringify(res));
  7200. let code = res.code;
  7201. let msg = res.msg;
  7202. if (code == 401) {
  7203. Laya.LocalStorage.removeItem(keyForLoginInfo);
  7204. alert(TIP_MSG_key.loginTimeOut);
  7205. xGame.uiMgr.Show(UIMsg, msg);
  7206. return;
  7207. }
  7208. if (code == 200) {
  7209. xGame.uiMgr.Show(UIMsg, msg);
  7210. DataMgr.loadUserSpOrderForAd();
  7211. DataMgr.getUserZiChanInfo(false);
  7212. this.closeSelf();
  7213. }
  7214. else {
  7215. xGame.uiMgr.Show(UIMsg, msg);
  7216. }
  7217. }
  7218. catch (error) {
  7219. console.log('error=' + error);
  7220. alert(error);
  7221. }
  7222. finally {
  7223. }
  7224. });
  7225. }
  7226. }
  7227. UIFuli1.uiName = "UIFuli1";
  7228. class ui_UIFuli2 extends fgui.GComponent {
  7229. static createInstance() {
  7230. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  7231. }
  7232. onConstruct() {
  7233. this.n1 = (this.getChild("n1"));
  7234. this.n2 = (this.getChild("n2"));
  7235. }
  7236. }
  7237. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  7238. class UIFuli2 extends UIBase {
  7239. constructor() {
  7240. super();
  7241. this.jiage = 14.99;
  7242. }
  7243. onConstructor() {
  7244. this.ui = ui_UIFuli2.createInstance();
  7245. this.contentPane = this.ui;
  7246. this.isEject = false;
  7247. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7248. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7249. }
  7250. show() {
  7251. super.show();
  7252. this.x = (Laya.stage.width - this.width) / 2;
  7253. this.y = (Laya.stage.height - this.height) / 2;
  7254. this.ui.n2.txt_price.text = "$" + this.jiage;
  7255. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  7256. this.setGlobalFont(this.ui);
  7257. }
  7258. closeSelf() {
  7259. DataMgr.loadUserSpOrderForAd();
  7260. this.hide();
  7261. }
  7262. gotoBuy() {
  7263. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7264. if (userInfo != null) {
  7265. let token = userInfo.token;
  7266. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  7267. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  7268. DataMgr.loadUserSpOrderForAd();
  7269. return;
  7270. }
  7271. else {
  7272. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7273. }
  7274. }
  7275. gotoBuy1() {
  7276. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7277. if (userInfo == null) {
  7278. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7279. return;
  7280. }
  7281. let reqData = xGame.httpMgr.getReqData();
  7282. let pd = JSON.parse(reqData);
  7283. pd.productId = 2;
  7284. reqData = JSON.stringify(pd);
  7285. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7286. try {
  7287. console.log('zh:buySp res = ' + JSON.stringify(res));
  7288. let code = res.code;
  7289. let msg = res.msg;
  7290. if (code == 401) {
  7291. Laya.LocalStorage.removeItem(keyForLoginInfo);
  7292. alert(TIP_MSG_key.loginTimeOut);
  7293. xGame.uiMgr.Show(UIMsg, msg);
  7294. return;
  7295. }
  7296. if (code == 200) {
  7297. xGame.uiMgr.Show(UIMsg, msg);
  7298. DataMgr.loadUserSpOrderForAd();
  7299. DataMgr.getUserZiChanInfo(false);
  7300. this.closeSelf();
  7301. }
  7302. else {
  7303. xGame.uiMgr.Show(UIMsg, msg);
  7304. }
  7305. }
  7306. catch (error) {
  7307. console.log('error=' + error);
  7308. alert(error);
  7309. }
  7310. finally {
  7311. }
  7312. });
  7313. }
  7314. }
  7315. UIFuli2.uiName = "UIFuli2";
  7316. class ui_UIGetAward extends fgui.GComponent {
  7317. static createInstance() {
  7318. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7319. }
  7320. onConstruct() {
  7321. this.n4 = (this.getChild("n4"));
  7322. this.n0 = (this.getChild("n0"));
  7323. this.myList = (this.getChild("myList"));
  7324. this.n1 = (this.getChild("n1"));
  7325. this.eftNode = (this.getChild("eftNode"));
  7326. this.btnNode = (this.getChild("btnNode"));
  7327. this.t0 = this.getTransition("t0");
  7328. }
  7329. }
  7330. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7331. class UIGetAward extends UIBase {
  7332. constructor() {
  7333. super();
  7334. this.showTriple = true;
  7335. }
  7336. onConstructor() {
  7337. this.ui = ui_UIGetAward.createInstance();
  7338. this.contentPane = this.ui;
  7339. this.isEject = false;
  7340. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7341. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7342. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7343. }
  7344. show(arr, showTriple, callback) {
  7345. super.show();
  7346. this.ui.t0.play();
  7347. this.ui.eftNode.visible = true;
  7348. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7349. this.ui.eftNode.visible = false;
  7350. }), 1, 0, 0, 0.9);
  7351. this.awardArr = arr;
  7352. this.showTriple = showTriple;
  7353. this.callback = callback;
  7354. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7355. this.ui.myList.numItems = arr.length;
  7356. xGame.soundMgr.playSound("getaward");
  7357. this.setGlobalFont(this.ui);
  7358. }
  7359. updateSelf(index, obj) {
  7360. let temp = this.awardArr[index];
  7361. let icon = this.getIcon(temp.type);
  7362. let str = icon;
  7363. if (temp.type > 2) {
  7364. str = "s" + icon;
  7365. }
  7366. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7367. obj.myIcon.rotation = 0;
  7368. obj.numTxt.text = temp.num + "";
  7369. obj.numTxt.visible = temp.type > 2 ? false : true;
  7370. obj.nameTxt.text = this.getNameStr(temp.type);
  7371. }
  7372. renderItem(index, obj) {
  7373. this.updateSelf(index, obj);
  7374. }
  7375. tripleGetAward() {
  7376. console.log('zh:qjff_AD_for_uigetAward');
  7377. if (Laya.Browser.onAndroid) {
  7378. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7379. if (!boo) {
  7380. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7381. return;
  7382. }
  7383. }
  7384. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7385. }
  7386. else {
  7387. console.log('zh:AD 失败,直接发放奖励');
  7388. this.qjff_AD_for_uigetAward();
  7389. }
  7390. }
  7391. qjff_AD_for_uigetAward() {
  7392. this.getAward(3);
  7393. }
  7394. normalGetAward() {
  7395. if (PlatMgr.isMisVideo())
  7396. this.tripleGetAward();
  7397. else
  7398. this.getAward();
  7399. }
  7400. getAward(times = 1) {
  7401. this.hide();
  7402. for (let index = 0; index < this.awardArr.length; index++) {
  7403. this.awardArr[index].num *= times;
  7404. }
  7405. this.callback && this.callback(times != 1);
  7406. }
  7407. getIcon(type) {
  7408. switch (type) {
  7409. case Prop.diamond:
  7410. return "ty_zs";
  7411. case Prop.coin:
  7412. return "ty_jb";
  7413. case Prop.gan1:
  7414. return "qg1";
  7415. case Prop.gan2:
  7416. return "qg2";
  7417. case Prop.gan3:
  7418. return "qg3";
  7419. case Prop.gan4:
  7420. return "qg4";
  7421. default:
  7422. break;
  7423. }
  7424. }
  7425. getNameStr(type) {
  7426. switch (type) {
  7427. case Prop.diamond:
  7428. return "Diamond";
  7429. case Prop.coin:
  7430. return "Coins";
  7431. case Prop.gan1:
  7432. case Prop.gan2:
  7433. case Prop.gan3:
  7434. case Prop.gan4:
  7435. return cfgTable.ballrodData[type - 1].name;
  7436. default:
  7437. break;
  7438. }
  7439. }
  7440. }
  7441. UIGetAward.uiName = "UIGetAward";
  7442. class ui_UIRepentProp extends fgui.GComponent {
  7443. static createInstance() {
  7444. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7445. }
  7446. onConstruct() {
  7447. this.c1 = this.getController("c1");
  7448. this.n11 = (this.getChild("n11"));
  7449. this.regretNode = (this.getChild("regretNode"));
  7450. this.helpLineNode = (this.getChild("helpLineNode"));
  7451. this.t0 = this.getTransition("t0");
  7452. }
  7453. }
  7454. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7455. class UIRepentProp extends UIBase {
  7456. constructor() {
  7457. super();
  7458. this.viewType = 0;
  7459. this.regretType = 0;
  7460. }
  7461. onConstructor() {
  7462. this.ui = ui_UIRepentProp.createInstance();
  7463. this.contentPane = this.ui;
  7464. this.isEject = false;
  7465. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7466. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7467. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7468. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7469. }
  7470. show(viewType, regretType, callback) {
  7471. PlatMgr.showInsert(true);
  7472. this.viewType = viewType;
  7473. this.regretType = regretType;
  7474. this.callback = callback;
  7475. super.show();
  7476. this.ui.t0.play();
  7477. this.ui.c1.selectedIndex = this.viewType;
  7478. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7479. if (this.viewType == 0) {
  7480. let guide = DataMgr.getGuideHelpLine();
  7481. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7482. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7483. }
  7484. xGame.common.gameMgr.gamePause = true;
  7485. this.setGlobalFont(this.ui);
  7486. }
  7487. hideSelf() {
  7488. xGame.common.gameMgr.gamePause = false;
  7489. this.callback && this.callback(false);
  7490. this.hide();
  7491. }
  7492. videoRegret() {
  7493. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7494. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7495. }
  7496. else {
  7497. console.log('zh:AD 失败,直接发放奖励');
  7498. this.qjff_AD_for_UIrepentProp_videoRegret();
  7499. }
  7500. }
  7501. qjff_AD_for_UIrepentProp_videoRegret() {
  7502. this.callback && this.callback(true);
  7503. this.hideSelf();
  7504. }
  7505. videoAddHelpLine() {
  7506. let guide = DataMgr.getGuideHelpLine();
  7507. if (guide == 0) {
  7508. this.callback && this.callback(true);
  7509. this.hideSelf();
  7510. DataMgr.setGuideHelpLine();
  7511. xGame.common.gameUI.ui.guideNode.visible = false;
  7512. }
  7513. else {
  7514. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7515. if (Laya.Browser.onAndroid) {
  7516. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7517. if (!boo) {
  7518. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7519. return;
  7520. }
  7521. }
  7522. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7523. }
  7524. else {
  7525. console.log('zh:AD 失败,直接发放奖励');
  7526. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7527. }
  7528. }
  7529. }
  7530. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7531. this.callback && this.callback(true);
  7532. this.hideSelf();
  7533. }
  7534. }
  7535. UIRepentProp.uiName = "UIRepentProp";
  7536. class UIMain extends UIBase {
  7537. constructor() {
  7538. super();
  7539. this.firstEnter = true;
  7540. }
  7541. nativeCallJs(msg) {
  7542. let t = msg;
  7543. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7544. switch (t) {
  7545. case 'qjff_chouJiang':
  7546. let dui = xGame.uiMgr.getUI(UIDraw);
  7547. dui.qjff_chouJiang();
  7548. break;
  7549. case 'qjff_AD_for_uisign':
  7550. let dui2 = xGame.uiMgr.getUI(UISign);
  7551. dui2.qjff_AD_for_uisign();
  7552. break;
  7553. case 'qjff_AD_for_uitry':
  7554. let dui3 = xGame.uiMgr.getUI(UITry);
  7555. dui3.qjff_AD_for_uitry();
  7556. break;
  7557. case 'qjff_AD_for_uipower':
  7558. let dui4 = xGame.uiMgr.getUI(UIPower);
  7559. dui4.qjff_AD_for_uipower();
  7560. break;
  7561. case 'qjff_AD_for_uigetAward':
  7562. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7563. dui5.qjff_AD_for_uigetAward();
  7564. break;
  7565. case 'qjff_AD_for_uiGameEnd':
  7566. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7567. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7568. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7569. break;
  7570. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7571. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7572. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7573. break;
  7574. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7575. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7576. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7577. break;
  7578. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7579. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7580. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7581. break;
  7582. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7583. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7584. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7585. break;
  7586. case 'qjff_AD_for_UIBOX_onOpenBox':
  7587. let dui11 = xGame.uiMgr.getUI(UIBox);
  7588. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7589. break;
  7590. case 'qjff_AD_for_UIAddCoin':
  7591. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7592. dui12.qjff_AD_for_UIAddCoin();
  7593. break;
  7594. case 'app_sign_for_buyProduct_onSuccess':
  7595. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  7596. DataMgr.getUserZiChanInfo(false);
  7597. break;
  7598. case '222axxxxxx':
  7599. let dui15 = xGame.uiMgr.getUI(UISign);
  7600. dui15.qjff_AD_for_uisign();
  7601. break;
  7602. case '333axsxxxxxx':
  7603. let dui16 = xGame.uiMgr.getUI(UISign);
  7604. dui16.qjff_AD_for_uisign();
  7605. break;
  7606. default:
  7607. console.log('zh:未知的方法名字' + t);
  7608. break;
  7609. }
  7610. }
  7611. onConstructor() {
  7612. console.log('zh: UIMain onConstructor');
  7613. this.ui = ui_UIMain.createInstance();
  7614. this.contentPane = this.ui;
  7615. this.isEject = false;
  7616. this.addEvent();
  7617. this.addClickSpine();
  7618. this.settingNode = new SettingNode(this.ui.settingNode);
  7619. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7620. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7621. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7622. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7623. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7624. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7625. let curUse = DataMgr.getCurSecretary();
  7626. this.changeSecretary(curUse);
  7627. this.ui.talkNode.visible = false;
  7628. let guide = DataMgr.getSkillGuide();
  7629. if (xGame.common.isNewDay && guide == 1) {
  7630. xGame.common.isNewDay = false;
  7631. xGame.soundMgr.playSound("s_main01");
  7632. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7633. console.log("zh:播放小秘书每天语音");
  7634. }
  7635. this.onGetUserInfo();
  7636. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7637. DataMgr.getUserZiChanInfo(false);
  7638. }
  7639. this.ui.n83.visible = false;
  7640. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7641. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7642. let ua = d.username;
  7643. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7644. }
  7645. this.c_btn_for_user();
  7646. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7647. }
  7648. Logout() {
  7649. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7650. LocalStorageManager.removeItem(keyForLoginInfo);
  7651. this.freshUser();
  7652. }
  7653. JSBridgeUtils.instance.loginOutForApp();
  7654. this.setUserDefaultNickname();
  7655. DataMgr.setCoin2(4000);
  7656. DataMgr.setDiamond2(0);
  7657. this.setDefaultQiuGanInfo();
  7658. DataMgr.setPlaceBallLevelList("");
  7659. DataMgr.setChallengeMode_overLev(1);
  7660. this.setDefaultSignData();
  7661. }
  7662. setDefaultSignData() {
  7663. DataMgr.setSignData(1);
  7664. DataMgr.setSignTime(new Date().getTime());
  7665. }
  7666. setDefaultQiuGanInfo() {
  7667. DataMgr.setBallRod(0, 1);
  7668. DataMgr.setBallRod(1, 0);
  7669. DataMgr.setBallRod(2, 0);
  7670. DataMgr.setBallRod(3, 0);
  7671. DataMgr.setBallRod(4, 0);
  7672. DataMgr.setBallRod(5, 1);
  7673. }
  7674. setUserDefaultNickname() {
  7675. let defUsername = "player";
  7676. this.ui.headNode.nameTxt.text = defUsername;
  7677. DataMgr.updateUserNickName(defUsername);
  7678. Moyu.updateUserInfo(defUsername);
  7679. }
  7680. gotoLogin() {
  7681. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  7682. xGame.uiMgr.Show(UILogin);
  7683. }
  7684. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  7685. this.Logout();
  7686. }
  7687. }
  7688. gotoRegUser() {
  7689. xGame.uiMgr.Show(UIReg);
  7690. }
  7691. showFuLiSp1() {
  7692. console.log('zh:福利1');
  7693. this.checkForShowFuLi17(1);
  7694. }
  7695. showFuLiSp7() {
  7696. console.log('zh:福利7');
  7697. this.checkForShowFuLi17(7);
  7698. }
  7699. checkForShowFuLi17(alert_spid) {
  7700. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7701. if (userInfo == null) {
  7702. if (alert_spid === 1) {
  7703. xGame.uiMgr.Show(UIFuli1);
  7704. }
  7705. if (alert_spid === 7) {
  7706. xGame.uiMgr.Show(UIFuli2);
  7707. }
  7708. return;
  7709. }
  7710. console.log('zh:是否需要展示福利 ' + alert_spid + ' 的弹窗');
  7711. let reqData = xGame.httpMgr.getReqData();
  7712. let pd = JSON.parse(reqData);
  7713. pd.productId = alert_spid;
  7714. reqData = JSON.stringify(pd);
  7715. xGame.httpMgr.sendPost2025('order/getOrderForBuyFuLiSpid17', reqData, (res) => {
  7716. try {
  7717. let code = res.code;
  7718. let msg = res.msg;
  7719. if (code == 401) {
  7720. Laya.LocalStorage.removeItem(keyForLoginInfo);
  7721. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7722. return;
  7723. }
  7724. if (code == 200) {
  7725. let data = res.data;
  7726. let buyOkSpid = [];
  7727. for (let i = 0; i < data.length; i++) {
  7728. let item = data[i];
  7729. let temp_spid = item.spid;
  7730. DataMgr.updateLocalUserDataForSpid17(temp_spid, true);
  7731. buyOkSpid.push(temp_spid);
  7732. }
  7733. let isBuyOk7 = buyOkSpid.indexOf(7) >= 0 ? true : false;
  7734. if (isBuyOk7) {
  7735. return;
  7736. }
  7737. let isBuyOk = buyOkSpid.indexOf(alert_spid) >= 0 ? true : false;
  7738. if (isBuyOk && alert_spid === 1) {
  7739. return;
  7740. }
  7741. else {
  7742. if (isBuyOk === false) {
  7743. if (alert_spid === 1) {
  7744. xGame.uiMgr.Show(UIFuli1);
  7745. }
  7746. if (alert_spid === 7) {
  7747. xGame.uiMgr.Show(UIFuli2);
  7748. }
  7749. }
  7750. else {
  7751. console.log('zh:已经购买了SPID=' + alert_spid + ',不需要再提示用户了');
  7752. }
  7753. }
  7754. }
  7755. else {
  7756. xGame.uiMgr.Show(UIMsg, msg);
  7757. }
  7758. }
  7759. catch (error) {
  7760. console.log('error=' + error);
  7761. alert(error);
  7762. }
  7763. finally {
  7764. }
  7765. });
  7766. }
  7767. c_btn_for_user() {
  7768. this.ui.n_dengLu.c1.selectedIndex = 0;
  7769. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7770. this.ui.n_dengLu.c1.selectedIndex = 1;
  7771. }
  7772. else {
  7773. this.ui.n_dengLu.c1.selectedIndex = 0;
  7774. }
  7775. }
  7776. changeSecretary(curUse) {
  7777. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7778. xGame.common.secretary && xGame.common.secretary.dispose();
  7779. this.addSecretarySpine(name);
  7780. }
  7781. addSecretarySpine(name) {
  7782. let spine = new SpineMgr(name, () => {
  7783. this.playSecretaryIdle();
  7784. });
  7785. xGame.common.secretary = spine;
  7786. }
  7787. addClickSpine() {
  7788. let clickSpine = new SpineMgr("dianji", () => {
  7789. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7790. let parent = Laya.stage;
  7791. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7792. clickSpine.play(data, 0, false, parent, (spine) => {
  7793. spine.destroy(true);
  7794. });
  7795. });
  7796. });
  7797. }
  7798. addEvent() {
  7799. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7800. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7801. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  7802. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7803. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7804. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7805. this.addUIClick(this.ui, this.interuptSecretary);
  7806. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7807. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7808. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7809. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7810. this.addUIClick(this.ui.signBtn, this.openSignView);
  7811. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7812. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7813. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7814. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7815. }
  7816. show(showFailWords) {
  7817. super.show();
  7818. DataMgr.loadUserSpOrderForAd();
  7819. this.moneyNode.ui.c1.selectedIndex = 1;
  7820. this.playSecretaryIdle();
  7821. xGame.soundMgr.playMusic("caromhall01", 0);
  7822. Laya.timer.clearAll(this);
  7823. this.playSecretaryRandomSound();
  7824. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7825. if (showFailWords) {
  7826. console.log('zh:uimain.ts ');
  7827. setTimeout(() => {
  7828. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7829. let words = -1;
  7830. if (str == "s_main02") {
  7831. words = 2;
  7832. }
  7833. else {
  7834. words = 3;
  7835. }
  7836. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7837. xGame.soundMgr.playSound(str);
  7838. }, 300);
  7839. }
  7840. this.showGuide();
  7841. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7842. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7843. let guide = DataMgr.getSkillGuide();
  7844. if (guide == 1) {
  7845. let randTime = xGame.common.randomNum(300, 800);
  7846. if (this.firstEnter) {
  7847. console.log("zh: firstEnter");
  7848. this.firstEnter = false;
  7849. randTime += 900;
  7850. }
  7851. else {
  7852. console.log("zh: no firstEnter");
  7853. }
  7854. Laya.timer.once(randTime, this, () => {
  7855. });
  7856. Laya.timer.once(1000, this, () => {
  7857. console.log('zh: 1秒后 showFuLiSp1');
  7858. this.showFuLiSp1();
  7859. });
  7860. Laya.timer.once(10000, this, () => {
  7861. console.log('zh: 10秒后 showFuLiSp1');
  7862. this.showFuLiSp7();
  7863. });
  7864. }
  7865. this.setGlobalFont(this.ui);
  7866. }
  7867. checkActive(show) {
  7868. }
  7869. showGuide() {
  7870. let guide = DataMgr.getSkillGuide();
  7871. this.ui.guideBtn.visible = guide == 0;
  7872. this.ui.enterGuide.visible = false;
  7873. this.ui.secretaryGuide.visible = guide == 0;
  7874. if (guide == 0) {
  7875. console.log("zh:显示引导");
  7876. xGame.soundMgr.playSound("s_guide");
  7877. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7878. }
  7879. else {
  7880. console.log("zh:不需要显示引导");
  7881. }
  7882. }
  7883. ensureSecretary() {
  7884. console.log('zh: ensureSecretary ');
  7885. this.ui.secretaryGuide.visible = false;
  7886. this.ui.enterGuide.visible = true;
  7887. this.ui.wordsNode.t0.play();
  7888. if (DataMgr.getNewUser())
  7889. Moyu.sendDataEvent("gameReady");
  7890. }
  7891. playSecretaryIdle() {
  7892. let parent = this.ui.secretary.displayObject;
  7893. parent.destroyChildren();
  7894. let xx = this.ui.secretary.width / 2;
  7895. let yy = this.ui.secretary.height;
  7896. let scale = xGame.common.getSecretaryScale();
  7897. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7898. xGame.common.secretary.play(data, 0, true, parent);
  7899. }
  7900. startGame(type) {
  7901. if (!this.isReadyForLoadNetSource()) {
  7902. return;
  7903. }
  7904. xGame.common.gameMode = type;
  7905. Moyu.sendDataEvent("PlayGame", { type: type });
  7906. let gm = xGame.common.gameMode;
  7907. console.log('zh:进入游戏gameMode =' + gm);
  7908. switch (gm) {
  7909. case GameMode.classic:
  7910. console.log('zh:进入经典模式111111111');
  7911. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7912. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7913. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  7914. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7915. console.log('zh:判断是否可以玩该模式classic =NO');
  7916. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7917. xGame.uiMgr.Show(UIMsg, tipStr);
  7918. return;
  7919. }
  7920. else {
  7921. console.log('zh:可以玩该模式classic');
  7922. this.beginGame();
  7923. }
  7924. }
  7925. else {
  7926. console.log('zh:不需要判断是否可以玩该classic');
  7927. let challengeTimes = DataMgr.getChallengeTimes();
  7928. if (challengeTimes == 0) {
  7929. xGame.uiMgr.Show(UIInvitation);
  7930. }
  7931. else {
  7932. this.beginGame();
  7933. }
  7934. }
  7935. break;
  7936. case GameMode.bigMove:
  7937. console.info('zh:bigMove check 大招');
  7938. let guide = DataMgr.getSkillGuide();
  7939. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7940. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7941. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7942. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7943. console.log('zh:提示不可以玩');
  7944. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7945. xGame.uiMgr.Show(UIMsg, tipStr);
  7946. return;
  7947. }
  7948. else {
  7949. console.log('zh:可以玩该模式 bigMove');
  7950. this.beginGame();
  7951. if (DataMgr.getNewUser())
  7952. Moyu.sendDataEvent("gameStart0");
  7953. }
  7954. }
  7955. else {
  7956. this.beginGame();
  7957. if (DataMgr.getNewUser())
  7958. Moyu.sendDataEvent("gameStart0");
  7959. }
  7960. break;
  7961. default:
  7962. console.error('zh:未知错误!!!!');
  7963. break;
  7964. }
  7965. }
  7966. beginGame(isNice = false) {
  7967. console.log('zh:beginGame ');
  7968. let guide = DataMgr.getSkillGuide();
  7969. if (guide == 1) {
  7970. console.log('zh:非新手引导,showInternAd ');
  7971. JSBridgeUtils.instance.showInternAd('beginGame');
  7972. }
  7973. else {
  7974. console.log('zh:新手引导,不显示AD ');
  7975. }
  7976. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  7977. console.log('zh:beginGame 1');
  7978. if (xGame.common.gameMode == GameMode.classic) {
  7979. console.log('zh:beginGame 2');
  7980. if (isNice) {
  7981. console.log('zh:进入巅峰赛');
  7982. this.enterClassic();
  7983. }
  7984. else {
  7985. console.log('zh:beginGame 3-1');
  7986. xGame.uiMgr.Show(UIModeSelection, () => {
  7987. console.log('zh:beginGame 3-2');
  7988. this.enterClassic();
  7989. });
  7990. }
  7991. }
  7992. else if (xGame.common.gameMode == GameMode.bigMove) {
  7993. console.log('zh:beginGame 5');
  7994. this.ui.enterGuide.visible = false;
  7995. xGame.uiMgr.Show(UISkill);
  7996. }
  7997. }
  7998. enterClassic() {
  7999. console.log('zh:beginGame 7');
  8000. xGame.uiMgr.Show(UIGame);
  8001. xGame.uiMgr.Show(UIMatching, () => {
  8002. if (!this.isHide)
  8003. this.hide();
  8004. xGame.common.gameUI.ui.alpha = 1;
  8005. console.log('zh:beginGame 8');
  8006. xGame.common.gameUI.startGame();
  8007. xGame.uiMgr.Hide(UIGameEnd);
  8008. });
  8009. }
  8010. start_debug_for_moni_payOk() {
  8011. console.log('zh:start_debug_for_moni_payOk');
  8012. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8013. if (userInfo != null) {
  8014. let token = userInfo.token;
  8015. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  8016. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  8017. alert('模拟支付OK');
  8018. return;
  8019. }
  8020. else {
  8021. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8022. }
  8023. }
  8024. startGlobal() {
  8025. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  8026. }
  8027. startWeekly() {
  8028. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  8029. }
  8030. zhouSaiMonth() {
  8031. console.log('zh: zhouSaiMonth 被调用');
  8032. }
  8033. isReadyForLoadNetSource() {
  8034. let reqCount = xGame.cfgMgr.httpReqCount;
  8035. let ok = xGame.cfgMgr.httpReqOkCount;
  8036. if (reqCount > ok) {
  8037. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  8038. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  8039. Laya.timer.once(5000, this, () => {
  8040. let retryCount = 0;
  8041. const maxRetries = 3;
  8042. const tryFetchConfig = () => {
  8043. try {
  8044. xGame.cfgMgr.getConfigFromServer();
  8045. }
  8046. catch (error) {
  8047. if (retryCount < maxRetries) {
  8048. retryCount++;
  8049. console.log(`🔄 第${retryCount}次重试获取配置...`);
  8050. Laya.timer.once(5000, this, tryFetchConfig);
  8051. }
  8052. else {
  8053. console.error("❌ 达到最大重试次数,配置获取失败");
  8054. }
  8055. }
  8056. };
  8057. tryFetchConfig();
  8058. });
  8059. return false;
  8060. }
  8061. return true;
  8062. }
  8063. startPlaceBall() {
  8064. if (!this.isReadyForLoadNetSource()) {
  8065. return;
  8066. }
  8067. xGame.uiMgr.Show(UILevelDisplay);
  8068. }
  8069. hide() {
  8070. console.log('zh:uimain hide ...');
  8071. super.hide();
  8072. xGame.common.stopGirlPop(this.ui.talkNode);
  8073. }
  8074. onGetUserInfo(force = false) {
  8075. if (Moyu.isWx) {
  8076. let info = Moyu.getSystemInfo();
  8077. if (info)
  8078. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  8079. }
  8080. else {
  8081. Moyu.initUser(this, this.freshUser, force);
  8082. }
  8083. this.freshUser();
  8084. console.log('zh:5秒后更新用户信息');
  8085. setTimeout(() => {
  8086. DataMgr.getUserZiChanInfo(true);
  8087. }, 5000);
  8088. }
  8089. event_login_in() {
  8090. console.log("zh:event_login_in被触发");
  8091. this.freshUser();
  8092. }
  8093. freshUser() {
  8094. let user = Moyu.getUserInfo();
  8095. if (!user.isAuth) {
  8096. user.headIcon = 'res/ty_touxiang.png';
  8097. }
  8098. else {
  8099. DataMgr.upRankData();
  8100. }
  8101. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  8102. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  8103. let keyStr = keyForLoginInfo;
  8104. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8105. const d = LocalStorageManager.getItem(keyStr);
  8106. let ua = d.username;
  8107. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  8108. }
  8109. else {
  8110. }
  8111. this.c_btn_for_user();
  8112. }
  8113. interuptSecretary() {
  8114. Laya.timer.clearAll(this);
  8115. this.playSecretaryRandomSound();
  8116. }
  8117. playSecretaryRandomSound() {
  8118. if (this.isHide)
  8119. return;
  8120. let time = xGame.common.randomNum(45000, 60000);
  8121. Laya.timer.once(time, this, () => {
  8122. if (this.isHide)
  8123. return;
  8124. let index = xGame.common.randomNum(4, 7);
  8125. xGame.soundMgr.playSound("s_main0" + index);
  8126. let words = 1;
  8127. switch (index) {
  8128. case 4:
  8129. words = 5;
  8130. break;
  8131. case 5:
  8132. words = 3;
  8133. break;
  8134. case 6:
  8135. words = 6;
  8136. break;
  8137. case 7:
  8138. words = 7;
  8139. break;
  8140. default:
  8141. break;
  8142. }
  8143. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8144. this.playSecretaryRandomSound();
  8145. });
  8146. }
  8147. openSecretaryView() {
  8148. xGame.uiMgr.Show(UISecretary);
  8149. Moyu.sendDataEvent("secretary");
  8150. }
  8151. openShopView() {
  8152. xGame.uiMgr.Show(UIShop, 1);
  8153. }
  8154. openShopView0() {
  8155. xGame.uiMgr.Show(UIShop, 0);
  8156. }
  8157. openSignView() {
  8158. xGame.uiMgr.Show(UISign);
  8159. }
  8160. openDrawView() {
  8161. xGame.uiMgr.Show(UIDraw);
  8162. }
  8163. openRanking() {
  8164. console.log('zh:phb openRanking');
  8165. xGame.uiMgr.Show(UIRanking);
  8166. Moyu.sendDataEvent("rankingList");
  8167. }
  8168. }
  8169. UIMain.uiName = "UIMain";
  8170. class UIGameEnd extends UIBase {
  8171. constructor() {
  8172. super();
  8173. this.success = false;
  8174. this.awardCoinNum = 1000;
  8175. this.awardDiamondNum = 10;
  8176. }
  8177. onConstructor() {
  8178. this.ui = ui_UIGameEnd.createInstance();
  8179. this.contentPane = this.ui;
  8180. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8181. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8182. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8183. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8184. this.ui.talkNode.visible = false;
  8185. if (Moyu.isKs)
  8186. this.ui.closeNode.closeBtn.x += 100;
  8187. }
  8188. updateType() {
  8189. switch (xGame.common.gameMode) {
  8190. case GameMode.classic:
  8191. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8192. this.ui.coinNode.visible = this.success;
  8193. if (!this.success) {
  8194. Laya.timer.once(500, this, () => {
  8195. xGame.uiMgr.Show(UIAddCoin);
  8196. });
  8197. }
  8198. else {
  8199. this.logEventForClassic_win();
  8200. }
  8201. this.logEventForClassic_complete();
  8202. this.ui.isGetAward.visible = false;
  8203. this.ui.leftBtn.c1.selectedIndex = 3;
  8204. this.ui.rightBtn.c1.selectedIndex = 0;
  8205. this.moneyNode.ui.c1.selectedIndex = 1;
  8206. break;
  8207. case GameMode.bigMove:
  8208. console.log('zh:招法模式 aaaaaa bigMove');
  8209. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8210. this.ui.coinNode.visible = this.success;
  8211. if (xGame.common.gameMode == GameMode.bigMove) {
  8212. if (this.success) {
  8213. DataMgr.setSkillSuccessTimes(1, true);
  8214. DataMgr.setSkillAccTimes(1);
  8215. }
  8216. else {
  8217. DataMgr.setSkillSuccessTimes(0, false);
  8218. }
  8219. }
  8220. this.logEventForRod_complete_N();
  8221. if (!this.success) {
  8222. Laya.timer.once(500, this, () => {
  8223. xGame.uiMgr.Show(UIAddCoin);
  8224. });
  8225. }
  8226. else {
  8227. this.logEventForRod_win();
  8228. }
  8229. this.ui.isGetAward.visible = false;
  8230. this.ui.leftBtn.c1.selectedIndex = 3;
  8231. this.ui.rightBtn.c1.selectedIndex = 0;
  8232. this.moneyNode.ui.c1.selectedIndex = 1;
  8233. break;
  8234. case GameMode.placeBall:
  8235. this.ui.coinNode.visible = false;
  8236. if (this.success) {
  8237. if (xGame.common.placeBallStarNum == 3) {
  8238. this.ui.c1.selectedIndex = 2;
  8239. }
  8240. else {
  8241. this.ui.c1.selectedIndex = 3;
  8242. }
  8243. let level = xGame.common.placeBallCurLevel;
  8244. if (level > 59) {
  8245. this.logEventForChallenge_level_complete(level);
  8246. }
  8247. else {
  8248. this.logEventForChallenge_level_N(level);
  8249. }
  8250. }
  8251. else {
  8252. this.ui.c1.selectedIndex = 4;
  8253. }
  8254. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8255. if (cfg.type == PlaceBallType.challenge) {
  8256. this.ui.c1.selectedIndex = 2;
  8257. }
  8258. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8259. this.updatePlaceBallBtn();
  8260. this.updatePlaceBallStarNum();
  8261. this.updatePlaceBallAwardState();
  8262. this.moneyNode.ui.c1.selectedIndex = 2;
  8263. this.moneyNode.checkPowerTime();
  8264. this.moneyNode.powerChange();
  8265. DataMgr.upRankData();
  8266. break;
  8267. default:
  8268. break;
  8269. }
  8270. }
  8271. logEventForRod_complete_N() {
  8272. let gfmsIdx = xGame.common.curPlayerSkillType;
  8273. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8274. let gfmc = 'Skyfall Shot';
  8275. if (gfmsIdx == 0) {
  8276. gfmc = 'Skyfall Shot';
  8277. }
  8278. if (gfmsIdx == 1) {
  8279. gfmc = 'Surging break';
  8280. }
  8281. if (gfmsIdx == 2) {
  8282. gfmc = 'Frost Lock';
  8283. }
  8284. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8285. console.log('zh:logEventForRod_complete_N level = ' + level);
  8286. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8287. let jsonStr = {
  8288. "count": 0,
  8289. "name": gfmc
  8290. };
  8291. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8292. const d = LocalStorageManager.getItem(keyStr);
  8293. jsonStr.count = d.count + 1;
  8294. LocalStorageManager.setItem(keyStr, jsonStr);
  8295. }
  8296. else {
  8297. LocalStorageManager.setItem(keyStr, jsonStr);
  8298. }
  8299. const d2 = LocalStorageManager.getItem(keyStr);
  8300. let count = d2.count;
  8301. console.log('zh:logEventForRod_complete_N count = ' + count);
  8302. if (count % 5 == 0) {
  8303. const reqStr = JSON.stringify(jsonStr);
  8304. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8305. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8306. }
  8307. }
  8308. logEventForRod_win() {
  8309. console.log('zh:logEventForRod_win,胜利');
  8310. let gfmsIdx = xGame.common.curPlayerSkillType;
  8311. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8312. let gfmc = 'Skyfall Shot';
  8313. if (gfmsIdx == 0) {
  8314. gfmc = 'Skyfall Shot';
  8315. }
  8316. if (gfmsIdx == 1) {
  8317. gfmc = 'Surging break';
  8318. }
  8319. if (gfmsIdx == 2) {
  8320. gfmc = 'Frost Lock';
  8321. }
  8322. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8323. console.log('zh:logEventForRod_win level = ' + level);
  8324. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8325. let jsonStr = {
  8326. "count": 1,
  8327. "name": gfmc + ' Lev' + level
  8328. };
  8329. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8330. const d = LocalStorageManager.getItem(keyStr);
  8331. jsonStr.count = d.count + 1;
  8332. LocalStorageManager.setItem(keyStr, jsonStr);
  8333. }
  8334. else {
  8335. LocalStorageManager.setItem(keyStr, jsonStr);
  8336. }
  8337. const reqStr = JSON.stringify(jsonStr);
  8338. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8339. }
  8340. logEventForClassic_win() {
  8341. console.log('zh:logEventForClassic_win,胜利');
  8342. let rtype = xGame.common.classicRoomType;
  8343. let msmc = '';
  8344. if (rtype == 1) {
  8345. msmc = 'beginner';
  8346. }
  8347. if (rtype == 2) {
  8348. msmc = 'expert';
  8349. }
  8350. if (rtype == 3) {
  8351. msmc = 'master';
  8352. }
  8353. let keyStr = 'sjmd_classic_win_' + rtype;
  8354. let jsonStr = {
  8355. "difficulty": msmc,
  8356. "classic_count": 1,
  8357. "difficulty_count": 1
  8358. };
  8359. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8360. const d = LocalStorageManager.getItem(keyStr);
  8361. jsonStr.classic_count = d.classic_count + 1;
  8362. jsonStr.difficulty_count = d.difficulty_count + 1;
  8363. LocalStorageManager.setItem(keyStr, jsonStr);
  8364. }
  8365. else {
  8366. LocalStorageManager.setItem(keyStr, jsonStr);
  8367. }
  8368. const reqStr = JSON.stringify(jsonStr);
  8369. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8370. }
  8371. logEventForClassic_complete() {
  8372. console.log('zh:logEventForClassic_complete,胜利');
  8373. let rtype = xGame.common.classicRoomType;
  8374. let msmc = '';
  8375. if (rtype == 1) {
  8376. msmc = 'beginner';
  8377. }
  8378. if (rtype == 2) {
  8379. msmc = 'expert';
  8380. }
  8381. if (rtype == 3) {
  8382. msmc = 'master';
  8383. }
  8384. let keyStr = 'sjmd_classic_complete_' + rtype;
  8385. let jsonStr = {
  8386. "msmc": msmc,
  8387. "count": 0
  8388. };
  8389. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8390. const d = LocalStorageManager.getItem(keyStr);
  8391. jsonStr.count = d.count + 1;
  8392. LocalStorageManager.setItem(keyStr, jsonStr);
  8393. }
  8394. else {
  8395. LocalStorageManager.setItem(keyStr, jsonStr);
  8396. }
  8397. if (jsonStr.count % 5 == 0) {
  8398. const reqStr = JSON.stringify(jsonStr);
  8399. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8400. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8401. }
  8402. }
  8403. updatePlaceBallBtn() {
  8404. this.ui.leftBtn.c1.selectedIndex = 5;
  8405. if (this.success) {
  8406. this.ui.rightBtn.c1.selectedIndex = 14;
  8407. }
  8408. else {
  8409. if (xGame.common.placeBallStarNum == 3) {
  8410. this.ui.rightBtn.c1.selectedIndex = 14;
  8411. }
  8412. else {
  8413. this.ui.rightBtn.c1.selectedIndex = 1;
  8414. }
  8415. }
  8416. }
  8417. updatePlaceBallStarNum() {
  8418. let starNum = xGame.common.placeBallStarNum;
  8419. if (starNum == 0)
  8420. this.ui.starNumNode.c1.selectedIndex = 3;
  8421. else {
  8422. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8423. }
  8424. }
  8425. updatePlaceBallAwardState() {
  8426. let level = xGame.common.placeBallCurLevel;
  8427. let starNum = xGame.common.placeBallStarNum;
  8428. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8429. let data = cfgTable.placeballData[level].award;
  8430. let cfg = cfgTable.placeballData[level];
  8431. this.awardDiamondNum = data[1];
  8432. this.awardCoinNum = data[0];
  8433. if (cfg.type == PlaceBallType.challenge) {
  8434. this.awardDiamondNum = 0;
  8435. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8436. }
  8437. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8438. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8439. if (cfg.type == PlaceBallType.challenge) {
  8440. this.ui.awardNode.coinNode.visible = true;
  8441. }
  8442. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8443. this.ui.awardNode.diamondNode.x = 265;
  8444. this.ui.awardNode.coinNode.x = 354;
  8445. }
  8446. else {
  8447. this.ui.awardNode.diamondNode.x = 291;
  8448. this.ui.awardNode.coinNode.x = 291;
  8449. }
  8450. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8451. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8452. if (this.awardCoinNum == 0) {
  8453. this.ui.awardNode.coinNode.numTxt.text = "";
  8454. }
  8455. if (getAward) {
  8456. this.ui.isGetAward.visible = true;
  8457. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8458. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8459. }
  8460. else {
  8461. this.ui.isGetAward.visible = false;
  8462. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8463. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8464. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8465. }
  8466. else {
  8467. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8468. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8469. }
  8470. }
  8471. }
  8472. show(success) {
  8473. super.show();
  8474. xGame.eventMgr.event(RESET_GAME);
  8475. this.success = success;
  8476. Laya.timer.clearAll(this);
  8477. this.playSecretaryAni();
  8478. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8479. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8480. offsetTime = Math.floor(offsetTime / 1000);
  8481. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8482. this.updateType();
  8483. Laya.timer.once(200, this, () => {
  8484. this.addAward(() => {
  8485. this.updateType();
  8486. Laya.timer.once(500, this, () => {
  8487. this.showChallengeLevel();
  8488. });
  8489. });
  8490. });
  8491. if (this.success) {
  8492. JSBridgeUtils.instance.showInternAd('gameend_success');
  8493. console.log('zh:game end 成功');
  8494. xGame.soundMgr.playSound('slots_roll01');
  8495. xGame.soundMgr.playSound("s_win");
  8496. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8497. this.diyGameDataUtilForGameWin();
  8498. this.updateGamePlaceBallData2Server();
  8499. }
  8500. else {
  8501. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8502. console.log('zh:game end失败');
  8503. xGame.soundMgr.playSound('matchwin01');
  8504. xGame.soundMgr.playSound("s_lose");
  8505. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8506. }
  8507. let challengeNum = DataMgr.getChallengeTimes();
  8508. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8509. DataMgr.setChallengeTimes(1);
  8510. }
  8511. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8512. DataMgr.setClassicTimes();
  8513. }
  8514. this.setGlobalFont(this.ui);
  8515. }
  8516. diyGameDataUtilForGameWin() {
  8517. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8518. switch (xGame.common.gameMode) {
  8519. case GameMode.classic:
  8520. console.log('zh:DiyGameDataUtilForGameWin 111');
  8521. case GameMode.bigMove:
  8522. console.log('zh:DiyGameDataUtilForGameWin 222');
  8523. this.restartGame();
  8524. break;
  8525. case GameMode.placeBall:
  8526. console.log('zh:DiyGameDataUtilForGameWin 333');
  8527. var level = xGame.common.placeBallCurLevel;
  8528. console.log('zh:练习模式 联系了多少LEV=' + level);
  8529. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8530. if (level > db_over_lev) {
  8531. DataMgr.setChallengeMode_overLev(level);
  8532. }
  8533. break;
  8534. default:
  8535. console.log('zh:DiyGameDataUtilForGameWin 444');
  8536. break;
  8537. }
  8538. }
  8539. updateGamePlaceBallData2Server() {
  8540. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8541. if (userInfo == null) {
  8542. return;
  8543. }
  8544. let pbdObj = DataMgr.getPlaceBallLevelList();
  8545. let reqData = xGame.httpMgr.getReqData();
  8546. let pd = JSON.parse(reqData);
  8547. pd.placeBallData = JSON.stringify(pbdObj);
  8548. reqData = JSON.stringify(pd);
  8549. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8550. try {
  8551. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8552. let code = res.code;
  8553. let msg = res.msg;
  8554. if (code == 401) {
  8555. Laya.LocalStorage.removeItem(keyForLoginInfo);
  8556. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8557. return;
  8558. }
  8559. if (code == 200) {
  8560. let data = res.data;
  8561. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8562. }
  8563. else {
  8564. xGame.uiMgr.Show(UIMsg, msg);
  8565. }
  8566. }
  8567. catch (error) {
  8568. console.log('error=' + error);
  8569. alert(error);
  8570. }
  8571. finally {
  8572. }
  8573. });
  8574. }
  8575. showChallengeLevel() {
  8576. if (DataMgr.getChallengeTimes() != 0)
  8577. return;
  8578. let skill = DataMgr.getSkillAccTimes();
  8579. let put = DataMgr.getPlaceBallLevelList().length;
  8580. if (skill >= 3 || put >= 5) {
  8581. xGame.uiMgr.Show(UIInvitation);
  8582. this.hide();
  8583. }
  8584. }
  8585. addAward(callback) {
  8586. if (!this.success) {
  8587. callback && callback();
  8588. return;
  8589. }
  8590. switch (xGame.common.gameMode) {
  8591. case GameMode.classic:
  8592. this.awardCoinNum = xGame.common.passAwardCoin;
  8593. this.awardDiamondNum = 0;
  8594. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8595. break;
  8596. case GameMode.bigMove:
  8597. this.awardCoinNum = xGame.common.passAwardCoin;
  8598. this.awardDiamondNum = 0;
  8599. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8600. callback && callback();
  8601. break;
  8602. case GameMode.placeBall:
  8603. let level = xGame.common.placeBallCurLevel;
  8604. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8605. if (xGame.common.placeBallStarNum != 3) {
  8606. callback && callback();
  8607. return;
  8608. }
  8609. else {
  8610. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8611. if (getAward) {
  8612. callback && callback();
  8613. return;
  8614. }
  8615. }
  8616. let cfg = cfgTable.placeballData[level];
  8617. let data = cfgTable.placeballData[level].award;
  8618. this.awardCoinNum = data[0];
  8619. this.awardDiamondNum = data[1];
  8620. if (cfg.type == PlaceBallType.challenge) {
  8621. this.awardDiamondNum = 0;
  8622. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8623. }
  8624. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8625. let diamondAward;
  8626. if (this.awardDiamondNum > 0) {
  8627. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8628. xGame.common.getAward([diamondAward, coinAward], callback);
  8629. }
  8630. else {
  8631. xGame.common.getAward([coinAward], callback);
  8632. }
  8633. if (cfg.type == PlaceBallType.normal) {
  8634. DataMgr.setPlaceBallAward(level);
  8635. }
  8636. break;
  8637. default:
  8638. break;
  8639. }
  8640. }
  8641. playSecretaryAni_old() {
  8642. let parent = this.ui.secretary.displayObject;
  8643. parent.destroyChildren();
  8644. let xx = this.ui.secretary.width / 2;
  8645. let yy = this.ui.secretary.height;
  8646. let scale = xGame.common.getSecretaryScale();
  8647. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8648. if (this.success) {
  8649. let rand = Math.random() <= 0.5 ? 2 : 3;
  8650. xGame.common.secretary.play(data, rand, false, parent, () => {
  8651. xGame.common.secretary.play(data, 1, true, parent);
  8652. });
  8653. }
  8654. else {
  8655. xGame.common.secretary.play(data, 0, true, parent);
  8656. }
  8657. }
  8658. playSecretaryAni() {
  8659. let parent = this.ui.secretary.displayObject;
  8660. parent.destroyChildren();
  8661. let xx = this.ui.secretary.width / 2;
  8662. let yy = this.ui.secretary.height;
  8663. let scale = xGame.common.getSecretaryScale();
  8664. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8665. if (this.success) {
  8666. let rand = 0;
  8667. xGame.common.secretary.play(data, 0, true, parent);
  8668. }
  8669. else {
  8670. xGame.common.secretary.play(data, 0, true, parent);
  8671. }
  8672. }
  8673. restartGame() {
  8674. switch (xGame.common.gameMode) {
  8675. case GameMode.classic:
  8676. xGame.eventMgr.event(RESTART_GAME);
  8677. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8678. break;
  8679. case GameMode.bigMove:
  8680. this.hide();
  8681. xGame.eventMgr.event(RESTART_GAME);
  8682. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8683. break;
  8684. default:
  8685. break;
  8686. }
  8687. }
  8688. hide() {
  8689. super.hide();
  8690. xGame.common.stopGirlPop(this.ui.talkNode);
  8691. PlatMgr.showBanner(false);
  8692. }
  8693. returnHome() {
  8694. this.hide();
  8695. let showFailWords = !this.success;
  8696. xGame.uiMgr.Show(UIMain, showFailWords);
  8697. }
  8698. clickLeftBtn() {
  8699. switch (xGame.common.gameMode) {
  8700. case GameMode.classic:
  8701. case GameMode.bigMove:
  8702. this.returnHome();
  8703. break;
  8704. case GameMode.placeBall:
  8705. let level = xGame.common.placeBallCurLevel;
  8706. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8707. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8708. break;
  8709. default:
  8710. break;
  8711. }
  8712. }
  8713. powerStartPlaceBallLevel(level, btn) {
  8714. if (DataMgr.powerEnough()) {
  8715. btn.touchable = false;
  8716. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8717. btn.touchable = true;
  8718. DataMgr.setPower(-1);
  8719. xGame.eventMgr.event(POWER_TIME);
  8720. this.startPlaceBallLevel(level);
  8721. this.logEventForChallenge_level_start(level);
  8722. }));
  8723. }
  8724. else {
  8725. xGame.uiMgr.Show(UIPower, 0);
  8726. }
  8727. }
  8728. clickRightBtn() {
  8729. switch (xGame.common.gameMode) {
  8730. case GameMode.classic:
  8731. console.log('zh:clickRightBtn 111');
  8732. case GameMode.bigMove:
  8733. console.log('zh:clickRightBtn 222');
  8734. this.restartGame();
  8735. break;
  8736. case GameMode.placeBall:
  8737. console.log('zh:clickRightBtn 333');
  8738. let level = xGame.common.placeBallCurLevel;
  8739. let data = DataMgr.getPlaceBallLevel(level);
  8740. let curPss = data.play && !data.isCur;
  8741. if (curPss) {
  8742. console.log('zh:clickRightBtn 333-111');
  8743. console.log('zh:当前LV=' + level);
  8744. if (level == 60) {
  8745. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8746. Laya.timer.once(3000, this, () => {
  8747. this.returnHome();
  8748. });
  8749. }
  8750. else {
  8751. let lev = level + 1;
  8752. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8753. }
  8754. }
  8755. else {
  8756. console.log('zh:clickRightBtn 333-000');
  8757. Moyu.sendDataEvent("placeBallNextLevel");
  8758. console.log('zh:qjff_AD_for_uiGameEnd');
  8759. if (Laya.Browser.onAndroid) {
  8760. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8761. if (!boo) {
  8762. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8763. return;
  8764. }
  8765. }
  8766. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8767. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8768. }
  8769. else {
  8770. console.log('zh:AD 失败,直接发放奖励');
  8771. this.qjff_AD_for_uiGameEnd(level);
  8772. }
  8773. }
  8774. break;
  8775. default:
  8776. console.log('zh:clickRightBtn 444');
  8777. break;
  8778. }
  8779. }
  8780. logEventForChallenge_level_start(level) {
  8781. let keyStr = 'sjmd_challenge_level_start';
  8782. let jsonStr = {
  8783. "count": 0,
  8784. "gold_balance ": DataMgr.getCoin(),
  8785. "level": level,
  8786. "diamond_balance ": DataMgr.getDiamond()
  8787. };
  8788. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8789. const d = LocalStorageManager.getItem(keyStr);
  8790. if (level > d.level) {
  8791. jsonStr.count = d.count + 1;
  8792. LocalStorageManager.setItem(keyStr, jsonStr);
  8793. }
  8794. else {
  8795. }
  8796. }
  8797. else {
  8798. LocalStorageManager.setItem(keyStr, jsonStr);
  8799. }
  8800. const reqStr = JSON.stringify(jsonStr);
  8801. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8802. }
  8803. qjff_AD_for_uiGameEnd(level) {
  8804. DataMgr.setPlaceBallLevel(level, 1);
  8805. this.startPlaceBallLevel(level + 1);
  8806. }
  8807. startPlaceBallLevel(level) {
  8808. xGame.common.gameMode = GameMode.placeBall;
  8809. xGame.common.placeBallCurLevel = level;
  8810. xGame.uiMgr.Show(UIGame);
  8811. this.hide();
  8812. }
  8813. logEventForChallenge_level_complete(level) {
  8814. let keyStr = 'sjmd_challenge_level_complete';
  8815. let jsonStr = {
  8816. "count": 1,
  8817. "gold_balance ": DataMgr.getCoin(),
  8818. "level": level,
  8819. "diamond_balance ": DataMgr.getDiamond()
  8820. };
  8821. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8822. const d = LocalStorageManager.getItem(keyStr);
  8823. jsonStr.count = d.count + 1;
  8824. LocalStorageManager.setItem(keyStr, jsonStr);
  8825. }
  8826. else {
  8827. LocalStorageManager.setItem(keyStr, jsonStr);
  8828. }
  8829. const reqStr = JSON.stringify(jsonStr);
  8830. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8831. }
  8832. logEventForChallenge_level_N(level) {
  8833. console.log('zh:logEventForChallenge_level_N ' + level);
  8834. let keyStr = 'sjmd_challenge_level_N';
  8835. if (LocalStorageManager.hasKey(keyStr)) {
  8836. let lev = LocalStorageManager.getItem(keyStr);
  8837. if (level > lev) {
  8838. LocalStorageManager.setItem(keyStr, level);
  8839. }
  8840. if ((level) % 5 == 0) {
  8841. console.log('zh:每5关上报1次');
  8842. let sjmc = 'challenge_level_' + level;
  8843. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8844. let sjmcForFirebase = 'challenge_level_' + level;
  8845. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8846. }
  8847. else {
  8848. console.log('zh:5 no 上报');
  8849. }
  8850. }
  8851. else {
  8852. LocalStorageManager.setItem(keyStr, level);
  8853. }
  8854. }
  8855. }
  8856. UIGameEnd.uiName = "UIGameEnd";
  8857. class ui_UIVideoShare extends fgui.GComponent {
  8858. static createInstance() {
  8859. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8860. }
  8861. onConstruct() {
  8862. this.n10 = (this.getChild("n10"));
  8863. this.myNode = (this.getChild("myNode"));
  8864. this.t0 = this.getTransition("t0");
  8865. }
  8866. }
  8867. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8868. class UIVideoShare extends UIBase {
  8869. constructor() {
  8870. super();
  8871. this.success = false;
  8872. this.awardNum = 0;
  8873. this.isShared = true;
  8874. }
  8875. onConstructor() {
  8876. this.ui = ui_UIVideoShare.createInstance();
  8877. this.contentPane = this.ui;
  8878. this.isEject = false;
  8879. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8880. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8881. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8882. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8883. }
  8884. show(success) {
  8885. super.show();
  8886. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8887. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8888. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8889. this.success = success;
  8890. let time = xGame.common.randomNum(600, 1500);
  8891. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8892. if (success)
  8893. xGame.soundMgr.playSound("applause");
  8894. this.ui.t0.play();
  8895. this.checkShareState();
  8896. let times = DataMgr.getDailyVideoShareTimes();
  8897. this.awardNum = times == 0 ? 2000 : 200;
  8898. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8899. this.setGlobalFont(this.ui);
  8900. }
  8901. checkShareState() {
  8902. if (PlatMgr.forceShare == 0) {
  8903. this.ui.myNode.closeBtn.visible = true;
  8904. this.ui.myNode.tipsNode.visible = false;
  8905. this.ui.myNode.closeBtn.x = 90;
  8906. this.ui.myNode.shareBtn.x = 342;
  8907. }
  8908. else if (PlatMgr.forceShare == 1) {
  8909. this.ui.myNode.closeBtn.visible = false;
  8910. this.ui.myNode.tipsNode.visible = true;
  8911. this.ui.myNode.shareBtn.x = 218;
  8912. this.isShared = true;
  8913. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8914. }
  8915. }
  8916. checkForceShare() {
  8917. this.isShared = !this.isShared;
  8918. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8919. }
  8920. videoShare() {
  8921. if (PlatMgr.forceShare == 1) {
  8922. if (this.isShared) {
  8923. this.shareGame();
  8924. }
  8925. else {
  8926. this.hideSelf();
  8927. }
  8928. }
  8929. else {
  8930. this.shareGame();
  8931. }
  8932. }
  8933. shareGame() {
  8934. Moyu.sendDataEvent("VideoShare");
  8935. if (Moyu.canShare() > 100) {
  8936. Moyu.shareGame((success) => {
  8937. if (success) {
  8938. DataMgr.setDailyVideoShareTimes(1);
  8939. DataMgr.setCoin(this.awardNum);
  8940. }
  8941. this.hideSelf();
  8942. }, this);
  8943. }
  8944. else {
  8945. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8946. this.hideSelf();
  8947. }
  8948. }
  8949. hideSelf() {
  8950. this.hide();
  8951. xGame.uiMgr.Show(UIGameEnd, this.success);
  8952. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8953. xGame.common.screenImg.destroy();
  8954. xGame.common.screenImg = null;
  8955. }
  8956. }
  8957. }
  8958. UIVideoShare.uiName = "UIVideoShare";
  8959. class ui_UITips extends fgui.GComponent {
  8960. static createInstance() {
  8961. return (fgui.UIPackage.createObject("game", "UITips"));
  8962. }
  8963. onConstruct() {
  8964. this.n0 = (this.getChild("n0"));
  8965. this.myNode = (this.getChild("myNode"));
  8966. this.t0 = this.getTransition("t0");
  8967. }
  8968. }
  8969. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8970. class UITips extends UIBase {
  8971. constructor() {
  8972. super();
  8973. this.type = 0;
  8974. }
  8975. onConstructor() {
  8976. this.ui = ui_UITips.createInstance();
  8977. this.contentPane = this.ui;
  8978. this.isEject = false;
  8979. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8980. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8981. }
  8982. show(tipsTxt, womanTxt, type) {
  8983. super.show();
  8984. this.ui.t0.play();
  8985. this.ui.myNode.tipsTxt.text = tipsTxt;
  8986. this.ui.myNode.womanTxt.text = womanTxt;
  8987. PlatMgr.showInsert(true);
  8988. this.ui.myNode.c1.selectedIndex = type;
  8989. this.type = type;
  8990. switch (this.type) {
  8991. case TipsType.exitGame:
  8992. xGame.common.gameMgr.gamePause = true;
  8993. break;
  8994. case TipsType.foul:
  8995. Laya.timer.once(200, this, () => {
  8996. xGame.common.gameMgr.gamePause = true;
  8997. });
  8998. break;
  8999. default:
  9000. break;
  9001. }
  9002. this.setGlobalFont(this.ui);
  9003. }
  9004. clickLeftBtn() {
  9005. this.hide();
  9006. xGame.common.gameMgr.gamePause = false;
  9007. switch (this.type) {
  9008. case TipsType.exitGame:
  9009. break;
  9010. case TipsType.foul:
  9011. break;
  9012. default:
  9013. break;
  9014. }
  9015. }
  9016. clickRightBtn() {
  9017. this.hide();
  9018. switch (this.type) {
  9019. case TipsType.exitGame:
  9020. xGame.eventMgr.event(RESET_GAME);
  9021. xGame.uiMgr.Show(UIMain);
  9022. Moyu.recordEnd(this, null);
  9023. xGame.common.longHelpLine = false;
  9024. break;
  9025. case TipsType.foul:
  9026. xGame.common.gameMgr.gamePause = false;
  9027. Laya.timer.clearAll(this);
  9028. break;
  9029. default:
  9030. break;
  9031. }
  9032. }
  9033. }
  9034. UITips.uiName = "UITips";
  9035. class GameMgr {
  9036. constructor() {
  9037. this.selfCamp = "";
  9038. this.selfFoulNum = 0;
  9039. this.selfBallArr = [];
  9040. this.selfTimer = 0;
  9041. this.selfScore = 0;
  9042. this.aiCamp = "";
  9043. this.aiFoulNum = 0;
  9044. this.aiBallArr = [];
  9045. this.aiTimer = 0;
  9046. this.aiScore = 0;
  9047. this.aiSkillLevelNum = 1;
  9048. this.targertScore = 0;
  9049. this.setTime = 30;
  9050. this.selfTurnRate = 0.5;
  9051. this.accTime = 0;
  9052. this.curFoul = "";
  9053. this.maxFoulTimes = 3;
  9054. this.isFirstInGame = true;
  9055. this.firstColliObj = null;
  9056. this.inHoleBalls = [];
  9057. this.blackNum = 8;
  9058. this.success = false;
  9059. this.holePosList = [];
  9060. this.posObj = {};
  9061. this._selfTurn = false;
  9062. this.lastRootBallPos = new Laya.Vector2(311, 430);
  9063. this.ensureBallType = false;
  9064. this.isOpenBall = true;
  9065. this.finishOneShoot = true;
  9066. this.isEnd = false;
  9067. this.isChangeTurn = false;
  9068. this.isInterrupt = false;
  9069. this.aiPlayedBreakArmy = false;
  9070. this.isTouchedBall = false;
  9071. this.finishBalls = 0;
  9072. this.needBalls = 0;
  9073. this.allBallNum = 0;
  9074. this.placeBallPosData = {};
  9075. this.curHP = 0;
  9076. this.showLongView = false;
  9077. this.firstShoot = true;
  9078. this._gamePause = false;
  9079. this.trunCount = 0;
  9080. this.isBlackInHole = false;
  9081. this.isEnter = true;
  9082. xGame.eventMgr.offAll(ALL_BALL_STOP);
  9083. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  9084. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  9085. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  9086. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  9087. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  9088. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9089. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9090. }
  9091. get gamePause() {
  9092. return this._gamePause;
  9093. }
  9094. set gamePause(v) {
  9095. if (v) {
  9096. Laya.physicsTimer.pause();
  9097. }
  9098. else {
  9099. Laya.physicsTimer.resume();
  9100. }
  9101. this._gamePause = v;
  9102. }
  9103. get selfTurn() {
  9104. return this._selfTurn;
  9105. }
  9106. set selfTurn(val) {
  9107. this.trunCount++;
  9108. this._selfTurn = val;
  9109. if (val) {
  9110. xGame.common.d2World.d2Gan.ui.self.visible = true;
  9111. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9112. }
  9113. else {
  9114. xGame.common.d2World.d2Gan.ui.self.visible = false;
  9115. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  9116. if (this.trunCount > 1)
  9117. PlatMgr.openBox();
  9118. }
  9119. }
  9120. resetGame() {
  9121. this.inHoleBalls = [];
  9122. this.isFirstInGame = true;
  9123. this.firstColliObj = null;
  9124. this.aiCamp = "";
  9125. this.selfCamp = "";
  9126. this.aiFoulNum = 0;
  9127. this.selfFoulNum = 0;
  9128. this.selfBallArr = [];
  9129. this.aiBallArr = [];
  9130. this.gamePause = false;
  9131. this.ensureBallType = false;
  9132. this.isInterrupt = false;
  9133. this.updateLeftBall();
  9134. this.clearTime();
  9135. this.aiPlayedBreakArmy = false;
  9136. this.isBlackInHole = false;
  9137. this.placeBallPosData = {};
  9138. if (xGame.common.d3World.knifeRoot) {
  9139. xGame.common.d3World.knifeRoot.destroyChildren();
  9140. }
  9141. }
  9142. gameReady() {
  9143. this.trunCount = 0;
  9144. this.firstColliObj = null;
  9145. this.isFirstInGame = true;
  9146. this.selfTurn = Math.random() <= this.selfTurnRate;
  9147. let challengeNum = DataMgr.getChallengeTimes();
  9148. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9149. this.selfTurn = true;
  9150. }
  9151. if (xGame.common.gameMode == GameMode.placeBall)
  9152. this.selfTurn = true;
  9153. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  9154. this.selfTurn = true;
  9155. }
  9156. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  9157. this.checkGuide();
  9158. if (xGame.common.uiRodMethod)
  9159. xGame.common.uiRodMethod.resetRod();
  9160. xGame.common.d2World.getHelpLine();
  9161. this.isOpenBall = true;
  9162. this.isTouchedBall = false;
  9163. xGame.common.aiPlayer.stopRun();
  9164. this.setTime = 30;
  9165. let ui = xGame.common.gameUI.ui;
  9166. switch (xGame.common.gameMode) {
  9167. case GameMode.classic:
  9168. xGame.common.aiPlayer.init();
  9169. this.blackNum = 8;
  9170. this.placeRootBall();
  9171. this.peoplePlay(9, 10);
  9172. ui.wordsBtn.visible = true;
  9173. ui.aiWordsBtn.visible = true;
  9174. xGame.common.talkMgr.changeAIState(true);
  9175. DataMgr.gameData.gameCount++;
  9176. DataMgr.saveGameData();
  9177. break;
  9178. case GameMode.bigMove:
  9179. this.blackNum = -1;
  9180. this.selfScore = 0;
  9181. this.aiScore = 0;
  9182. xGame.common.aiPlayer.init();
  9183. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9184. this.updateSelfScore();
  9185. this.updateAIScore();
  9186. this.updateTargetSroce();
  9187. this.placeRootBall();
  9188. this.peoplePlay(9, 10);
  9189. ui.wordsBtn.visible = true;
  9190. ui.aiWordsBtn.visible = true;
  9191. xGame.common.talkMgr.changeAIState(true);
  9192. if (DataMgr.getSkillGuide() < 1)
  9193. DataMgr.gameData.gameCount = 0;
  9194. else {
  9195. DataMgr.gameData.gameCount++;
  9196. DataMgr.saveGameData();
  9197. PlatMgr.openTry();
  9198. }
  9199. if (xGame.common.d3World.knifeRoot) {
  9200. xGame.common.d3World.knifeRoot.destroyChildren();
  9201. }
  9202. break;
  9203. case GameMode.placeBall:
  9204. this.blackNum = -1;
  9205. this.selfTurn = true;
  9206. this.setTime = 10000;
  9207. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9208. this.curHP = this.placeBallData.hp;
  9209. if (this.placeBallData.ball == -1)
  9210. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9211. else
  9212. this.needBalls = this.placeBallData.ball;
  9213. console.log("需要的进球数目", this.needBalls);
  9214. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9215. this.finishBalls = 0;
  9216. this.placeBallPosData = {};
  9217. this.updatePlaceBallPos();
  9218. this.updatePlaceBallState();
  9219. this.finishOneShoot = true;
  9220. xGame.common.gameUI.ui.moveNode.visible = false;
  9221. this.isOpenBall = false;
  9222. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9223. ui.wordsBtn.visible = false;
  9224. ui.aiWordsBtn.visible = false;
  9225. xGame.common.talkMgr.changeAIState(false);
  9226. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9227. PlatMgr.openBox();
  9228. });
  9229. break;
  9230. default:
  9231. break;
  9232. }
  9233. this.showLongView = false;
  9234. xGame.common.wordsMgr.comboTimes = 1;
  9235. let guide = DataMgr.getSkillGuide();
  9236. if (guide)
  9237. xGame.eventMgr.event(WAIT_SHOOT);
  9238. xGame.common.upSkillLevel = false;
  9239. xGame.common.gameStartTime = new Date().getTime();
  9240. this.firstShoot = true;
  9241. }
  9242. checkGuide() {
  9243. let guide = DataMgr.getSkillGuide();
  9244. let gameUI = xGame.common.gameUI.ui;
  9245. gameUI.guide1.visible = false;
  9246. gameUI.guide2.visible = false;
  9247. gameUI.guide3.visible = false;
  9248. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9249. this.selfTurn = true;
  9250. }
  9251. else {
  9252. return;
  9253. }
  9254. let oneBall = this.getOneBall();
  9255. gameUI.guide1.visible = true;
  9256. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9257. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9258. }
  9259. getOneBall() {
  9260. let arr = xGame.common.d2World.ballArr;
  9261. for (let index = 0; index < arr.length; index++) {
  9262. if (arr[index].number == 0)
  9263. continue;
  9264. return arr[index];
  9265. }
  9266. }
  9267. updateSelfScore() {
  9268. let ui = xGame.common.gameUI.ui.topNode;
  9269. ui.selfScoreTxt.text = this.selfScore + "";
  9270. }
  9271. updateAIScore() {
  9272. let ui = xGame.common.gameUI.ui.topNode;
  9273. ui.aiScoreTxt.text = this.aiScore + "";
  9274. }
  9275. updateTargetSroce() {
  9276. let ui = xGame.common.gameUI.ui.topNode;
  9277. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9278. }
  9279. updateLeftBall() {
  9280. let topUI = xGame.common.gameUI.ui.topNode;
  9281. topUI.selfBallList.numItems = this.selfBallArr.length;
  9282. topUI.aiBallList.numItems = this.aiBallArr.length;
  9283. }
  9284. ballShoot() {
  9285. this.clearTime();
  9286. this.finishOneShoot = false;
  9287. xGame.common.gameUI.ui.moveNode.visible = false;
  9288. if (xGame.common.gameUI.ui.guideNode.visible) {
  9289. xGame.common.gameUI.ui.guideNode.visible = false;
  9290. }
  9291. if (this.firstShoot) {
  9292. this.firstShoot = false;
  9293. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9294. }
  9295. }
  9296. ensureCamp(number) {
  9297. this.ensureBallType = true;
  9298. this.isOpenBall = false;
  9299. if (xGame.common.gameMode != GameMode.classic)
  9300. return;
  9301. let full = [1, 2, 3, 4, 5, 6, 7];
  9302. let flower = [9, 10, 11, 12, 13, 14, 15];
  9303. let sayWords = "";
  9304. if (this.selfTurn) {
  9305. if (number <= 7) {
  9306. this.selfCamp = ballCamp.full;
  9307. this.selfBallArr = full;
  9308. this.aiCamp = ballCamp.flower;
  9309. this.aiBallArr = flower;
  9310. sayWords = cfgTable.wordsData[3].msg;
  9311. }
  9312. else {
  9313. this.selfCamp = ballCamp.flower;
  9314. this.selfBallArr = flower;
  9315. this.aiCamp = ballCamp.full;
  9316. this.aiBallArr = full;
  9317. sayWords = cfgTable.wordsData[4].msg;
  9318. }
  9319. }
  9320. else {
  9321. if (number <= 7) {
  9322. this.selfCamp = ballCamp.flower;
  9323. this.selfBallArr = flower;
  9324. this.aiCamp = ballCamp.full;
  9325. this.aiBallArr = full;
  9326. sayWords = cfgTable.wordsData[2].msg;
  9327. }
  9328. else {
  9329. this.selfCamp = ballCamp.full;
  9330. this.selfBallArr = full;
  9331. this.aiCamp = ballCamp.flower;
  9332. this.aiBallArr = flower;
  9333. sayWords = cfgTable.wordsData[1].msg;
  9334. }
  9335. }
  9336. this.updateLeftBall();
  9337. xGame.uiMgr.Show(UIMsg, sayWords);
  9338. }
  9339. updatePlaceBallState() {
  9340. let ui = xGame.common.gameUI.ui;
  9341. switch (this.placeBallData.type) {
  9342. case PlaceBallType.normal:
  9343. let normal = ui.placeNormalNode;
  9344. normal.hpTxt.text = this.curHP + "";
  9345. this.updatePlaceBallStar(normal);
  9346. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9347. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9348. break;
  9349. case PlaceBallType.challenge:
  9350. let challenge = ui.placeChallengeNode;
  9351. challenge.hpTxt.text = "Shots:" + this.curHP;
  9352. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9353. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9354. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9355. break;
  9356. default:
  9357. break;
  9358. }
  9359. }
  9360. playSubHpAni() {
  9361. let ui = xGame.common.gameUI.ui;
  9362. switch (this.placeBallData.type) {
  9363. case PlaceBallType.normal:
  9364. let normal = ui.placeNormalNode;
  9365. normal.hpTxt.visible = false;
  9366. normal.starAni.c1.selectedIndex = 1;
  9367. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9368. normal.hpTxt.visible = true;
  9369. normal.starAni.c1.selectedIndex = 0;
  9370. }));
  9371. break;
  9372. default:
  9373. break;
  9374. }
  9375. }
  9376. getEndStarNum() {
  9377. let num;
  9378. let level = xGame.common.placeBallCurLevel;
  9379. if (this.curHP == this.placeBallData.hp) {
  9380. num = 3;
  9381. }
  9382. else if (this.curHP <= 1) {
  9383. num = 1;
  9384. }
  9385. else {
  9386. num = 2;
  9387. }
  9388. if (!this.success) {
  9389. num = 0;
  9390. }
  9391. else {
  9392. DataMgr.setPlaceBallLevel(level, num);
  9393. }
  9394. let myType = cfgTable.placeballData[level].type;
  9395. if (this.success && myType == 1) {
  9396. num = 3;
  9397. }
  9398. xGame.common.placeBallStarNum = num;
  9399. }
  9400. updatePlaceBallStar(node) {
  9401. let star = 0;
  9402. if (this.curHP == this.placeBallData.hp) {
  9403. star = 3;
  9404. }
  9405. else if (this.curHP >= 2) {
  9406. star = 2;
  9407. }
  9408. else if (this.curHP == 1) {
  9409. star = 1;
  9410. }
  9411. else {
  9412. star = 0;
  9413. }
  9414. let temp;
  9415. for (let index = 1; index <= 3; index++) {
  9416. temp = node["star" + index];
  9417. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9418. }
  9419. node.myProgress.value = (star / 3) * 100;
  9420. }
  9421. openRegretView(isFoul, GoalNum, challenge = false) {
  9422. let regretType = -1;
  9423. if (isFoul) {
  9424. regretType = 1;
  9425. }
  9426. else {
  9427. if (GoalNum <= 0) {
  9428. regretType = 0;
  9429. }
  9430. }
  9431. if (challenge) {
  9432. regretType = 1;
  9433. }
  9434. if (regretType != -1) {
  9435. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9436. if (success) {
  9437. this.curHP++;
  9438. this.updatePlaceBallState();
  9439. this.setPlaceBallAllPos();
  9440. xGame.common.gameUI.ui.moveNode.visible = false;
  9441. }
  9442. else {
  9443. if (this.curHP <= 0) {
  9444. this.success = false;
  9445. this.gameEnd();
  9446. }
  9447. this.playSubHpAni();
  9448. }
  9449. this.updatePlaceBallState();
  9450. this.updatePlaceBallPos();
  9451. });
  9452. }
  9453. }
  9454. setPlaceBallAllPos() {
  9455. let allBall = xGame.common.d2World.ballArr;
  9456. let cfgArr = this.placeBallPosData;
  9457. let temp;
  9458. let obj;
  9459. for (let index = 0; index < allBall.length; index++) {
  9460. temp = allBall[index];
  9461. if (temp.destroyed)
  9462. continue;
  9463. obj = cfgArr[temp.myUNID];
  9464. if (obj && obj.src && !obj.src.destroyed) {
  9465. temp.gameObj.x = obj.posX;
  9466. temp.gameObj.y = obj.posY;
  9467. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9468. }
  9469. }
  9470. xGame.common.d2World.getHelpLine();
  9471. }
  9472. updatePlaceBallPos() {
  9473. let arr = xGame.common.d2World.ballArr;
  9474. let temp;
  9475. for (let index = 0; index < arr.length; index++) {
  9476. temp = arr[index];
  9477. if (!this.placeBallPosData[temp.myUNID]) {
  9478. this.placeBallPosData[temp.myUNID] = {
  9479. src: temp,
  9480. posX: temp.gameObj.x,
  9481. posY: temp.gameObj.y
  9482. };
  9483. }
  9484. else {
  9485. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9486. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9487. }
  9488. }
  9489. let check;
  9490. for (const key in this.placeBallPosData) {
  9491. check = this.placeBallPosData[key];
  9492. if (check.src.destroyed) {
  9493. delete this.placeBallPosData[key];
  9494. }
  9495. }
  9496. }
  9497. gameRun(type) {
  9498. if (this.gamePause)
  9499. return;
  9500. this.curFoul = this.getFoulType();
  9501. if (type) {
  9502. xGame.common.d2World.d2Gan.shoot();
  9503. xGame.common.gameUI.forceCancel();
  9504. this.curFoul = type;
  9505. }
  9506. this.isEnd = false;
  9507. this.isChangeTurn = true;
  9508. if (xGame.common.gameMode == GameMode.classic) {
  9509. this.judgeClassic(this.curFoul);
  9510. this.checkClassicWords(() => {
  9511. xGame.common.destroyClassicEmotion();
  9512. if (this.isEnd) {
  9513. if (this.isBlackInHole) {
  9514. xGame.common.gameUI.ui.blackAni.visible = true;
  9515. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9516. xGame.common.gameUI.ui.blackAni.visible = false;
  9517. this.gameEnd();
  9518. }));
  9519. }
  9520. else {
  9521. this.gameEnd();
  9522. }
  9523. }
  9524. else {
  9525. this.waitShoot();
  9526. xGame.eventMgr.event(WAIT_SHOOT);
  9527. }
  9528. });
  9529. }
  9530. else if (xGame.common.gameMode == GameMode.bigMove) {
  9531. xGame.common.aiPlayer.stopRun();
  9532. let scoreArr = this.getScore(this.curFoul);
  9533. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9534. this.isEnd = true;
  9535. }
  9536. this.checkBigSkillWords(() => {
  9537. if (this.isEnd) {
  9538. this.gameEnd();
  9539. }
  9540. else {
  9541. this.waitShoot();
  9542. xGame.eventMgr.event(WAIT_SHOOT);
  9543. }
  9544. });
  9545. }
  9546. else if (xGame.common.gameMode == GameMode.placeBall) {
  9547. xGame.common.destroyAwardSpine();
  9548. let isFoul = this.curFoul == FoulType.rootHole;
  9549. let GoalNum = this.inHoleBalls.length;
  9550. if (this.inHoleBalls.indexOf(0) > -1)
  9551. GoalNum -= 1;
  9552. if (isFoul) {
  9553. this.placeRootBall();
  9554. }
  9555. console.log("neeballs", this.needBalls);
  9556. console.log("当前完成的goalNum", GoalNum);
  9557. this.finishBalls += GoalNum;
  9558. console.log("当前完成的finishballs", this.finishBalls);
  9559. let need = this.needBalls;
  9560. if (this.placeBallData.type == PlaceBallType.challenge) {
  9561. need += 100;
  9562. }
  9563. if (this.finishBalls >= need) {
  9564. this.success = true;
  9565. this.gameEnd();
  9566. }
  9567. else {
  9568. switch (this.placeBallData.type) {
  9569. case PlaceBallType.normal:
  9570. if (!isFoul && GoalNum > 0) {
  9571. this.updatePlaceBallPos();
  9572. this.updatePlaceBallState();
  9573. }
  9574. else {
  9575. this.curHP--;
  9576. this.openRegretView(isFoul, GoalNum);
  9577. }
  9578. this.waitShoot();
  9579. xGame.eventMgr.event(WAIT_SHOOT);
  9580. break;
  9581. case PlaceBallType.challenge:
  9582. this.curHP--;
  9583. this.updatePlaceBallState();
  9584. if (isFoul) {
  9585. this.openRegretView(isFoul, GoalNum, true);
  9586. }
  9587. else {
  9588. this.updatePlaceBallPos();
  9589. if (this.curHP <= 0) {
  9590. this.success = true;
  9591. this.gameEnd();
  9592. }
  9593. }
  9594. this.waitShoot();
  9595. xGame.eventMgr.event(WAIT_SHOOT);
  9596. break;
  9597. default:
  9598. break;
  9599. }
  9600. }
  9601. }
  9602. }
  9603. checkClassicWords(callback) {
  9604. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9605. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9606. let type = this.getClassicWordsType();
  9607. if (condition && type != -1) {
  9608. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9609. xGame.soundMgr.playSound(str);
  9610. xGame.common.wordsMgr.playClassicWords(type, callback);
  9611. }
  9612. else {
  9613. Laya.timer.once(300, this, () => {
  9614. callback && callback();
  9615. });
  9616. }
  9617. }
  9618. getClassicWordsType() {
  9619. let d2world = xGame.common.d2World;
  9620. let type = -1;
  9621. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9622. type = ClassicWordsType.perfectShow;
  9623. return type;
  9624. }
  9625. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9626. type = ClassicWordsType.directShoot;
  9627. return type;
  9628. }
  9629. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9630. type = ClassicWordsType.anotherShoot;
  9631. return type;
  9632. }
  9633. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9634. type = ClassicWordsType.bigPower;
  9635. return type;
  9636. }
  9637. let minSpeed = 1;
  9638. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9639. type = ClassicWordsType.hardShoot;
  9640. return type;
  9641. }
  9642. if (this.inHoleBalls.length > 0) {
  9643. type = ClassicWordsType.directShoot;
  9644. return type;
  9645. }
  9646. return type;
  9647. }
  9648. checkBigSkillWords(callback) {
  9649. if (this.curFoul == FoulType.timeOut) {
  9650. callback && callback();
  9651. }
  9652. else {
  9653. let playSkill = false;
  9654. if (this.selfTurn) {
  9655. playSkill = true;
  9656. }
  9657. else {
  9658. if (!this.aiPlayedBreakArmy) {
  9659. this.aiPlayedBreakArmy = true;
  9660. playSkill = true;
  9661. }
  9662. if (this.aiCurSkill != SkillType.breakArmy) {
  9663. playSkill = true;
  9664. }
  9665. }
  9666. if (xGame.common.skillMgr.playedLastSkill) {
  9667. xGame.common.skillMgr.playedLastSkill = false;
  9668. playSkill = false;
  9669. }
  9670. if (playSkill) {
  9671. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9672. let selfExtra = 0;
  9673. let aiExtra = 0;
  9674. if (this.selfTurn)
  9675. selfExtra += extraScore;
  9676. else
  9677. aiExtra += extraScore;
  9678. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9679. this.isEnd = true;
  9680. }
  9681. this.playBigSkillTimes(callback);
  9682. });
  9683. }
  9684. else {
  9685. this.playBigSkillTimes(callback);
  9686. }
  9687. }
  9688. }
  9689. playBigSkillTimes(callback) {
  9690. let length = this.inHoleBalls.length;
  9691. if (this.inHoleBalls.indexOf(0) > -1) {
  9692. length = this.inHoleBalls.length - 1;
  9693. }
  9694. if (length <= 0) {
  9695. callback && callback();
  9696. return;
  9697. }
  9698. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9699. callback && callback();
  9700. });
  9701. }
  9702. playSkillTips() {
  9703. let levelNum = 0;
  9704. let curType;
  9705. if (this.selfTurn) {
  9706. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9707. curType = this.selfCurSkill;
  9708. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9709. levelNum += 5;
  9710. }
  9711. }
  9712. else {
  9713. levelNum = this.aiSkillLevelNum;
  9714. curType = this.aiCurSkill;
  9715. }
  9716. let str = ``;
  9717. switch (curType) {
  9718. case SkillType.highSpace:
  9719. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9720. break;
  9721. case SkillType.breakArmy:
  9722. str = `You pocketed ${levelNum} extra balls`;
  9723. break;
  9724. case SkillType.ice:
  9725. str = `${levelNum * 2} extra balls were frozen`;
  9726. break;
  9727. case SkillType.fireworks:
  9728. str = `${levelNum} extra balls exploded `;
  9729. break;
  9730. case SkillType.GuanYu:
  9731. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9732. break;
  9733. default:
  9734. break;
  9735. }
  9736. xGame.uiMgr.Show(UIMsg, str);
  9737. }
  9738. getFoulType() {
  9739. let foulType = "";
  9740. if (this.firstColliObj == null) {
  9741. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9742. return FoulType.rootHole;
  9743. }
  9744. return FoulType.notTouch;
  9745. }
  9746. else {
  9747. if (this.selfTurn) {
  9748. if (this.selfBallArr.length > 0) {
  9749. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9750. foulType = FoulType.wrongTouch;
  9751. }
  9752. }
  9753. else {
  9754. if (this.ensureBallType) {
  9755. }
  9756. else {
  9757. if (this.firstColliObj == this.blackNum) {
  9758. foulType = FoulType.wrongTouch;
  9759. }
  9760. }
  9761. }
  9762. }
  9763. else {
  9764. if (this.aiBallArr.length > 0) {
  9765. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9766. foulType = FoulType.wrongTouch;
  9767. }
  9768. }
  9769. else {
  9770. if (this.ensureBallType) {
  9771. }
  9772. else {
  9773. if (this.firstColliObj == this.blackNum) {
  9774. foulType = FoulType.wrongTouch;
  9775. }
  9776. }
  9777. }
  9778. }
  9779. if (this.inHoleBalls.length <= 0) {
  9780. return foulType;
  9781. }
  9782. let temp;
  9783. if (this.inHoleBalls.indexOf(0) > -1) {
  9784. foulType = FoulType.rootHole;
  9785. }
  9786. else {
  9787. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9788. temp = this.inHoleBalls[index];
  9789. if (this.selfTurn) {
  9790. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9791. foulType = FoulType.wrongHole;
  9792. break;
  9793. }
  9794. }
  9795. else {
  9796. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9797. foulType = FoulType.wrongHole;
  9798. break;
  9799. }
  9800. }
  9801. }
  9802. }
  9803. let foo;
  9804. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9805. temp = this.inHoleBalls[index];
  9806. foo = this.selfBallArr.indexOf(temp);
  9807. if (foo > -1) {
  9808. this.selfBallArr.splice(foo, 1);
  9809. }
  9810. foo = this.aiBallArr.indexOf(temp);
  9811. if (foo > -1) {
  9812. this.aiBallArr.splice(foo, 1);
  9813. }
  9814. }
  9815. this.updateLeftBall();
  9816. }
  9817. return foulType;
  9818. }
  9819. judgeGameEndByBlack(arr) {
  9820. if (this.selfTurn) {
  9821. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9822. this.selfFoulNum = this.maxFoulTimes;
  9823. return true;
  9824. }
  9825. }
  9826. else {
  9827. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9828. this.aiFoulNum = this.maxFoulTimes;
  9829. return true;
  9830. }
  9831. }
  9832. }
  9833. judgeClassic(type) {
  9834. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9835. xGame.common.aiPlayer.stopRun();
  9836. if (this.judgeNormalSuccess()) {
  9837. this.isEnd = true;
  9838. return;
  9839. }
  9840. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9841. if (this.selfTurn) {
  9842. if (isFoul) {
  9843. this.selfFoulNum++;
  9844. }
  9845. if (this.selfFoulNum >= this.maxFoulTimes) {
  9846. this.success = false;
  9847. this.isEnd = true;
  9848. return;
  9849. }
  9850. }
  9851. else {
  9852. if (isFoul)
  9853. this.aiFoulNum++;
  9854. if (this.aiFoulNum >= this.maxFoulTimes) {
  9855. this.success = true;
  9856. this.isEnd = true;
  9857. return;
  9858. }
  9859. }
  9860. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9861. this.isChangeTurn = false;
  9862. }
  9863. else {
  9864. this.isInterrupt = true;
  9865. }
  9866. }
  9867. waitShoot() {
  9868. if (xGame.common.gameMode == GameMode.classic) {
  9869. switch (this.curFoul) {
  9870. case FoulType.timeOut:
  9871. case FoulType.rootHole:
  9872. this.selfTurn = !this.selfTurn;
  9873. this.peoplePlay(5, 6, true);
  9874. break;
  9875. case FoulType.notTouch:
  9876. this.selfTurn = !this.selfTurn;
  9877. this.peoplePlay(7, 7);
  9878. break;
  9879. case FoulType.wrongHole:
  9880. this.selfTurn = !this.selfTurn;
  9881. this.peoplePlay(11, 11);
  9882. break;
  9883. default:
  9884. if (this.inHoleBalls.length > 0) {
  9885. this.peoplePlay(0, 0, false, false);
  9886. }
  9887. else {
  9888. this.selfTurn = !this.selfTurn;
  9889. this.peoplePlay(7, 7);
  9890. }
  9891. break;
  9892. }
  9893. }
  9894. else if (xGame.common.gameMode == GameMode.bigMove) {
  9895. if (this.curFoul == FoulType.timeOut) {
  9896. this.selfTurn = !this.selfTurn;
  9897. this.peoplePlay(14, 15);
  9898. this.placeRootBall();
  9899. }
  9900. else {
  9901. this.selfTurn = !this.selfTurn;
  9902. if (this.curFoul == FoulType.rootHole) {
  9903. this.peoplePlay(12, 13);
  9904. this.placeRootBall();
  9905. }
  9906. else {
  9907. this.peoplePlay(0, 0, false, false);
  9908. }
  9909. }
  9910. }
  9911. else if (xGame.common.gameMode == GameMode.placeBall) {
  9912. this.finishOneShoot = true;
  9913. }
  9914. this.gameResult();
  9915. }
  9916. gameResult() {
  9917. this.firstColliObj = null;
  9918. this.inHoleBalls = [];
  9919. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9920. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9921. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9922. if (xGame.common.uiRodMethod)
  9923. xGame.common.uiRodMethod.resetRod();
  9924. xGame.common.d2World.rootBall.showSelf();
  9925. this.clearIceSkill();
  9926. if (this.selfTurn) {
  9927. PlatMgr.gameInsert();
  9928. }
  9929. xGame.common.d3World.knifeRoot.destroyChildren();
  9930. if (this.selfTurn) {
  9931. xGame.common.gameUI.showHelpLineGuide();
  9932. xGame.common.gameUI.setTurnAlpha(true);
  9933. }
  9934. else {
  9935. xGame.common.gameUI.setTurnAlpha(false);
  9936. }
  9937. }
  9938. getScore(type) {
  9939. let selfAdd = 0;
  9940. let aiAdd = 0;
  9941. if (type == FoulType.timeOut) {
  9942. if (this.selfTurn)
  9943. aiAdd += 3;
  9944. else
  9945. selfAdd += 3;
  9946. }
  9947. else {
  9948. if (this.inHoleBalls.length > 0) {
  9949. if (this.selfTurn) {
  9950. if (type == FoulType.rootHole) {
  9951. aiAdd += 3;
  9952. if (this.inHoleBalls.length - 1 > 0) {
  9953. selfAdd += this.inHoleBalls.length - 1;
  9954. }
  9955. }
  9956. else {
  9957. selfAdd += this.inHoleBalls.length;
  9958. }
  9959. }
  9960. else {
  9961. if (type == FoulType.rootHole) {
  9962. selfAdd += 3;
  9963. if (this.inHoleBalls.length - 1 > 0) {
  9964. aiAdd += this.inHoleBalls.length - 1;
  9965. }
  9966. }
  9967. else {
  9968. aiAdd += this.inHoleBalls.length;
  9969. }
  9970. }
  9971. }
  9972. }
  9973. return [selfAdd, aiAdd];
  9974. }
  9975. judgeScoreEnd(selfAdd, aiAdd) {
  9976. this.selfScore += selfAdd;
  9977. this.aiScore += aiAdd;
  9978. this.updateAIScore();
  9979. this.updateSelfScore();
  9980. if (this.selfScore >= this.targertScore) {
  9981. this.success = true;
  9982. return true;
  9983. }
  9984. if (this.aiScore >= this.targertScore) {
  9985. this.success = false;
  9986. return true;
  9987. }
  9988. let ballArr = xGame.common.d2World.ballArr;
  9989. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9990. if (this.selfScore > this.aiScore) {
  9991. this.success = true;
  9992. return true;
  9993. }
  9994. else if (this.selfScore < this.aiScore) {
  9995. this.success = false;
  9996. return true;
  9997. }
  9998. else {
  9999. if (this.selfTurn) {
  10000. this.success = false;
  10001. }
  10002. else {
  10003. this.success = true;
  10004. }
  10005. return true;
  10006. }
  10007. }
  10008. }
  10009. clearIceSkill() {
  10010. let arr = xGame.common.d2World.ballArr;
  10011. let temp;
  10012. if (this.selfTurn) {
  10013. if (this.selfCurSkill == SkillType.ice) {
  10014. for (let index = 0; index < arr.length; index++) {
  10015. temp = arr[index];
  10016. if (temp.ballFunc == "ice") {
  10017. temp.setBallFunc("normal", "self");
  10018. }
  10019. }
  10020. }
  10021. }
  10022. else {
  10023. if (this.aiCurSkill == SkillType.ice) {
  10024. for (let index = 0; index < arr.length; index++) {
  10025. temp = arr[index];
  10026. if (temp.ballFunc == "ice") {
  10027. temp.setBallFunc("normal", "ai");
  10028. }
  10029. }
  10030. }
  10031. }
  10032. }
  10033. judgeNormalSuccess() {
  10034. if (this.selfTurn) {
  10035. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  10036. this.success = true;
  10037. return true;
  10038. }
  10039. }
  10040. else {
  10041. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  10042. this.success = false;
  10043. return true;
  10044. }
  10045. }
  10046. }
  10047. gameEnd() {
  10048. if (Moyu.isTT) {
  10049. xGame.common.screenImg = getScreenImg();
  10050. }
  10051. console.log("游戏结束", this.success);
  10052. xGame.common.aiPlayer.stopRun();
  10053. if (xGame.common.gameMode == GameMode.placeBall) {
  10054. this.getEndStarNum();
  10055. this.updatePlaceBallState();
  10056. }
  10057. this.isEnter = false;
  10058. Moyu.recordEnd(this, () => {
  10059. if (this.isEnter)
  10060. return;
  10061. this.isEnter = true;
  10062. console.log("进入录结束回调");
  10063. this.enterNext();
  10064. });
  10065. Laya.timer.once(1000, this, () => {
  10066. if (this.isEnter)
  10067. return;
  10068. this.isEnter = true;
  10069. this.enterNext();
  10070. });
  10071. xGame.common.longHelpLine = false;
  10072. }
  10073. enterNext() {
  10074. Laya.timer.clearAll(this);
  10075. if (Moyu.canShare() > 100 || Moyu.isKs) {
  10076. xGame.uiMgr.Show(UIVideoShare, this.success);
  10077. }
  10078. else {
  10079. xGame.uiMgr.Show(UIGameEnd, this.success);
  10080. }
  10081. }
  10082. aiLeave() {
  10083. let ui = xGame.common.gameUI.ui;
  10084. ui.topNode.aiNameTxt.text = "offline";
  10085. }
  10086. aiGameEnd(suc) {
  10087. this.success = suc;
  10088. xGame.common.aiPlayer.stopRun();
  10089. if (this.success) {
  10090. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  10091. Laya.timer.once(1000, this, () => {
  10092. this.clearTime();
  10093. this.gameEnd();
  10094. });
  10095. }
  10096. }
  10097. openTimer() {
  10098. let src = xGame.common.gameUI;
  10099. if (this.selfTurn) {
  10100. src.ui.topNode.selfProgress.visible = true;
  10101. src.ui.topNode.aiProgress.visible = false;
  10102. this.curTimer = src.ui.topNode.selfProgress;
  10103. }
  10104. else {
  10105. src.ui.topNode.selfProgress.visible = false;
  10106. src.ui.topNode.aiProgress.visible = true;
  10107. this.curTimer = src.ui.topNode.aiProgress;
  10108. }
  10109. this.accTime = 0;
  10110. Laya.timer.clearAll(this);
  10111. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  10112. this.curTimer.value = 100;
  10113. }
  10114. updateTime(dt) {
  10115. if (this.gamePause)
  10116. return;
  10117. this.accTime += dt;
  10118. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  10119. if (this.accTime >= this.setTime) {
  10120. this.clearTime();
  10121. console.log("时钟进入了gameRun");
  10122. this.gameRun(FoulType.timeOut);
  10123. }
  10124. }
  10125. clearTime() {
  10126. let src = xGame.common.gameUI;
  10127. src.ui.topNode.selfProgress.visible = false;
  10128. src.ui.topNode.aiProgress.visible = false;
  10129. Laya.timer.clearAll(this);
  10130. }
  10131. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  10132. let ui = xGame.common.gameUI.ui;
  10133. let selfMsg, aiMsg;
  10134. if (sayWords) {
  10135. selfMsg = cfgTable.wordsData[selfIndex].msg;
  10136. aiMsg = cfgTable.wordsData[aiIndex].msg;
  10137. if (Foul) {
  10138. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  10139. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  10140. this.placeRootBall();
  10141. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  10142. if (this.curFoul == FoulType.rootHole) {
  10143. if (!DataMgr.getRootBallFoul()) {
  10144. DataMgr.setRootBallFoul();
  10145. aiMsg = "";
  10146. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  10147. let woman = "Boss, pay attention next time~";
  10148. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10149. }
  10150. }
  10151. else if (this.curFoul == FoulType.timeOut) {
  10152. if (!DataMgr.getTimeoutFoul()) {
  10153. DataMgr.setTimeoutFoul();
  10154. aiMsg = "";
  10155. let tips = "Game timeout, 3 fouls, this game failed.";
  10156. let woman = "Boss, pay attention to the timeline~";
  10157. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10158. }
  10159. }
  10160. }
  10161. }
  10162. }
  10163. if (this.selfTurn) {
  10164. if (sayWords) {
  10165. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  10166. ui.selfTurn.visible = true;
  10167. ui.aiTurn.visible = false;
  10168. ui.selfTurn.t0.play();
  10169. Moyu.vibration();
  10170. });
  10171. }
  10172. }
  10173. else {
  10174. let aiNum = xGame.tools.random(1, 11);
  10175. let challengeNum = DataMgr.getChallengeTimes();
  10176. let delay = false;
  10177. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  10178. aiNum = 9;
  10179. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  10180. aiNum = 3;
  10181. if (challengeNum == 3) {
  10182. if (!this.showLongView) {
  10183. this.showLongView = true;
  10184. delay = true;
  10185. }
  10186. }
  10187. }
  10188. }
  10189. if (delay) {
  10190. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10191. if (success) {
  10192. xGame.common.longHelpLine = true;
  10193. xGame.common.d2World.getHelpLine();
  10194. }
  10195. else {
  10196. aiNum = 10;
  10197. }
  10198. xGame.common.aiPlayer.setAiLevel(aiNum);
  10199. if (sayWords) {
  10200. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10201. xGame.common.aiPlayer.runAI();
  10202. ui.selfTurn.visible = false;
  10203. ui.aiTurn.visible = true;
  10204. ui.aiTurn.t0.play();
  10205. });
  10206. }
  10207. else {
  10208. xGame.common.aiPlayer.runAI();
  10209. }
  10210. this.openTimer();
  10211. this.finishOneShoot = true;
  10212. if (this.selfTurn) {
  10213. ui.topNode.selfKuang.visible = true;
  10214. ui.topNode.aiKuang.visible = false;
  10215. ui.topNode.selfTips.visible = true;
  10216. ui.topNode.aiTips.visible = false;
  10217. }
  10218. else {
  10219. ui.topNode.selfKuang.visible = false;
  10220. ui.topNode.aiKuang.visible = true;
  10221. ui.topNode.selfTips.visible = false;
  10222. ui.topNode.aiTips.visible = true;
  10223. }
  10224. });
  10225. return;
  10226. }
  10227. if (xGame.common.gameMode == GameMode.classic) {
  10228. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10229. if (cfg) {
  10230. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10231. aiNum = aiLevel;
  10232. }
  10233. }
  10234. xGame.common.aiPlayer.setAiLevel(aiNum);
  10235. if (sayWords) {
  10236. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10237. xGame.common.aiPlayer.runAI();
  10238. ui.selfTurn.visible = false;
  10239. ui.aiTurn.visible = true;
  10240. ui.aiTurn.t0.play();
  10241. });
  10242. }
  10243. else {
  10244. xGame.common.aiPlayer.runAI();
  10245. }
  10246. }
  10247. this.openTimer();
  10248. this.finishOneShoot = true;
  10249. if (this.selfTurn) {
  10250. ui.topNode.selfKuang.visible = true;
  10251. ui.topNode.aiKuang.visible = false;
  10252. ui.topNode.selfTips.visible = true;
  10253. ui.topNode.aiTips.visible = false;
  10254. }
  10255. else {
  10256. ui.topNode.selfKuang.visible = false;
  10257. ui.topNode.aiKuang.visible = true;
  10258. ui.topNode.selfTips.visible = false;
  10259. ui.topNode.aiTips.visible = true;
  10260. }
  10261. }
  10262. placeRootBall() {
  10263. let rootBall = xGame.common.d2World.rootBall;
  10264. if (!rootBall)
  10265. return;
  10266. rootBall.gameObj.x = this.lastRootBallPos.x;
  10267. rootBall.gameObj.y = this.lastRootBallPos.y;
  10268. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10269. let moveNode = xGame.common.gameUI.ui.moveNode;
  10270. moveNode.visible = true;
  10271. moveNode.x = this.lastRootBallPos.x;
  10272. moveNode.y = this.lastRootBallPos.y;
  10273. if (!this.selfTurn) {
  10274. xGame.common.aiPlayer.resetRoot();
  10275. }
  10276. }
  10277. }
  10278. class ui_guanyuAni extends fgui.GComponent {
  10279. static createInstance() {
  10280. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10281. }
  10282. onConstruct() {
  10283. this.n0 = (this.getChild("n0"));
  10284. }
  10285. }
  10286. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10287. class UIFireworks extends UIBase {
  10288. constructor() {
  10289. super();
  10290. }
  10291. onConstructor() {
  10292. this.isEject = false;
  10293. }
  10294. show(callback) {
  10295. super.show();
  10296. }
  10297. }
  10298. UIFireworks.uiName = "UIFireworks";
  10299. class ui_UIGuanYu extends fgui.GComponent {
  10300. static createInstance() {
  10301. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10302. }
  10303. onConstruct() {
  10304. this.n2 = (this.getChild("n2"));
  10305. this.n1 = (this.getChild("n1"));
  10306. this.n3 = (this.getChild("n3"));
  10307. this.n4 = (this.getChild("n4"));
  10308. this.n5 = (this.getChild("n5"));
  10309. this.n6 = (this.getChild("n6"));
  10310. this.n8 = (this.getChild("n8"));
  10311. this.n7 = (this.getChild("n7"));
  10312. this.t0 = this.getTransition("t0");
  10313. }
  10314. }
  10315. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10316. class UIGuanYu extends UIBase {
  10317. constructor() {
  10318. super();
  10319. }
  10320. onConstructor() {
  10321. this.ui = ui_UIGuanYu.createInstance();
  10322. this.contentPane = this.ui;
  10323. this.isEject = false;
  10324. }
  10325. show(callback) {
  10326. super.show();
  10327. this.ui.t0.play(Laya.Handler.create(this, () => {
  10328. callback && callback();
  10329. this.hide();
  10330. }));
  10331. this.setGlobalFont(this.ui);
  10332. }
  10333. }
  10334. UIGuanYu.uiName = "UIGuanYu";
  10335. class SkillMgr {
  10336. constructor() {
  10337. this.leveNum = 0;
  10338. this.extraScore = 0;
  10339. this.selfTurn = false;
  10340. this.playedLastSkill = false;
  10341. this.tweenArr = [];
  10342. this._finishNum = 0;
  10343. this._curFinish = 0;
  10344. this._rootX = 0;
  10345. this._rootY = 0;
  10346. this.knifeTimes = 0;
  10347. this.knifeV2 = new Laya.Vector2();
  10348. this.knifeV3 = new Laya.Vector3();
  10349. this.rtStarX = 0;
  10350. this.rtStarY = 0;
  10351. this.addBigSkillSpine();
  10352. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10353. }
  10354. addBigSkillSpine() {
  10355. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10356. console.log("extra2 success");
  10357. });
  10358. }
  10359. runBigSkill(callback) {
  10360. this.tweenArr = [];
  10361. this.callback = callback;
  10362. this.judgeSkill();
  10363. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10364. let guide = DataMgr.getSkillGuide();
  10365. if (!xGame.common.gameMgr.selfTurn) {
  10366. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10367. }
  10368. else {
  10369. if (xGame.common.temSelfLevel != 0) {
  10370. this.leveNum = xGame.common.temSelfLevel;
  10371. }
  10372. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10373. this.leveNum += 5;
  10374. }
  10375. }
  10376. if (guide == 0) {
  10377. DataMgr.setSkillGuide(1);
  10378. if (DataMgr.getNewUser()) {
  10379. Moyu.sendDataEvent("gameFirstPlay");
  10380. DataMgr.setNewUser();
  10381. }
  10382. }
  10383. this.playSpineAni(() => {
  10384. switch (this.curSkill) {
  10385. case SkillType.highSpace:
  10386. this.runHighSpace();
  10387. break;
  10388. case SkillType.breakArmy:
  10389. this.runBreakArmy();
  10390. break;
  10391. case SkillType.ice:
  10392. this.runIce();
  10393. break;
  10394. case SkillType.fireworks:
  10395. this.runFireworks();
  10396. break;
  10397. case SkillType.GuanYu:
  10398. this.runGuanYu();
  10399. break;
  10400. default:
  10401. break;
  10402. }
  10403. });
  10404. }
  10405. judgeSkill() {
  10406. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10407. let gameMgr = xGame.common.gameMgr;
  10408. let type;
  10409. for (let index = 0; index < typeArr.length; index++) {
  10410. type = typeArr[index];
  10411. if (gameMgr.selfTurn) {
  10412. if (gameMgr.selfCurSkill == type) {
  10413. this.selfTurn = true;
  10414. this.curSkill = type;
  10415. return;
  10416. }
  10417. }
  10418. else {
  10419. if (gameMgr.aiCurSkill == type) {
  10420. this.selfTurn = false;
  10421. this.curSkill = type;
  10422. return;
  10423. }
  10424. }
  10425. }
  10426. }
  10427. playSpineAni(callback) {
  10428. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10429. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10430. parent.destroyChildren();
  10431. let aniIndex = 0;
  10432. let skillSpine;
  10433. switch (this.curSkill) {
  10434. case SkillType.highSpace:
  10435. aniIndex = 1;
  10436. xGame.soundMgr.playSound("skill01");
  10437. skillSpine = this.skillSpine2;
  10438. data.scaleX = 0.5;
  10439. data.scaleY = 0.5;
  10440. skillSpine.play(data, 1, false, parent, () => {
  10441. callback && callback();
  10442. });
  10443. break;
  10444. case SkillType.breakArmy:
  10445. aniIndex = 2;
  10446. xGame.soundMgr.playSound("skill02");
  10447. skillSpine = this.skillSpine2;
  10448. data.scaleX = 0.5;
  10449. data.scaleY = 0.5;
  10450. skillSpine.play(data, 2, false, parent, () => {
  10451. callback && callback();
  10452. });
  10453. break;
  10454. case SkillType.ice:
  10455. aniIndex = 0;
  10456. xGame.soundMgr.playSound("skill03");
  10457. skillSpine = this.skillSpine2;
  10458. data.scaleX = 0.5;
  10459. data.scaleY = 0.5;
  10460. skillSpine.play(data, 0, false, parent, () => {
  10461. callback && callback();
  10462. });
  10463. break;
  10464. case SkillType.fireworks:
  10465. xGame.soundMgr.playSound("skill_04_01");
  10466. xGame.soundMgr.playSound("skill04");
  10467. xGame.uiMgr.Show(UIFireworks, callback);
  10468. break;
  10469. case SkillType.GuanYu:
  10470. xGame.soundMgr.playSound("skill05_1");
  10471. xGame.soundMgr.playSound("skill05");
  10472. xGame.uiMgr.Show(UIGuanYu, callback);
  10473. break;
  10474. default:
  10475. break;
  10476. }
  10477. }
  10478. getAllBallArr() {
  10479. let arr = xGame.common.d2World.ballArr;
  10480. let outArr = [];
  10481. for (let index = 0; index < arr.length; index++) {
  10482. if (arr[index] instanceof D2RootBallSrc)
  10483. continue;
  10484. if (arr[index].ballFunc == "ice")
  10485. continue;
  10486. if (arr[index].destroyed)
  10487. continue;
  10488. outArr.push(arr[index]);
  10489. }
  10490. return outArr;
  10491. }
  10492. getOneArr(deletObj) {
  10493. let allArr = this.getAllBallArr();
  10494. let temp;
  10495. for (let index = 0; index < allArr.length; index++) {
  10496. temp = allArr[index];
  10497. if (temp.id == deletObj.id) {
  10498. allArr.splice(index, 1);
  10499. break;
  10500. }
  10501. }
  10502. return allArr;
  10503. }
  10504. getNearBallBag(ball) {
  10505. let ui = xGame.common.gameUI.ui;
  10506. let circleArr = [];
  10507. for (let index = 1; index <= 6; index++) {
  10508. circleArr.push(ui.border["circle" + index]);
  10509. }
  10510. let outIndex = 0;
  10511. let temp;
  10512. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10513. ;
  10514. let dis = 0;
  10515. for (let index = 1; index < circleArr.length; index++) {
  10516. temp = circleArr[index];
  10517. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10518. if (dis < min) {
  10519. min = dis;
  10520. outIndex = index;
  10521. }
  10522. }
  10523. return [circleArr[outIndex], outIndex];
  10524. }
  10525. ballFlyToBag(ballArr, time = 300) {
  10526. let temp;
  10527. let hole;
  10528. this._finishNum = ballArr.length;
  10529. this._curFinish = 0;
  10530. let holeObj = {};
  10531. let holeCfg = {
  10532. "1": 0,
  10533. "2": 0,
  10534. "3": 0,
  10535. "4": 0,
  10536. "5": 0,
  10537. "6": 0
  10538. };
  10539. for (let index = 0; index < ballArr.length; index++) {
  10540. temp = ballArr[index];
  10541. temp.outColli.isSensor = true;
  10542. temp.innerColli.isSensor = true;
  10543. temp.isRunSkillAni = true;
  10544. let holeArr = this.getNearBallBag(temp);
  10545. hole = holeArr[0];
  10546. holeObj[index] = holeArr[1];
  10547. temp.d3BallSrc.scaleXYZ = 0.5;
  10548. this.tweenArr.push(temp.d3BallSrc, temp);
  10549. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10550. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10551. }));
  10552. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10553. let mIndex = holeObj[this._curFinish];
  10554. let isDone = holeCfg[mIndex];
  10555. if (isDone) {
  10556. ballArr[this._curFinish].checkWrongBall(false);
  10557. }
  10558. else {
  10559. holeCfg[mIndex] = 1;
  10560. ballArr[this._curFinish].checkWrongBall();
  10561. }
  10562. this._curFinish++;
  10563. if (this._curFinish >= this._finishNum) {
  10564. if (this.curSkill == SkillType.highSpace) {
  10565. }
  10566. else if (this.curSkill == SkillType.breakArmy) {
  10567. let rootBall = xGame.common.d2World.rootBall;
  10568. rootBall.gameObj.x = this._rootX;
  10569. rootBall.gameObj.y = this._rootY;
  10570. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10571. xGame.common.d2World.d2Gan.ui.visible = true;
  10572. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10573. xGame.common.d2World.getHelpLine();
  10574. this.callback && this.callback(this.extraScore);
  10575. }
  10576. }
  10577. }));
  10578. }
  10579. }
  10580. runHighSpace() {
  10581. let rootBall = xGame.common.d2World.rootBall;
  10582. rootBall.showSelf();
  10583. let d3Src = rootBall.d3BallSrc;
  10584. let allArr = this.getAllBallArr();
  10585. if (allArr.length <= 0) {
  10586. this.callback && this.callback(0);
  10587. return;
  10588. }
  10589. let selectBall = xGame.common.d2World.targetBall;
  10590. let wrong = selectBall && selectBall.destroyed;
  10591. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10592. selectBall = xGame.common.getRandArrEle(allArr);
  10593. }
  10594. let targetD3Src = selectBall.d3BallSrc;
  10595. xGame.common.d2World.d2Gan.ui.visible = false;
  10596. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10597. d3Src.scaleXYZ = 0.5;
  10598. this.tweenArr.push(d3Src);
  10599. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10600. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10601. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10602. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10603. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10604. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10605. let outArr = [selectBall];
  10606. let other = this.leveNum - 1;
  10607. if (other > 0) {
  10608. let nearArr = this.getOneArr(selectBall);
  10609. if (nearArr.length > 0) {
  10610. xGame.common.botherArr(nearArr);
  10611. if (other >= nearArr.length)
  10612. other = nearArr.length;
  10613. for (let index = 0; index < other; index++) {
  10614. outArr.push(nearArr[index]);
  10615. }
  10616. }
  10617. }
  10618. xGame.common.extraMoveNum = other + 1;
  10619. this.extraScore = other + 1;
  10620. this._rootX = selectBall.gameObj.x;
  10621. this._rootY = selectBall.gameObj.y;
  10622. rootBall.gameObj.x = this._rootX;
  10623. rootBall.gameObj.y = this._rootY;
  10624. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10625. Laya.Tween.clearAll(d3Src);
  10626. this.addRandomForce(outArr);
  10627. }));
  10628. }));
  10629. }
  10630. addRandomForce(outArr) {
  10631. if (outArr.length > 0) {
  10632. xGame.common.d2World.openCheckStill = true;
  10633. this.playedLastSkill = true;
  10634. }
  10635. let temp;
  10636. for (let index = 0; index < outArr.length; index++) {
  10637. let angle = xGame.common.randomNum(0, 360);
  10638. let linearPercent = xGame.common.randomNum(65, 100);
  10639. temp = outArr[index];
  10640. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10641. }
  10642. }
  10643. setLinearSpeed(angle, rigy, linearPercent) {
  10644. let sin = Math.sin(angle * Math.PI / 180);
  10645. let cos = Math.cos(angle * Math.PI / 180);
  10646. let maxSpeed = 4;
  10647. let speed = new Laya.Vector2();
  10648. speed.x = maxSpeed * linearPercent * sin;
  10649. speed.y = -maxSpeed * linearPercent * cos;
  10650. rigy.applyLinearImpulseToCenter(speed);
  10651. }
  10652. runBreakArmy() {
  10653. xGame.common.d2World.d2Gan.ui.visible = false;
  10654. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10655. let gameUI = xGame.common.gameUI.ui;
  10656. gameUI.skillRod.visible = true;
  10657. gameUI.skillRod.rotation = 110;
  10658. let outArr = this.getAllBallArr();
  10659. if (outArr.length <= 0) {
  10660. gameUI.skillRod.visible = false;
  10661. this.callback && this.callback(0);
  10662. return;
  10663. }
  10664. xGame.common.botherArr(outArr);
  10665. if (this.leveNum >= outArr.length)
  10666. this.leveNum = outArr.length;
  10667. let deleteNum = outArr.length - this.leveNum;
  10668. outArr.splice(0, deleteNum);
  10669. this.extraScore = this.leveNum;
  10670. let potX = gameUI.skillRod.x;
  10671. let potY = gameUI.skillRod.y;
  10672. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10673. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10674. let disArr = [];
  10675. for (let index = 0; index < outArr.length; index++) {
  10676. let obj = outArr[index];
  10677. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10678. dis = Math.pow(dis, 0.5);
  10679. disArr.push(dis);
  10680. }
  10681. this.tweenArr.push(gameUI.skillRod);
  10682. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10683. })).update = Laya.Handler.create(this, (e, t, c) => {
  10684. let angle = gameUI.skillRod.rotation;
  10685. let xx;
  10686. let yy;
  10687. let temp;
  10688. for (let index = 0; index < outArr.length; index++) {
  10689. temp = outArr[index];
  10690. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10691. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10692. yy -= 20;
  10693. temp.gameObj.x = xx;
  10694. temp.gameObj.y = yy;
  10695. temp.d3BallSrc.setTransPos(xx, yy);
  10696. }
  10697. if (angle <= 60) {
  10698. Laya.Tween.clearAll(gameUI.skillRod);
  10699. this.ballFlyToBag(outArr, 150);
  10700. gameUI.skillRod.visible = false;
  10701. }
  10702. }, null, false);
  10703. }
  10704. runIce() {
  10705. let ballArr = xGame.common.d2World.ballArr;
  10706. this.leveNum *= 2;
  10707. if (this.leveNum >= ballArr.length - 1)
  10708. this.leveNum = ballArr.length - 1;
  10709. let tempArr = [];
  10710. let outArr = [];
  10711. for (let index = 0; index < ballArr.length; index++) {
  10712. if (ballArr[index] instanceof D2RootBallSrc)
  10713. continue;
  10714. tempArr.push(ballArr[index]);
  10715. }
  10716. if (tempArr.length <= 0) {
  10717. this.callback && this.callback(0);
  10718. return;
  10719. }
  10720. xGame.common.botherArr(tempArr);
  10721. for (let index = 0; index < this.leveNum; index++) {
  10722. outArr.push(tempArr[index]);
  10723. }
  10724. this.extraScore = this.leveNum;
  10725. let temp;
  10726. for (let index = 0; index < outArr.length; index++) {
  10727. temp = outArr[index];
  10728. temp.d3BallSrc.playIceEft();
  10729. }
  10730. Laya.timer.once(2000, this, () => {
  10731. for (let index = 0; index < outArr.length; index++) {
  10732. temp = outArr[index];
  10733. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10734. temp.setBallFunc("ice", str);
  10735. }
  10736. this.callback && this.callback(0);
  10737. });
  10738. }
  10739. runFireworks() {
  10740. let allArr = this.getAllBallArr();
  10741. if (allArr.length <= 0) {
  10742. this.callback && this.callback(0);
  10743. return;
  10744. }
  10745. xGame.common.d2World.d2Gan.ui.visible = false;
  10746. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10747. let outArr = [];
  10748. let other = this.leveNum;
  10749. if (other > 0) {
  10750. if (allArr.length > 0) {
  10751. xGame.common.botherArr(allArr);
  10752. if (other >= allArr.length)
  10753. other = allArr.length;
  10754. for (let index = 0; index < other; index++) {
  10755. outArr.push(allArr[index]);
  10756. }
  10757. }
  10758. }
  10759. xGame.common.extraMoveNum = other;
  10760. this.extraScore = other;
  10761. this.addRandmomFireworks(outArr);
  10762. }
  10763. addRandmomFireworks(outArr) {
  10764. Laya.timer.once(1100, this, () => {
  10765. if (outArr.length > 0) {
  10766. xGame.common.d2World.openCheckStill = true;
  10767. this.playedLastSkill = true;
  10768. }
  10769. });
  10770. xGame.soundMgr.playSound("skill_04_02");
  10771. let temp;
  10772. let delay = -200;
  10773. for (let index = 0; index < outArr.length; index++) {
  10774. temp = outArr[index];
  10775. delay += 200;
  10776. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10777. let angle = xGame.common.randomNum(0, 360);
  10778. angle = this.getFireworksAngle(obj);
  10779. let linearPercent = xGame.common.randomNum(45, 80);
  10780. if (!obj.destroyed)
  10781. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10782. });
  10783. }
  10784. }
  10785. getFireworksAngle(obj) {
  10786. let rootBall = xGame.common.d2World.rootBall;
  10787. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10788. }
  10789. resetGame() {
  10790. Laya.timer.clearAll(this);
  10791. if (this.tweenArr) {
  10792. for (let index = 0; index < this.tweenArr.length; index++) {
  10793. Laya.Tween.clearAll(this.tweenArr[index]);
  10794. }
  10795. }
  10796. this.tweenArr = null;
  10797. }
  10798. runGuanYu() {
  10799. xGame.common.d2World.d2Gan.ui.visible = false;
  10800. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10801. let rootBall = xGame.common.d2World.rootBall;
  10802. if (rootBall.isInHole) {
  10803. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10804. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10805. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10806. rootBall.showSelf();
  10807. }
  10808. this.rtStarX = rootBall.gameObj.x;
  10809. this.rtStarY = rootBall.gameObj.y;
  10810. this.knifeTimes = 0;
  10811. this.playedLastSkill = true;
  10812. rootBall.forceRun = true;
  10813. rootBall.rigy.type = "static";
  10814. xGame.common.d2World.openCheckStill = true;
  10815. this.guanyuRandomKnife();
  10816. }
  10817. guanyuRandomKnife() {
  10818. let rootBall = xGame.common.d2World.rootBall;
  10819. let dir = this.getRandDir();
  10820. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10821. console.log("当前angle", angle);
  10822. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10823. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10824. let dis = 324;
  10825. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10826. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10827. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10828. this.rtStarX = rootBall.gameObj.x;
  10829. this.rtStarY = rootBall.gameObj.y;
  10830. this.knifeTimes++;
  10831. let skillLevel;
  10832. if (xGame.common.gameMgr.selfTurn) {
  10833. skillLevel = DataMgr.getBigSkillByIndex(4);
  10834. }
  10835. else {
  10836. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10837. }
  10838. if (!skillLevel)
  10839. skillLevel = 1;
  10840. skillLevel += 2;
  10841. if (this.knifeTimes < skillLevel) {
  10842. Laya.timer.once(400, this, () => {
  10843. this.guanyuRandomKnife();
  10844. });
  10845. }
  10846. else {
  10847. rootBall.forceRun = false;
  10848. rootBall.rigy.type = "dynamic";
  10849. xGame.common.extraMoveNum = skillLevel;
  10850. }
  10851. }));
  10852. }
  10853. getRandDir() {
  10854. let rootBall = xGame.common.d2World.rootBall;
  10855. let allBall = this.getAllBallArr();
  10856. let target = xGame.common.getRandArrEle(allBall);
  10857. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10858. return this.knifeV2;
  10859. }
  10860. cloneKnife(x, y, rotation) {
  10861. let parent = xGame.common.d3World.knifeRoot;
  10862. let prefab = xGame.common.d3World.knife;
  10863. let clone = prefab.clone();
  10864. parent.addChild(clone);
  10865. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10866. clone.transform.localPositionX = this.knifeV3.x;
  10867. clone.transform.localPositionY = 0;
  10868. clone.transform.localPositionZ = this.knifeV3.z;
  10869. clone.transform.localRotationEulerX = 0;
  10870. clone.transform.localRotationEulerY = rotation;
  10871. clone.transform.localRotationEulerZ = 0;
  10872. clone.active = true;
  10873. return clone;
  10874. }
  10875. cloneGuanYuEft(x, y, angle) {
  10876. return;
  10877. let parent = xGame.common.gameUI.ui.guanyuNode;
  10878. let eft = new ui_guanyuAni();
  10879. eft.parent = parent;
  10880. eft.x = x;
  10881. eft.y = y;
  10882. eft.rotation = angle;
  10883. }
  10884. }
  10885. class ui_UIWordsList extends fgui.GComponent {
  10886. static createInstance() {
  10887. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10888. }
  10889. onConstruct() {
  10890. this.c1 = this.getController("c1");
  10891. this.n74 = (this.getChild("n74"));
  10892. this.clickNode = (this.getChild("clickNode"));
  10893. this.myNode = (this.getChild("myNode"));
  10894. this.n68 = (this.getChild("n68"));
  10895. this.n66 = (this.getChild("n66"));
  10896. this.n55 = (this.getChild("n55"));
  10897. this.wordsBtn = (this.getChild("wordsBtn"));
  10898. this.emotionBtn = (this.getChild("emotionBtn"));
  10899. this.mybggg = (this.getChild("mybggg"));
  10900. this.wordsList = (this.getChild("wordsList"));
  10901. this.emotionList = (this.getChild("emotionList"));
  10902. this.myRoot = (this.getChild("myRoot"));
  10903. }
  10904. }
  10905. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10906. class EmotionDisplay {
  10907. constructor(index, ui) {
  10908. this.ui = ui;
  10909. this.index = index;
  10910. this.ui.onClick(this, this.clickSelf);
  10911. this.updateSelf();
  10912. }
  10913. updateSelf() {
  10914. let data = cfgTable.emotionData[this.index + 1];
  10915. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10916. }
  10917. clickSelf() {
  10918. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10919. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10920. xGame.common.talkMgr.closeTalkView();
  10921. }
  10922. }
  10923. class WordsDisplay {
  10924. constructor(index, ui) {
  10925. this.ui = ui;
  10926. this.index = index;
  10927. this.ui.onClick(this, this.clickSelf);
  10928. this.updateSelf();
  10929. }
  10930. updateSelf() {
  10931. let data = cfgTable.talkwordsData[this.index + 1];
  10932. this.ui.txt.text = data.msg;
  10933. }
  10934. clickSelf() {
  10935. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10936. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10937. xGame.common.talkMgr.closeTalkView();
  10938. }
  10939. }
  10940. class UIWordsList extends UIBase {
  10941. constructor() {
  10942. super();
  10943. }
  10944. onConstructor() {
  10945. this.ui = ui_UIWordsList.createInstance();
  10946. this.contentPane = this.ui;
  10947. this.isEject = false;
  10948. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10949. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10950. this.addUIClick(this.ui.clickNode, this.hide);
  10951. this.initTalkList();
  10952. this.initEmotionList();
  10953. }
  10954. show() {
  10955. super.show();
  10956. this.setGlobalFont(this.ui);
  10957. }
  10958. initTalkList() {
  10959. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10960. let data = cfgTable.talkwordsData;
  10961. let length = Object.keys(data).length;
  10962. this.ui.wordsList.numItems = length;
  10963. }
  10964. initEmotionList() {
  10965. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10966. let data = cfgTable.emotionData;
  10967. let length = Object.keys(data).length;
  10968. this.ui.emotionList.numItems = length;
  10969. }
  10970. renderTalkItem(index, obj) {
  10971. let temp = new WordsDisplay(index, obj);
  10972. }
  10973. renderEmotionItem(index, obj) {
  10974. let temp = new EmotionDisplay(index, obj);
  10975. }
  10976. openTalkList() {
  10977. this.ui.c1.selectedIndex = 0;
  10978. }
  10979. openEmotionList() {
  10980. this.ui.c1.selectedIndex = 1;
  10981. }
  10982. }
  10983. UIWordsList.uiName = "UIWordsList";
  10984. class TalkMgr {
  10985. constructor() {
  10986. this.aiSpeak = true;
  10987. this.emotionList = [];
  10988. this.talkList = [];
  10989. this.addEvent();
  10990. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10991. this.emotionList = [];
  10992. this.talkList = [];
  10993. for (let k in cfgTable.emotionData) {
  10994. this.emotionList.push(cfgTable.emotionData[k].id);
  10995. }
  10996. for (let k in cfgTable.talkwordsData) {
  10997. this.talkList.push(cfgTable.talkwordsData[k].id);
  10998. }
  10999. }
  11000. addEvent() {
  11001. let ui = xGame.common.gameUI.ui;
  11002. ui.wordsBtn.visible = true;
  11003. ui.wordsBtn.onClick(this, this.openTalkView);
  11004. ui.aiWordsBtn.visible = true;
  11005. ui.aiWordsBtn.onClick(this, this.clickAIState);
  11006. }
  11007. openTalkView() {
  11008. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11009. xGame.uiMgr.Show(UIWordsList);
  11010. }
  11011. closeTalkView() {
  11012. xGame.uiMgr.Hide(UIWordsList);
  11013. }
  11014. clickAIState() {
  11015. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11016. this.aiSpeak = !this.aiSpeak;
  11017. this.changeAIState(this.aiSpeak);
  11018. }
  11019. changeAIState(speak) {
  11020. this.aiSpeak = speak;
  11021. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  11022. if (speak) {
  11023. btn.c1.selectedIndex = 0;
  11024. }
  11025. else {
  11026. btn.c1.selectedIndex = 1;
  11027. }
  11028. }
  11029. showSelfTalk(wordsId) {
  11030. let ui = xGame.common.gameUI.ui;
  11031. ui.selfTalk.visible = true;
  11032. ui.selfTalk.myNode.c1.selectedIndex = 1;
  11033. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  11034. ui.selfTalk.t0.play();
  11035. }
  11036. showSelfEmotion(emotionId) {
  11037. let ui = xGame.common.gameUI.ui;
  11038. ui.selfTalk.visible = true;
  11039. ui.selfTalk.myNode.c1.selectedIndex = 0;
  11040. this.selfSpine && this.selfSpine.dispose();
  11041. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  11042. let spineData = cfgTable.emotionData[emotionId].spine;
  11043. this.selfSpine = new SpineMgr(spineData, () => {
  11044. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  11045. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  11046. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11047. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  11048. });
  11049. ui.selfTalk.t0.play();
  11050. }
  11051. showAITalk(wordsId) {
  11052. if (!this.aiSpeak)
  11053. return;
  11054. if (DataMgr.gameData.gameCount < 2)
  11055. return;
  11056. if (wordsId < 1)
  11057. wordsId = this.getRandTalk();
  11058. let ui = xGame.common.gameUI.ui;
  11059. ui.aiTalk.visible = true;
  11060. ui.aiTalk.myNode.c1.selectedIndex = 1;
  11061. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  11062. ui.aiTalk.t0.play();
  11063. }
  11064. getRandTalk() {
  11065. let rand = xGame.tools.random(0, this.talkList.length);
  11066. return this.emotionList[rand];
  11067. }
  11068. getRandEmotion() {
  11069. let rand = xGame.tools.random(0, this.emotionList.length);
  11070. return this.emotionList[rand];
  11071. }
  11072. showAIEmotion(emotionId) {
  11073. if (!this.aiSpeak)
  11074. return;
  11075. if (DataMgr.gameData.gameCount < 2)
  11076. return;
  11077. if (emotionId < 1)
  11078. emotionId = this.getRandEmotion();
  11079. let ui = xGame.common.gameUI.ui;
  11080. ui.aiTalk.visible = true;
  11081. ui.aiTalk.myNode.c1.selectedIndex = 0;
  11082. this.aiSpine && this.aiSpine.dispose();
  11083. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11084. let spineData = cfgTable.emotionData[emotionId].spine;
  11085. this.aiSpine = new SpineMgr(spineData, () => {
  11086. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  11087. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  11088. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11089. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  11090. });
  11091. ui.aiTalk.t0.play();
  11092. }
  11093. resetGame() {
  11094. let ui = xGame.common.gameUI.ui;
  11095. ui.aiTalk.visible = false;
  11096. ui.selfTalk.visible = false;
  11097. this.aiSpine && this.aiSpine.dispose();
  11098. this.selfSpine && this.selfSpine.dispose();
  11099. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11100. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  11101. this.closeTalkView();
  11102. }
  11103. }
  11104. class WordsMgr {
  11105. constructor() {
  11106. this.comboTimes = 1;
  11107. this.skillTimes = 0;
  11108. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  11109. this.comboSpine = new SpineMgr("yxz_liangan");
  11110. this.skillSpine = new SpineMgr("yiganxqiu");
  11111. this.scoreSpine = new SpineMgr("defen");
  11112. }
  11113. setClassicCombo(isInterrupt) {
  11114. if (isInterrupt) {
  11115. this.comboTimes = 0;
  11116. }
  11117. }
  11118. playClassicWords(type, callback) {
  11119. this.callback = callback;
  11120. let aniIndex = type;
  11121. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11122. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11123. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  11124. mySpine.destroy(true);
  11125. this.playClassicTimes();
  11126. });
  11127. }
  11128. playClassicTimes() {
  11129. this.comboTimes++;
  11130. if (this.comboTimes <= 1) {
  11131. this.callback && this.callback();
  11132. }
  11133. else {
  11134. let aniIndex = this.comboTimes - 1;
  11135. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11136. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11137. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  11138. mySpine.destroy(true);
  11139. this.callback && this.callback();
  11140. });
  11141. }
  11142. }
  11143. playBigSkillTimes(times, callback) {
  11144. if (times <= 0) {
  11145. callback && callback();
  11146. return;
  11147. }
  11148. this.callback = callback;
  11149. let pre = "sz_0";
  11150. let aniIndex = 0;
  11151. this.getWordsImg(times, pre, () => {
  11152. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11153. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11154. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  11155. let r1 = ``;
  11156. let r2 = ``;
  11157. if (times <= 9) {
  11158. r1 = `res/d2Res/${pre}${times}.png`;
  11159. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11160. aniIndex = 0;
  11161. }
  11162. else {
  11163. r1 = `res/d2Res/${pre}${times % 10}.png`;
  11164. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  11165. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  11166. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  11167. aniIndex = 1;
  11168. }
  11169. this.skillSpine.play(data, aniIndex, false, parent, () => {
  11170. mySpine.destroy(true);
  11171. xGame.common.gameMgr.playSkillTips();
  11172. this.playScore(times);
  11173. xGame.common.playRandomMutiBallBigSkillSound();
  11174. }, mySpine);
  11175. });
  11176. }
  11177. playScore(score) {
  11178. let pre = "sz_";
  11179. let aniIndex = 0;
  11180. this.getWordsImg(score, pre, () => {
  11181. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11182. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11183. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11184. let r1 = ``;
  11185. let r2 = ``;
  11186. if (score <= 9) {
  11187. r1 = `res/d2Res/${pre}${score}.png`;
  11188. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11189. aniIndex = 0;
  11190. }
  11191. else {
  11192. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11193. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11194. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11195. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11196. aniIndex = 1;
  11197. }
  11198. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11199. mySpine.destroy(true);
  11200. this.callback && this.callback();
  11201. }, mySpine);
  11202. });
  11203. }
  11204. getWordsImg(number, pre = "", callback) {
  11205. let arr = [];
  11206. if (number <= 9) {
  11207. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11208. }
  11209. else {
  11210. 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 });
  11211. }
  11212. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11213. callback && callback();
  11214. }));
  11215. }
  11216. }
  11217. class ui_UIRodMethod extends fgui.GComponent {
  11218. static createInstance() {
  11219. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11220. }
  11221. onConstruct() {
  11222. this.n24 = (this.getChild("n24"));
  11223. this.white = (this.getChild("white"));
  11224. this.dot = (this.getChild("dot"));
  11225. this.sureBtn = (this.getChild("sureBtn"));
  11226. this.n20 = (this.getChild("n20"));
  11227. this.n21 = (this.getChild("n21"));
  11228. this.n22 = (this.getChild("n22"));
  11229. this.n23 = (this.getChild("n23"));
  11230. this.n5 = (this.getChild("n5"));
  11231. this.n14 = (this.getChild("n14"));
  11232. this.t0 = this.getTransition("t0");
  11233. }
  11234. }
  11235. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11236. class UIRodMethod extends UIBase {
  11237. constructor() {
  11238. super();
  11239. this.isPressd = false;
  11240. }
  11241. onConstructor() {
  11242. this.ui = ui_UIRodMethod.createInstance();
  11243. this.contentPane = this.ui;
  11244. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11245. this.moveDir = new Laya.Vector2();
  11246. this.moveDest = new Laya.Vector2();
  11247. this.centerPos = new Laya.Vector2();
  11248. xGame.common.uiRodMethod = this;
  11249. }
  11250. show() {
  11251. super.show();
  11252. xGame.common.gameMgr.gamePause = true;
  11253. this.openPressDotEvent();
  11254. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11255. this.centerPos.x = this.ui.white.x;
  11256. this.centerPos.y = this.ui.white.y;
  11257. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11258. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11259. this.setDot();
  11260. this.setGlobalFont(this.ui);
  11261. }
  11262. setDot() {
  11263. this.ui.dot.x = this.moveDest.x;
  11264. this.ui.dot.y = this.moveDest.y;
  11265. }
  11266. closeSelf() {
  11267. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11268. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11269. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11270. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11271. xGame.common.gameMgr.gamePause = false;
  11272. this.hide();
  11273. }
  11274. openPressDotEvent() {
  11275. this.closePressDotEvent();
  11276. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11277. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11278. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11279. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11280. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11281. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11282. }
  11283. closePressDotEvent() {
  11284. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11285. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11286. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11287. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11288. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11289. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11290. }
  11291. onDown(e) {
  11292. if (e.type == Laya.Event.MOUSE_DOWN)
  11293. this.isPressd = true;
  11294. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11295. this.isPressd = false;
  11296. if (!this.isPressd)
  11297. return;
  11298. this.moveDest.x = e.stageX;
  11299. this.moveDest.y = e.stageY;
  11300. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11301. if (dis > 6724) {
  11302. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11303. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11304. }
  11305. this.setDot();
  11306. }
  11307. resetRod() {
  11308. this.ui.dot.x = this.ui.white.x;
  11309. this.ui.dot.y = this.ui.white.y;
  11310. this.gameRod.dot.x = this.gameRod.bg.x;
  11311. this.gameRod.dot.y = this.gameRod.bg.y;
  11312. xGame.common.rodOffest.x = 0;
  11313. xGame.common.rodOffest.y = 0;
  11314. }
  11315. }
  11316. UIRodMethod.uiName = "UIRodMethod";
  11317. class UIGame extends UIBase {
  11318. constructor() {
  11319. super();
  11320. this.powerNum = 0;
  11321. this.isD3Inited = false;
  11322. this.isPrePlay = false;
  11323. this.isMoveRod = false;
  11324. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11325. this.rulerDis = 20;
  11326. this.rulerOffset = 0;
  11327. }
  11328. onConstructor() {
  11329. this.ui = ui_UIGame.createInstance();
  11330. this.contentPane = this.ui;
  11331. this.ui.x += xGame.common.sysOffestNum;
  11332. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11333. this.isEject = false;
  11334. xGame.common.gameUI = this;
  11335. this.initSelf();
  11336. }
  11337. isTurnSelf() {
  11338. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11339. return true;
  11340. }
  11341. }
  11342. initSelf() {
  11343. let topUI = this.ui.topNode;
  11344. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11345. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11346. this.barInfo = {};
  11347. this.barInfo.curY = 0;
  11348. this.barInfo.height = this.ui.powerNode.height;
  11349. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11350. this.barInfo.powerStartY = this.ui.powerNode.y;
  11351. xGame.common.aiPlayer = new AIPlayer();
  11352. xGame.common.gameMgr = new GameMgr();
  11353. xGame.common.skillMgr = new SkillMgr();
  11354. xGame.common.wordsMgr = new WordsMgr();
  11355. xGame.common.talkMgr = new TalkMgr();
  11356. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11357. });
  11358. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11359. });
  11360. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11361. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11362. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11363. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11364. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11365. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11366. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11367. }
  11368. getGanZiImg() {
  11369. let index = DataMgr.getCurBallRod();
  11370. let data = cfgTable.ballrodData[index + 1];
  11371. let gan_url = xGame.common.getGameIconUrl(data.img);
  11372. this.ui.powerNode.showImg.url = gan_url;
  11373. }
  11374. returnHome() {
  11375. let tips = "Are you sure to exit the game?";
  11376. let woman = "Boss, why don't you play for a while longer?";
  11377. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11378. }
  11379. addRodMethodClick() {
  11380. if (this.isTurnSelf()) {
  11381. xGame.uiMgr.Show(UIRodMethod);
  11382. }
  11383. }
  11384. clickHelpLineBtn(force = false) {
  11385. if (!this.isTurnSelf())
  11386. return;
  11387. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11388. if (success) {
  11389. xGame.common.longHelpLine = true;
  11390. xGame.common.d2World.getHelpLine();
  11391. Moyu.sendDataEvent("guideNum");
  11392. }
  11393. else {
  11394. }
  11395. });
  11396. }
  11397. renderSelfDisplayBalls(index, target) {
  11398. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11399. target.myImg.url = xGame.common.getGameIconUrl(str);
  11400. }
  11401. renderAIDisplayBalls(index, target) {
  11402. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11403. target.myImg.url = xGame.common.getGameIconUrl(str);
  11404. ;
  11405. }
  11406. updateMode() {
  11407. if (xGame.common.gameMode == GameMode.classic) {
  11408. this.ui.topNode.scoreNode.visible = false;
  11409. }
  11410. else if (xGame.common.gameMode == GameMode.bigMove) {
  11411. this.ui.topNode.scoreNode.visible = true;
  11412. }
  11413. }
  11414. show() {
  11415. super.show();
  11416. this.ui.alpha = 0;
  11417. this.updateSelf();
  11418. xGame.common.gameMgr.gamePause = false;
  11419. xGame.common.gameUI.ui.blackAni.visible = false;
  11420. xGame.common.gameUI.ui.whiteAni.visible = false;
  11421. this.ui.powerEft.visible = false;
  11422. this.ui.colorNode.visible = false;
  11423. this.updateHead();
  11424. let curUse = DataMgr.getCurBallRod();
  11425. this.getGanZiImg();
  11426. this.setGlobalFont(this.ui);
  11427. }
  11428. updateSelf() {
  11429. if (xGame.common.gameMode == GameMode.classic) {
  11430. this.ui.c1.selectedIndex = 0;
  11431. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11432. this.ui.topNode.middleNode.visible = true;
  11433. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11434. }
  11435. else if (xGame.common.gameMode == GameMode.bigMove) {
  11436. this.ui.c1.selectedIndex = 0;
  11437. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11438. this.ui.topNode.middleNode.visible = false;
  11439. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11440. let rand = xGame.common.randomNum(1, max);
  11441. let guide = DataMgr.getSkillGuide();
  11442. if (guide == 0)
  11443. rand = 1;
  11444. xGame.common.bigMoveLevelIndex = rand;
  11445. }
  11446. else if (xGame.common.gameMode == GameMode.placeBall) {
  11447. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11448. this.ui.c1.selectedIndex = 1 + data.type;
  11449. this.ui.alpha = 1;
  11450. this.startGame();
  11451. }
  11452. this.updateMode();
  11453. this.initD3world();
  11454. this.initD2world();
  11455. }
  11456. startGame() {
  11457. this.ui.snowNode.visible = Math.random() <= 0.1;
  11458. this.ui.d2Node.visible = false;
  11459. xGame.common.d3World.d3Hand.gameObj.active = false;
  11460. xGame.common.d3World.tableSrc.init();
  11461. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11462. this.cameraViewChange(() => {
  11463. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11464. switch (xGame.common.gameMode) {
  11465. case GameMode.classic:
  11466. xGame.common.d3World.d3Hand.gameObj.active = true;
  11467. this.playPutBallD3Ani();
  11468. break;
  11469. case GameMode.bigMove:
  11470. this.enterGame();
  11471. Laya.timer.once(500, this, () => {
  11472. this.ui.topNode.middleNode.visible = true;
  11473. this.ui.topNode.middleNode.t0.play();
  11474. });
  11475. break;
  11476. case GameMode.placeBall:
  11477. this.enterGame();
  11478. break;
  11479. default:
  11480. break;
  11481. }
  11482. });
  11483. PlatMgr.showBanner(false);
  11484. }
  11485. enterGame() {
  11486. this.ui.d2Node.visible = true;
  11487. xGame.common.d3World.d3Hand.gameObj.active = false;
  11488. xGame.common.showOneCamera("mainCamera");
  11489. Moyu.recordGame(30, true);
  11490. if (!this.isPrePlay) {
  11491. this.isPrePlay = true;
  11492. xGame.common.d3World.prePlayEft();
  11493. }
  11494. xGame.common.gameMgr.gameReady();
  11495. this.openAllEvent();
  11496. this.ui.snowNode.visible = false;
  11497. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11498. this.ui.helpBtn.visible = condition;
  11499. }
  11500. showHelpLineGuide() {
  11501. let longGuide = DataMgr.getGuideHelpLine();
  11502. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11503. this.ui.helpBtn.visible = true;
  11504. this.ui.guideNode.visible = true;
  11505. }
  11506. }
  11507. setTurnAlpha(alpha) {
  11508. this.ui.keduNode.alpha = alpha;
  11509. this.ui.ganNode.alpha = alpha;
  11510. this.ui.rodMethodNode.alpha = alpha;
  11511. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11512. }
  11513. cameraViewChange(callback) {
  11514. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11515. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11516. xGame.common.showOneCamera("visitAngle");
  11517. cameraSrc.localRotationEulerY = 180;
  11518. cameraSrc.localRotationEulerZ = 0;
  11519. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11520. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11521. callback && callback();
  11522. }));
  11523. }));
  11524. }
  11525. playPutBallD3Ani() {
  11526. xGame.common.showOneCamera("mainCamera");
  11527. let handSrc = xGame.common.d3World.d3Hand;
  11528. handSrc.gameObj.active = true;
  11529. handSrc.transform.localPositionZ = 3;
  11530. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11531. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11532. handSrc.gameObj.active = false;
  11533. this.enterGame();
  11534. }), 400);
  11535. }));
  11536. }
  11537. updateHead() {
  11538. let user = Moyu.getUserInfo();
  11539. this.ui.topNode.selfNameTxt.text = user.nickName;
  11540. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11541. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11542. if (DataMgr.getSkillGuide() < 1) {
  11543. this.ui.topNode.aiNameTxt.text = 'billiards';
  11544. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11545. }
  11546. else {
  11547. this.ui.topNode.aiNameTxt.text = aiData.name;
  11548. let randNo = Math.floor(Math.random() * 10) + 1;
  11549. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11550. }
  11551. }
  11552. initD2world() {
  11553. let node = this.ui.d2Root.displayObject;
  11554. let src = node.getComponent(D2World);
  11555. if (!src) {
  11556. xGame.common.d2World = node.addComponent(D2World);
  11557. }
  11558. xGame.common.d2World.initSelf();
  11559. }
  11560. initD3world() {
  11561. if (this.isD3Inited)
  11562. return;
  11563. this.isD3Inited = true;
  11564. let scene3D = xGame.common.d3Scene;
  11565. this.ui.d3Root.displayObject.addChild(scene3D);
  11566. scene3D.active = true;
  11567. xGame.common.d3World.tableSrc.setBorderPos();
  11568. }
  11569. onRootMove(e) {
  11570. let rootBall = xGame.common.d2World.rootBall;
  11571. this.ui.moveNode.x = e.x;
  11572. this.ui.moveNode.y = e.y;
  11573. rootBall.gameObj.x = e.x;
  11574. rootBall.gameObj.y = e.y;
  11575. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11576. }
  11577. aiRootMove(move) {
  11578. if (move)
  11579. this.hideBallUI();
  11580. else {
  11581. this.showBallUI();
  11582. xGame.common.d2World.getHelpLine();
  11583. }
  11584. }
  11585. aiForce(type, force = 0) {
  11586. this.pressTarget = PressType.powerNode;
  11587. if (type == 1)
  11588. this.onEventUp({ force: true });
  11589. else if (type == 2)
  11590. this.onEventMove({ stageY: force, force: true });
  11591. }
  11592. onEventPress(e) {
  11593. if (e.stopPropagation)
  11594. e.stopPropagation();
  11595. if (!this.isTurnSelf())
  11596. return;
  11597. let target = e.target;
  11598. switch (target) {
  11599. case this.ui.myPowerNode.displayObject:
  11600. this.pressTarget = PressType.powerNode;
  11601. this.barInfo.curY = e.stageY;
  11602. this.updateBarInfo();
  11603. break;
  11604. case this.ui.moveNode.displayObject:
  11605. this.pressTarget = PressType.moveNode;
  11606. this.hideBallUI();
  11607. this.eventObj.curX = this.ui.moveNode.x;
  11608. this.eventObj.curY = this.ui.moveNode.y;
  11609. this.ui.moveNode.finger.visible = false;
  11610. this.eventObj.lastX = e.stageX;
  11611. this.eventObj.lastY = e.stageY;
  11612. break;
  11613. case this.ui.rulerClickNode.displayObject:
  11614. this.pressTarget = PressType.rulerNode;
  11615. this.eventObj.lastY = e.stageY;
  11616. break;
  11617. case this.ui.d2Root.displayObject:
  11618. this.pressTarget = PressType.d2Root;
  11619. this.eventObj.lastX = e.stageX;
  11620. this.eventObj.lastY = e.stageY;
  11621. this.eventObj.starX = e.stageX;
  11622. this.eventObj.starY = e.stageY;
  11623. this.eventObj.curX = 0;
  11624. this.eventObj.curY = 0;
  11625. xGame.common.d2World.d2Gan.setGanLastInfo();
  11626. this.rulerOffset = 0;
  11627. break;
  11628. default:
  11629. break;
  11630. }
  11631. }
  11632. onEventMove(e) {
  11633. if (e.stopPropagation)
  11634. e.stopPropagation();
  11635. if (e && e.force) {
  11636. }
  11637. else {
  11638. if (!this.isTurnSelf())
  11639. return;
  11640. }
  11641. switch (this.pressTarget) {
  11642. case PressType.powerNode:
  11643. this.barInfo.curY = e.stageY;
  11644. this.updateBarInfo();
  11645. this.isMoveRod = true;
  11646. break;
  11647. case PressType.moveNode:
  11648. let rootBall = xGame.common.d2World.rootBall;
  11649. let radius = rootBall.gameObj.width / 2;
  11650. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11651. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11652. let border = xGame.common.d2World.borderRect;
  11653. if (curX <= border.x + radius)
  11654. curX = border.x + radius;
  11655. else if (curX >= border.x + border.width - radius)
  11656. curX = border.x + border.width - radius;
  11657. if (curY <= border.y + radius)
  11658. curY = border.y + radius;
  11659. else if (curY >= border.y + border.height - radius)
  11660. curY = border.y + border.height - radius;
  11661. if (xGame.common.gameMgr.isOpenBall) {
  11662. if (curX >= border.x + border.openBallW - radius)
  11663. curX = border.x + border.openBallW - radius;
  11664. }
  11665. this.ui.moveNode.x = curX;
  11666. this.ui.moveNode.y = curY;
  11667. rootBall.gameObj.x = curX;
  11668. rootBall.gameObj.y = curY;
  11669. rootBall.d3BallSrc.setTransPos(curX, curY);
  11670. this.isMoveRod = true;
  11671. break;
  11672. case PressType.rulerNode:
  11673. let yy = e.stageY - this.eventObj.lastY;
  11674. this.eventObj.lastY = e.stageY;
  11675. let ruler1 = this.ui.rulerNode.img1;
  11676. let ruler2 = this.ui.rulerNode.img2;
  11677. ruler1.y += yy;
  11678. ruler2.y += yy;
  11679. this.rulerOffset += yy;
  11680. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11681. this.rulerOffset = 0;
  11682. xGame.soundMgr.playSound("inch", 1, 10);
  11683. }
  11684. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11685. let h = ruler1.height;
  11686. this.checkGuide();
  11687. this.isMoveRod = true;
  11688. if (ruler1.y >= h) {
  11689. ruler1.y = -h;
  11690. ruler2.y = 0;
  11691. return;
  11692. }
  11693. else if (ruler1.y <= -h) {
  11694. ruler1.y = h;
  11695. ruler2.y = 0;
  11696. return;
  11697. }
  11698. if (ruler2.y >= h) {
  11699. ruler2.y = -h;
  11700. ruler1.y = 0;
  11701. return;
  11702. }
  11703. else if (ruler2.y <= -h) {
  11704. ruler2.y = h;
  11705. ruler1.y = 0;
  11706. return;
  11707. }
  11708. break;
  11709. case PressType.d2Root:
  11710. this.eventObj.curX = e.stageX;
  11711. this.eventObj.curY = e.stageY;
  11712. let offset = this.checkRodMoveDir();
  11713. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11714. this.eventObj.lastX = e.stageX;
  11715. this.eventObj.lastY = e.stageY;
  11716. break;
  11717. default:
  11718. break;
  11719. }
  11720. }
  11721. onEventUp(e) {
  11722. if (e.stopPropagation)
  11723. e.stopPropagation();
  11724. if (e && e.force) {
  11725. }
  11726. else {
  11727. if (!this.isTurnSelf())
  11728. return;
  11729. }
  11730. switch (this.pressTarget) {
  11731. case PressType.powerNode:
  11732. this.ui.powerNode.value = 0;
  11733. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11734. this.ui.powerTxt.text = "";
  11735. if (this.powerNum > 0) {
  11736. xGame.eventMgr.event(BALL_SHOOT);
  11737. xGame.common.d2World.shoot(this.powerNum);
  11738. xGame.common.d2World.d2Gan.shoot();
  11739. xGame.common.d2World.d2HelpLine.shoot();
  11740. this.finishGuide();
  11741. this.ui.powerEft.visible = false;
  11742. this.ui.colorNode.visible = false;
  11743. let ganStr = "";
  11744. if (this.powerNum <= 30) {
  11745. ganStr = "gan_30";
  11746. }
  11747. else if (this.powerNum <= 60) {
  11748. ganStr = "gan_50";
  11749. }
  11750. else {
  11751. ganStr = "gan_80";
  11752. }
  11753. xGame.soundMgr.playSound(ganStr);
  11754. }
  11755. break;
  11756. case PressType.moveNode:
  11757. let rootBall = xGame.common.d2World.rootBall;
  11758. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11759. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11760. let isIntersect = this.judgeBallIntersect();
  11761. if (isIntersect) {
  11762. this.ui.moveNode.x = lastX;
  11763. this.ui.moveNode.y = lastY;
  11764. rootBall.gameObj.x = lastX;
  11765. rootBall.gameObj.y = lastY;
  11766. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11767. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11768. }
  11769. else {
  11770. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11771. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11772. }
  11773. this.showBallUI();
  11774. this.ui.moveNode.finger.visible = true;
  11775. xGame.common.d2World.getHelpLine();
  11776. break;
  11777. case PressType.rulerNode:
  11778. break;
  11779. case PressType.d2Root:
  11780. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11781. if (dis <= 25) {
  11782. this.moveToClickDot(e);
  11783. }
  11784. break;
  11785. default:
  11786. break;
  11787. }
  11788. this.pressTarget = -1;
  11789. }
  11790. checkGuide() {
  11791. let guide = DataMgr.getSkillGuide();
  11792. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11793. xGame.common.guideStep++;
  11794. xGame.common.gameUI.ui.guide2.visible = false;
  11795. xGame.common.gameUI.ui.guide3.visible = true;
  11796. }
  11797. }
  11798. finishGuide() {
  11799. let guide = DataMgr.getSkillGuide();
  11800. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11801. xGame.common.guideStep = 10;
  11802. this.closeAllGuide();
  11803. console.log('zh: 新手引导完毕');
  11804. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11805. }
  11806. }
  11807. closeAllGuide() {
  11808. xGame.common.gameUI.ui.guide1.visible = false;
  11809. xGame.common.gameUI.ui.guide2.visible = false;
  11810. xGame.common.gameUI.ui.guide3.visible = false;
  11811. }
  11812. updateBarInfo() {
  11813. let star = this.ui.powerNode.y;
  11814. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11815. if (rate >= 1)
  11816. rate = 1;
  11817. if (rate <= 0)
  11818. rate = 0;
  11819. this.powerNum = Math.ceil(rate * 100);
  11820. this.ui.powerNode.value = this.powerNum;
  11821. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11822. this.ui.colorNode.value = this.powerNum;
  11823. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11824. this.ui.powerEft.visible = this.powerNum != 0;
  11825. this.ui.colorNode.visible = this.powerNum != 0;
  11826. this.ui.powerTxt.text = this.powerNum + "";
  11827. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11828. }
  11829. forceCancel() {
  11830. this.ui.powerNode.value = 0;
  11831. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11832. this.ui.powerTxt.text = "";
  11833. }
  11834. checkRodMoveDir() {
  11835. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11836. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11837. if (tempX >= 0 && tempY <= 0) {
  11838. return this.checkDir();
  11839. }
  11840. else if (tempX < 0 && tempY < 0) {
  11841. return this.checkDir(1, -1);
  11842. }
  11843. else if (tempX < 0 && tempY > 0) {
  11844. return this.checkDir(-1, -1);
  11845. }
  11846. else {
  11847. return this.checkDir(-1, 1);
  11848. }
  11849. }
  11850. checkDir(flagX = 1, flagY = 1) {
  11851. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11852. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11853. if (offsetY == 0) {
  11854. return offsetX * flagX;
  11855. }
  11856. if (offsetX == 0) {
  11857. return offsetY * flagY;
  11858. }
  11859. let angle = offsetY / offsetX;
  11860. if (Math.abs(angle) >= 1) {
  11861. return offsetY * flagY;
  11862. }
  11863. else {
  11864. return offsetX * flagX;
  11865. }
  11866. }
  11867. judgeBallIntersect() {
  11868. let rootBall = xGame.common.d2World.rootBall;
  11869. let ballArr = xGame.common.d2World.ballArr;
  11870. let radius = rootBall.gameObj.width / 2;
  11871. let temp;
  11872. let isIntersect = false;
  11873. for (let index = 0; index < ballArr.length; index++) {
  11874. temp = ballArr[index];
  11875. if (temp.number == rootBall.number)
  11876. continue;
  11877. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11878. if (isIntersect) {
  11879. break;
  11880. }
  11881. }
  11882. return isIntersect;
  11883. }
  11884. hideBallUI() {
  11885. let d2Gan = xGame.common.d2World.d2Gan;
  11886. if (!d2Gan.ui.isDisposed)
  11887. d2Gan.ui.visible = false;
  11888. let d2Help = xGame.common.d2World.d2HelpLine;
  11889. if (!d2Help.ui.isDisposed)
  11890. d2Help.ui.visible = false;
  11891. let rootBall = xGame.common.d2World.rootBall;
  11892. if (!rootBall.destroyed) {
  11893. rootBall.gameObj.active = false;
  11894. }
  11895. }
  11896. showBallUI() {
  11897. let d2Gan = xGame.common.d2World.d2Gan;
  11898. if (!d2Gan.ui.isDisposed)
  11899. d2Gan.ui.visible = true;
  11900. let d2Help = xGame.common.d2World.d2HelpLine;
  11901. if (!d2Help.ui.isDisposed)
  11902. d2Help.ui.visible = true;
  11903. let rootBall = xGame.common.d2World.rootBall;
  11904. if (!rootBall.destroyed) {
  11905. rootBall.gameObj.active = true;
  11906. }
  11907. }
  11908. moveToClickDot(e) {
  11909. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11910. let root = xGame.common.d2World.rootBall.gameObj;
  11911. let xx = e.stageX - xGame.common.sysOffestNum;
  11912. let yy = e.stageY;
  11913. let x = xx - root.x;
  11914. let y = yy - root.y;
  11915. let angle = xGame.common.getfguiRotation(x, y);
  11916. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11917. xGame.common.d2World.getHelpLine();
  11918. }
  11919. this.isMoveRod = false;
  11920. xGame.common.clickedBall = false;
  11921. }
  11922. openAllEvent() {
  11923. this.closeAllEvent();
  11924. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11925. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11926. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11927. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11928. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11929. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11930. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11931. }
  11932. closeAllEvent() {
  11933. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11934. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11935. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11936. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11937. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11938. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11939. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11940. }
  11941. resetGame() {
  11942. this.closeAllEvent();
  11943. this.hideBallUI();
  11944. xGame.common.gameMgr.gamePause = true;
  11945. }
  11946. }
  11947. UIGame.uiName = "UIGame";
  11948. class UIAddProp extends UIBase {
  11949. constructor() {
  11950. super();
  11951. this.curType = "";
  11952. }
  11953. onConstructor() {
  11954. this.ui = ui_UIAddProp.createInstance();
  11955. this.contentPane = this.ui;
  11956. this.isEject = false;
  11957. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11958. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11959. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11960. this.updateUI();
  11961. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11962. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11963. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11964. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11965. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11966. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11967. }
  11968. show(type) {
  11969. super.show();
  11970. this.curType = type == 0 ? "coin" : "diamond";
  11971. this.switchBtn("");
  11972. this.ui.t0.play();
  11973. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11974. PlatMgr.showInsert(true);
  11975. this.setGlobalFont(this.ui);
  11976. }
  11977. closeSelf() {
  11978. this.hide();
  11979. }
  11980. updateUI() {
  11981. let data = cfgTable.moneyData;
  11982. let temp;
  11983. let obj;
  11984. for (const key in data) {
  11985. temp = data[key];
  11986. obj = this.ui.myNode["node" + key];
  11987. if (parseInt(key) <= 2) {
  11988. obj.diamondTxt.text = "+" + temp.num;
  11989. }
  11990. else {
  11991. obj.coinTxt.text = temp.num;
  11992. obj.diamondTxt.text = temp.get.split('_')[1];
  11993. }
  11994. }
  11995. this.updateDiamondShare();
  11996. }
  11997. updateDiamondShare() {
  11998. let data = DataMgr.getShareDiamondTimes();
  11999. if (data >= xGame.common.maxShareDiamondTimes) {
  12000. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  12001. this.ui.myNode.node1.touchable = false;
  12002. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  12003. }
  12004. else {
  12005. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  12006. this.ui.myNode.node1.touchable = true;
  12007. }
  12008. }
  12009. switchBtn(type) {
  12010. if (type == "")
  12011. type = this.curType;
  12012. else {
  12013. if (this.curType == type) {
  12014. return;
  12015. }
  12016. else {
  12017. this.curType = type;
  12018. }
  12019. }
  12020. if (type == "coin") {
  12021. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  12022. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  12023. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  12024. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  12025. this.ui.myNode.c1.selectedIndex = 0;
  12026. }
  12027. else {
  12028. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  12029. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  12030. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  12031. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  12032. this.ui.myNode.c1.selectedIndex = 1;
  12033. }
  12034. }
  12035. convertCoin(index) {
  12036. let data = cfgTable.moneyData[index];
  12037. let coinNum = data.num;
  12038. let str = data.get.split('_')[1];
  12039. let needDiamond = parseInt(str);
  12040. if (DataMgr.diamondEnough(needDiamond)) {
  12041. DataMgr.setDiamond(-needDiamond);
  12042. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  12043. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  12044. }
  12045. else {
  12046. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  12047. this.switchBtn("diamond");
  12048. }
  12049. }
  12050. videoGetDiamond() {
  12051. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  12052. if (Laya.Browser.onAndroid) {
  12053. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12054. if (!boo) {
  12055. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12056. return;
  12057. }
  12058. }
  12059. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  12060. }
  12061. else {
  12062. console.log('zh:AD 失败,直接发放奖励');
  12063. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  12064. }
  12065. }
  12066. qjff_AD_for_uiAddProp_videoGetDiamond() {
  12067. let num = cfgTable.moneyData[2].num;
  12068. xGame.common.playObjFlyAnim(num, Prop.diamond);
  12069. this.closeSelf();
  12070. }
  12071. videoGetCoin() {
  12072. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  12073. if (Laya.Browser.onAndroid) {
  12074. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12075. if (!boo) {
  12076. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12077. return;
  12078. }
  12079. }
  12080. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  12081. }
  12082. else {
  12083. console.log('zh:AD 失败,直接发放奖励');
  12084. this.qjff_AD_for_uiAddProp_videoGetCoin();
  12085. }
  12086. }
  12087. qjff_AD_for_uiAddProp_videoGetCoin() {
  12088. xGame.common.playObjFlyAnim(2000, Prop.coin);
  12089. this.closeSelf();
  12090. }
  12091. shareGetDiamond() {
  12092. let times = DataMgr.getShareDiamondTimes();
  12093. if (times >= xGame.common.maxShareDiamondTimes) {
  12094. console.log('zh: 233333333333 maxShareDiamondTimes');
  12095. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  12096. }
  12097. else {
  12098. console.log('zh:33333333333333ad');
  12099. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  12100. if (Laya.Browser.onAndroid) {
  12101. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12102. if (!boo) {
  12103. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12104. return;
  12105. }
  12106. }
  12107. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  12108. }
  12109. else {
  12110. console.log('zh:AD 失败,直接发放奖励');
  12111. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  12112. }
  12113. }
  12114. }
  12115. qjff_AD_for_uiAddProp_shareGetDiamond() {
  12116. let diamond = xGame.common.randomNum(50, 100);
  12117. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  12118. DataMgr.setShareDiamondTimes(1);
  12119. this.updateDiamondShare();
  12120. }
  12121. openPutBallView() {
  12122. let end = xGame.uiMgr.getUI(UIGameEnd);
  12123. let skill = xGame.uiMgr.getUI(UISkill);
  12124. let level = xGame.uiMgr.getUI(UILevelDisplay);
  12125. let uigame = xGame.uiMgr.getUI(UIGame);
  12126. if (end && !end.isHide) {
  12127. xGame.uiMgr.Hide(UIGameEnd);
  12128. xGame.uiMgr.Show(UIMain);
  12129. }
  12130. if (skill && !skill.isHide)
  12131. xGame.uiMgr.Hide(UISkill);
  12132. if (uigame && !uigame.isHide)
  12133. xGame.uiMgr.Hide(UIGame);
  12134. if (level && !level.isHide) {
  12135. }
  12136. else {
  12137. xGame.uiMgr.Show(UILevelDisplay);
  12138. }
  12139. this.closeSelf();
  12140. }
  12141. }
  12142. UIAddProp.uiName = "UIAddProp";
  12143. class MoneyNode {
  12144. constructor(ui) {
  12145. this.leftTime = 0;
  12146. this.ui = ui;
  12147. this.ui.addCoinBtn.onClick(this, this.addCoin);
  12148. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  12149. this.ui.addPowerBtn.onClick(this, this.addPower);
  12150. this.ui.c1.selectedIndex = 1;
  12151. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  12152. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  12153. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  12154. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  12155. this.coinChange();
  12156. this.diamondChange();
  12157. this.powerChange();
  12158. }
  12159. addPower() {
  12160. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12161. xGame.uiMgr.Show(UIPower);
  12162. }
  12163. powerChange() {
  12164. let powerNum = DataMgr.getPower();
  12165. this.ui.powerTxt.text = powerNum + "";
  12166. }
  12167. checkPowerTime() {
  12168. let cur = new Date().getTime();
  12169. let last = DataMgr.getPowerTime();
  12170. if (last == 0) {
  12171. last = cur;
  12172. DataMgr.setPowerTime(cur);
  12173. }
  12174. let power = DataMgr.getPower();
  12175. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  12176. Laya.timer.clearAll(this);
  12177. if (power >= xGame.common.natureMaxPower) {
  12178. this.ui.powerTimeTxt.text = "";
  12179. DataMgr.setPowerTime(cur);
  12180. return;
  12181. }
  12182. if (power + offset >= xGame.common.natureMaxPower) {
  12183. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12184. this.ui.powerTimeTxt.text = "";
  12185. DataMgr.setPowerTime(cur);
  12186. }
  12187. else {
  12188. if (offset > 0) {
  12189. DataMgr.setPower(offset);
  12190. DataMgr.setPowerTime(cur);
  12191. }
  12192. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12193. this.leftTime = xGame.common.powerRecoverNum - time;
  12194. if (this.leftTime <= 0)
  12195. this.leftTime = 0;
  12196. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12197. Laya.timer.loop(1000, this, this.updatePowerTime);
  12198. }
  12199. }
  12200. updatePowerTime() {
  12201. this.leftTime -= 1;
  12202. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12203. if (this.leftTime <= 0) {
  12204. this.checkPowerTime();
  12205. }
  12206. }
  12207. coinChange() {
  12208. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12209. }
  12210. diamondChange() {
  12211. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12212. }
  12213. addCoin() {
  12214. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12215. Moyu.sendDataEvent("AddCoinBtn");
  12216. xGame.uiMgr.Show(UIAddProp, 0);
  12217. }
  12218. addDiamond() {
  12219. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12220. Moyu.sendDataEvent("AddDiamondBtn");
  12221. xGame.uiMgr.Show(UIAddProp, 1);
  12222. }
  12223. }
  12224. class UIDraw extends UIBase {
  12225. constructor() {
  12226. super();
  12227. this.curKey = 0;
  12228. }
  12229. onConstructor() {
  12230. this.ui = ui_UIDraw.createInstance();
  12231. this.contentPane = this.ui;
  12232. this.isEject = false;
  12233. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12234. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12235. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12236. this.initDraw();
  12237. this.initUI();
  12238. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12239. }
  12240. show() {
  12241. super.show();
  12242. this.ui.t0.play();
  12243. this.playSecretaryIdle();
  12244. this.updateDraw();
  12245. this.checkFree();
  12246. if (PlatMgr.bannerDelay > 0) {
  12247. this.ui.closeNode.closeBtn.visible = false;
  12248. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12249. this.ui.closeNode.closeBtn.visible = true;
  12250. });
  12251. }
  12252. PlatMgr.showRateBanner();
  12253. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12254. this.setGlobalFont(this.ui);
  12255. }
  12256. hide() {
  12257. Laya.timer.clearAll(this);
  12258. super.hide();
  12259. }
  12260. checkFree() {
  12261. let isFree = DataMgr.getDailyfreeDrawTimes();
  12262. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12263. }
  12264. initDraw() {
  12265. this.drawObj = [];
  12266. let data = cfgTable.drawData;
  12267. let temp;
  12268. let weight = 0;
  12269. for (const key in data) {
  12270. temp = data[key];
  12271. weight += temp.weight;
  12272. this.drawObj.push(weight);
  12273. }
  12274. this.allWeight = weight;
  12275. }
  12276. initUI() {
  12277. let data = cfgTable.drawData;
  12278. let temp;
  12279. let img;
  12280. let txt;
  12281. for (const key in data) {
  12282. temp = data[key];
  12283. img = this.ui.myNode.rotNode["img" + key];
  12284. txt = this.ui.myNode.rotNode["txt" + key];
  12285. img.url = xGame.common.getGameIconUrl(temp.icon);
  12286. txt.visible = true;
  12287. if (temp.award > 2) {
  12288. img.rotation = 0;
  12289. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12290. }
  12291. else {
  12292. img.rotation = temp.rotation;
  12293. txt.text = temp.num;
  12294. }
  12295. }
  12296. }
  12297. getCurkey() {
  12298. let rand = Math.random() * this.allWeight;
  12299. let temp;
  12300. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12301. temp = this.drawObj[index];
  12302. if (index == 0) {
  12303. if (rand < temp) {
  12304. return index + 1;
  12305. }
  12306. }
  12307. else {
  12308. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12309. return index + 1;
  12310. }
  12311. }
  12312. }
  12313. return 2;
  12314. }
  12315. startDraw() {
  12316. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12317. if (freeTimes > 0) {
  12318. this.beginDraw();
  12319. DataMgr.setDailyfreeDrawTimes(0);
  12320. this.checkFree();
  12321. }
  12322. else {
  12323. if (Laya.Browser.onAndroid) {
  12324. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12325. if (!boo) {
  12326. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12327. return;
  12328. }
  12329. }
  12330. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12331. }
  12332. else {
  12333. console.log('zh:AD 失败,直接发放奖励');
  12334. this.qjff_chouJiang();
  12335. }
  12336. }
  12337. }
  12338. qjff_chouJiang() {
  12339. this.beginDraw();
  12340. }
  12341. beginDraw() {
  12342. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12343. this.ui.drawBtn.touchable = false;
  12344. this.curKey = this.getCurkey();
  12345. console.log("当前key", this.curKey);
  12346. let cell = 60;
  12347. let lap = 3;
  12348. let angle = cell * (this.curKey - 1) + lap * 360;
  12349. let target = this.ui.myNode.rotNode;
  12350. target.rotation = 0;
  12351. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12352. console.log("旋转完成");
  12353. this.ui.drawBtn.touchable = true;
  12354. this.getAward();
  12355. }));
  12356. }
  12357. getAward() {
  12358. let data = cfgTable.drawData[this.curKey];
  12359. let temp = new AwardType();
  12360. temp.type = data.award;
  12361. temp.num = data.num;
  12362. xGame.common.getAward([temp], () => {
  12363. DataMgr.setDrawTimes(1);
  12364. this.updateDraw();
  12365. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12366. });
  12367. }
  12368. updateDraw() {
  12369. let drawTimes = DataMgr.getDrawTimes();
  12370. let awardTimes = DataMgr.getDrawAwardTimes();
  12371. if (Math.floor(drawTimes / 3) > awardTimes) {
  12372. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12373. this.ui.extraNode.boxBtn.touchable = true;
  12374. this.ui.extraNode.tipsTxt.text = "3/3";
  12375. this.ui.extraNode.barNode.width = 265;
  12376. this.getExtraAward();
  12377. }
  12378. else {
  12379. this.ui.extraNode.boxBtn.t0.stop();
  12380. this.ui.extraNode.boxBtn.touchable = false;
  12381. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12382. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12383. }
  12384. let data = cfgTable.drawData[1];
  12385. if (awardTimes == 0) {
  12386. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12387. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12388. this.ui.myNode.rotNode.img1.rotation = 0;
  12389. }
  12390. else {
  12391. let award = data.nextid;
  12392. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12393. this.ui.myNode.rotNode.txt1.text = award[1];
  12394. this.ui.myNode.rotNode.img1.rotation = 0;
  12395. }
  12396. }
  12397. getExtraAward() {
  12398. let drawTimes = DataMgr.getDrawTimes();
  12399. let awardTimes = DataMgr.getDrawAwardTimes();
  12400. let data = cfgTable.drawData[1];
  12401. let award = new AwardType();
  12402. if (awardTimes == 0) {
  12403. award.num = data.num;
  12404. award.type = data.award;
  12405. xGame.common.getAward([award], () => {
  12406. let all = Math.floor(drawTimes / 3);
  12407. DataMgr.setDrawAwardTimes(all);
  12408. this.updateDraw();
  12409. });
  12410. }
  12411. else {
  12412. award.num = parseInt(data.nextid[1]);
  12413. award.type = parseInt(data.nextid[0]);
  12414. xGame.common.getAward([award], () => {
  12415. let all = Math.floor(drawTimes / 3);
  12416. DataMgr.setDrawAwardTimes(all);
  12417. this.updateDraw();
  12418. });
  12419. }
  12420. }
  12421. closeSelf() {
  12422. this.hide();
  12423. }
  12424. playSecretaryIdle() {
  12425. let parent = this.ui.secretary.displayObject;
  12426. parent.destroyChildren();
  12427. let xx = this.ui.secretary.width / 2;
  12428. let yy = this.ui.secretary.height;
  12429. let scale = xGame.common.getSecretaryScale();
  12430. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12431. xGame.common.secretary.play(data, 0, true, parent);
  12432. }
  12433. }
  12434. UIDraw.uiName = "UIDraw";
  12435. class ui_UIFlyEft extends fgui.GComponent {
  12436. static createInstance() {
  12437. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12438. }
  12439. onConstruct() {
  12440. this.n0 = (this.getChild("n0"));
  12441. this.n1 = (this.getChild("n1"));
  12442. this.n2 = (this.getChild("n2"));
  12443. this.n3 = (this.getChild("n3"));
  12444. this.n4 = (this.getChild("n4"));
  12445. this.n5 = (this.getChild("n5"));
  12446. this.n6 = (this.getChild("n6"));
  12447. this.n7 = (this.getChild("n7"));
  12448. this.iconNode = (this.getChild("iconNode"));
  12449. this.txt = (this.getChild("txt"));
  12450. this.txtNode = (this.getChild("txtNode"));
  12451. }
  12452. }
  12453. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12454. class UIFlyEft extends UIBase {
  12455. constructor() {
  12456. super();
  12457. this.max = 8;
  12458. this.delay = 0;
  12459. }
  12460. onConstructor() {
  12461. this.ui = ui_UIFlyEft.createInstance();
  12462. this.contentPane = this.ui;
  12463. this.isEject = false;
  12464. this.isMuti = true;
  12465. this.ui.x += xGame.common.sysOffestNum;
  12466. }
  12467. getArrPos() {
  12468. if (this.iconPos && this.iconPos.length > 0)
  12469. return;
  12470. this.iconPos = [];
  12471. let temp;
  12472. for (let index = 0; index < this.max; index++) {
  12473. temp = this.ui["n" + index];
  12474. this.iconPos.push([temp.x, temp.y]);
  12475. }
  12476. }
  12477. show(stPos, edPos, num, type, callback) {
  12478. super.show();
  12479. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12480. this.getArrPos();
  12481. this.updateUI(type);
  12482. this.updatePos();
  12483. this.runFly(edPos, callback);
  12484. this.runWorlds(stPos, num);
  12485. this.setGlobalFont(this.ui);
  12486. }
  12487. updateUI(type) {
  12488. let temp;
  12489. let str;
  12490. for (let index = 0; index < this.max; index++) {
  12491. temp = this.ui["n" + index];
  12492. str = this.getIconStr(type);
  12493. temp.url = xGame.common.getGameIconUrl(str);
  12494. }
  12495. }
  12496. getIconStr(type) {
  12497. switch (type) {
  12498. case Prop.diamond:
  12499. return "ty_zs";
  12500. case Prop.coin:
  12501. return "ty_jb";
  12502. default:
  12503. break;
  12504. }
  12505. }
  12506. updatePos() {
  12507. let temp;
  12508. for (let index = 0; index < this.max; index++) {
  12509. temp = this.ui["n" + index];
  12510. temp.x = this.iconPos[index][0];
  12511. temp.y = this.iconPos[index][1];
  12512. }
  12513. }
  12514. runFly(endPos, callback) {
  12515. let all = 0;
  12516. let temp;
  12517. for (let index = 0; index < this.max; index++) {
  12518. temp = this.ui["n" + index];
  12519. temp.visible = true;
  12520. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12521. temp.visible = false;
  12522. all++;
  12523. if (all >= this.max) {
  12524. callback && callback();
  12525. }
  12526. }), 20 * index);
  12527. }
  12528. }
  12529. runWorlds(stPos, num) {
  12530. let str = "+" + num;
  12531. this.ui.txt.text = str;
  12532. let starX = stPos.x;
  12533. let starY = stPos.y + 50;
  12534. this.ui.txt.x = starX;
  12535. this.ui.txt.y = starY;
  12536. this.ui.txt.visible = true;
  12537. this.ui.txt.alpha = 1;
  12538. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12539. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12540. this.ui.txt.visible = false;
  12541. this.hide();
  12542. }));
  12543. }));
  12544. }
  12545. }
  12546. UIFlyEft.uiName = "UIFlyEft";
  12547. class Common {
  12548. constructor() {
  12549. this.convertNum = 0.025;
  12550. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12551. this.scaleV3One = new Laya.Vector3();
  12552. this.scaleV3Two = new Laya.Vector3();
  12553. this.posV4 = new Laya.Vector4();
  12554. this.showDebug = false;
  12555. this.openGuide = true;
  12556. this.rodOffest = new Laya.Vector2(0, 0);
  12557. this.rodAngle = 0;
  12558. this.gameMode = GameMode.classic;
  12559. this.bigMoveLevelIndex = 1;
  12560. this.bigMoveNeedCoin = 1000;
  12561. this.classicNiceNeddCoin = 1000;
  12562. this.passAwardCoin = 2000;
  12563. this.classicRoomType = 1;
  12564. this.maxPower = 20;
  12565. this.natureMaxPower = 5;
  12566. this.videoPower = 2;
  12567. this.powerRecoverNum = 900;
  12568. this.curPlayerSkillType = 0;
  12569. this.isNewDay = false;
  12570. this.clickedBall = false;
  12571. this.placeBallCurLevel = 0;
  12572. this.placeBallStarNum = 0;
  12573. this.longHelpLine = false;
  12574. this.maxShareDiamondTimes = 3;
  12575. this.guideStep = 0;
  12576. this.temSelfLevel = 0;
  12577. this.extraMoveNum = 0;
  12578. this.curRankID = 0;
  12579. this.rankID = {
  12580. normalStar: 12000,
  12581. wxStar: 12001
  12582. };
  12583. this.skillNameList = ["Skyfall Shot", "Surging Break", "Frost Lock"];
  12584. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12585. this.btnClickStr = "buttonclick";
  12586. this.maxSkillLevel = 10;
  12587. this.upSkillLevel = false;
  12588. this.gameStartTime = 0;
  12589. this._sysOffestNum = 0;
  12590. this.angleV2 = new Laya.Vector2();
  12591. this.rootV = new Laya.Vector2(0, 1);
  12592. this.tempDir1 = new Laya.Vector2();
  12593. this.tempDir2 = new Laya.Vector2();
  12594. this.ballSize = 33;
  12595. this.stPos = new Laya.Point();
  12596. this.edPos = new Laya.Point();
  12597. Common._instance = this;
  12598. window["common"] = this;
  12599. }
  12600. static getInstance() {
  12601. if (!this._instance) {
  12602. this._instance = new Common();
  12603. }
  12604. return this._instance;
  12605. }
  12606. get sysOffestNum() {
  12607. if (this._sysOffestNum == 0) {
  12608. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12609. }
  12610. return this._sysOffestNum;
  12611. }
  12612. testShader() {
  12613. let test = new LightShader();
  12614. test.texture = "res/d3Res/ballTexture/ball1.png";
  12615. Laya.stage.addChild(test);
  12616. }
  12617. playScale(node) {
  12618. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12619. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12620. }));
  12621. }));
  12622. }
  12623. setGroup(colli, ...group) {
  12624. let out = 0;
  12625. for (let index = 0; index < group.length; index++) {
  12626. if (index == 0) {
  12627. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12628. }
  12629. else {
  12630. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12631. }
  12632. }
  12633. colli.collisionGroup = out;
  12634. }
  12635. setCanGroupWith(colli, ...group) {
  12636. let out = 0;
  12637. for (let index = 0; index < group.length; index++) {
  12638. if (index == 0) {
  12639. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12640. }
  12641. else {
  12642. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12643. }
  12644. }
  12645. colli.canCollideWith = out;
  12646. }
  12647. loadPrefab(name, callback) {
  12648. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12649. let prefab = new Laya.Prefab();
  12650. prefab.json = obj;
  12651. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12652. callback && callback(img);
  12653. }));
  12654. }
  12655. pos2to3Convert(x, y, d3Pos) {
  12656. x = x + this.sysOffestNum;
  12657. d3Pos.setValue(x, y, 0);
  12658. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12659. if (success) {
  12660. }
  12661. else {
  12662. console.error("转换出错了。。。。。。。。");
  12663. }
  12664. }
  12665. scale2to3Convert(num) {
  12666. this.scaleV3One.setValue(0, 0, 0);
  12667. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12668. this.scaleV3Two.setValue(0, num, 0);
  12669. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12670. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12671. return outNum;
  12672. }
  12673. pos3to2Convert(d3Pos) {
  12674. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12675. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12676. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12677. d3Pos.x -= this.sysOffestNum;
  12678. }
  12679. scale3to2Convert(num) {
  12680. let scale = this.scale2to3Convert(1);
  12681. let d2Out = num / scale;
  12682. return d2Out;
  12683. }
  12684. getCollider(type, restitution = 0.9, density = 10) {
  12685. let colli;
  12686. if (type == "box")
  12687. colli = new Laya.BoxCollider();
  12688. else
  12689. colli = new Laya.CircleCollider();
  12690. colli.friction = 0;
  12691. colli.restitution = restitution;
  12692. colli.density = density;
  12693. return colli;
  12694. }
  12695. getRigbody() {
  12696. let rigy = new Laya.RigidBody();
  12697. rigy.bullet = true;
  12698. rigy.allowRotation = false;
  12699. rigy.allowSleep = false;
  12700. rigy.gravityScale = 0;
  12701. return rigy;
  12702. }
  12703. getfguiRotation(x, y) {
  12704. this.angleV2.setValue(x, y);
  12705. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12706. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12707. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12708. angle = -angle;
  12709. }
  12710. return 180 + angle;
  12711. }
  12712. getAngle(x, y) {
  12713. this.angleV2.setValue(x, y);
  12714. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12715. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12716. return angle;
  12717. }
  12718. randomNum(a, b) {
  12719. return a + Math.floor((b - a + 1) * Math.random());
  12720. }
  12721. getRandArrEle(arr) {
  12722. return arr[Math.floor(arr.length * Math.random())];
  12723. }
  12724. getSign(val) {
  12725. return val >= 0 ? 1 : -1;
  12726. }
  12727. botherArr(arr) {
  12728. let times = arr.length + 2;
  12729. let length = arr.length;
  12730. let a;
  12731. let b;
  12732. let temp;
  12733. for (let index = 0; index < times; index++) {
  12734. a = Math.floor(Math.random() * length);
  12735. b = Math.floor(Math.random() * length);
  12736. temp = arr[a];
  12737. arr[a] = arr[b];
  12738. arr[b] = temp;
  12739. }
  12740. }
  12741. getGameIconUrl(id) {
  12742. return "ui://game/" + id;
  12743. }
  12744. getComponentUrl(id) {
  12745. return "ui://game/" + id;
  12746. }
  12747. getAnimation() {
  12748. }
  12749. judgeSkillType(type = SkillType.highSpace) {
  12750. if (this.gameMode == GameMode.classic)
  12751. return;
  12752. let gameMgr = this.gameMgr;
  12753. if (gameMgr.selfTurn) {
  12754. if (gameMgr.selfCurSkill == type) {
  12755. return true;
  12756. }
  12757. }
  12758. else {
  12759. if (gameMgr.aiCurSkill == type) {
  12760. return true;
  12761. }
  12762. }
  12763. }
  12764. ballColliHole(collider) {
  12765. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12766. xGame.common.gameMgr.isFirstInGame = false;
  12767. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12768. }
  12769. collider.owner.mySrc.checkWrongBall();
  12770. }
  12771. getArrMaxEle(arr) {
  12772. let max = -Infinity;
  12773. for (let index = 0; index < arr.length; index++) {
  12774. max = Math.max(arr[index], max);
  12775. }
  12776. return max;
  12777. }
  12778. getArrMinEle(arr) {
  12779. let min = Infinity;
  12780. for (let index = 0; index < arr.length; index++) {
  12781. min = Math.min(arr[index], min);
  12782. }
  12783. return min;
  12784. }
  12785. playRandomMutiBallBigSkillSound() {
  12786. if (Math.random() <= 0.5)
  12787. return;
  12788. let rand = this.randomNum(1, 6);
  12789. let str = "ganfa0" + rand;
  12790. xGame.soundMgr.playSound(str);
  12791. }
  12792. showOneCamera(type) {
  12793. let object = xGame.common.d3World.cameraObj;
  12794. for (const key in object) {
  12795. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12796. object[key].init();
  12797. object[key].owner.active = key == type;
  12798. }
  12799. }
  12800. }
  12801. checkBallOverBorder(x, y) {
  12802. let radius = 17;
  12803. let condition = this._checkBorder(x + radius, y) ||
  12804. this._checkBorder(x - radius, y) ||
  12805. this._checkBorder(x, y + radius) ||
  12806. this._checkBorder(x, y - radius);
  12807. if (condition) {
  12808. return true;
  12809. }
  12810. }
  12811. _checkBorder(x, y) {
  12812. let borderRect = this.d2World.borderRect;
  12813. let xOffest = 20;
  12814. let yOffest = 20;
  12815. if (y <= borderRect.y - yOffest) {
  12816. return true;
  12817. }
  12818. if (y >= borderRect.y + borderRect.height + yOffest) {
  12819. return true;
  12820. }
  12821. if (x <= borderRect.x - xOffest) {
  12822. return true;
  12823. }
  12824. if (x >= borderRect.x + borderRect.width + xOffest) {
  12825. return true;
  12826. }
  12827. }
  12828. initWeight(cfg) {
  12829. let allCfgData = { data: {}, allWeightNum: 0 };
  12830. let weightCfg = allCfgData.data;
  12831. let weight = 0;
  12832. for (const key in cfg) {
  12833. weightCfg[key] = {};
  12834. weightCfg[key].id = cfg[key].id;
  12835. weightCfg[key].minWeight = weight;
  12836. weight += cfg[key].weight;
  12837. weightCfg[key].maxWeight = weight;
  12838. }
  12839. allCfgData.allWeightNum = weight;
  12840. return allCfgData;
  12841. }
  12842. getRandomWeightData(cfg) {
  12843. let weightCfg = cfg.data;
  12844. let allWeightNum = cfg.allWeightNum;
  12845. let rand = Math.floor(Math.random() * allWeightNum);
  12846. for (const key in weightCfg) {
  12847. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12848. return weightCfg[key];
  12849. }
  12850. }
  12851. return weightCfg[1];
  12852. }
  12853. showGirlTalkPop(wordsIndex, node, msgNode) {
  12854. node.visible = true;
  12855. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12856. node.t0.play(Laya.Handler.create(this, () => {
  12857. node.visible = false;
  12858. }));
  12859. }
  12860. stopGirlPop(node) {
  12861. node.t0.stop();
  12862. node.visible = false;
  12863. }
  12864. createHead(loader, url, size = 107) {
  12865. if (Laya.Browser.name == "Browser") {
  12866. loader.url = url;
  12867. return;
  12868. }
  12869. else {
  12870. console.log('zh:url=', url);
  12871. loader.url = url;
  12872. }
  12873. }
  12874. addTestCoin(num) {
  12875. DataMgr.setCoin(num);
  12876. }
  12877. addTestDiamond(num) {
  12878. DataMgr.setDiamond(num);
  12879. }
  12880. addTestSkill() {
  12881. DataMgr.setBigSkill(0, 99);
  12882. DataMgr.setBigSkill(1, 99);
  12883. DataMgr.setBigSkill(2, 99);
  12884. }
  12885. playClassicEmotion(number, x, y) {
  12886. if (this.gameMode == GameMode.bigMove)
  12887. return;
  12888. let randIndex = this.randomNum(0, 2);
  12889. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12890. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12891. if (this.gameMgr.selfTurn) {
  12892. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12893. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12894. }
  12895. else {
  12896. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12897. }
  12898. else {
  12899. if (number == this.gameMgr.blackNum) {
  12900. if (this.gameMgr.selfBallArr.length == 0) {
  12901. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12902. }
  12903. else {
  12904. }
  12905. }
  12906. else {
  12907. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12908. }
  12909. }
  12910. }
  12911. }
  12912. else {
  12913. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12914. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12915. }
  12916. else {
  12917. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12918. }
  12919. else {
  12920. if (number == this.gameMgr.blackNum) {
  12921. if (this.gameMgr.aiBallArr.length == 0) {
  12922. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12923. }
  12924. else {
  12925. }
  12926. }
  12927. else {
  12928. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12929. }
  12930. }
  12931. }
  12932. }
  12933. }
  12934. playHappySound(number) {
  12935. if (this.gameMode != GameMode.classic)
  12936. return;
  12937. if (number == 8)
  12938. return;
  12939. let play = false;
  12940. if (this.gameMgr.selfTurn) {
  12941. if (this.gameMgr.ensureBallType) {
  12942. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12943. play = true;
  12944. }
  12945. }
  12946. else {
  12947. play = true;
  12948. }
  12949. }
  12950. else {
  12951. if (this.gameMgr.ensureBallType) {
  12952. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12953. play = true;
  12954. }
  12955. }
  12956. else {
  12957. play = true;
  12958. }
  12959. }
  12960. if (play)
  12961. xGame.soundMgr.playSound("applause");
  12962. }
  12963. destroyClassicEmotion() {
  12964. if (this.gameMode == GameMode.bigMove)
  12965. return;
  12966. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12967. parent.destroyChildren();
  12968. }
  12969. playAwardSpine(x, y) {
  12970. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12971. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12972. this.awardSpine.play(data, 0, false, parent);
  12973. }
  12974. destroyAwardSpine() {
  12975. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12976. parent.destroyChildren();
  12977. }
  12978. isBlock(bx, by, hx, hy, except = null) {
  12979. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12980. let balls = xGame.common.d2World.ballArr;
  12981. let outArr = [];
  12982. for (let index = 0; index < balls.length; index++) {
  12983. let obj = balls[index];
  12984. if (obj.number == 0)
  12985. continue;
  12986. if (obj == except)
  12987. continue;
  12988. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12989. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12990. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12991. if (num >= 1)
  12992. num = 1;
  12993. if (num < 0)
  12994. continue;
  12995. let gap = Math.sin(Math.acos(num)) * dis;
  12996. if (gap < this.ballSize) {
  12997. outArr.push({
  12998. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12999. disHon: Math.cos(Math.acos(num)) * dis,
  13000. disVer: Math.sin(Math.acos(num)) * dis,
  13001. src: balls[index],
  13002. dir: this.tempDir1
  13003. });
  13004. }
  13005. }
  13006. if (outArr.length > 0) {
  13007. outArr.sort((a, b) => { return a.dis - b.dis; });
  13008. return outArr[0];
  13009. }
  13010. }
  13011. AngleBetween(vector1, vector2) {
  13012. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  13013. return rad * (180 / Math.PI);
  13014. }
  13015. getSecretaryScale() {
  13016. if (this.secretary.spineName == "mishu") {
  13017. return 1.28;
  13018. }
  13019. else {
  13020. return 1.024;
  13021. }
  13022. }
  13023. signAwardContainsRod(arr) {
  13024. let temp;
  13025. for (let index = 0; index < arr.length; index++) {
  13026. temp = arr[index].split('-')[0];
  13027. if (parseInt(temp) > 2) {
  13028. return true;
  13029. }
  13030. }
  13031. }
  13032. judgeSameDay() {
  13033. let lastTime = DataMgr.getSignTime();
  13034. let curTime = new Date().getTime();
  13035. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  13036. return true;
  13037. }
  13038. return false;
  13039. }
  13040. getAward(arr, callback) {
  13041. let showTriple = arr[0].type <= 2;
  13042. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  13043. let temp;
  13044. for (let index = 0; index < arr.length; index++) {
  13045. temp = arr[index];
  13046. switch (temp.type) {
  13047. case 1:
  13048. this.playObjFlyAnim(temp.num, temp.type);
  13049. break;
  13050. case 2:
  13051. this.playObjFlyAnim(temp.num, temp.type);
  13052. break;
  13053. case 3:
  13054. case 4:
  13055. case 5:
  13056. case 6:
  13057. DataMgr.setBallRod(temp.type - 2, 1);
  13058. DataMgr.setCurBallRod(temp.type - 2);
  13059. break;
  13060. default:
  13061. break;
  13062. }
  13063. }
  13064. callback && callback(watchVideo);
  13065. });
  13066. }
  13067. getMoneyNode() {
  13068. let moneyNode;
  13069. let sign = xGame.uiMgr.getUI(UISign);
  13070. let draw = xGame.uiMgr.getUI(UIDraw);
  13071. let end = xGame.uiMgr.getUI(UIGameEnd);
  13072. let skill = xGame.uiMgr.getUI(UISkill);
  13073. if (sign && !sign.isHide)
  13074. moneyNode = sign.ui.moneyNode;
  13075. if (draw && !draw.isHide)
  13076. moneyNode = draw.ui.moneyNode;
  13077. if (end && !end.isHide)
  13078. moneyNode = end.ui.moneyNode;
  13079. if (skill && !skill.isHide)
  13080. moneyNode = skill.ui.moneyNode;
  13081. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  13082. let main = xGame.uiMgr.getUI(UIMain);
  13083. if (condition1 && main && !main.isHide) {
  13084. moneyNode = main.ui.moneyNode;
  13085. }
  13086. return moneyNode;
  13087. }
  13088. playObjFlyAnim(num, type, callback = null) {
  13089. this.stPos.x = Laya.stage.width / 2;
  13090. this.stPos.y = Laya.stage.height / 2;
  13091. let moneyNode = this.getMoneyNode();
  13092. switch (type) {
  13093. case Prop.diamond:
  13094. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  13095. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  13096. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  13097. this.edPos.x /= 2;
  13098. this.edPos.y /= 2;
  13099. break;
  13100. case Prop.coin:
  13101. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  13102. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  13103. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  13104. this.edPos.x /= 2;
  13105. this.edPos.y /= 2;
  13106. break;
  13107. default:
  13108. break;
  13109. }
  13110. xGame.soundMgr.playSound("coinbag");
  13111. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  13112. switch (type) {
  13113. case Prop.diamond:
  13114. DataMgr.setDiamond(num);
  13115. break;
  13116. case Prop.coin:
  13117. DataMgr.setCoin(num);
  13118. break;
  13119. default:
  13120. break;
  13121. }
  13122. callback && callback();
  13123. });
  13124. }
  13125. autoPopUIView() {
  13126. let arr = [];
  13127. let sign = this.judgeSameDay() ? false : true;
  13128. if (sign)
  13129. arr.push("sign");
  13130. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  13131. if (draw)
  13132. arr.push("draw");
  13133. if (arr.length <= 0)
  13134. return;
  13135. let str = this.getRandArrEle(arr);
  13136. switch (str) {
  13137. case "sign":
  13138. xGame.uiMgr.Show(UISign);
  13139. break;
  13140. case "draw":
  13141. xGame.uiMgr.Show(UIDraw);
  13142. break;
  13143. default:
  13144. break;
  13145. }
  13146. }
  13147. getMSTime(time) {
  13148. let min = Math.floor(time / 60);
  13149. let sec = Math.floor((time - min * 60));
  13150. if (sec < 10)
  13151. sec = "0" + sec;
  13152. if (min < 10)
  13153. min = "0" + min;
  13154. return `${min}:${sec}`;
  13155. }
  13156. testPower() {
  13157. DataMgr.setPower(0, false);
  13158. }
  13159. getAllStarNum() {
  13160. let data = DataMgr.getPlaceBallLevelList();
  13161. let out = 0;
  13162. for (let index = 0; index < data.length; index++) {
  13163. out += data[index].star;
  13164. }
  13165. return out;
  13166. }
  13167. recoverCameraView() {
  13168. Laya.timer.once(900, this, () => {
  13169. xGame.common.showOneCamera("mainCamera");
  13170. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  13171. xGame.common.gameUI.ui.d2Node.alpha = 1;
  13172. xGame.common.gameUI.ui.border.alpha = 0;
  13173. if (Laya.physicsTimer.scale < 1) {
  13174. Laya.physicsTimer.scale = 1;
  13175. }
  13176. }
  13177. });
  13178. }
  13179. getClassicLevel() {
  13180. let successTimes = DataMgr.getClassicTimes();
  13181. let needKey = "";
  13182. let lastKey = "";
  13183. let cfg = cfgTable.classictimesData;
  13184. let data;
  13185. for (const key in cfg) {
  13186. data = cfg[key];
  13187. if (successTimes <= data.times) {
  13188. needKey = key;
  13189. }
  13190. lastKey = key;
  13191. }
  13192. if (needKey == "")
  13193. needKey = lastKey;
  13194. return cfg[needKey];
  13195. }
  13196. }
  13197. Common._instance = null;
  13198. class ui_Component92 extends fgui.GComponent {
  13199. static createInstance() {
  13200. return (fgui.UIPackage.createObject("game", "Component92"));
  13201. }
  13202. onConstruct() {
  13203. this.n0 = (this.getChild("n0"));
  13204. }
  13205. }
  13206. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13207. class ui_Component129 extends fgui.GProgressBar {
  13208. static createInstance() {
  13209. return (fgui.UIPackage.createObject("game", "Component129"));
  13210. }
  13211. onConstruct() {
  13212. this.bar_v = (this.getChild("bar_v"));
  13213. this.n84 = (this.getChild("n84"));
  13214. }
  13215. }
  13216. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13217. class ui_Component130 extends fgui.GComponent {
  13218. static createInstance() {
  13219. return (fgui.UIPackage.createObject("game", "Component130"));
  13220. }
  13221. onConstruct() {
  13222. this.ani = (this.getChild("ani"));
  13223. this.t0 = this.getTransition("t0");
  13224. }
  13225. }
  13226. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13227. class ui_powerEft extends fgui.GComponent {
  13228. static createInstance() {
  13229. return (fgui.UIPackage.createObject("game", "powerEft"));
  13230. }
  13231. onConstruct() {
  13232. this.ani = (this.getChild("ani"));
  13233. this.n88 = (this.getChild("n88"));
  13234. this.n89 = (this.getChild("n89"));
  13235. }
  13236. }
  13237. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13238. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13239. static createInstance() {
  13240. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13241. }
  13242. onConstruct() {
  13243. this.c1 = this.getController("c1");
  13244. this.n2 = (this.getChild("n2"));
  13245. this.n22 = (this.getChild("n22"));
  13246. this.n23 = (this.getChild("n23"));
  13247. this.n15 = (this.getChild("n15"));
  13248. this.challenge = (this.getChild("challenge"));
  13249. this.n17 = (this.getChild("n17"));
  13250. this.n3 = (this.getChild("n3"));
  13251. this.starNode = (this.getChild("starNode"));
  13252. this.levelTxt = (this.getChild("levelTxt"));
  13253. this.n14 = (this.getChild("n14"));
  13254. this.n19 = (this.getChild("n19"));
  13255. this.n20 = (this.getChild("n20"));
  13256. this.n21 = (this.getChild("n21"));
  13257. this.special = (this.getChild("special"));
  13258. }
  13259. }
  13260. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13261. class ui_Component79 extends fgui.GComponent {
  13262. static createInstance() {
  13263. return (fgui.UIPackage.createObject("game", "Component79"));
  13264. }
  13265. onConstruct() {
  13266. this.c1 = this.getController("c1");
  13267. this.n7 = (this.getChild("n7"));
  13268. this.n8 = (this.getChild("n8"));
  13269. this.n9 = (this.getChild("n9"));
  13270. this.n10 = (this.getChild("n10"));
  13271. this.n11 = (this.getChild("n11"));
  13272. this.n12 = (this.getChild("n12"));
  13273. }
  13274. }
  13275. ui_Component79.URL = "ui://isxx5ak7avag477";
  13276. class ui_Component80 extends fgui.GComponent {
  13277. static createInstance() {
  13278. return (fgui.UIPackage.createObject("game", "Component80"));
  13279. }
  13280. onConstruct() {
  13281. this.n0 = (this.getChild("n0"));
  13282. this.n1 = (this.getChild("n1"));
  13283. this.myList = (this.getChild("myList"));
  13284. this.t0 = this.getTransition("t0");
  13285. }
  13286. }
  13287. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13288. class ui_SignNormal extends fgui.GComponent {
  13289. static createInstance() {
  13290. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13291. }
  13292. onConstruct() {
  13293. this.c1 = this.getController("c1");
  13294. this.n7 = (this.getChild("n7"));
  13295. this.n15 = (this.getChild("n15"));
  13296. this.titleTxt = (this.getChild("titleTxt"));
  13297. this.n8 = (this.getChild("n8"));
  13298. this.myIcon = (this.getChild("myIcon"));
  13299. this.numTxt = (this.getChild("numTxt"));
  13300. this.n12 = (this.getChild("n12"));
  13301. this.n13 = (this.getChild("n13"));
  13302. this.n17 = (this.getChild("n17"));
  13303. this.n14 = (this.getChild("n14"));
  13304. }
  13305. }
  13306. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13307. class ui_Button_reg extends fgui.GButton {
  13308. static createInstance() {
  13309. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13310. }
  13311. onConstruct() {
  13312. this.button = this.getController("button");
  13313. this.n6 = (this.getChild("n6"));
  13314. }
  13315. }
  13316. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13317. class ui_screenNode extends fgui.GComponent {
  13318. static createInstance() {
  13319. return (fgui.UIPackage.createObject("game", "screenNode"));
  13320. }
  13321. onConstruct() {
  13322. this.n9 = (this.getChild("n9"));
  13323. this.screenImg = (this.getChild("screenImg"));
  13324. }
  13325. }
  13326. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13327. class ui_GetAwrad_com1 extends fgui.GComponent {
  13328. static createInstance() {
  13329. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13330. }
  13331. onConstruct() {
  13332. this.n38 = (this.getChild("n38"));
  13333. this.n39 = (this.getChild("n39"));
  13334. this.n40 = (this.getChild("n40"));
  13335. this.t0 = this.getTransition("t0");
  13336. this.t1 = this.getTransition("t1");
  13337. }
  13338. }
  13339. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13340. class ui_GetAwrad_com2 extends fgui.GComponent {
  13341. static createInstance() {
  13342. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13343. }
  13344. onConstruct() {
  13345. this.n39 = (this.getChild("n39"));
  13346. this.n40 = (this.getChild("n40"));
  13347. this.t0 = this.getTransition("t0");
  13348. }
  13349. }
  13350. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13351. class ui_Component128 extends fgui.GComponent {
  13352. static createInstance() {
  13353. return (fgui.UIPackage.createObject("game", "Component128"));
  13354. }
  13355. onConstruct() {
  13356. this.n38 = (this.getChild("n38"));
  13357. this.n40 = (this.getChild("n40"));
  13358. }
  13359. }
  13360. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13361. class ui_Component100_1 extends fgui.GComponent {
  13362. static createInstance() {
  13363. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13364. }
  13365. onConstruct() {
  13366. this.myNode = (this.getChild("myNode"));
  13367. this.t0 = this.getTransition("t0");
  13368. }
  13369. }
  13370. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13371. class ui_Component142 extends fgui.GComponent {
  13372. static createInstance() {
  13373. return (fgui.UIPackage.createObject("game", "Component142"));
  13374. }
  13375. onConstruct() {
  13376. this.n41 = (this.getChild("n41"));
  13377. this.n42 = (this.getChild("n42"));
  13378. }
  13379. }
  13380. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13381. class ui_main_guang extends fgui.GComponent {
  13382. static createInstance() {
  13383. return (fgui.UIPackage.createObject("game", "main_guang"));
  13384. }
  13385. onConstruct() {
  13386. this.n1 = (this.getChild("n1"));
  13387. this.n2 = (this.getChild("n2"));
  13388. this.n3 = (this.getChild("n3"));
  13389. this.n4 = (this.getChild("n4"));
  13390. this.n5 = (this.getChild("n5"));
  13391. this.n6 = (this.getChild("n6"));
  13392. this.n8 = (this.getChild("n8"));
  13393. this.t0 = this.getTransition("t0");
  13394. }
  13395. }
  13396. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13397. class ui_try_com1 extends fgui.GComponent {
  13398. static createInstance() {
  13399. return (fgui.UIPackage.createObject("game", "try_com1"));
  13400. }
  13401. onConstruct() {
  13402. this.c1 = this.getController("c1");
  13403. this.n0 = (this.getChild("n0"));
  13404. this.n2 = (this.getChild("n2"));
  13405. this.cancelBtn = (this.getChild("cancelBtn"));
  13406. this.videoBtn = (this.getChild("videoBtn"));
  13407. this.n9 = (this.getChild("n9"));
  13408. this.n24 = (this.getChild("n24"));
  13409. this.titleTxt = (this.getChild("titleTxt"));
  13410. this.n32 = (this.getChild("n32"));
  13411. this.n29 = (this.getChild("n29"));
  13412. this.n36 = (this.getChild("n36"));
  13413. this.txtTime = (this.getChild("txtTime"));
  13414. this.t0 = this.getTransition("t0");
  13415. }
  13416. }
  13417. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13418. class ui_try_com2 extends fgui.GComponent {
  13419. static createInstance() {
  13420. return (fgui.UIPackage.createObject("game", "try_com2"));
  13421. }
  13422. onConstruct() {
  13423. this.skillicon = (this.getChild("skillicon"));
  13424. this.n35 = (this.getChild("n35"));
  13425. this.n31 = (this.getChild("n31"));
  13426. this.n32 = (this.getChild("n32"));
  13427. this.n33 = (this.getChild("n33"));
  13428. this.n34 = (this.getChild("n34"));
  13429. }
  13430. }
  13431. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13432. class ui_try_com3 extends fgui.GComponent {
  13433. static createInstance() {
  13434. return (fgui.UIPackage.createObject("game", "try_com3"));
  13435. }
  13436. onConstruct() {
  13437. this.n33 = (this.getChild("n33"));
  13438. this.n34 = (this.getChild("n34"));
  13439. this.n35 = (this.getChild("n35"));
  13440. this.t0 = this.getTransition("t0");
  13441. }
  13442. }
  13443. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13444. class ui_huihe1 extends fgui.GComponent {
  13445. static createInstance() {
  13446. return (fgui.UIPackage.createObject("game", "huihe1"));
  13447. }
  13448. onConstruct() {
  13449. this.n0 = (this.getChild("n0"));
  13450. this.n1 = (this.getChild("n1"));
  13451. this.t0 = this.getTransition("t0");
  13452. }
  13453. }
  13454. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13455. class ui_huihe2 extends fgui.GComponent {
  13456. static createInstance() {
  13457. return (fgui.UIPackage.createObject("game", "huihe2"));
  13458. }
  13459. onConstruct() {
  13460. this.n0 = (this.getChild("n0"));
  13461. this.n1 = (this.getChild("n1"));
  13462. this.t0 = this.getTransition("t0");
  13463. }
  13464. }
  13465. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13466. class ui_Component143 extends fgui.GComponent {
  13467. static createInstance() {
  13468. return (fgui.UIPackage.createObject("game", "Component143"));
  13469. }
  13470. onConstruct() {
  13471. this.n3 = (this.getChild("n3"));
  13472. this.n4 = (this.getChild("n4"));
  13473. this.n5 = (this.getChild("n5"));
  13474. this.n6 = (this.getChild("n6"));
  13475. this.n7 = (this.getChild("n7"));
  13476. this.n8 = (this.getChild("n8"));
  13477. this.n9 = (this.getChild("n9"));
  13478. this.n10 = (this.getChild("n10"));
  13479. this.t0 = this.getTransition("t0");
  13480. }
  13481. }
  13482. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13483. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13484. static createInstance() {
  13485. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13486. }
  13487. onConstruct() {
  13488. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13489. }
  13490. }
  13491. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13492. class ui_dh_jingbi2 extends fgui.GComponent {
  13493. static createInstance() {
  13494. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13495. }
  13496. onConstruct() {
  13497. this.n0 = (this.getChild("n0"));
  13498. this.n1 = (this.getChild("n1"));
  13499. this.n2 = (this.getChild("n2"));
  13500. this.n3 = (this.getChild("n3"));
  13501. this.n4 = (this.getChild("n4"));
  13502. this.n5 = (this.getChild("n5"));
  13503. this.n6 = (this.getChild("n6"));
  13504. this.n8 = (this.getChild("n8"));
  13505. this.n10 = (this.getChild("n10"));
  13506. this.t0 = this.getTransition("t0");
  13507. }
  13508. }
  13509. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13510. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13511. static createInstance() {
  13512. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13513. }
  13514. onConstruct() {
  13515. this.n1 = (this.getChild("n1"));
  13516. this.n4 = (this.getChild("n4"));
  13517. this.t0 = this.getTransition("t0");
  13518. }
  13519. }
  13520. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13521. class ui_dh_jingbi3 extends fgui.GComponent {
  13522. static createInstance() {
  13523. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13524. }
  13525. onConstruct() {
  13526. this.n0 = (this.getChild("n0"));
  13527. this.n1 = (this.getChild("n1"));
  13528. this.n2 = (this.getChild("n2"));
  13529. this.n3 = (this.getChild("n3"));
  13530. this.n4 = (this.getChild("n4"));
  13531. this.n5 = (this.getChild("n5"));
  13532. this.n6 = (this.getChild("n6"));
  13533. this.n8 = (this.getChild("n8"));
  13534. this.n10 = (this.getChild("n10"));
  13535. this.t0 = this.getTransition("t0");
  13536. }
  13537. }
  13538. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13539. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13540. static createInstance() {
  13541. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13542. }
  13543. onConstruct() {
  13544. this.n3 = (this.getChild("n3"));
  13545. this.n1 = (this.getChild("n1"));
  13546. this.t0 = this.getTransition("t0");
  13547. }
  13548. }
  13549. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13550. class ui_hb_jinbi1 extends fgui.GButton {
  13551. static createInstance() {
  13552. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13553. }
  13554. onConstruct() {
  13555. this.n20 = (this.getChild("n20"));
  13556. this.n25 = (this.getChild("n25"));
  13557. this.coinTxt = (this.getChild("coinTxt"));
  13558. this.n28 = (this.getChild("n28"));
  13559. this.n32 = (this.getChild("n32"));
  13560. this.n38 = (this.getChild("n38"));
  13561. this.n45 = (this.getChild("n45"));
  13562. this.getTips = (this.getChild("getTips"));
  13563. this.n39 = (this.getChild("n39"));
  13564. this.diamondTxt = (this.getChild("diamondTxt"));
  13565. this.n41 = (this.getChild("n41"));
  13566. this.n42 = (this.getChild("n42"));
  13567. this.n46 = (this.getChild("n46"));
  13568. this.n47 = (this.getChild("n47"));
  13569. this.n48 = (this.getChild("n48"));
  13570. this.t0 = this.getTransition("t0");
  13571. }
  13572. }
  13573. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13574. class ui_hb_jinbi2 extends fgui.GButton {
  13575. static createInstance() {
  13576. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13577. }
  13578. onConstruct() {
  13579. this.n20 = (this.getChild("n20"));
  13580. this.n25 = (this.getChild("n25"));
  13581. this.coinTxt = (this.getChild("coinTxt"));
  13582. this.n28 = (this.getChild("n28"));
  13583. this.n32 = (this.getChild("n32"));
  13584. this.n38 = (this.getChild("n38"));
  13585. this.n39 = (this.getChild("n39"));
  13586. this.diamondTxt = (this.getChild("diamondTxt"));
  13587. this.n41 = (this.getChild("n41"));
  13588. this.n42 = (this.getChild("n42"));
  13589. this.n43 = (this.getChild("n43"));
  13590. this.n44 = (this.getChild("n44"));
  13591. this.n45 = (this.getChild("n45"));
  13592. this.t0 = this.getTransition("t0");
  13593. }
  13594. }
  13595. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13596. class ui_hb_jinbi3 extends fgui.GButton {
  13597. static createInstance() {
  13598. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13599. }
  13600. onConstruct() {
  13601. this.n20 = (this.getChild("n20"));
  13602. this.n25 = (this.getChild("n25"));
  13603. this.coinTxt = (this.getChild("coinTxt"));
  13604. this.n28 = (this.getChild("n28"));
  13605. this.n32 = (this.getChild("n32"));
  13606. this.n38 = (this.getChild("n38"));
  13607. this.n39 = (this.getChild("n39"));
  13608. this.diamondTxt = (this.getChild("diamondTxt"));
  13609. this.n41 = (this.getChild("n41"));
  13610. this.n42 = (this.getChild("n42"));
  13611. this.n43 = (this.getChild("n43"));
  13612. this.n44 = (this.getChild("n44"));
  13613. this.n45 = (this.getChild("n45"));
  13614. this.t0 = this.getTransition("t0");
  13615. }
  13616. }
  13617. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13618. class ui_Component104 extends fgui.GComponent {
  13619. static createInstance() {
  13620. return (fgui.UIPackage.createObject("game", "Component104"));
  13621. }
  13622. onConstruct() {
  13623. this.c1 = this.getController("c1");
  13624. this.n12 = (this.getChild("n12"));
  13625. this.coinBtn = (this.getChild("coinBtn"));
  13626. this.diamondBtn = (this.getChild("diamondBtn"));
  13627. this.node3 = (this.getChild("node3"));
  13628. this.node4 = (this.getChild("node4"));
  13629. this.node5 = (this.getChild("node5"));
  13630. this.node1 = (this.getChild("node1"));
  13631. this.node2 = (this.getChild("node2"));
  13632. this.node6 = (this.getChild("node6"));
  13633. this.t0 = this.getTransition("t0");
  13634. }
  13635. }
  13636. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13637. class ui_Component105 extends fgui.GButton {
  13638. static createInstance() {
  13639. return (fgui.UIPackage.createObject("game", "Component105"));
  13640. }
  13641. onConstruct() {
  13642. this.c1 = this.getController("c1");
  13643. this.n49 = (this.getChild("n49"));
  13644. this.n18 = (this.getChild("n18"));
  13645. this.n46 = (this.getChild("n46"));
  13646. this.n48 = (this.getChild("n48"));
  13647. }
  13648. }
  13649. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13650. class ui_Component106 extends fgui.GButton {
  13651. static createInstance() {
  13652. return (fgui.UIPackage.createObject("game", "Component106"));
  13653. }
  13654. onConstruct() {
  13655. this.c1 = this.getController("c1");
  13656. this.n49 = (this.getChild("n49"));
  13657. this.n18 = (this.getChild("n18"));
  13658. this.n46 = (this.getChild("n46"));
  13659. this.n48 = (this.getChild("n48"));
  13660. }
  13661. }
  13662. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13663. class ui_hb_zs1 extends fgui.GButton {
  13664. static createInstance() {
  13665. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13666. }
  13667. onConstruct() {
  13668. this.c1 = this.getController("c1");
  13669. this.n20 = (this.getChild("n20"));
  13670. this.n21 = (this.getChild("n21"));
  13671. this.n26 = (this.getChild("n26"));
  13672. this.n27 = (this.getChild("n27"));
  13673. this.shareTxt = (this.getChild("shareTxt"));
  13674. this.n32 = (this.getChild("n32"));
  13675. this.n38 = (this.getChild("n38"));
  13676. this.n39 = (this.getChild("n39"));
  13677. this.n44 = (this.getChild("n44"));
  13678. this.diamondTxt = (this.getChild("diamondTxt"));
  13679. this.n41 = (this.getChild("n41"));
  13680. this.n45 = (this.getChild("n45"));
  13681. this.n47 = (this.getChild("n47"));
  13682. this.n48 = (this.getChild("n48"));
  13683. this.randTxt = (this.getChild("randTxt"));
  13684. this.n50 = (this.getChild("n50"));
  13685. this.t0 = this.getTransition("t0");
  13686. }
  13687. }
  13688. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13689. class ui_dh_zs1 extends fgui.GComponent {
  13690. static createInstance() {
  13691. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13692. }
  13693. onConstruct() {
  13694. this.n10 = (this.getChild("n10"));
  13695. this.n9 = (this.getChild("n9"));
  13696. this.n1 = (this.getChild("n1"));
  13697. this.n2 = (this.getChild("n2"));
  13698. this.n3 = (this.getChild("n3"));
  13699. this.n4 = (this.getChild("n4"));
  13700. this.n5 = (this.getChild("n5"));
  13701. this.n6 = (this.getChild("n6"));
  13702. this.n8 = (this.getChild("n8"));
  13703. this.n11 = (this.getChild("n11"));
  13704. this.t0 = this.getTransition("t0");
  13705. }
  13706. }
  13707. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13708. class ui_dh_zs1_1 extends fgui.GComponent {
  13709. static createInstance() {
  13710. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13711. }
  13712. onConstruct() {
  13713. this.n3 = (this.getChild("n3"));
  13714. this.n1 = (this.getChild("n1"));
  13715. this.t0 = this.getTransition("t0");
  13716. }
  13717. }
  13718. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13719. class ui_hb_zs2 extends fgui.GButton {
  13720. static createInstance() {
  13721. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13722. }
  13723. onConstruct() {
  13724. this.n20 = (this.getChild("n20"));
  13725. this.n21 = (this.getChild("n21"));
  13726. this.n26 = (this.getChild("n26"));
  13727. this.n27 = (this.getChild("n27"));
  13728. this.n32 = (this.getChild("n32"));
  13729. this.n38 = (this.getChild("n38"));
  13730. this.n39 = (this.getChild("n39"));
  13731. this.n44 = (this.getChild("n44"));
  13732. this.diamondTxt = (this.getChild("diamondTxt"));
  13733. this.n41 = (this.getChild("n41"));
  13734. this.n45 = (this.getChild("n45"));
  13735. this.t0 = this.getTransition("t0");
  13736. }
  13737. }
  13738. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13739. class ui_hb_zs3 extends fgui.GButton {
  13740. static createInstance() {
  13741. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13742. }
  13743. onConstruct() {
  13744. this.n20 = (this.getChild("n20"));
  13745. this.n21 = (this.getChild("n21"));
  13746. this.n26 = (this.getChild("n26"));
  13747. this.n27 = (this.getChild("n27"));
  13748. this.n32 = (this.getChild("n32"));
  13749. this.n38 = (this.getChild("n38"));
  13750. this.n47 = (this.getChild("n47"));
  13751. this.t0 = this.getTransition("t0");
  13752. }
  13753. }
  13754. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13755. class ui_dh_zs2 extends fgui.GComponent {
  13756. static createInstance() {
  13757. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13758. }
  13759. onConstruct() {
  13760. this.n10 = (this.getChild("n10"));
  13761. this.n9 = (this.getChild("n9"));
  13762. this.n1 = (this.getChild("n1"));
  13763. this.n2 = (this.getChild("n2"));
  13764. this.n3 = (this.getChild("n3"));
  13765. this.n4 = (this.getChild("n4"));
  13766. this.n5 = (this.getChild("n5"));
  13767. this.n6 = (this.getChild("n6"));
  13768. this.n8 = (this.getChild("n8"));
  13769. this.n11 = (this.getChild("n11"));
  13770. this.t0 = this.getTransition("t0");
  13771. }
  13772. }
  13773. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13774. class ui_dh_zs2_1 extends fgui.GComponent {
  13775. static createInstance() {
  13776. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13777. }
  13778. onConstruct() {
  13779. this.n3 = (this.getChild("n3"));
  13780. this.n1 = (this.getChild("n1"));
  13781. this.t0 = this.getTransition("t0");
  13782. }
  13783. }
  13784. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13785. class ui_dh_zs3 extends fgui.GComponent {
  13786. static createInstance() {
  13787. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13788. }
  13789. onConstruct() {
  13790. this.n10 = (this.getChild("n10"));
  13791. this.n9 = (this.getChild("n9"));
  13792. this.n1 = (this.getChild("n1"));
  13793. this.n2 = (this.getChild("n2"));
  13794. this.n3 = (this.getChild("n3"));
  13795. this.n4 = (this.getChild("n4"));
  13796. this.n5 = (this.getChild("n5"));
  13797. this.n6 = (this.getChild("n6"));
  13798. this.n8 = (this.getChild("n8"));
  13799. this.n11 = (this.getChild("n11"));
  13800. this.t0 = this.getTransition("t0");
  13801. }
  13802. }
  13803. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13804. class ui_dh_zs3_1 extends fgui.GComponent {
  13805. static createInstance() {
  13806. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13807. }
  13808. onConstruct() {
  13809. this.n3 = (this.getChild("n3"));
  13810. this.n1 = (this.getChild("n1"));
  13811. this.t0 = this.getTransition("t0");
  13812. }
  13813. }
  13814. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13815. class ui_Component107 extends fgui.GComponent {
  13816. static createInstance() {
  13817. return (fgui.UIPackage.createObject("game", "Component107"));
  13818. }
  13819. onConstruct() {
  13820. this.n18 = (this.getChild("n18"));
  13821. this.n19 = (this.getChild("n19"));
  13822. this.n20 = (this.getChild("n20"));
  13823. this.n21 = (this.getChild("n21"));
  13824. this.n22 = (this.getChild("n22"));
  13825. this.levelTxt = (this.getChild("levelTxt"));
  13826. this.t0 = this.getTransition("t0");
  13827. }
  13828. }
  13829. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13830. class ui_box_com1 extends fgui.GComponent {
  13831. static createInstance() {
  13832. return (fgui.UIPackage.createObject("game", "box_com1"));
  13833. }
  13834. onConstruct() {
  13835. this.n14 = (this.getChild("n14"));
  13836. this.n6 = (this.getChild("n6"));
  13837. this.t0 = this.getTransition("t0");
  13838. }
  13839. }
  13840. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13841. class ui_box_com2 extends fgui.GProgressBar {
  13842. static createInstance() {
  13843. return (fgui.UIPackage.createObject("game", "box_com2"));
  13844. }
  13845. onConstruct() {
  13846. this.bg0 = (this.getChild("bg0"));
  13847. this.bg = (this.getChild("bg"));
  13848. this.bar = (this.getChild("bar"));
  13849. this.n7 = (this.getChild("n7"));
  13850. this.n8 = (this.getChild("n8"));
  13851. this.n10 = (this.getChild("n10"));
  13852. this.n11 = (this.getChild("n11"));
  13853. this.n12 = (this.getChild("n12"));
  13854. }
  13855. }
  13856. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13857. class ui_box_com4 extends fgui.GComponent {
  13858. static createInstance() {
  13859. return (fgui.UIPackage.createObject("game", "box_com4"));
  13860. }
  13861. onConstruct() {
  13862. this.n8 = (this.getChild("n8"));
  13863. this.t0 = this.getTransition("t0");
  13864. }
  13865. }
  13866. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13867. class ui_box_com3 extends fgui.GComponent {
  13868. static createInstance() {
  13869. return (fgui.UIPackage.createObject("game", "box_com3"));
  13870. }
  13871. onConstruct() {
  13872. this.n2 = (this.getChild("n2"));
  13873. this.n3 = (this.getChild("n3"));
  13874. this.n4 = (this.getChild("n4"));
  13875. this.n5 = (this.getChild("n5"));
  13876. this.t0 = this.getTransition("t0");
  13877. this.t1 = this.getTransition("t1");
  13878. }
  13879. }
  13880. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13881. class ui_Component97 extends fgui.GComponent {
  13882. static createInstance() {
  13883. return (fgui.UIPackage.createObject("game", "Component97"));
  13884. }
  13885. onConstruct() {
  13886. this.c1 = this.getController("c1");
  13887. this.n46 = (this.getChild("n46"));
  13888. this.diamondNode = (this.getChild("diamondNode"));
  13889. this.coinNode = (this.getChild("coinNode"));
  13890. this.t0 = this.getTransition("t0");
  13891. }
  13892. }
  13893. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13894. class ui_Component98 extends fgui.GButton {
  13895. static createInstance() {
  13896. return (fgui.UIPackage.createObject("game", "Component98"));
  13897. }
  13898. onConstruct() {
  13899. this.n8 = (this.getChild("n8"));
  13900. this.n40 = (this.getChild("n40"));
  13901. }
  13902. }
  13903. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13904. class ui_Component28_11 extends fgui.GButton {
  13905. static createInstance() {
  13906. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13907. }
  13908. onConstruct() {
  13909. this.c1 = this.getController("c1");
  13910. this.n12 = (this.getChild("n12"));
  13911. this.n17 = (this.getChild("n17"));
  13912. this.n13 = (this.getChild("n13"));
  13913. this.diamondTxt = (this.getChild("diamondTxt"));
  13914. this.n15 = (this.getChild("n15"));
  13915. this.n16 = (this.getChild("n16"));
  13916. }
  13917. }
  13918. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13919. class ui_Component58_11 extends fgui.GComponent {
  13920. static createInstance() {
  13921. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13922. }
  13923. onConstruct() {
  13924. this.c1 = this.getController("c1");
  13925. this.n23 = (this.getChild("n23"));
  13926. this.n41 = (this.getChild("n41"));
  13927. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13928. this.n_daoju = (this.getChild("n_daoju"));
  13929. this.myList = (this.getChild("myList"));
  13930. this.djList = (this.getChild("djList"));
  13931. this.t0 = this.getTransition("t0");
  13932. }
  13933. }
  13934. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13935. class ui_Component100 extends fgui.GComponent {
  13936. static createInstance() {
  13937. return (fgui.UIPackage.createObject("game", "Component100"));
  13938. }
  13939. onConstruct() {
  13940. this.c1 = this.getController("c1");
  13941. this.n75 = (this.getChild("n75"));
  13942. this.n76 = (this.getChild("n76"));
  13943. this.n80 = (this.getChild("n80"));
  13944. this.txt = (this.getChild("txt"));
  13945. this.spineRoot = (this.getChild("spineRoot"));
  13946. }
  13947. }
  13948. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13949. class ui_Component101 extends fgui.GComponent {
  13950. static createInstance() {
  13951. return (fgui.UIPackage.createObject("game", "Component101"));
  13952. }
  13953. onConstruct() {
  13954. this.c1 = this.getController("c1");
  13955. this.n36 = (this.getChild("n36"));
  13956. this.n35 = (this.getChild("n35"));
  13957. this.n33 = (this.getChild("n33"));
  13958. this.n34 = (this.getChild("n34"));
  13959. }
  13960. }
  13961. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13962. class ui_Component53 extends fgui.GComponent {
  13963. static createInstance() {
  13964. return (fgui.UIPackage.createObject("game", "Component53"));
  13965. }
  13966. onConstruct() {
  13967. this.n0 = (this.getChild("n0"));
  13968. this.n1 = (this.getChild("n1"));
  13969. this.n2 = (this.getChild("n2"));
  13970. this.n3 = (this.getChild("n3"));
  13971. this.n4 = (this.getChild("n4"));
  13972. this.n5 = (this.getChild("n5"));
  13973. this.n6 = (this.getChild("n6"));
  13974. this.n7 = (this.getChild("n7"));
  13975. this.n8 = (this.getChild("n8"));
  13976. this.n9 = (this.getChild("n9"));
  13977. this.n10 = (this.getChild("n10"));
  13978. this.n11 = (this.getChild("n11"));
  13979. this.n12 = (this.getChild("n12"));
  13980. this.n13 = (this.getChild("n13"));
  13981. this.n14 = (this.getChild("n14"));
  13982. this.n15 = (this.getChild("n15"));
  13983. this.n16 = (this.getChild("n16"));
  13984. this.n19 = (this.getChild("n19"));
  13985. this.n20 = (this.getChild("n20"));
  13986. this.n21 = (this.getChild("n21"));
  13987. this.n22 = (this.getChild("n22"));
  13988. this.n23 = (this.getChild("n23"));
  13989. this.n24 = (this.getChild("n24"));
  13990. this.n25 = (this.getChild("n25"));
  13991. this.n26 = (this.getChild("n26"));
  13992. this.n27 = (this.getChild("n27"));
  13993. this.n28 = (this.getChild("n28"));
  13994. this.n29 = (this.getChild("n29"));
  13995. this.n30 = (this.getChild("n30"));
  13996. this.n31 = (this.getChild("n31"));
  13997. this.n32 = (this.getChild("n32"));
  13998. this.n33 = (this.getChild("n33"));
  13999. this.n34 = (this.getChild("n34"));
  14000. this.n35 = (this.getChild("n35"));
  14001. this.t0 = this.getTransition("t0");
  14002. }
  14003. }
  14004. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  14005. class ui_Component58 extends fgui.GComponent {
  14006. static createInstance() {
  14007. return (fgui.UIPackage.createObject("game", "Component58"));
  14008. }
  14009. onConstruct() {
  14010. this.n23 = (this.getChild("n23"));
  14011. this.n41 = (this.getChild("n41"));
  14012. this.n8 = (this.getChild("n8"));
  14013. this.skillList = (this.getChild("skillList"));
  14014. this.t0 = this.getTransition("t0");
  14015. }
  14016. }
  14017. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  14018. class ui_Component59 extends fgui.GComponent {
  14019. static createInstance() {
  14020. return (fgui.UIPackage.createObject("game", "Component59"));
  14021. }
  14022. onConstruct() {
  14023. this.n3 = (this.getChild("n3"));
  14024. this.msgTxt = (this.getChild("msgTxt"));
  14025. this.t0 = this.getTransition("t0");
  14026. }
  14027. }
  14028. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  14029. class ui_RulerNode extends fgui.GComponent {
  14030. static createInstance() {
  14031. return (fgui.UIPackage.createObject("game", "RulerNode"));
  14032. }
  14033. onConstruct() {
  14034. this.n6 = (this.getChild("n6"));
  14035. this.n4 = (this.getChild("n4"));
  14036. this.img1 = (this.getChild("img1"));
  14037. this.img2 = (this.getChild("img2"));
  14038. }
  14039. }
  14040. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  14041. class ui_Component108 extends fgui.GComponent {
  14042. static createInstance() {
  14043. return (fgui.UIPackage.createObject("game", "Component108"));
  14044. }
  14045. onConstruct() {
  14046. this.n19 = (this.getChild("n19"));
  14047. this.t0 = this.getTransition("t0");
  14048. }
  14049. }
  14050. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  14051. class ui_Component63 extends fgui.GComponent {
  14052. static createInstance() {
  14053. return (fgui.UIPackage.createObject("game", "Component63"));
  14054. }
  14055. onConstruct() {
  14056. this.n66 = (this.getChild("n66"));
  14057. this.n56 = (this.getChild("n56"));
  14058. this.n63 = (this.getChild("n63"));
  14059. this.n65 = (this.getChild("n65"));
  14060. this.t0 = this.getTransition("t0");
  14061. }
  14062. }
  14063. ui_Component63.URL = "ui://isxx5ak7h657452";
  14064. class ui_topNode extends fgui.GComponent {
  14065. static createInstance() {
  14066. return (fgui.UIPackage.createObject("game", "topNode"));
  14067. }
  14068. onConstruct() {
  14069. this.selfProgress = (this.getChild("selfProgress"));
  14070. this.aiProgress = (this.getChild("aiProgress"));
  14071. this.selfKuang = (this.getChild("selfKuang"));
  14072. this.aiKuang = (this.getChild("aiKuang"));
  14073. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  14074. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  14075. this.n33 = (this.getChild("n33"));
  14076. this.n34 = (this.getChild("n34"));
  14077. this.selfNameTxt = (this.getChild("selfNameTxt"));
  14078. this.aiNameTxt = (this.getChild("aiNameTxt"));
  14079. this.selfBallList = (this.getChild("selfBallList"));
  14080. this.aiBallList = (this.getChild("aiBallList"));
  14081. this.middleNode = (this.getChild("middleNode"));
  14082. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  14083. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  14084. this.scoreNode = (this.getChild("scoreNode"));
  14085. this.selfTips = (this.getChild("selfTips"));
  14086. this.aiTips = (this.getChild("aiTips"));
  14087. }
  14088. }
  14089. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  14090. class ui_selfProgress extends fgui.GProgressBar {
  14091. static createInstance() {
  14092. return (fgui.UIPackage.createObject("game", "selfProgress"));
  14093. }
  14094. onConstruct() {
  14095. this.n3 = (this.getChild("n3"));
  14096. this.bar = (this.getChild("bar"));
  14097. }
  14098. }
  14099. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  14100. class ui_aiProgress extends fgui.GProgressBar {
  14101. static createInstance() {
  14102. return (fgui.UIPackage.createObject("game", "aiProgress"));
  14103. }
  14104. onConstruct() {
  14105. this.n3 = (this.getChild("n3"));
  14106. this.bar = (this.getChild("bar"));
  14107. }
  14108. }
  14109. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  14110. class ui_ballDisplay extends fgui.GComponent {
  14111. static createInstance() {
  14112. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  14113. }
  14114. onConstruct() {
  14115. this.myImg = (this.getChild("myImg"));
  14116. }
  14117. }
  14118. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  14119. class ui_moveNode extends fgui.GComponent {
  14120. static createInstance() {
  14121. return (fgui.UIPackage.createObject("game", "moveNode"));
  14122. }
  14123. onConstruct() {
  14124. this.n8 = (this.getChild("n8"));
  14125. this.finger = (this.getChild("finger"));
  14126. }
  14127. }
  14128. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  14129. class ui_cancelBtn extends fgui.GButton {
  14130. static createInstance() {
  14131. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  14132. }
  14133. onConstruct() {
  14134. this.c1 = this.getController("c1");
  14135. this.n0 = (this.getChild("n0"));
  14136. this.n1 = (this.getChild("n1"));
  14137. }
  14138. }
  14139. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  14140. class ui_shareBtn extends fgui.GButton {
  14141. static createInstance() {
  14142. return (fgui.UIPackage.createObject("game", "shareBtn"));
  14143. }
  14144. onConstruct() {
  14145. this.c1 = this.getController("c1");
  14146. this.n2 = (this.getChild("n2"));
  14147. this.n1 = (this.getChild("n1"));
  14148. this.n3 = (this.getChild("n3"));
  14149. this.n4 = (this.getChild("n4"));
  14150. this.n5 = (this.getChild("n5"));
  14151. this.n6 = (this.getChild("n6"));
  14152. }
  14153. }
  14154. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  14155. class ui_share2Btn extends fgui.GButton {
  14156. static createInstance() {
  14157. return (fgui.UIPackage.createObject("game", "share2Btn"));
  14158. }
  14159. onConstruct() {
  14160. this.n3 = (this.getChild("n3"));
  14161. }
  14162. }
  14163. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  14164. class ui_rodMethodNode extends fgui.GComponent {
  14165. static createInstance() {
  14166. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  14167. }
  14168. onConstruct() {
  14169. this.bg = (this.getChild("bg"));
  14170. this.dot = (this.getChild("dot"));
  14171. }
  14172. }
  14173. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  14174. class ui_sureBtn extends fgui.GButton {
  14175. static createInstance() {
  14176. return (fgui.UIPackage.createObject("game", "sureBtn"));
  14177. }
  14178. onConstruct() {
  14179. this.n2 = (this.getChild("n2"));
  14180. this.n1 = (this.getChild("n1"));
  14181. }
  14182. }
  14183. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14184. class ui_Component18 extends fgui.GComponent {
  14185. static createInstance() {
  14186. return (fgui.UIPackage.createObject("game", "Component18"));
  14187. }
  14188. onConstruct() {
  14189. this.c1 = this.getController("c1");
  14190. this.nameTxt = (this.getChild("nameTxt"));
  14191. this.headImg = (this.getChild("headImg"));
  14192. this.n24 = (this.getChild("n24"));
  14193. this.skillImg = (this.getChild("skillImg"));
  14194. this.skillTxt = (this.getChild("skillTxt"));
  14195. }
  14196. }
  14197. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14198. class ui_Component45 extends fgui.GComponent {
  14199. static createInstance() {
  14200. return (fgui.UIPackage.createObject("game", "Component45"));
  14201. }
  14202. onConstruct() {
  14203. this.c1 = this.getController("c1");
  14204. this.n40 = (this.getChild("n40"));
  14205. this.n41 = (this.getChild("n41"));
  14206. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14207. this.n42 = (this.getChild("n42"));
  14208. this.awardTxt = (this.getChild("awardTxt"));
  14209. this.n44 = (this.getChild("n44"));
  14210. this.t0 = this.getTransition("t0");
  14211. }
  14212. }
  14213. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14214. class ui_emotionDisplay extends fgui.GButton {
  14215. static createInstance() {
  14216. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14217. }
  14218. onConstruct() {
  14219. this.myIcon = (this.getChild("myIcon"));
  14220. }
  14221. }
  14222. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14223. class ui_Component49 extends fgui.GButton {
  14224. static createInstance() {
  14225. return (fgui.UIPackage.createObject("game", "Component49"));
  14226. }
  14227. onConstruct() {
  14228. this.n69 = (this.getChild("n69"));
  14229. this.n56 = (this.getChild("n56"));
  14230. }
  14231. }
  14232. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14233. class ui_Component50 extends fgui.GButton {
  14234. static createInstance() {
  14235. return (fgui.UIPackage.createObject("game", "Component50"));
  14236. }
  14237. onConstruct() {
  14238. this.n54 = (this.getChild("n54"));
  14239. this.n65 = (this.getChild("n65"));
  14240. }
  14241. }
  14242. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14243. class ui_Component51 extends fgui.GButton {
  14244. static createInstance() {
  14245. return (fgui.UIPackage.createObject("game", "Component51"));
  14246. }
  14247. onConstruct() {
  14248. this.c1 = this.getController("c1");
  14249. this.n51 = (this.getChild("n51"));
  14250. this.n54 = (this.getChild("n54"));
  14251. }
  14252. }
  14253. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14254. class ui_Button5 extends fgui.GButton {
  14255. static createInstance() {
  14256. return (fgui.UIPackage.createObject("game", "Button5"));
  14257. }
  14258. onConstruct() {
  14259. this.c1 = this.getController("c1");
  14260. this.n0 = (this.getChild("n0"));
  14261. this.n2 = (this.getChild("n2"));
  14262. }
  14263. }
  14264. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14265. class ui_Component124 extends fgui.GComponent {
  14266. static createInstance() {
  14267. return (fgui.UIPackage.createObject("game", "Component124"));
  14268. }
  14269. onConstruct() {
  14270. this.n22 = (this.getChild("n22"));
  14271. this.shareNode = (this.getChild("shareNode"));
  14272. }
  14273. }
  14274. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14275. class ui_Component125 extends fgui.GComponent {
  14276. static createInstance() {
  14277. return (fgui.UIPackage.createObject("game", "Component125"));
  14278. }
  14279. onConstruct() {
  14280. this.n29 = (this.getChild("n29"));
  14281. this.coinTxt = (this.getChild("coinTxt"));
  14282. }
  14283. }
  14284. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14285. class ui_Component52 extends fgui.GButton {
  14286. static createInstance() {
  14287. return (fgui.UIPackage.createObject("game", "Component52"));
  14288. }
  14289. onConstruct() {
  14290. this.n35 = (this.getChild("n35"));
  14291. this.n36 = (this.getChild("n36"));
  14292. }
  14293. }
  14294. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14295. class ui_Component_denglu extends fgui.GComponent {
  14296. static createInstance() {
  14297. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14298. }
  14299. onConstruct() {
  14300. this.c1 = this.getController("c1");
  14301. this.n102 = (this.getChild("n102"));
  14302. this.n103 = (this.getChild("n103"));
  14303. }
  14304. }
  14305. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14306. class ui_Component_fl_1 extends fgui.GComponent {
  14307. static createInstance() {
  14308. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14309. }
  14310. onConstruct() {
  14311. this.n_zzq_fl1 = (this.getChild("n_zzq_fl1"));
  14312. this.txt_price = (this.getChild("txt_price"));
  14313. this.n_no = (this.getChild("n_no"));
  14314. this.n_buy = (this.getChild("n_buy"));
  14315. }
  14316. }
  14317. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14318. class ui_Component_fl_2 extends fgui.GComponent {
  14319. static createInstance() {
  14320. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14321. }
  14322. onConstruct() {
  14323. this.n_zzq_fl2 = (this.getChild("n_zzq_fl2"));
  14324. this.txt_price = (this.getChild("txt_price"));
  14325. this.n_no = (this.getChild("n_no"));
  14326. this.n_buy = (this.getChild("n_buy"));
  14327. }
  14328. }
  14329. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14330. class ui_drawBtn extends fgui.GButton {
  14331. static createInstance() {
  14332. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14333. }
  14334. onConstruct() {
  14335. this.c1 = this.getController("c1");
  14336. this.n2 = (this.getChild("n2"));
  14337. this.n1 = (this.getChild("n1"));
  14338. this.n5 = (this.getChild("n5"));
  14339. }
  14340. }
  14341. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14342. class ui_Component43 extends fgui.GButton {
  14343. static createInstance() {
  14344. return (fgui.UIPackage.createObject("game", "Component43"));
  14345. }
  14346. onConstruct() {
  14347. this.n49 = (this.getChild("n49"));
  14348. }
  14349. }
  14350. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14351. class ui_wordsDisplay extends fgui.GComponent {
  14352. static createInstance() {
  14353. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14354. }
  14355. onConstruct() {
  14356. this.txt = (this.getChild("txt"));
  14357. this.n63 = (this.getChild("n63"));
  14358. }
  14359. }
  14360. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14361. class ui_Component_phb extends fgui.GComponent {
  14362. static createInstance() {
  14363. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14364. }
  14365. onConstruct() {
  14366. this.n3 = (this.getChild("n3"));
  14367. this.n4 = (this.getChild("n4"));
  14368. }
  14369. }
  14370. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14371. class ui_Component3 extends fgui.GComponent {
  14372. static createInstance() {
  14373. return (fgui.UIPackage.createObject("game", "Component3"));
  14374. }
  14375. onConstruct() {
  14376. this.n26 = (this.getChild("n26"));
  14377. this.n24 = (this.getChild("n24"));
  14378. this.nameTxt = (this.getChild("nameTxt"));
  14379. this.headRoot = (this.getChild("headRoot"));
  14380. }
  14381. }
  14382. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14383. class ui_Component4 extends fgui.GComponent {
  14384. static createInstance() {
  14385. return (fgui.UIPackage.createObject("game", "Component4"));
  14386. }
  14387. onConstruct() {
  14388. this.headImg = (this.getChild("headImg"));
  14389. }
  14390. }
  14391. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14392. class ui_Component7 extends fgui.GButton {
  14393. static createInstance() {
  14394. return (fgui.UIPackage.createObject("game", "Component7"));
  14395. }
  14396. onConstruct() {
  14397. this.n17 = (this.getChild("n17"));
  14398. }
  14399. }
  14400. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14401. class ui_Component8 extends fgui.GButton {
  14402. static createInstance() {
  14403. return (fgui.UIPackage.createObject("game", "Component8"));
  14404. }
  14405. onConstruct() {
  14406. this.n19 = (this.getChild("n19"));
  14407. }
  14408. }
  14409. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14410. class ui_Component10 extends fgui.GButton {
  14411. static createInstance() {
  14412. return (fgui.UIPackage.createObject("game", "Component10"));
  14413. }
  14414. onConstruct() {
  14415. this.c1 = this.getController("c1");
  14416. this.n40 = (this.getChild("n40"));
  14417. }
  14418. }
  14419. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14420. class ui_Component11 extends fgui.GButton {
  14421. static createInstance() {
  14422. return (fgui.UIPackage.createObject("game", "Component11"));
  14423. }
  14424. onConstruct() {
  14425. this.n34 = (this.getChild("n34"));
  14426. }
  14427. }
  14428. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14429. class ui_Component12 extends fgui.GButton {
  14430. static createInstance() {
  14431. return (fgui.UIPackage.createObject("game", "Component12"));
  14432. }
  14433. onConstruct() {
  14434. this.n35 = (this.getChild("n35"));
  14435. }
  14436. }
  14437. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14438. class ui_Component13 extends fgui.GButton {
  14439. static createInstance() {
  14440. return (fgui.UIPackage.createObject("game", "Component13"));
  14441. }
  14442. onConstruct() {
  14443. this.n27 = (this.getChild("n27"));
  14444. this.n36 = (this.getChild("n36"));
  14445. }
  14446. }
  14447. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14448. class ui_dh_js_tuowei extends fgui.GComponent {
  14449. static createInstance() {
  14450. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14451. }
  14452. onConstruct() {
  14453. this.n19 = (this.getChild("n19"));
  14454. this.n18 = (this.getChild("n18"));
  14455. this.n0 = (this.getChild("n0"));
  14456. this.n3 = (this.getChild("n3"));
  14457. this.n4 = (this.getChild("n4"));
  14458. this.n5 = (this.getChild("n5"));
  14459. this.n6 = (this.getChild("n6"));
  14460. this.n8 = (this.getChild("n8"));
  14461. this.n9 = (this.getChild("n9"));
  14462. this.n10 = (this.getChild("n10"));
  14463. this.n11 = (this.getChild("n11"));
  14464. this.n12 = (this.getChild("n12"));
  14465. this.n13 = (this.getChild("n13"));
  14466. this.n14 = (this.getChild("n14"));
  14467. this.n15 = (this.getChild("n15"));
  14468. this.n20 = (this.getChild("n20"));
  14469. this.t0 = this.getTransition("t0");
  14470. this.t1 = this.getTransition("t1");
  14471. }
  14472. }
  14473. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14474. class ui_dh_js_tw_g extends fgui.GComponent {
  14475. static createInstance() {
  14476. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14477. }
  14478. onConstruct() {
  14479. this.n0 = (this.getChild("n0"));
  14480. this.n1 = (this.getChild("n1"));
  14481. this.t0 = this.getTransition("t0");
  14482. }
  14483. }
  14484. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14485. class ui_dh_js_xingxing extends fgui.GComponent {
  14486. static createInstance() {
  14487. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14488. }
  14489. onConstruct() {
  14490. this.n1 = (this.getChild("n1"));
  14491. this.n2 = (this.getChild("n2"));
  14492. this.n3 = (this.getChild("n3"));
  14493. this.n4 = (this.getChild("n4"));
  14494. this.n0 = (this.getChild("n0"));
  14495. this.t2 = this.getTransition("t2");
  14496. this.t1 = this.getTransition("t1");
  14497. }
  14498. }
  14499. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14500. class ui_dh_zy_jiazai extends fgui.GComponent {
  14501. static createInstance() {
  14502. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14503. }
  14504. onConstruct() {
  14505. this.c1 = this.getController("c1");
  14506. this.n0 = (this.getChild("n0"));
  14507. this.n1 = (this.getChild("n1"));
  14508. this.n2 = (this.getChild("n2"));
  14509. this.n4 = (this.getChild("n4"));
  14510. this.n5 = (this.getChild("n5"));
  14511. this.n6 = (this.getChild("n6"));
  14512. this.n8 = (this.getChild("n8"));
  14513. this.n7 = (this.getChild("n7"));
  14514. this.t0 = this.getTransition("t0");
  14515. }
  14516. }
  14517. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14518. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14519. static createInstance() {
  14520. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14521. }
  14522. onConstruct() {
  14523. this.c1 = this.getController("c1");
  14524. this.n3 = (this.getChild("n3"));
  14525. this.n5 = (this.getChild("n5"));
  14526. this.n4 = (this.getChild("n4"));
  14527. this.n0 = (this.getChild("n0"));
  14528. this.n1 = (this.getChild("n1"));
  14529. this.n2 = (this.getChild("n2"));
  14530. }
  14531. }
  14532. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14533. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14534. static createInstance() {
  14535. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14536. }
  14537. onConstruct() {
  14538. this.n19 = (this.getChild("n19"));
  14539. this.n21 = (this.getChild("n21"));
  14540. this.n0 = (this.getChild("n0"));
  14541. this.n3 = (this.getChild("n3"));
  14542. this.n4 = (this.getChild("n4"));
  14543. this.n5 = (this.getChild("n5"));
  14544. this.n6 = (this.getChild("n6"));
  14545. this.n8 = (this.getChild("n8"));
  14546. this.n9 = (this.getChild("n9"));
  14547. this.n10 = (this.getChild("n10"));
  14548. this.n11 = (this.getChild("n11"));
  14549. this.n12 = (this.getChild("n12"));
  14550. this.n13 = (this.getChild("n13"));
  14551. this.n14 = (this.getChild("n14"));
  14552. this.n15 = (this.getChild("n15"));
  14553. this.n23 = (this.getChild("n23"));
  14554. this.t0 = this.getTransition("t0");
  14555. this.t1 = this.getTransition("t1");
  14556. }
  14557. }
  14558. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14559. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14560. static createInstance() {
  14561. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14562. }
  14563. onConstruct() {
  14564. this.n1 = (this.getChild("n1"));
  14565. this.n2 = (this.getChild("n2"));
  14566. this.t0 = this.getTransition("t0");
  14567. }
  14568. }
  14569. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14570. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14571. static createInstance() {
  14572. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14573. }
  14574. onConstruct() {
  14575. this.n4 = (this.getChild("n4"));
  14576. this.n2 = (this.getChild("n2"));
  14577. this.n3 = (this.getChild("n3"));
  14578. this.idle = this.getTransition("idle");
  14579. this.attack = this.getTransition("attack");
  14580. }
  14581. }
  14582. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14583. class ui_special extends fgui.GComponent {
  14584. static createInstance() {
  14585. return (fgui.UIPackage.createObject("game", "special"));
  14586. }
  14587. onConstruct() {
  14588. this.n18 = (this.getChild("n18"));
  14589. this.n19 = (this.getChild("n19"));
  14590. this.n20 = (this.getChild("n20"));
  14591. this.n21 = (this.getChild("n21"));
  14592. this.n22 = (this.getChild("n22"));
  14593. this.levelTxt = (this.getChild("levelTxt"));
  14594. this.n24 = (this.getChild("n24"));
  14595. this.n25 = (this.getChild("n25"));
  14596. this.t0 = this.getTransition("t0");
  14597. }
  14598. }
  14599. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14600. class ui_Component145 extends fgui.GComponent {
  14601. static createInstance() {
  14602. return (fgui.UIPackage.createObject("game", "Component145"));
  14603. }
  14604. onConstruct() {
  14605. this.guanyuNode = (this.getChild("guanyuNode"));
  14606. }
  14607. }
  14608. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14609. class ui_longBtn extends fgui.GButton {
  14610. static createInstance() {
  14611. return (fgui.UIPackage.createObject("game", "longBtn"));
  14612. }
  14613. onConstruct() {
  14614. this.c1 = this.getController("c1");
  14615. this.n2 = (this.getChild("n2"));
  14616. this.n1 = (this.getChild("n1"));
  14617. this.n4 = (this.getChild("n4"));
  14618. }
  14619. }
  14620. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14621. class ui_Component146 extends fgui.GComponent {
  14622. static createInstance() {
  14623. return (fgui.UIPackage.createObject("game", "Component146"));
  14624. }
  14625. onConstruct() {
  14626. this.n89 = (this.getChild("n89"));
  14627. this.n90 = (this.getChild("n90"));
  14628. this.guideBtn = (this.getChild("guideBtn"));
  14629. }
  14630. }
  14631. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14632. class ui_Component146_11 extends fgui.GComponent {
  14633. static createInstance() {
  14634. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14635. }
  14636. onConstruct() {
  14637. this.n89 = (this.getChild("n89"));
  14638. this.n90 = (this.getChild("n90"));
  14639. this.guideBtn = (this.getChild("guideBtn"));
  14640. }
  14641. }
  14642. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14643. class ui_Component111_1 extends fgui.GComponent {
  14644. static createInstance() {
  14645. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14646. }
  14647. onConstruct() {
  14648. this.n68 = (this.getChild("n68"));
  14649. this.myMask = (this.getChild("myMask"));
  14650. }
  14651. }
  14652. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14653. class ui_Component64_1 extends fgui.GComponent {
  14654. static createInstance() {
  14655. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14656. }
  14657. onConstruct() {
  14658. this.n57 = (this.getChild("n57"));
  14659. this.n54 = (this.getChild("n54"));
  14660. this.n55 = (this.getChild("n55"));
  14661. this.n56 = (this.getChild("n56"));
  14662. this.t1 = this.getTransition("t1");
  14663. }
  14664. }
  14665. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14666. class ui_ModeSelection_com123 extends fgui.GComponent {
  14667. static createInstance() {
  14668. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14669. }
  14670. onConstruct() {
  14671. this.type1 = (this.getChild("type1"));
  14672. this.type2 = (this.getChild("type2"));
  14673. this.type3 = (this.getChild("type3"));
  14674. this.n38 = (this.getChild("n38"));
  14675. this.t0 = this.getTransition("t0");
  14676. }
  14677. }
  14678. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14679. class ui_Component132_2 extends fgui.GComponent {
  14680. static createInstance() {
  14681. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14682. }
  14683. onConstruct() {
  14684. this.n25 = (this.getChild("n25"));
  14685. this.n26 = (this.getChild("n26"));
  14686. this.n27 = (this.getChild("n27"));
  14687. this.t0 = this.getTransition("t0");
  14688. }
  14689. }
  14690. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14691. class ui_UIPower$1 extends fgui.GComponent {
  14692. static createInstance() {
  14693. return (fgui.UIPackage.createObject("game", "UIPower"));
  14694. }
  14695. onConstruct() {
  14696. this.n11 = (this.getChild("n11"));
  14697. this.myNode = (this.getChild("myNode"));
  14698. this.t0 = this.getTransition("t0");
  14699. }
  14700. }
  14701. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14702. class ui_Component133 extends fgui.GComponent {
  14703. static createInstance() {
  14704. return (fgui.UIPackage.createObject("game", "Component133"));
  14705. }
  14706. onConstruct() {
  14707. this.n29 = (this.getChild("n29"));
  14708. this.n30 = (this.getChild("n30"));
  14709. }
  14710. }
  14711. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14712. class ui_Component134 extends fgui.GComponent {
  14713. static createInstance() {
  14714. return (fgui.UIPackage.createObject("game", "Component134"));
  14715. }
  14716. onConstruct() {
  14717. this.n30 = (this.getChild("n30"));
  14718. this.n31 = (this.getChild("n31"));
  14719. this.t0 = this.getTransition("t0");
  14720. }
  14721. }
  14722. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14723. class ui_Component135 extends fgui.GComponent {
  14724. static createInstance() {
  14725. return (fgui.UIPackage.createObject("game", "Component135"));
  14726. }
  14727. onConstruct() {
  14728. this.n30 = (this.getChild("n30"));
  14729. this.t0 = this.getTransition("t0");
  14730. }
  14731. }
  14732. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14733. class ui_Component137 extends fgui.GComponent {
  14734. static createInstance() {
  14735. return (fgui.UIPackage.createObject("game", "Component137"));
  14736. }
  14737. onConstruct() {
  14738. this.n28 = (this.getChild("n28"));
  14739. this.n29 = (this.getChild("n29"));
  14740. this.n30 = (this.getChild("n30"));
  14741. this.n32 = (this.getChild("n32"));
  14742. }
  14743. }
  14744. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14745. class ui_dh_zuanshi extends fgui.GButton {
  14746. static createInstance() {
  14747. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14748. }
  14749. onConstruct() {
  14750. this.n1 = (this.getChild("n1"));
  14751. this.n2 = (this.getChild("n2"));
  14752. this.n0 = (this.getChild("n0"));
  14753. this.n3 = (this.getChild("n3"));
  14754. this.n4 = (this.getChild("n4"));
  14755. }
  14756. }
  14757. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14758. class ui_Component138 extends fgui.GComponent {
  14759. static createInstance() {
  14760. return (fgui.UIPackage.createObject("game", "Component138"));
  14761. }
  14762. onConstruct() {
  14763. this.n1 = (this.getChild("n1"));
  14764. this.n2 = (this.getChild("n2"));
  14765. this.t0 = this.getTransition("t0");
  14766. }
  14767. }
  14768. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14769. class ui_Component139 extends fgui.GComponent {
  14770. static createInstance() {
  14771. return (fgui.UIPackage.createObject("game", "Component139"));
  14772. }
  14773. onConstruct() {
  14774. this.n0 = (this.getChild("n0"));
  14775. this.t0 = this.getTransition("t0");
  14776. }
  14777. }
  14778. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14779. class ui_Component140 extends fgui.GComponent {
  14780. static createInstance() {
  14781. return (fgui.UIPackage.createObject("game", "Component140"));
  14782. }
  14783. onConstruct() {
  14784. this.n2 = (this.getChild("n2"));
  14785. this.n3 = (this.getChild("n3"));
  14786. this.t0 = this.getTransition("t0");
  14787. }
  14788. }
  14789. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14790. class ui_Component141 extends fgui.GComponent {
  14791. static createInstance() {
  14792. return (fgui.UIPackage.createObject("game", "Component141"));
  14793. }
  14794. onConstruct() {
  14795. this.n0 = (this.getChild("n0"));
  14796. this.t0 = this.getTransition("t0");
  14797. }
  14798. }
  14799. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14800. class ui_powerNode extends fgui.GProgressBar {
  14801. static createInstance() {
  14802. return (fgui.UIPackage.createObject("game", "powerNode"));
  14803. }
  14804. onConstruct() {
  14805. this.n2 = (this.getChild("n2"));
  14806. this.bar_v = (this.getChild("bar_v"));
  14807. this.showImg = (this.getChild("showImg"));
  14808. this.n12 = (this.getChild("n12"));
  14809. }
  14810. }
  14811. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14812. class ui_dh_jingbi1 extends fgui.GComponent {
  14813. static createInstance() {
  14814. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14815. }
  14816. onConstruct() {
  14817. this.n0 = (this.getChild("n0"));
  14818. this.n1 = (this.getChild("n1"));
  14819. this.n2 = (this.getChild("n2"));
  14820. this.n3 = (this.getChild("n3"));
  14821. this.n4 = (this.getChild("n4"));
  14822. this.n5 = (this.getChild("n5"));
  14823. this.n6 = (this.getChild("n6"));
  14824. this.n8 = (this.getChild("n8"));
  14825. this.t0 = this.getTransition("t0");
  14826. }
  14827. }
  14828. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14829. class ui_Component94 extends fgui.GButton {
  14830. static createInstance() {
  14831. return (fgui.UIPackage.createObject("game", "Component94"));
  14832. }
  14833. onConstruct() {
  14834. this.n77 = (this.getChild("n77"));
  14835. }
  14836. }
  14837. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14838. class ui_Component95 extends fgui.GButton {
  14839. static createInstance() {
  14840. return (fgui.UIPackage.createObject("game", "Component95"));
  14841. }
  14842. onConstruct() {
  14843. this.n77 = (this.getChild("n77"));
  14844. }
  14845. }
  14846. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14847. class ui_Component126 extends fgui.GComponent {
  14848. static createInstance() {
  14849. return (fgui.UIPackage.createObject("game", "Component126"));
  14850. }
  14851. onConstruct() {
  14852. this.c1 = this.getController("c1");
  14853. this.normalBtn = (this.getChild("normalBtn"));
  14854. this.tripleBtn = (this.getChild("tripleBtn"));
  14855. }
  14856. }
  14857. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14858. class ui_Component60 extends fgui.GComponent {
  14859. static createInstance() {
  14860. return (fgui.UIPackage.createObject("game", "Component60"));
  14861. }
  14862. onConstruct() {
  14863. this.c1 = this.getController("c1");
  14864. this.n48 = (this.getChild("n48"));
  14865. this.womanTxt = (this.getChild("womanTxt"));
  14866. this.t0 = this.getTransition("t0");
  14867. }
  14868. }
  14869. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14870. class ui_Button_h extends fgui.GButton {
  14871. static createInstance() {
  14872. return (fgui.UIPackage.createObject("game", "Button_h"));
  14873. }
  14874. onConstruct() {
  14875. this.button = this.getController("button");
  14876. this.n0 = (this.getChild("n0"));
  14877. }
  14878. }
  14879. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14880. class ui_Button_lv extends fgui.GButton {
  14881. static createInstance() {
  14882. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14883. }
  14884. onConstruct() {
  14885. this.button = this.getController("button");
  14886. this.n0 = (this.getChild("n0"));
  14887. }
  14888. }
  14889. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14890. class ui_Component98_3 extends fgui.GButton {
  14891. static createInstance() {
  14892. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14893. }
  14894. onConstruct() {
  14895. this.c1 = this.getController("c1");
  14896. this.n8 = (this.getChild("n8"));
  14897. this.n41 = (this.getChild("n41"));
  14898. this.n40 = (this.getChild("n40"));
  14899. }
  14900. }
  14901. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14902. class ui_ModeSelection_com1 extends fgui.GButton {
  14903. static createInstance() {
  14904. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14905. }
  14906. onConstruct() {
  14907. this.n34 = (this.getChild("n34"));
  14908. this.n36 = (this.getChild("n36"));
  14909. this.n22 = (this.getChild("n22"));
  14910. this.n20 = (this.getChild("n20"));
  14911. this.n23 = (this.getChild("n23"));
  14912. this.n24 = (this.getChild("n24"));
  14913. this.n26 = (this.getChild("n26"));
  14914. this.n33 = (this.getChild("n33"));
  14915. this.coinImg = (this.getChild("coinImg"));
  14916. this.need = (this.getChild("need"));
  14917. this.n35 = (this.getChild("n35"));
  14918. this.n29 = (this.getChild("n29"));
  14919. this.tipsTxt = (this.getChild("tipsTxt"));
  14920. this.n30 = (this.getChild("n30"));
  14921. this.peopleTxt = (this.getChild("peopleTxt"));
  14922. this.t0 = this.getTransition("t0");
  14923. }
  14924. }
  14925. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14926. class ui_ModeSelection_com2 extends fgui.GButton {
  14927. static createInstance() {
  14928. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14929. }
  14930. onConstruct() {
  14931. this.n36 = (this.getChild("n36"));
  14932. this.n34 = (this.getChild("n34"));
  14933. this.n22 = (this.getChild("n22"));
  14934. this.n20 = (this.getChild("n20"));
  14935. this.n23 = (this.getChild("n23"));
  14936. this.n24 = (this.getChild("n24"));
  14937. this.n26 = (this.getChild("n26"));
  14938. this.n33 = (this.getChild("n33"));
  14939. this.coinImg = (this.getChild("coinImg"));
  14940. this.need = (this.getChild("need"));
  14941. this.n35 = (this.getChild("n35"));
  14942. this.n29 = (this.getChild("n29"));
  14943. this.tipsTxt = (this.getChild("tipsTxt"));
  14944. this.n30 = (this.getChild("n30"));
  14945. this.peopleTxt = (this.getChild("peopleTxt"));
  14946. this.t0 = this.getTransition("t0");
  14947. }
  14948. }
  14949. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14950. class ui_ModeSelection_com3 extends fgui.GButton {
  14951. static createInstance() {
  14952. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14953. }
  14954. onConstruct() {
  14955. this.n34 = (this.getChild("n34"));
  14956. this.n36 = (this.getChild("n36"));
  14957. this.n22 = (this.getChild("n22"));
  14958. this.n20 = (this.getChild("n20"));
  14959. this.n23 = (this.getChild("n23"));
  14960. this.n24 = (this.getChild("n24"));
  14961. this.n26 = (this.getChild("n26"));
  14962. this.n33 = (this.getChild("n33"));
  14963. this.coinImg = (this.getChild("coinImg"));
  14964. this.need = (this.getChild("need"));
  14965. this.n35 = (this.getChild("n35"));
  14966. this.n29 = (this.getChild("n29"));
  14967. this.tipsTxt = (this.getChild("tipsTxt"));
  14968. this.n30 = (this.getChild("n30"));
  14969. this.peopleTxt = (this.getChild("peopleTxt"));
  14970. this.t0 = this.getTransition("t0");
  14971. }
  14972. }
  14973. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14974. class ui_Invitation_com1 extends fgui.GComponent {
  14975. static createInstance() {
  14976. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14977. }
  14978. onConstruct() {
  14979. this.n14 = (this.getChild("n14"));
  14980. this.n13 = (this.getChild("n13"));
  14981. this.n3 = (this.getChild("n3"));
  14982. this.n1 = (this.getChild("n1"));
  14983. this.n6 = (this.getChild("n6"));
  14984. this.n7 = (this.getChild("n7"));
  14985. this.enterBtn = (this.getChild("enterBtn"));
  14986. this.n11 = (this.getChild("n11"));
  14987. this.n12 = (this.getChild("n12"));
  14988. this.n15 = (this.getChild("n15"));
  14989. this.t0 = this.getTransition("t0");
  14990. this.t1 = this.getTransition("t1");
  14991. }
  14992. }
  14993. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14994. class ui_Component87_1 extends fgui.GComponent {
  14995. static createInstance() {
  14996. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14997. }
  14998. onConstruct() {
  14999. this.n74 = (this.getChild("n74"));
  15000. this.n73 = (this.getChild("n73"));
  15001. this.ballTxt = (this.getChild("ballTxt"));
  15002. this.n76 = (this.getChild("n76"));
  15003. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15004. this.levelTxt = (this.getChild("levelTxt"));
  15005. this.n87 = (this.getChild("n87"));
  15006. this.n84 = (this.getChild("n84"));
  15007. this.hpTxt = (this.getChild("hpTxt"));
  15008. this.n89 = (this.getChild("n89"));
  15009. this.tipsTxt = (this.getChild("tipsTxt"));
  15010. }
  15011. }
  15012. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  15013. class ui_sqg1 extends fgui.GComponent {
  15014. static createInstance() {
  15015. return (fgui.UIPackage.createObject("game", "sqg1"));
  15016. }
  15017. onConstruct() {
  15018. this.n1 = (this.getChild("n1"));
  15019. this.n0 = (this.getChild("n0"));
  15020. }
  15021. }
  15022. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  15023. class ui_sqg2 extends fgui.GComponent {
  15024. static createInstance() {
  15025. return (fgui.UIPackage.createObject("game", "sqg2"));
  15026. }
  15027. onConstruct() {
  15028. this.n1 = (this.getChild("n1"));
  15029. this.n0 = (this.getChild("n0"));
  15030. }
  15031. }
  15032. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  15033. class ui_sqg3 extends fgui.GComponent {
  15034. static createInstance() {
  15035. return (fgui.UIPackage.createObject("game", "sqg3"));
  15036. }
  15037. onConstruct() {
  15038. this.n1 = (this.getChild("n1"));
  15039. this.n0 = (this.getChild("n0"));
  15040. }
  15041. }
  15042. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  15043. class ui_sqg4 extends fgui.GComponent {
  15044. static createInstance() {
  15045. return (fgui.UIPackage.createObject("game", "sqg4"));
  15046. }
  15047. onConstruct() {
  15048. this.n1 = (this.getChild("n1"));
  15049. this.n0 = (this.getChild("n0"));
  15050. }
  15051. }
  15052. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  15053. class ui_Component36 extends fgui.GButton {
  15054. static createInstance() {
  15055. return (fgui.UIPackage.createObject("game", "Component36"));
  15056. }
  15057. onConstruct() {
  15058. this.c1 = this.getController("c1");
  15059. this.n53 = (this.getChild("n53"));
  15060. this.n56 = (this.getChild("n56"));
  15061. }
  15062. }
  15063. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  15064. class ui_Component37 extends fgui.GButton {
  15065. static createInstance() {
  15066. return (fgui.UIPackage.createObject("game", "Component37"));
  15067. }
  15068. onConstruct() {
  15069. this.c1 = this.getController("c1");
  15070. this.n52 = (this.getChild("n52"));
  15071. this.n54 = (this.getChild("n54"));
  15072. }
  15073. }
  15074. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  15075. class ui_UISetting extends fgui.GComponent {
  15076. static createInstance() {
  15077. return (fgui.UIPackage.createObject("game", "UISetting"));
  15078. }
  15079. onConstruct() {
  15080. this.c1 = this.getController("c1");
  15081. this.n4 = (this.getChild("n4"));
  15082. this.soundBtn = (this.getChild("soundBtn"));
  15083. this.shakeBtn = (this.getChild("shakeBtn"));
  15084. this.clickNode = (this.getChild("clickNode"));
  15085. this.xyBtn = (this.getChild("xyBtn"));
  15086. }
  15087. }
  15088. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  15089. class ui_Component39 extends fgui.GComponent {
  15090. static createInstance() {
  15091. return (fgui.UIPackage.createObject("game", "Component39"));
  15092. }
  15093. onConstruct() {
  15094. this.n5 = (this.getChild("n5"));
  15095. this.n6 = (this.getChild("n6"));
  15096. this.n7 = (this.getChild("n7"));
  15097. this.t0 = this.getTransition("t0");
  15098. }
  15099. }
  15100. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  15101. class ui_Component40 extends fgui.GButton {
  15102. static createInstance() {
  15103. return (fgui.UIPackage.createObject("game", "Component40"));
  15104. }
  15105. onConstruct() {
  15106. this.n46 = (this.getChild("n46"));
  15107. this.n47 = (this.getChild("n47"));
  15108. }
  15109. }
  15110. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  15111. class ui_Component41 extends fgui.GComponent {
  15112. static createInstance() {
  15113. return (fgui.UIPackage.createObject("game", "Component41"));
  15114. }
  15115. onConstruct() {
  15116. this.c1 = this.getController("c1");
  15117. this.n0 = (this.getChild("n0"));
  15118. this.titleTxt = (this.getChild("titleTxt"));
  15119. this.n2 = (this.getChild("n2"));
  15120. this.msgTips = (this.getChild("msgTips"));
  15121. this.numTxt = (this.getChild("numTxt"));
  15122. this.n18 = (this.getChild("n18"));
  15123. this.cancelBtn = (this.getChild("cancelBtn"));
  15124. this.videoBtn = (this.getChild("videoBtn"));
  15125. this.n10 = (this.getChild("n10"));
  15126. }
  15127. }
  15128. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  15129. class ui_Component42 extends fgui.GComponent {
  15130. static createInstance() {
  15131. return (fgui.UIPackage.createObject("game", "Component42"));
  15132. }
  15133. onConstruct() {
  15134. this.c1 = this.getController("c1");
  15135. this.n1 = (this.getChild("n1"));
  15136. this.n2 = (this.getChild("n2"));
  15137. this.n3 = (this.getChild("n3"));
  15138. this.tipsTxt = (this.getChild("tipsTxt"));
  15139. this.cancelBtn = (this.getChild("cancelBtn"));
  15140. this.sureBtn = (this.getChild("sureBtn"));
  15141. this.n11 = (this.getChild("n11"));
  15142. this.n13 = (this.getChild("n13"));
  15143. this.n14 = (this.getChild("n14"));
  15144. this.womanTxt = (this.getChild("womanTxt"));
  15145. this.t0 = this.getTransition("t0");
  15146. }
  15147. }
  15148. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  15149. class ui_dh_js_shengli extends fgui.GComponent {
  15150. static createInstance() {
  15151. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  15152. }
  15153. onConstruct() {
  15154. this.n3 = (this.getChild("n3"));
  15155. this.n4 = (this.getChild("n4"));
  15156. this.n1 = (this.getChild("n1"));
  15157. this.n2 = (this.getChild("n2"));
  15158. this.n5 = (this.getChild("n5"));
  15159. this.n6 = (this.getChild("n6"));
  15160. this.n7 = (this.getChild("n7"));
  15161. this.n8 = (this.getChild("n8"));
  15162. this.attack = this.getTransition("attack");
  15163. this.idle = this.getTransition("idle");
  15164. }
  15165. }
  15166. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  15167. class ui_dh_js_shengli_g extends fgui.GComponent {
  15168. static createInstance() {
  15169. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  15170. }
  15171. onConstruct() {
  15172. this.n3 = (this.getChild("n3"));
  15173. this.n1 = (this.getChild("n1"));
  15174. this.t0 = this.getTransition("t0");
  15175. }
  15176. }
  15177. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15178. class ui_dh_js_shibai extends fgui.GComponent {
  15179. static createInstance() {
  15180. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15181. }
  15182. onConstruct() {
  15183. this.n0 = (this.getChild("n0"));
  15184. this.n1 = (this.getChild("n1"));
  15185. this.n2 = (this.getChild("n2"));
  15186. this.n3 = (this.getChild("n3"));
  15187. this.idle = this.getTransition("idle");
  15188. this.attack = this.getTransition("attack");
  15189. }
  15190. }
  15191. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15192. class ui_dh_zy_ganfa extends fgui.GButton {
  15193. static createInstance() {
  15194. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15195. }
  15196. onConstruct() {
  15197. this.n0 = (this.getChild("n0"));
  15198. }
  15199. }
  15200. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15201. class ui_dh_zy_sc_guang extends fgui.GButton {
  15202. static createInstance() {
  15203. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15204. }
  15205. onConstruct() {
  15206. this.n0 = (this.getChild("n0"));
  15207. this.n2 = (this.getChild("n2"));
  15208. }
  15209. }
  15210. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15211. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15212. static createInstance() {
  15213. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15214. }
  15215. onConstruct() {
  15216. this.n0 = (this.getChild("n0"));
  15217. this.n3 = (this.getChild("n3"));
  15218. }
  15219. }
  15220. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15221. class ui_dh_zy_wanfa extends fgui.GButton {
  15222. static createInstance() {
  15223. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15224. }
  15225. onConstruct() {
  15226. this.n0 = (this.getChild("n0"));
  15227. }
  15228. }
  15229. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15230. class ui_Button_login extends fgui.GButton {
  15231. static createInstance() {
  15232. return (fgui.UIPackage.createObject("game", "Button_login"));
  15233. }
  15234. onConstruct() {
  15235. this.button = this.getController("button");
  15236. this.n5 = (this.getChild("n5"));
  15237. }
  15238. }
  15239. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15240. class ui_Component53_1 extends fgui.GComponent {
  15241. static createInstance() {
  15242. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15243. }
  15244. onConstruct() {
  15245. this.n0 = (this.getChild("n0"));
  15246. this.n1 = (this.getChild("n1"));
  15247. this.n2 = (this.getChild("n2"));
  15248. this.n3 = (this.getChild("n3"));
  15249. this.n4 = (this.getChild("n4"));
  15250. this.n5 = (this.getChild("n5"));
  15251. this.n6 = (this.getChild("n6"));
  15252. this.n7 = (this.getChild("n7"));
  15253. this.n8 = (this.getChild("n8"));
  15254. this.n9 = (this.getChild("n9"));
  15255. this.n10 = (this.getChild("n10"));
  15256. this.n11 = (this.getChild("n11"));
  15257. this.n12 = (this.getChild("n12"));
  15258. this.n13 = (this.getChild("n13"));
  15259. this.n14 = (this.getChild("n14"));
  15260. this.n15 = (this.getChild("n15"));
  15261. this.n16 = (this.getChild("n16"));
  15262. this.n19 = (this.getChild("n19"));
  15263. this.n20 = (this.getChild("n20"));
  15264. this.n21 = (this.getChild("n21"));
  15265. this.n22 = (this.getChild("n22"));
  15266. this.n23 = (this.getChild("n23"));
  15267. this.n24 = (this.getChild("n24"));
  15268. this.n25 = (this.getChild("n25"));
  15269. this.n26 = (this.getChild("n26"));
  15270. this.n27 = (this.getChild("n27"));
  15271. this.n28 = (this.getChild("n28"));
  15272. this.n29 = (this.getChild("n29"));
  15273. this.n30 = (this.getChild("n30"));
  15274. this.n31 = (this.getChild("n31"));
  15275. this.n32 = (this.getChild("n32"));
  15276. this.n33 = (this.getChild("n33"));
  15277. this.n34 = (this.getChild("n34"));
  15278. this.n35 = (this.getChild("n35"));
  15279. this.t0 = this.getTransition("t0");
  15280. }
  15281. }
  15282. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15283. class ui_Component30 extends fgui.GComponent {
  15284. static createInstance() {
  15285. return (fgui.UIPackage.createObject("game", "Component30"));
  15286. }
  15287. onConstruct() {
  15288. this.c1 = this.getController("c1");
  15289. this.n46 = (this.getChild("n46"));
  15290. this.n47 = (this.getChild("n47"));
  15291. this.numTxt = (this.getChild("numTxt"));
  15292. this.n50 = (this.getChild("n50"));
  15293. this.n53 = (this.getChild("n53"));
  15294. this.n54 = (this.getChild("n54"));
  15295. this.n55 = (this.getChild("n55"));
  15296. this.n56 = (this.getChild("n56"));
  15297. }
  15298. }
  15299. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15300. class ui_Component30_1 extends fgui.GComponent {
  15301. static createInstance() {
  15302. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15303. }
  15304. onConstruct() {
  15305. this.c1 = this.getController("c1");
  15306. this.n46 = (this.getChild("n46"));
  15307. this.n47 = (this.getChild("n47"));
  15308. this.numTxt = (this.getChild("numTxt"));
  15309. this.n50 = (this.getChild("n50"));
  15310. this.n51 = (this.getChild("n51"));
  15311. this.n52 = (this.getChild("n52"));
  15312. this.n53 = (this.getChild("n53"));
  15313. this.n54 = (this.getChild("n54"));
  15314. }
  15315. }
  15316. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15317. class ui_Component31 extends fgui.GComponent {
  15318. static createInstance() {
  15319. return (fgui.UIPackage.createObject("game", "Component31"));
  15320. }
  15321. onConstruct() {
  15322. this.n55 = (this.getChild("n55"));
  15323. this.n54 = (this.getChild("n54"));
  15324. this.conditionTxt = (this.getChild("conditionTxt"));
  15325. this.n57 = (this.getChild("n57"));
  15326. this.t0 = this.getTransition("t0");
  15327. }
  15328. }
  15329. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15330. class ui_Component32 extends fgui.GComponent {
  15331. static createInstance() {
  15332. return (fgui.UIPackage.createObject("game", "Component32"));
  15333. }
  15334. onConstruct() {
  15335. this.n5 = (this.getChild("n5"));
  15336. this.n6 = (this.getChild("n6"));
  15337. this.n7 = (this.getChild("n7"));
  15338. this.t0 = this.getTransition("t0");
  15339. }
  15340. }
  15341. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15342. class ui_AwardItem extends fgui.GComponent {
  15343. static createInstance() {
  15344. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15345. }
  15346. onConstruct() {
  15347. this.n9 = (this.getChild("n9"));
  15348. this.myIcon = (this.getChild("myIcon"));
  15349. this.numTxt = (this.getChild("numTxt"));
  15350. this.nameTxt = (this.getChild("nameTxt"));
  15351. this.n16 = (this.getChild("n16"));
  15352. this.n17 = (this.getChild("n17"));
  15353. }
  15354. }
  15355. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15356. class ui_ranking_com1 extends fgui.GButton {
  15357. static createInstance() {
  15358. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15359. }
  15360. onConstruct() {
  15361. this.c1 = this.getController("c1");
  15362. this.n49 = (this.getChild("n49"));
  15363. this.n18 = (this.getChild("n18"));
  15364. this.n46 = (this.getChild("n46"));
  15365. this.n48 = (this.getChild("n48"));
  15366. this.n50 = (this.getChild("n50"));
  15367. }
  15368. }
  15369. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15370. class ui_ranking_com2 extends fgui.GButton {
  15371. static createInstance() {
  15372. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15373. }
  15374. onConstruct() {
  15375. this.c1 = this.getController("c1");
  15376. this.n49 = (this.getChild("n49"));
  15377. this.n18 = (this.getChild("n18"));
  15378. this.n46 = (this.getChild("n46"));
  15379. this.n48 = (this.getChild("n48"));
  15380. this.n50 = (this.getChild("n50"));
  15381. }
  15382. }
  15383. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15384. class ui_ranking_com3 extends fgui.GComponent {
  15385. static createInstance() {
  15386. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15387. }
  15388. onConstruct() {
  15389. this.n17 = (this.getChild("n17"));
  15390. this.myIcon = (this.getChild("myIcon"));
  15391. }
  15392. }
  15393. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15394. class ui_ranking_com4 extends fgui.GComponent {
  15395. static createInstance() {
  15396. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15397. }
  15398. onConstruct() {
  15399. this.n16 = (this.getChild("n16"));
  15400. this.head = (this.getChild("head"));
  15401. }
  15402. }
  15403. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15404. class ui_ranking_com5 extends fgui.GComponent {
  15405. static createInstance() {
  15406. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15407. }
  15408. onConstruct() {
  15409. this.c1 = this.getController("c1");
  15410. this.c2 = this.getController("c2");
  15411. this.n2 = (this.getChild("n2"));
  15412. this.n3 = (this.getChild("n3"));
  15413. this.levelBtn = (this.getChild("levelBtn"));
  15414. this.starBtn = (this.getChild("starBtn"));
  15415. this.n23 = (this.getChild("n23"));
  15416. this.n24 = (this.getChild("n24"));
  15417. this.n25 = (this.getChild("n25"));
  15418. this.myList = (this.getChild("myList"));
  15419. this.selfNode = (this.getChild("selfNode"));
  15420. this.n9 = (this.getChild("n9"));
  15421. this.n12 = (this.getChild("n12"));
  15422. this.n13 = (this.getChild("n13"));
  15423. this.n14 = (this.getChild("n14"));
  15424. this.n39 = (this.getChild("n39"));
  15425. this.n41 = (this.getChild("n41"));
  15426. this.n42 = (this.getChild("n42"));
  15427. this.n45 = (this.getChild("n45"));
  15428. this.changeBtn = (this.getChild("changeBtn"));
  15429. this.closeBtn = (this.getChild("closeBtn"));
  15430. this.t0 = this.getTransition("t0");
  15431. }
  15432. }
  15433. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15434. class ui_RankItem extends fgui.GComponent {
  15435. static createInstance() {
  15436. return (fgui.UIPackage.createObject("game", "RankItem"));
  15437. }
  15438. onConstruct() {
  15439. this.n10 = (this.getChild("n10"));
  15440. this.n11 = (this.getChild("n11"));
  15441. this.rankTxt = (this.getChild("rankTxt"));
  15442. this.headNode = (this.getChild("headNode"));
  15443. this.nameTxt = (this.getChild("nameTxt"));
  15444. this.n19 = (this.getChild("n19"));
  15445. this.valueTxt = (this.getChild("valueTxt"));
  15446. this.img1 = (this.getChild("img1"));
  15447. this.img2 = (this.getChild("img2"));
  15448. this.img3 = (this.getChild("img3"));
  15449. }
  15450. }
  15451. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15452. class ui_ranking_com9 extends fgui.GComponent {
  15453. static createInstance() {
  15454. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15455. }
  15456. onConstruct() {
  15457. this.c1 = this.getController("c1");
  15458. this.n27 = (this.getChild("n27"));
  15459. this.n28 = (this.getChild("n28"));
  15460. this.headNode = (this.getChild("headNode"));
  15461. this.rankTxt = (this.getChild("rankTxt"));
  15462. this.nameTxt = (this.getChild("nameTxt"));
  15463. this.n34 = (this.getChild("n34"));
  15464. this.valueTxt = (this.getChild("valueTxt"));
  15465. this.n36 = (this.getChild("n36"));
  15466. this.n37 = (this.getChild("n37"));
  15467. this.n38 = (this.getChild("n38"));
  15468. this.n39 = (this.getChild("n39"));
  15469. this.n40 = (this.getChild("n40"));
  15470. }
  15471. }
  15472. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15473. class ui_ranking_com10 extends fgui.GComponent {
  15474. static createInstance() {
  15475. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15476. }
  15477. onConstruct() {
  15478. this.n23 = (this.getChild("n23"));
  15479. this.n24 = (this.getChild("n24"));
  15480. }
  15481. }
  15482. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15483. class ui_ranking_com11 extends fgui.GComponent {
  15484. static createInstance() {
  15485. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15486. }
  15487. onConstruct() {
  15488. this.n24 = (this.getChild("n24"));
  15489. this.n25 = (this.getChild("n25"));
  15490. this.t0 = this.getTransition("t0");
  15491. }
  15492. }
  15493. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15494. class ui_ranking_com13 extends fgui.GButton {
  15495. static createInstance() {
  15496. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15497. }
  15498. onConstruct() {
  15499. this.c1 = this.getController("c1");
  15500. this.n44 = (this.getChild("n44"));
  15501. this.n45 = (this.getChild("n45"));
  15502. this.n46 = (this.getChild("n46"));
  15503. }
  15504. }
  15505. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15506. class ui_Component122 extends fgui.GComponent {
  15507. static createInstance() {
  15508. return (fgui.UIPackage.createObject("game", "Component122"));
  15509. }
  15510. onConstruct() {
  15511. this.gameNode3 = (this.getChild("gameNode3"));
  15512. }
  15513. }
  15514. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15515. class ui_skillItem extends fgui.GComponent {
  15516. static createInstance() {
  15517. return (fgui.UIPackage.createObject("game", "skillItem"));
  15518. }
  15519. onConstruct() {
  15520. this.c1 = this.getController("c1");
  15521. this.n31 = (this.getChild("n31"));
  15522. this.n6 = (this.getChild("n6"));
  15523. this.skillImg = (this.getChild("skillImg"));
  15524. this.nameTxt = (this.getChild("nameTxt"));
  15525. this.levelTxt = (this.getChild("levelTxt"));
  15526. this.n28 = (this.getChild("n28"));
  15527. this.describeTxt = (this.getChild("describeTxt"));
  15528. this.n32 = (this.getChild("n32"));
  15529. this.mutiBtn = (this.getChild("mutiBtn"));
  15530. this.tryNode = (this.getChild("tryNode"));
  15531. this.normalBtn = (this.getChild("normalBtn"));
  15532. this.startBtn = (this.getChild("startBtn"));
  15533. this.n42 = (this.getChild("n42"));
  15534. this.n43 = (this.getChild("n43"));
  15535. this.n44 = (this.getChild("n44"));
  15536. }
  15537. }
  15538. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15539. class ui_Component26 extends fgui.GButton {
  15540. static createInstance() {
  15541. return (fgui.UIPackage.createObject("game", "Component26"));
  15542. }
  15543. onConstruct() {
  15544. this.n11 = (this.getChild("n11"));
  15545. this.n30 = (this.getChild("n30"));
  15546. this.n34 = (this.getChild("n34"));
  15547. }
  15548. }
  15549. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15550. class ui_Component28 extends fgui.GButton {
  15551. static createInstance() {
  15552. return (fgui.UIPackage.createObject("game", "Component28"));
  15553. }
  15554. onConstruct() {
  15555. this.n12 = (this.getChild("n12"));
  15556. this.n31 = (this.getChild("n31"));
  15557. this.curTxt = (this.getChild("curTxt"));
  15558. this.n33 = (this.getChild("n33"));
  15559. }
  15560. }
  15561. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15562. class ui_Component1302 extends fgui.GComponent {
  15563. static createInstance() {
  15564. return (fgui.UIPackage.createObject("game", "Component1302"));
  15565. }
  15566. onConstruct() {
  15567. this.n2 = (this.getChild("n2"));
  15568. this.n3 = (this.getChild("n3"));
  15569. }
  15570. }
  15571. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15572. class ui_Component113 extends fgui.GComponent {
  15573. static createInstance() {
  15574. return (fgui.UIPackage.createObject("game", "Component113"));
  15575. }
  15576. onConstruct() {
  15577. this.n85 = (this.getChild("n85"));
  15578. this.n86 = (this.getChild("n86"));
  15579. this.n77 = (this.getChild("n77"));
  15580. this.n79 = (this.getChild("n79"));
  15581. this.n80 = (this.getChild("n80"));
  15582. this.n81 = (this.getChild("n81"));
  15583. this.n82 = (this.getChild("n82"));
  15584. this.n84 = (this.getChild("n84"));
  15585. this.n87 = (this.getChild("n87"));
  15586. this.t0 = this.getTransition("t0");
  15587. }
  15588. }
  15589. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15590. class ui_Component114 extends fgui.GComponent {
  15591. static createInstance() {
  15592. return (fgui.UIPackage.createObject("game", "Component114"));
  15593. }
  15594. onConstruct() {
  15595. this.n77 = (this.getChild("n77"));
  15596. this.t0 = this.getTransition("t0");
  15597. }
  15598. }
  15599. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15600. class ui_Component115 extends fgui.GComponent {
  15601. static createInstance() {
  15602. return (fgui.UIPackage.createObject("game", "Component115"));
  15603. }
  15604. onConstruct() {
  15605. this.n83 = (this.getChild("n83"));
  15606. this.fingerNode = (this.getChild("fingerNode"));
  15607. this.n84 = (this.getChild("n84"));
  15608. }
  15609. }
  15610. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15611. class ui_Component117 extends fgui.GComponent {
  15612. static createInstance() {
  15613. return (fgui.UIPackage.createObject("game", "Component117"));
  15614. }
  15615. onConstruct() {
  15616. this.n87 = (this.getChild("n87"));
  15617. this.n88 = (this.getChild("n88"));
  15618. this.n84 = (this.getChild("n84"));
  15619. this.n85 = (this.getChild("n85"));
  15620. this.n86 = (this.getChild("n86"));
  15621. this.t0 = this.getTransition("t0");
  15622. }
  15623. }
  15624. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15625. class ui_Component98_1 extends fgui.GButton {
  15626. static createInstance() {
  15627. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15628. }
  15629. onConstruct() {
  15630. this.c1 = this.getController("c1");
  15631. this.n8 = (this.getChild("n8"));
  15632. this.n41 = (this.getChild("n41"));
  15633. this.n40 = (this.getChild("n40"));
  15634. }
  15635. }
  15636. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15637. class ui_Component61 extends fgui.GComponent {
  15638. static createInstance() {
  15639. return (fgui.UIPackage.createObject("game", "Component61"));
  15640. }
  15641. onConstruct() {
  15642. this.n14 = (this.getChild("n14"));
  15643. this.n6 = (this.getChild("n6"));
  15644. this.t0 = this.getTransition("t0");
  15645. }
  15646. }
  15647. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15648. class ui_Component62 extends fgui.GComponent {
  15649. static createInstance() {
  15650. return (fgui.UIPackage.createObject("game", "Component62"));
  15651. }
  15652. onConstruct() {
  15653. this.n66 = (this.getChild("n66"));
  15654. this.n56 = (this.getChild("n56"));
  15655. this.n63 = (this.getChild("n63"));
  15656. this.n65 = (this.getChild("n65"));
  15657. this.t0 = this.getTransition("t0");
  15658. }
  15659. }
  15660. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15661. class ui_d3Root extends fgui.GComponent {
  15662. static createInstance() {
  15663. return (fgui.UIPackage.createObject("game", "d3Root"));
  15664. }
  15665. onConstruct() {
  15666. }
  15667. }
  15668. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15669. class ui_d2Root extends fgui.GComponent {
  15670. static createInstance() {
  15671. return (fgui.UIPackage.createObject("game", "d2Root"));
  15672. }
  15673. onConstruct() {
  15674. }
  15675. }
  15676. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15677. class ui_ballNode extends fgui.GComponent {
  15678. static createInstance() {
  15679. return (fgui.UIPackage.createObject("game", "ballNode"));
  15680. }
  15681. onConstruct() {
  15682. }
  15683. }
  15684. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15685. class ui_border extends fgui.GComponent {
  15686. static createInstance() {
  15687. return (fgui.UIPackage.createObject("game", "border"));
  15688. }
  15689. onConstruct() {
  15690. this.bar1 = (this.getChild("bar1"));
  15691. this.bar2 = (this.getChild("bar2"));
  15692. this.bar3 = (this.getChild("bar3"));
  15693. this.bar4 = (this.getChild("bar4"));
  15694. this.bar5 = (this.getChild("bar5"));
  15695. this.bar6 = (this.getChild("bar6"));
  15696. this.circle1 = (this.getChild("circle1"));
  15697. this.circle2 = (this.getChild("circle2"));
  15698. this.circle3 = (this.getChild("circle3"));
  15699. this.circle4 = (this.getChild("circle4"));
  15700. this.circle5 = (this.getChild("circle5"));
  15701. this.circle6 = (this.getChild("circle6"));
  15702. this.n28 = (this.getChild("n28"));
  15703. }
  15704. }
  15705. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15706. class ui_btn_buy extends fgui.GButton {
  15707. static createInstance() {
  15708. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15709. }
  15710. onConstruct() {
  15711. this.button = this.getController("button");
  15712. this.n0 = (this.getChild("n0"));
  15713. this.n1 = (this.getChild("n1"));
  15714. this.n2 = (this.getChild("n2"));
  15715. }
  15716. }
  15717. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15718. class ui_Component41_2 extends fgui.GComponent {
  15719. static createInstance() {
  15720. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15721. }
  15722. onConstruct() {
  15723. this.c1 = this.getController("c1");
  15724. this.n0 = (this.getChild("n0"));
  15725. this.n2 = (this.getChild("n2"));
  15726. this.n19 = (this.getChild("n19"));
  15727. this.cancelBtn = (this.getChild("cancelBtn"));
  15728. this.videoBtn = (this.getChild("videoBtn"));
  15729. this.n9 = (this.getChild("n9"));
  15730. this.n22 = (this.getChild("n22"));
  15731. this.tipsTxt = (this.getChild("tipsTxt"));
  15732. this.n23 = (this.getChild("n23"));
  15733. this.n24 = (this.getChild("n24"));
  15734. this.n26 = (this.getChild("n26"));
  15735. this.n27 = (this.getChild("n27"));
  15736. this.titleTxt = (this.getChild("titleTxt"));
  15737. }
  15738. }
  15739. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15740. class ui_Component41_1 extends fgui.GComponent {
  15741. static createInstance() {
  15742. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15743. }
  15744. onConstruct() {
  15745. this.c1 = this.getController("c1");
  15746. this.n0 = (this.getChild("n0"));
  15747. this.n2 = (this.getChild("n2"));
  15748. this.cancelBtn = (this.getChild("cancelBtn"));
  15749. this.videoBtn = (this.getChild("videoBtn"));
  15750. this.n27 = (this.getChild("n27"));
  15751. this.n30 = (this.getChild("n30"));
  15752. this.n31 = (this.getChild("n31"));
  15753. this.n32 = (this.getChild("n32"));
  15754. this.n33 = (this.getChild("n33"));
  15755. this.n34 = (this.getChild("n34"));
  15756. this.n35 = (this.getChild("n35"));
  15757. this.n36 = (this.getChild("n36"));
  15758. this.n1 = (this.getChild("n1"));
  15759. this.n37 = (this.getChild("n37"));
  15760. this.t0 = this.getTransition("t0");
  15761. this.t1 = this.getTransition("t1");
  15762. this.t2 = this.getTransition("t2");
  15763. this.t3 = this.getTransition("t3");
  15764. }
  15765. }
  15766. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15767. class ui_againBtn extends fgui.GButton {
  15768. static createInstance() {
  15769. return (fgui.UIPackage.createObject("game", "againBtn"));
  15770. }
  15771. onConstruct() {
  15772. this.n2 = (this.getChild("n2"));
  15773. this.n1 = (this.getChild("n1"));
  15774. this.n5 = (this.getChild("n5"));
  15775. }
  15776. }
  15777. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15778. class ui_Component118 extends fgui.GButton {
  15779. static createInstance() {
  15780. return (fgui.UIPackage.createObject("game", "Component118"));
  15781. }
  15782. onConstruct() {
  15783. this.c1 = this.getController("c1");
  15784. this.n14 = (this.getChild("n14"));
  15785. this.n9 = (this.getChild("n9"));
  15786. this.n10 = (this.getChild("n10"));
  15787. this.diamondTxt = (this.getChild("diamondTxt"));
  15788. this.n13 = (this.getChild("n13"));
  15789. this.n15 = (this.getChild("n15"));
  15790. }
  15791. }
  15792. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15793. class ui_Component119 extends fgui.GComponent {
  15794. static createInstance() {
  15795. return (fgui.UIPackage.createObject("game", "Component119"));
  15796. }
  15797. onConstruct() {
  15798. this.n1 = (this.getChild("n1"));
  15799. this.n2 = (this.getChild("n2"));
  15800. this.n13 = (this.getChild("n13"));
  15801. this.n6 = (this.getChild("n6"));
  15802. this.screenNode = (this.getChild("screenNode"));
  15803. this.n15 = (this.getChild("n15"));
  15804. this.closeBtn = (this.getChild("closeBtn"));
  15805. this.share2Btn = (this.getChild("share2Btn"));
  15806. this.shareBtn = (this.getChild("shareBtn"));
  15807. this.tipsNode = (this.getChild("tipsNode"));
  15808. this.awardNode = (this.getChild("awardNode"));
  15809. }
  15810. }
  15811. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15812. class ui_daoJuDisplay extends fgui.GComponent {
  15813. static createInstance() {
  15814. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15815. }
  15816. onConstruct() {
  15817. this.n6 = (this.getChild("n6"));
  15818. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15819. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15820. this.btn_buy = (this.getChild("btn_buy"));
  15821. this.nameTxt = (this.getChild("nameTxt"));
  15822. this.zsImg = (this.getChild("zsImg"));
  15823. }
  15824. }
  15825. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15826. class ui_Component132_1 extends fgui.GComponent {
  15827. static createInstance() {
  15828. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15829. }
  15830. onConstruct() {
  15831. this.n25 = (this.getChild("n25"));
  15832. this.n26 = (this.getChild("n26"));
  15833. this.n27 = (this.getChild("n27"));
  15834. this.t0 = this.getTransition("t0");
  15835. }
  15836. }
  15837. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15838. class ui_SecretaryDisplay extends fgui.GComponent {
  15839. static createInstance() {
  15840. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15841. }
  15842. onConstruct() {
  15843. this.n2 = (this.getChild("n2"));
  15844. this.levelTxt = (this.getChild("levelTxt"));
  15845. this.n4 = (this.getChild("n4"));
  15846. this.secretary = (this.getChild("secretary"));
  15847. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15848. this.n16 = (this.getChild("n16"));
  15849. this.n37 = (this.getChild("n37"));
  15850. this.n41 = (this.getChild("n41"));
  15851. this.n14 = (this.getChild("n14"));
  15852. this.n17 = (this.getChild("n17"));
  15853. this.heightTxt = (this.getChild("heightTxt"));
  15854. this.n46 = (this.getChild("n46"));
  15855. this.n36 = (this.getChild("n36"));
  15856. this.n38 = (this.getChild("n38"));
  15857. this.foodTxt = (this.getChild("foodTxt"));
  15858. this.n47 = (this.getChild("n47"));
  15859. this.n40 = (this.getChild("n40"));
  15860. this.n42 = (this.getChild("n42"));
  15861. this.historyTxt = (this.getChild("historyTxt"));
  15862. this.n48 = (this.getChild("n48"));
  15863. this.nameImg = (this.getChild("nameImg"));
  15864. this.n12 = (this.getChild("n12"));
  15865. this.n49 = (this.getChild("n49"));
  15866. this.t0 = this.getTransition("t0");
  15867. }
  15868. }
  15869. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15870. class ui_BallRodDisplay extends fgui.GComponent {
  15871. static createInstance() {
  15872. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15873. }
  15874. onConstruct() {
  15875. this.c1 = this.getController("c1");
  15876. this.n31 = (this.getChild("n31"));
  15877. this.n6 = (this.getChild("n6"));
  15878. this.nameTxt = (this.getChild("nameTxt"));
  15879. this.rodImg = (this.getChild("rodImg"));
  15880. this.eftRod = (this.getChild("eftRod"));
  15881. this.levelNode = (this.getChild("levelNode"));
  15882. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15883. }
  15884. }
  15885. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15886. class ui_Component111_11 extends fgui.GComponent {
  15887. static createInstance() {
  15888. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15889. }
  15890. onConstruct() {
  15891. this.n68 = (this.getChild("n68"));
  15892. this.n69 = (this.getChild("n69"));
  15893. }
  15894. }
  15895. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15896. class ui_Component112 extends fgui.GComponent {
  15897. static createInstance() {
  15898. return (fgui.UIPackage.createObject("game", "Component112"));
  15899. }
  15900. onConstruct() {
  15901. this.n68 = (this.getChild("n68"));
  15902. this.n70 = (this.getChild("n70"));
  15903. this.myMask = (this.getChild("myMask"));
  15904. }
  15905. }
  15906. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15907. class ui_Component111 extends fgui.GComponent {
  15908. static createInstance() {
  15909. return (fgui.UIPackage.createObject("game", "Component111"));
  15910. }
  15911. onConstruct() {
  15912. this.n68 = (this.getChild("n68"));
  15913. this.myMask = (this.getChild("myMask"));
  15914. }
  15915. }
  15916. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15917. class ui_Component144 extends fgui.GButton {
  15918. static createInstance() {
  15919. return (fgui.UIPackage.createObject("game", "Component144"));
  15920. }
  15921. onConstruct() {
  15922. this.n8 = (this.getChild("n8"));
  15923. }
  15924. }
  15925. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15926. class ui_Sign_com2 extends fgui.GComponent {
  15927. static createInstance() {
  15928. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15929. }
  15930. onConstruct() {
  15931. this.n0 = (this.getChild("n0"));
  15932. this.n1 = (this.getChild("n1"));
  15933. this.t0 = this.getTransition("t0");
  15934. }
  15935. }
  15936. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15937. class ui_Sign_guang extends fgui.GComponent {
  15938. static createInstance() {
  15939. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15940. }
  15941. onConstruct() {
  15942. this.n1 = (this.getChild("n1"));
  15943. this.n2 = (this.getChild("n2"));
  15944. this.n3 = (this.getChild("n3"));
  15945. this.n4 = (this.getChild("n4"));
  15946. this.n5 = (this.getChild("n5"));
  15947. this.n6 = (this.getChild("n6"));
  15948. this.n8 = (this.getChild("n8"));
  15949. }
  15950. }
  15951. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15952. class ui_SignMax extends fgui.GComponent {
  15953. static createInstance() {
  15954. return (fgui.UIPackage.createObject("game", "SignMax"));
  15955. }
  15956. onConstruct() {
  15957. this.c1 = this.getController("c1");
  15958. this.n7 = (this.getChild("n7"));
  15959. this.n15 = (this.getChild("n15"));
  15960. this.n8 = (this.getChild("n8"));
  15961. this.titleTxt = (this.getChild("titleTxt"));
  15962. this.myIcon1 = (this.getChild("myIcon1"));
  15963. this.numTxt1 = (this.getChild("numTxt1"));
  15964. this.myIcon2 = (this.getChild("myIcon2"));
  15965. this.n20 = (this.getChild("n20"));
  15966. this.n17 = (this.getChild("n17"));
  15967. this.numTxt2 = (this.getChild("numTxt2"));
  15968. this.n12 = (this.getChild("n12"));
  15969. this.n13 = (this.getChild("n13"));
  15970. this.n21 = (this.getChild("n21"));
  15971. this.n14 = (this.getChild("n14"));
  15972. }
  15973. }
  15974. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15975. class ui_Sign_com2_1 extends fgui.GComponent {
  15976. static createInstance() {
  15977. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15978. }
  15979. onConstruct() {
  15980. this.n0 = (this.getChild("n0"));
  15981. this.n1 = (this.getChild("n1"));
  15982. this.t0 = this.getTransition("t0");
  15983. }
  15984. }
  15985. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15986. class ui_Sign_com5 extends fgui.GComponent {
  15987. static createInstance() {
  15988. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15989. }
  15990. onConstruct() {
  15991. this.n3 = (this.getChild("n3"));
  15992. this.n29 = (this.getChild("n29"));
  15993. this.n4 = (this.getChild("n4"));
  15994. this.day1 = (this.getChild("day1"));
  15995. this.day2 = (this.getChild("day2"));
  15996. this.day3 = (this.getChild("day3"));
  15997. this.day4 = (this.getChild("day4"));
  15998. this.day5 = (this.getChild("day5"));
  15999. this.day6 = (this.getChild("day6"));
  16000. this.day7 = (this.getChild("day7"));
  16001. this.t0 = this.getTransition("t0");
  16002. }
  16003. }
  16004. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  16005. class ui_Sign_com8 extends fgui.GComponent {
  16006. static createInstance() {
  16007. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  16008. }
  16009. onConstruct() {
  16010. this.n48 = (this.getChild("n48"));
  16011. this.womanTxt = (this.getChild("womanTxt"));
  16012. this.t0 = this.getTransition("t0");
  16013. }
  16014. }
  16015. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  16016. class ui_Sign_com6 extends fgui.GComponent {
  16017. static createInstance() {
  16018. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  16019. }
  16020. onConstruct() {
  16021. this.n2 = (this.getChild("n2"));
  16022. this.n3 = (this.getChild("n3"));
  16023. this.t0 = this.getTransition("t0");
  16024. }
  16025. }
  16026. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  16027. class ui_Sign_com7 extends fgui.GComponent {
  16028. static createInstance() {
  16029. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  16030. }
  16031. onConstruct() {
  16032. this.n29 = (this.getChild("n29"));
  16033. this.n2 = (this.getChild("n2"));
  16034. }
  16035. }
  16036. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  16037. class ui_UITurntable_com1_2 extends fgui.GComponent {
  16038. static createInstance() {
  16039. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  16040. }
  16041. onConstruct() {
  16042. this.n5 = (this.getChild("n5"));
  16043. this.n4 = (this.getChild("n4"));
  16044. this.t0 = this.getTransition("t0");
  16045. }
  16046. }
  16047. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  16048. class ui_UITurntable_com2 extends fgui.GComponent {
  16049. static createInstance() {
  16050. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  16051. }
  16052. onConstruct() {
  16053. this.c1 = this.getController("c1");
  16054. this.n4 = (this.getChild("n4"));
  16055. this.n6 = (this.getChild("n6"));
  16056. this.n10 = (this.getChild("n10"));
  16057. this.n11 = (this.getChild("n11"));
  16058. this.n12 = (this.getChild("n12"));
  16059. this.n13 = (this.getChild("n13"));
  16060. this.n14 = (this.getChild("n14"));
  16061. this.n15 = (this.getChild("n15"));
  16062. this.n16 = (this.getChild("n16"));
  16063. this.n17 = (this.getChild("n17"));
  16064. this.n18 = (this.getChild("n18"));
  16065. this.n19 = (this.getChild("n19"));
  16066. this.n20 = (this.getChild("n20"));
  16067. this.n21 = (this.getChild("n21"));
  16068. this.n22 = (this.getChild("n22"));
  16069. this.n23 = (this.getChild("n23"));
  16070. this.n24 = (this.getChild("n24"));
  16071. this.n25 = (this.getChild("n25"));
  16072. this.n26 = (this.getChild("n26"));
  16073. this.n27 = (this.getChild("n27"));
  16074. this.n28 = (this.getChild("n28"));
  16075. this.n29 = (this.getChild("n29"));
  16076. this.n30 = (this.getChild("n30"));
  16077. this.n31 = (this.getChild("n31"));
  16078. this.n32 = (this.getChild("n32"));
  16079. this.n33 = (this.getChild("n33"));
  16080. }
  16081. }
  16082. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  16083. class ui_UITurntable_com1_1 extends fgui.GComponent {
  16084. static createInstance() {
  16085. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  16086. }
  16087. onConstruct() {
  16088. this.n5 = (this.getChild("n5"));
  16089. this.n4 = (this.getChild("n4"));
  16090. this.t0 = this.getTransition("t0");
  16091. }
  16092. }
  16093. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  16094. class ui_UITurntable_com5 extends fgui.GComponent {
  16095. static createInstance() {
  16096. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  16097. }
  16098. onConstruct() {
  16099. this.flashNode = (this.getChild("flashNode"));
  16100. this.rotNode = (this.getChild("rotNode"));
  16101. this.n3 = (this.getChild("n3"));
  16102. this.n21 = (this.getChild("n21"));
  16103. this.t0 = this.getTransition("t0");
  16104. }
  16105. }
  16106. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  16107. class ui_UITurntable_com7 extends fgui.GComponent {
  16108. static createInstance() {
  16109. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  16110. }
  16111. onConstruct() {
  16112. this.n2 = (this.getChild("n2"));
  16113. this.n35 = (this.getChild("n35"));
  16114. this.img1 = (this.getChild("img1"));
  16115. this.img2 = (this.getChild("img2"));
  16116. this.img3 = (this.getChild("img3"));
  16117. this.img4 = (this.getChild("img4"));
  16118. this.img6 = (this.getChild("img6"));
  16119. this.img5 = (this.getChild("img5"));
  16120. this.txt1 = (this.getChild("txt1"));
  16121. this.txt2 = (this.getChild("txt2"));
  16122. this.txt3 = (this.getChild("txt3"));
  16123. this.txt4 = (this.getChild("txt4"));
  16124. this.txt5 = (this.getChild("txt5"));
  16125. this.txt6 = (this.getChild("txt6"));
  16126. }
  16127. }
  16128. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  16129. class ui_UITurntable_com9 extends fgui.GComponent {
  16130. static createInstance() {
  16131. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  16132. }
  16133. onConstruct() {
  16134. this.n38 = (this.getChild("n38"));
  16135. this.n39 = (this.getChild("n39"));
  16136. }
  16137. }
  16138. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16139. class ui_UITurntable_com10 extends fgui.GComponent {
  16140. static createInstance() {
  16141. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16142. }
  16143. onConstruct() {
  16144. this.n39 = (this.getChild("n39"));
  16145. this.n40 = (this.getChild("n40"));
  16146. this.t0 = this.getTransition("t0");
  16147. }
  16148. }
  16149. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16150. class ui_UITurntable_com11 extends fgui.GComponent {
  16151. static createInstance() {
  16152. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16153. }
  16154. onConstruct() {
  16155. this.n38 = (this.getChild("n38"));
  16156. this.n39 = (this.getChild("n39"));
  16157. this.n40 = (this.getChild("n40"));
  16158. this.t0 = this.getTransition("t0");
  16159. }
  16160. }
  16161. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16162. class ui_UITurntable_com12 extends fgui.GComponent {
  16163. static createInstance() {
  16164. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16165. }
  16166. onConstruct() {
  16167. this.n43 = (this.getChild("n43"));
  16168. this.barNode = (this.getChild("barNode"));
  16169. this.tipsTxt = (this.getChild("tipsTxt"));
  16170. this.n45 = (this.getChild("n45"));
  16171. this.boxBtn = (this.getChild("boxBtn"));
  16172. }
  16173. }
  16174. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16175. class ui_UITurntable_com1 extends fgui.GButton {
  16176. static createInstance() {
  16177. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16178. }
  16179. onConstruct() {
  16180. this.n41 = (this.getChild("n41"));
  16181. this.n42 = (this.getChild("n42"));
  16182. this.t0 = this.getTransition("t0");
  16183. }
  16184. }
  16185. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16186. class ui_UITurntable_com3 extends fgui.GComponent {
  16187. static createInstance() {
  16188. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16189. }
  16190. onConstruct() {
  16191. this.n48 = (this.getChild("n48"));
  16192. this.womanTxt = (this.getChild("womanTxt"));
  16193. this.t0 = this.getTransition("t0");
  16194. }
  16195. }
  16196. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16197. class ui_cancelBtn2 extends fgui.GButton {
  16198. static createInstance() {
  16199. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16200. }
  16201. onConstruct() {
  16202. this.c1 = this.getController("c1");
  16203. this.n0 = (this.getChild("n0"));
  16204. this.n1 = (this.getChild("n1"));
  16205. this.n2 = (this.getChild("n2"));
  16206. this.n3 = (this.getChild("n3"));
  16207. this.n4 = (this.getChild("n4"));
  16208. this.n5 = (this.getChild("n5"));
  16209. this.n6 = (this.getChild("n6"));
  16210. this.n7 = (this.getChild("n7"));
  16211. this.n8 = (this.getChild("n8"));
  16212. this.powerEft = (this.getChild("powerEft"));
  16213. }
  16214. }
  16215. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16216. class ui_shareBtn2 extends fgui.GButton {
  16217. static createInstance() {
  16218. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16219. }
  16220. onConstruct() {
  16221. this.c1 = this.getController("c1");
  16222. this.n2 = (this.getChild("n2"));
  16223. this.n24 = (this.getChild("n24"));
  16224. this.n1 = (this.getChild("n1"));
  16225. this.n3 = (this.getChild("n3"));
  16226. this.n23 = (this.getChild("n23"));
  16227. this.n4 = (this.getChild("n4"));
  16228. this.n5 = (this.getChild("n5"));
  16229. this.n6 = (this.getChild("n6"));
  16230. this.n20 = (this.getChild("n20"));
  16231. this.n21 = (this.getChild("n21"));
  16232. this.n22 = (this.getChild("n22"));
  16233. this.powerEft = (this.getChild("powerEft"));
  16234. }
  16235. }
  16236. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16237. class ui_UIMoney extends fgui.GComponent {
  16238. static createInstance() {
  16239. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16240. }
  16241. onConstruct() {
  16242. this.c1 = this.getController("c1");
  16243. this.n4 = (this.getChild("n4"));
  16244. this.coinImg = (this.getChild("coinImg"));
  16245. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16246. this.coinTxt = (this.getChild("coinTxt"));
  16247. this.n7 = (this.getChild("n7"));
  16248. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16249. this.diamondTxt = (this.getChild("diamondTxt"));
  16250. this.diamondImg = (this.getChild("diamondImg"));
  16251. this.n12 = (this.getChild("n12"));
  16252. this.powerImg = (this.getChild("powerImg"));
  16253. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16254. this.powerTxt = (this.getChild("powerTxt"));
  16255. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16256. }
  16257. }
  16258. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16259. class ui_backBtn extends fgui.GButton {
  16260. static createInstance() {
  16261. return (fgui.UIPackage.createObject("game", "backBtn"));
  16262. }
  16263. onConstruct() {
  16264. this.n0 = (this.getChild("n0"));
  16265. this.t0 = this.getTransition("t0");
  16266. this.t1 = this.getTransition("t1");
  16267. }
  16268. }
  16269. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16270. class ui_MoneyBtn extends fgui.GButton {
  16271. static createInstance() {
  16272. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16273. }
  16274. onConstruct() {
  16275. this.button = this.getController("button");
  16276. this.n0 = (this.getChild("n0"));
  16277. }
  16278. }
  16279. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16280. class ui_UIMoneyBtn extends fgui.GComponent {
  16281. static createInstance() {
  16282. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16283. }
  16284. onConstruct() {
  16285. this.n1 = (this.getChild("n1"));
  16286. this.closeBtn = (this.getChild("closeBtn"));
  16287. }
  16288. }
  16289. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16290. class ui_Component64 extends fgui.GComponent {
  16291. static createInstance() {
  16292. return (fgui.UIPackage.createObject("game", "Component64"));
  16293. }
  16294. onConstruct() {
  16295. this.n57 = (this.getChild("n57"));
  16296. this.n54 = (this.getChild("n54"));
  16297. this.n55 = (this.getChild("n55"));
  16298. this.n56 = (this.getChild("n56"));
  16299. this.t1 = this.getTransition("t1");
  16300. }
  16301. }
  16302. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16303. class ui_Component41_3 extends fgui.GComponent {
  16304. static createInstance() {
  16305. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16306. }
  16307. onConstruct() {
  16308. this.c1 = this.getController("c1");
  16309. this.n0 = (this.getChild("n0"));
  16310. this.n2 = (this.getChild("n2"));
  16311. this.cancelBtn = (this.getChild("cancelBtn"));
  16312. this.videoBtn = (this.getChild("videoBtn"));
  16313. this.n9 = (this.getChild("n9"));
  16314. this.n24 = (this.getChild("n24"));
  16315. this.n27 = (this.getChild("n27"));
  16316. this.titleTxt = (this.getChild("titleTxt"));
  16317. this.n28 = (this.getChild("n28"));
  16318. this.t0 = this.getTransition("t0");
  16319. }
  16320. }
  16321. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16322. class ui_dh_zs_4 extends fgui.GComponent {
  16323. static createInstance() {
  16324. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16325. }
  16326. onConstruct() {
  16327. this.n1 = (this.getChild("n1"));
  16328. this.n2 = (this.getChild("n2"));
  16329. this.n3 = (this.getChild("n3"));
  16330. this.n4 = (this.getChild("n4"));
  16331. this.n5 = (this.getChild("n5"));
  16332. this.n6 = (this.getChild("n6"));
  16333. this.n8 = (this.getChild("n8"));
  16334. this.t0 = this.getTransition("t0");
  16335. }
  16336. }
  16337. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16338. class ui_Component71_1 extends fgui.GButton {
  16339. static createInstance() {
  16340. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16341. }
  16342. onConstruct() {
  16343. this.n17 = (this.getChild("n17"));
  16344. this.t0 = this.getTransition("t0");
  16345. }
  16346. }
  16347. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16348. class ui_Component83 extends fgui.GComponent {
  16349. static createInstance() {
  16350. return (fgui.UIPackage.createObject("game", "Component83"));
  16351. }
  16352. onConstruct() {
  16353. this.c1 = this.getController("c1");
  16354. this.n17 = (this.getChild("n17"));
  16355. this.n19 = (this.getChild("n19"));
  16356. this.n20 = (this.getChild("n20"));
  16357. }
  16358. }
  16359. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16360. class ui_Component84 extends fgui.GComponent {
  16361. static createInstance() {
  16362. return (fgui.UIPackage.createObject("game", "Component84"));
  16363. }
  16364. onConstruct() {
  16365. this.c1 = this.getController("c1");
  16366. this.n4 = (this.getChild("n4"));
  16367. this.n22 = (this.getChild("n22"));
  16368. this.n23 = (this.getChild("n23"));
  16369. this.numTxt = (this.getChild("numTxt"));
  16370. this.n25 = (this.getChild("n25"));
  16371. this.n26 = (this.getChild("n26"));
  16372. }
  16373. }
  16374. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16375. class ui_Component84_1 extends fgui.GComponent {
  16376. static createInstance() {
  16377. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16378. }
  16379. onConstruct() {
  16380. this.c1 = this.getController("c1");
  16381. this.n4 = (this.getChild("n4"));
  16382. this.n22 = (this.getChild("n22"));
  16383. this.n23 = (this.getChild("n23"));
  16384. this.numTxt = (this.getChild("numTxt"));
  16385. this.n25 = (this.getChild("n25"));
  16386. this.n26 = (this.getChild("n26"));
  16387. }
  16388. }
  16389. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16390. class ui_Component85 extends fgui.GComponent {
  16391. static createInstance() {
  16392. return (fgui.UIPackage.createObject("game", "Component85"));
  16393. }
  16394. onConstruct() {
  16395. this.n1 = (this.getChild("n1"));
  16396. this.n6 = (this.getChild("n6"));
  16397. this.n2 = (this.getChild("n2"));
  16398. this.n3 = (this.getChild("n3"));
  16399. this.levelTxt = (this.getChild("levelTxt"));
  16400. this.n10 = (this.getChild("n10"));
  16401. this.n11 = (this.getChild("n11"));
  16402. this.n12 = (this.getChild("n12"));
  16403. this.n13 = (this.getChild("n13"));
  16404. this.n14 = (this.getChild("n14"));
  16405. this.modeNode = (this.getChild("modeNode"));
  16406. this.n18 = (this.getChild("n18"));
  16407. this.conditionTxt = (this.getChild("conditionTxt"));
  16408. this.diamondNode = (this.getChild("diamondNode"));
  16409. this.coinNode = (this.getChild("coinNode"));
  16410. this.startBtn = (this.getChild("startBtn"));
  16411. this.n28 = (this.getChild("n28"));
  16412. this.displayRoot = (this.getChild("displayRoot"));
  16413. this.t0 = this.getTransition("t0");
  16414. }
  16415. }
  16416. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16417. class ui_Component86 extends fgui.GButton {
  16418. static createInstance() {
  16419. return (fgui.UIPackage.createObject("game", "Component86"));
  16420. }
  16421. onConstruct() {
  16422. this.n15 = (this.getChild("n15"));
  16423. this.t0 = this.getTransition("t0");
  16424. }
  16425. }
  16426. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16427. class ui_Component87 extends fgui.GComponent {
  16428. static createInstance() {
  16429. return (fgui.UIPackage.createObject("game", "Component87"));
  16430. }
  16431. onConstruct() {
  16432. this.n66 = (this.getChild("n66"));
  16433. this.myProgress = (this.getChild("myProgress"));
  16434. this.starAni = (this.getChild("starAni"));
  16435. this.hpTxt = (this.getChild("hpTxt"));
  16436. this.n74 = (this.getChild("n74"));
  16437. this.n73 = (this.getChild("n73"));
  16438. this.ballTxt = (this.getChild("ballTxt"));
  16439. this.n76 = (this.getChild("n76"));
  16440. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16441. this.levelTxt = (this.getChild("levelTxt"));
  16442. this.star1 = (this.getChild("star1"));
  16443. this.star2 = (this.getChild("star2"));
  16444. this.star3 = (this.getChild("star3"));
  16445. }
  16446. }
  16447. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16448. class ui_Component88 extends fgui.GProgressBar {
  16449. static createInstance() {
  16450. return (fgui.UIPackage.createObject("game", "Component88"));
  16451. }
  16452. onConstruct() {
  16453. this.n68 = (this.getChild("n68"));
  16454. this.bar = (this.getChild("bar"));
  16455. }
  16456. }
  16457. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16458. class ui_Component89 extends fgui.GComponent {
  16459. static createInstance() {
  16460. return (fgui.UIPackage.createObject("game", "Component89"));
  16461. }
  16462. onConstruct() {
  16463. this.c1 = this.getController("c1");
  16464. this.n71 = (this.getChild("n71"));
  16465. this.n72 = (this.getChild("n72"));
  16466. }
  16467. }
  16468. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16469. class ui_Component90 extends fgui.GComponent {
  16470. static createInstance() {
  16471. return (fgui.UIPackage.createObject("game", "Component90"));
  16472. }
  16473. onConstruct() {
  16474. this.c1 = this.getController("c1");
  16475. this.n64 = (this.getChild("n64"));
  16476. this.n65 = (this.getChild("n65"));
  16477. this.n66 = (this.getChild("n66"));
  16478. this.t0 = this.getTransition("t0");
  16479. }
  16480. }
  16481. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16482. class ui_Component127 extends fgui.GButton {
  16483. static createInstance() {
  16484. return (fgui.UIPackage.createObject("game", "Component127"));
  16485. }
  16486. onConstruct() {
  16487. this.n5 = (this.getChild("n5"));
  16488. }
  16489. }
  16490. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16491. class gameBinder {
  16492. static bindAll() {
  16493. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16494. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16495. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16496. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16497. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16498. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16499. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16500. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16501. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16502. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16503. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16504. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16505. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16506. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16507. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16508. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16509. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16510. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16511. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16512. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16513. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16514. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16515. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16516. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16517. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16518. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16519. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16520. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16521. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16522. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16523. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16524. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16525. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16526. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16527. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16528. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16529. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16530. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16531. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16532. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16533. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16534. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16535. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16536. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16537. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16538. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16539. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16540. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16541. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16542. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16543. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16544. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16545. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16546. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16547. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16548. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16549. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16550. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16551. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16552. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16553. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16554. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16555. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16556. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16557. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16558. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16559. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16560. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16561. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16562. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16563. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16564. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16565. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16566. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16567. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16568. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16569. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16570. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16571. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16572. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16573. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16574. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16575. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16576. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16577. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16578. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16579. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16580. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16581. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16582. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16583. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16584. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16585. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16586. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16587. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16588. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16589. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16590. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16591. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16592. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16593. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16594. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16595. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16596. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16597. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16598. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16599. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16600. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16601. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16602. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16603. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16604. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16605. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16606. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16607. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16608. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16609. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16610. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16611. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16612. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16613. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16614. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16615. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16616. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16617. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16618. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16619. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16620. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16621. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16622. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16623. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16624. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16625. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16626. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16627. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16628. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16629. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16630. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16631. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16632. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16633. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16634. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16635. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16636. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16637. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16638. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16639. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16640. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16641. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16642. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16643. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16644. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16645. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16646. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16647. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16648. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16649. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16650. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16651. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16652. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16653. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16654. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16655. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16656. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16657. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16658. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16659. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16660. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16661. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16662. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16663. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16664. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16665. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16666. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16667. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16668. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16669. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16670. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16671. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16672. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16673. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16674. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16675. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16676. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16677. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16678. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16679. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16680. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16681. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16682. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16683. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16684. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16685. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16686. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16687. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16688. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16689. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16690. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16691. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16692. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16693. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16694. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16695. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16696. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16697. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16698. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16699. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16700. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16701. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16702. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16703. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16704. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16705. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16706. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16707. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16708. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16709. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16710. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16711. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16712. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16713. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16714. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16715. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16716. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16717. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16718. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16719. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16720. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16721. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16722. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16723. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16724. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16725. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16726. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16727. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16728. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16729. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16730. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16731. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16732. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16733. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16734. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16735. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16736. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16737. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16738. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16739. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16740. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16741. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16742. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16743. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16744. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16745. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16746. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16747. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16748. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16749. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16750. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16751. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16752. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16753. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16754. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16755. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16756. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16757. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16758. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16759. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16760. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16761. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16762. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16763. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16764. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16765. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16766. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16767. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16768. }
  16769. }
  16770. class ui_btn6 extends fgui.GButton {
  16771. static createInstance() {
  16772. return (fgui.UIPackage.createObject("loading", "btn6"));
  16773. }
  16774. onConstruct() {
  16775. this.n6 = (this.getChild("n6"));
  16776. this.n1 = (this.getChild("n1"));
  16777. }
  16778. }
  16779. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16780. class ui_xyItem extends fgui.GComponent {
  16781. static createInstance() {
  16782. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16783. }
  16784. onConstruct() {
  16785. this.xyItem = (this.getChild("xyItem"));
  16786. }
  16787. }
  16788. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16789. class ui_loadinfo extends fgui.GProgressBar {
  16790. static createInstance() {
  16791. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16792. }
  16793. onConstruct() {
  16794. this.bg = (this.getChild("bg"));
  16795. this.bar = (this.getChild("bar"));
  16796. this.title = (this.getChild("title"));
  16797. this.ani = (this.getChild("ani"));
  16798. }
  16799. }
  16800. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16801. class ui_xyNode extends fgui.GComponent {
  16802. static createInstance() {
  16803. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16804. }
  16805. onConstruct() {
  16806. this.n0 = (this.getChild("n0"));
  16807. this.btnYes = (this.getChild("btnYes"));
  16808. this.btnNo = (this.getChild("btnNo"));
  16809. this.btnKnown = (this.getChild("btnKnown"));
  16810. this.btnSure = (this.getChild("btnSure"));
  16811. this.txtWelcom = (this.getChild("txtWelcom"));
  16812. this.txtXy = (this.getChild("txtXy"));
  16813. this.n75 = (this.getChild("n75"));
  16814. this.btnXy1 = (this.getChild("btnXy1"));
  16815. this.btnXy3 = (this.getChild("btnXy3"));
  16816. this.btnXy2 = (this.getChild("btnXy2"));
  16817. this.n74 = (this.getChild("n74"));
  16818. this.xy1 = (this.getChild("xy1"));
  16819. this.txtTitle = (this.getChild("txtTitle"));
  16820. this.btnBack = (this.getChild("btnBack"));
  16821. this.xyList = (this.getChild("xyList"));
  16822. this.xy2 = (this.getChild("xy2"));
  16823. this.xyNode = (this.getChild("xyNode"));
  16824. }
  16825. }
  16826. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16827. class ui_ageNode extends fgui.GComponent {
  16828. static createInstance() {
  16829. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16830. }
  16831. onConstruct() {
  16832. this.n3 = (this.getChild("n3"));
  16833. this.n7 = (this.getChild("n7"));
  16834. this.n4 = (this.getChild("n4"));
  16835. this.btnAge = (this.getChild("btnAge"));
  16836. this.ageNode = (this.getChild("ageNode"));
  16837. }
  16838. }
  16839. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16840. class ui_rnNode extends fgui.GComponent {
  16841. static createInstance() {
  16842. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16843. }
  16844. onConstruct() {
  16845. this.n28 = (this.getChild("n28"));
  16846. this.n30 = (this.getChild("n30"));
  16847. this.n33 = (this.getChild("n33"));
  16848. this.rn1 = (this.getChild("rn1"));
  16849. this.n40 = (this.getChild("n40"));
  16850. this.n41 = (this.getChild("n41"));
  16851. this.rn3 = (this.getChild("rn3"));
  16852. this.n37 = (this.getChild("n37"));
  16853. this.n39 = (this.getChild("n39"));
  16854. this.rn2 = (this.getChild("rn2"));
  16855. this.n47 = (this.getChild("n47"));
  16856. this.n49 = (this.getChild("n49"));
  16857. this.n44 = (this.getChild("n44"));
  16858. this.inputCode = (this.getChild("inputCode"));
  16859. this.inputName = (this.getChild("inputName"));
  16860. this.n48 = (this.getChild("n48"));
  16861. this.n50 = (this.getChild("n50"));
  16862. this.rn4 = (this.getChild("rn4"));
  16863. this.btnCheck = (this.getChild("btnCheck"));
  16864. this.btnExit = (this.getChild("btnExit"));
  16865. this.btnDone = (this.getChild("btnDone"));
  16866. this.rnNode = (this.getChild("rnNode"));
  16867. }
  16868. }
  16869. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16870. class ui_tipNode extends fgui.GComponent {
  16871. static createInstance() {
  16872. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16873. }
  16874. onConstruct() {
  16875. this.bg = (this.getChild("bg"));
  16876. this.n55 = (this.getChild("n55"));
  16877. this.n56 = (this.getChild("n56"));
  16878. this.tipNode = (this.getChild("tipNode"));
  16879. }
  16880. }
  16881. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16882. class ui_fcmNode extends fgui.GComponent {
  16883. static createInstance() {
  16884. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16885. }
  16886. onConstruct() {
  16887. this.n63 = (this.getChild("n63"));
  16888. this.n62 = (this.getChild("n62"));
  16889. this.btnRn = (this.getChild("btnRn"));
  16890. this.n61 = (this.getChild("n61"));
  16891. this.n58 = (this.getChild("n58"));
  16892. this.fcmNode = (this.getChild("fcmNode"));
  16893. }
  16894. }
  16895. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16896. class ui_msgNode extends fgui.GComponent {
  16897. static createInstance() {
  16898. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16899. }
  16900. onConstruct() {
  16901. this.n69 = (this.getChild("n69"));
  16902. this.txtMsg = (this.getChild("txtMsg"));
  16903. this.msgNode = (this.getChild("msgNode"));
  16904. }
  16905. }
  16906. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16907. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16908. static createInstance() {
  16909. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16910. }
  16911. onConstruct() {
  16912. this.n1 = (this.getChild("n1"));
  16913. this.n13 = (this.getChild("n13"));
  16914. this.n14 = (this.getChild("n14"));
  16915. this.n15 = (this.getChild("n15"));
  16916. this.n3 = (this.getChild("n3"));
  16917. this.n4 = (this.getChild("n4"));
  16918. this.n5 = (this.getChild("n5"));
  16919. this.n6 = (this.getChild("n6"));
  16920. this.n7 = (this.getChild("n7"));
  16921. this.n8 = (this.getChild("n8"));
  16922. this.n9 = (this.getChild("n9"));
  16923. this.n10 = (this.getChild("n10"));
  16924. this.n12 = (this.getChild("n12"));
  16925. this.n11 = (this.getChild("n11"));
  16926. this.n16 = (this.getChild("n16"));
  16927. this.n17 = (this.getChild("n17"));
  16928. this.n18 = (this.getChild("n18"));
  16929. this.n20 = (this.getChild("n20"));
  16930. this.n21 = (this.getChild("n21"));
  16931. this.t0 = this.getTransition("t0");
  16932. }
  16933. }
  16934. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16935. class ui_btn5 extends fgui.GButton {
  16936. static createInstance() {
  16937. return (fgui.UIPackage.createObject("loading", "btn5"));
  16938. }
  16939. onConstruct() {
  16940. this.n9 = (this.getChild("n9"));
  16941. this.n1 = (this.getChild("n1"));
  16942. }
  16943. }
  16944. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16945. class ui_UILoading extends fgui.GComponent {
  16946. static createInstance() {
  16947. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16948. }
  16949. onConstruct() {
  16950. this.n12 = (this.getChild("n12"));
  16951. this.loadinfo = (this.getChild("loadinfo"));
  16952. this.n13 = (this.getChild("n13"));
  16953. this.txtLoad = (this.getChild("txtLoad"));
  16954. this.n18 = (this.getChild("n18"));
  16955. }
  16956. }
  16957. ui_UILoading.URL = "ui://37nctnhwphc33";
  16958. class ui_AgeItem extends fgui.GComponent {
  16959. static createInstance() {
  16960. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16961. }
  16962. onConstruct() {
  16963. this.txtAge = (this.getChild("txtAge"));
  16964. }
  16965. }
  16966. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16967. class ui_btn1 extends fgui.GButton {
  16968. static createInstance() {
  16969. return (fgui.UIPackage.createObject("loading", "btn1"));
  16970. }
  16971. onConstruct() {
  16972. this.n6 = (this.getChild("n6"));
  16973. this.n1 = (this.getChild("n1"));
  16974. }
  16975. }
  16976. ui_btn1.URL = "ui://37nctnhwxe622p";
  16977. class ui_btn3 extends fgui.GButton {
  16978. static createInstance() {
  16979. return (fgui.UIPackage.createObject("loading", "btn3"));
  16980. }
  16981. onConstruct() {
  16982. this.n9 = (this.getChild("n9"));
  16983. this.n1 = (this.getChild("n1"));
  16984. }
  16985. }
  16986. ui_btn3.URL = "ui://37nctnhwxe622s";
  16987. class ui_btn2 extends fgui.GButton {
  16988. static createInstance() {
  16989. return (fgui.UIPackage.createObject("loading", "btn2"));
  16990. }
  16991. onConstruct() {
  16992. this.n6 = (this.getChild("n6"));
  16993. this.n1 = (this.getChild("n1"));
  16994. }
  16995. }
  16996. ui_btn2.URL = "ui://37nctnhwxe622t";
  16997. class ui_btnBack extends fgui.GButton {
  16998. static createInstance() {
  16999. return (fgui.UIPackage.createObject("loading", "btnBack"));
  17000. }
  17001. onConstruct() {
  17002. this.n6 = (this.getChild("n6"));
  17003. this.n7 = (this.getChild("n7"));
  17004. }
  17005. }
  17006. ui_btnBack.URL = "ui://37nctnhwxe622u";
  17007. class ui_btnXy1 extends fgui.GButton {
  17008. static createInstance() {
  17009. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  17010. }
  17011. onConstruct() {
  17012. this.n1 = (this.getChild("n1"));
  17013. }
  17014. }
  17015. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  17016. class ui_btnXy2 extends fgui.GButton {
  17017. static createInstance() {
  17018. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  17019. }
  17020. onConstruct() {
  17021. this.n1 = (this.getChild("n1"));
  17022. }
  17023. }
  17024. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  17025. class ui_btnXy3 extends fgui.GButton {
  17026. static createInstance() {
  17027. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  17028. }
  17029. onConstruct() {
  17030. this.n1 = (this.getChild("n1"));
  17031. }
  17032. }
  17033. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  17034. class ui_btn4 extends fgui.GButton {
  17035. static createInstance() {
  17036. return (fgui.UIPackage.createObject("loading", "btn4"));
  17037. }
  17038. onConstruct() {
  17039. this.n9 = (this.getChild("n9"));
  17040. this.n1 = (this.getChild("n1"));
  17041. }
  17042. }
  17043. ui_btn4.URL = "ui://37nctnhwxe622z";
  17044. class loadingBinder {
  17045. static bindAll() {
  17046. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  17047. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  17048. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  17049. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  17050. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  17051. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  17052. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  17053. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  17054. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  17055. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  17056. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  17057. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  17058. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  17059. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  17060. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  17061. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  17062. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  17063. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  17064. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  17065. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  17066. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  17067. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  17068. }
  17069. }
  17070. class UIMgr {
  17071. constructor() {
  17072. this._stage = null;
  17073. this._uiList = [];
  17074. this._showList = [];
  17075. this._bindPkgList = [];
  17076. this.uiIndex = 0;
  17077. }
  17078. static get inst() {
  17079. if (UIMgr._inst == null) {
  17080. UIMgr._inst = new UIMgr();
  17081. }
  17082. return UIMgr._inst;
  17083. }
  17084. setStage(s) {
  17085. if (this._stage) {
  17086. console.log("ViewMgr::Stage->舞台不可赋值两次");
  17087. return;
  17088. }
  17089. this._stage = s;
  17090. }
  17091. clearTempData() {
  17092. console.log('zh:clearTempData start');
  17093. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  17094. console.log('zh:clearTempData end');
  17095. }
  17096. init() {
  17097. this.setStage(Laya.stage);
  17098. fairygui.UIConfig.defaultFont = "arial";
  17099. fairygui.UIConfig.modalLayerColor = "rgba(29, 22, 22, 0.9)";
  17100. fairygui.UIConfig.packageFileExtension = "obj";
  17101. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  17102. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  17103. fairygui.GRoot.inst.width = Laya.stage.width;
  17104. fairygui.GRoot.inst.height = Laya.stage.height;
  17105. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  17106. }
  17107. addAllUpdate() {
  17108. this.uiIndex = 0;
  17109. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  17110. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  17111. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  17112. }
  17113. }
  17114. }
  17115. bindFUI(pkgname) {
  17116. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  17117. return;
  17118. }
  17119. switch (pkgname) {
  17120. case fguiRes.loading:
  17121. fairygui.UIPackage.addPackage(pkgname);
  17122. loadingBinder.bindAll();
  17123. this._bindPkgList.push(pkgname);
  17124. break;
  17125. case fguiRes.game:
  17126. fairygui.UIPackage.addPackage(pkgname);
  17127. gameBinder.bindAll();
  17128. this._bindPkgList.push(pkgname);
  17129. break;
  17130. default:
  17131. break;
  17132. }
  17133. }
  17134. Show(cls, ...param) {
  17135. let nameStr = cls.uiName;
  17136. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17137. let temp = this._uiList[i];
  17138. let str = temp.className;
  17139. if (str == nameStr) {
  17140. if (temp.isMuti) {
  17141. if (temp.isHide) {
  17142. temp.show(...param);
  17143. this._uiList.splice(i, 1);
  17144. this._uiList.push(temp);
  17145. return temp;
  17146. }
  17147. }
  17148. else {
  17149. temp.show(...param);
  17150. this._uiList.splice(i, 1);
  17151. this._uiList.push(temp);
  17152. return temp;
  17153. }
  17154. }
  17155. }
  17156. let ui = new cls();
  17157. ui.className = nameStr;
  17158. this._showUI(ui, param);
  17159. return ui;
  17160. }
  17161. destroyUI(ui) {
  17162. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17163. let temp = this._uiList[i].className;
  17164. if (temp == ui.className) {
  17165. this._uiList.splice(i, 1);
  17166. break;
  17167. }
  17168. }
  17169. this.checkUIState();
  17170. }
  17171. _showUI(ui, param) {
  17172. this._uiList.push(ui);
  17173. ui.show(...param);
  17174. }
  17175. Hide(uiClass) {
  17176. let ui = this.getUI(uiClass);
  17177. if (ui && !ui.isHide) {
  17178. ui.hide();
  17179. }
  17180. }
  17181. getUI(ui) {
  17182. let nameStr = ui.uiName;
  17183. for (let index = 0; index < this._uiList.length; index++) {
  17184. let temp = this._uiList[index];
  17185. if (temp.className == nameStr) {
  17186. return temp;
  17187. }
  17188. }
  17189. return null;
  17190. }
  17191. isShow(cls) {
  17192. for (var i of this._uiList) {
  17193. if (i instanceof cls) {
  17194. return i.isShowing;
  17195. }
  17196. }
  17197. return false;
  17198. }
  17199. showUINum() {
  17200. let num = 0;
  17201. for (var i of this._uiList) {
  17202. if (i.isShowing) {
  17203. num++;
  17204. }
  17205. }
  17206. return num;
  17207. }
  17208. checkUIState() {
  17209. Laya.timer.clear(this, this._uiCheck);
  17210. Laya.timer.once(400, this, this._uiCheck);
  17211. }
  17212. _uiCheck() {
  17213. let showList = [];
  17214. for (var i of this._uiList) {
  17215. if (!i.isHide) {
  17216. showList.push(i);
  17217. }
  17218. }
  17219. for (let index = 0; index < showList.length; index++) {
  17220. if (index == showList.length - 1) {
  17221. showList[index].checkActive(true);
  17222. }
  17223. else {
  17224. showList[index].checkActive(false);
  17225. }
  17226. }
  17227. }
  17228. showTip(msg, time = 600, size = 30) {
  17229. }
  17230. }
  17231. class UIShowList {
  17232. }
  17233. class SoundMgr {
  17234. constructor() {
  17235. this.soundMax = 4;
  17236. this.isLoad = false;
  17237. this.soundMap = {};
  17238. this.isSound = true;
  17239. this.openShake = true;
  17240. SoundMgr._instance = this;
  17241. }
  17242. static getInstance() {
  17243. if (!this._instance) {
  17244. this._instance = new SoundMgr();
  17245. }
  17246. return this._instance;
  17247. }
  17248. init() {
  17249. console.log('zh:sm init 1');
  17250. Laya.SoundManager.autoReleaseSound = true;
  17251. Laya.SoundManager.autoStopMusic = true;
  17252. Laya.SoundManager.musicVolume = 0.3;
  17253. Laya.SoundManager.soundVolume = 0.5;
  17254. this.musicPlayed = false;
  17255. this.audioUrl = "asset/sound/ogg/";
  17256. console.log('zh:sm init 2');
  17257. console.log('zh:dev type ');
  17258. if (Laya.Browser.onAndroid) {
  17259. console.log('zh:dev type android');
  17260. this.audioUrl = "asset/sound/ogg/";
  17261. this.isLoad = true;
  17262. }
  17263. else {
  17264. console.log('zh:dev type not android');
  17265. this.audioUrl = "asset/sound/mp3/";
  17266. this.isLoad = true;
  17267. }
  17268. }
  17269. onSetting(isS) {
  17270. this.isSound = isS;
  17271. this.mute(!this.isSound);
  17272. }
  17273. clearCount() {
  17274. for (var key in this.soundMap) {
  17275. delete this.soundMap[key];
  17276. }
  17277. }
  17278. playMusic(path, loop = 0) {
  17279. console.log('zh:playMusic 1 PATH=' + path);
  17280. this.musicPath = path;
  17281. if (!this.isLoad) {
  17282. return;
  17283. }
  17284. if (!path || path == "") {
  17285. return;
  17286. }
  17287. if (!this.isSound) {
  17288. return;
  17289. }
  17290. this.musicPlayed = true;
  17291. let url = this.getUrl(path);
  17292. if (!Laya.Browser.onAndroid) {
  17293. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17294. this.play(url, loop);
  17295. }));
  17296. }
  17297. else {
  17298. this.play(url, loop);
  17299. }
  17300. }
  17301. play(url, loop) {
  17302. Laya.SoundManager.playMusic(url, loop);
  17303. }
  17304. getUrl(path) {
  17305. let url = this.audioUrl + path;
  17306. if (Laya.Browser.onAndroid) {
  17307. url += ".ogg";
  17308. }
  17309. else {
  17310. url += ".mp3";
  17311. }
  17312. return url;
  17313. }
  17314. pauseMusic(pause) {
  17315. if (pause) {
  17316. this.mute(true);
  17317. }
  17318. else if (this.isSound)
  17319. this.mute(false);
  17320. }
  17321. stopMusic() {
  17322. Laya.SoundManager.stopMusic();
  17323. if (Moyu.isNeedPlatAudio) {
  17324. Moyu.stopMusic();
  17325. }
  17326. }
  17327. mute(mute) {
  17328. if (Moyu.isNeedPlatAudio) {
  17329. Moyu.pauseMusic(mute);
  17330. }
  17331. else {
  17332. Laya.SoundManager.musicMuted = mute;
  17333. if (!mute && !this.musicPlayed && this.musicPath) {
  17334. this.playMusic(this.musicPath);
  17335. }
  17336. }
  17337. }
  17338. stopSound(path) {
  17339. let url = this.getUrl(path);
  17340. Laya.SoundManager.stopSound(url);
  17341. }
  17342. playSound(path, loop = 1, soundMax = this.soundMax) {
  17343. if (!this.isLoad)
  17344. return;
  17345. if (!this.isSound)
  17346. return;
  17347. if (!path || path == "")
  17348. return;
  17349. let url = this.getUrl(path);
  17350. if (Moyu.isNeedPlatAudio) {
  17351. Moyu.playSound(path, loop == 0);
  17352. }
  17353. else {
  17354. let count = 1;
  17355. if (this.soundMap[path])
  17356. count = this.soundMap[path] + 1;
  17357. if (count > soundMax)
  17358. return;
  17359. this.soundMap[path] = count;
  17360. Laya.SoundManager.playSound(url, loop);
  17361. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17362. }
  17363. }
  17364. removePath(path) {
  17365. if (this.soundMap[path]) {
  17366. let count = this.soundMap[path];
  17367. count--;
  17368. if (count < 1)
  17369. delete this.soundMap[path];
  17370. else
  17371. this.soundMap[path] = count;
  17372. }
  17373. }
  17374. playBtnSound() {
  17375. this.playSound("btn");
  17376. }
  17377. playGetSound() {
  17378. }
  17379. playCloseUISound() {
  17380. }
  17381. }
  17382. SoundMgr._instance = null;
  17383. var Handler$1 = Laya.Handler;
  17384. var EResType;
  17385. (function (EResType) {
  17386. EResType[EResType["none"] = 0] = "none";
  17387. EResType[EResType["nromal"] = 1] = "nromal";
  17388. EResType[EResType["td"] = 2] = "td";
  17389. EResType[EResType["sk"] = 3] = "sk";
  17390. })(EResType || (EResType = {}));
  17391. class CResLoader {
  17392. constructor(doneCall, proCall) {
  17393. this.completrCall = doneCall;
  17394. this.progressCall = proCall;
  17395. this.progressHander = new Handler$1(this, this.onProgress);
  17396. this.tdResMap = {};
  17397. }
  17398. load(resList) {
  17399. this.resCount = 0;
  17400. this.loadCount = 0;
  17401. for (let i = 0; i < resList.length; i++) {
  17402. let path = resList[i];
  17403. if (!path)
  17404. continue;
  17405. this.resCount++;
  17406. let type = this.getResType(path);
  17407. if (type == EResType.nromal)
  17408. this.loadNromal(path);
  17409. else if (type == EResType.td)
  17410. this.loadTd(path);
  17411. }
  17412. }
  17413. getRes(path) {
  17414. let type = this.getResType(path);
  17415. if (type == EResType.nromal)
  17416. return Laya.loader.getRes(path);
  17417. else if (type == EResType.td) {
  17418. let res = this.tdResMap[path];
  17419. if (res)
  17420. return res.clone();
  17421. return null;
  17422. }
  17423. }
  17424. destroy() {
  17425. this.progressHander.clear();
  17426. this.progressHander = null;
  17427. }
  17428. clearRes(path) {
  17429. let type = this.getResType(path);
  17430. if (type == EResType.nromal)
  17431. Laya.loader.clearRes(path);
  17432. else if (type == EResType.td) {
  17433. let obj = this.tdResMap[path];
  17434. if (obj)
  17435. obj.destroy();
  17436. delete this.tdResMap[path];
  17437. }
  17438. }
  17439. getResType(path) {
  17440. let exs = this.getExtension(path);
  17441. if (exs == "sk")
  17442. return EResType.sk;
  17443. if (exs == "ls" || exs == "lh" || exs == "lm")
  17444. return EResType.td;
  17445. else
  17446. return EResType.nromal;
  17447. }
  17448. getExtension(res) {
  17449. var index = res.lastIndexOf(".");
  17450. return res.substr(index + 1);
  17451. }
  17452. loadNromal(path) {
  17453. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17454. if (res) {
  17455. this.onLoad();
  17456. }
  17457. else
  17458. console.log("load res fail:" + path);
  17459. }), this.progressHander);
  17460. }
  17461. loadSk() {
  17462. }
  17463. loadTd(path) {
  17464. if (this.tdResMap[path]) {
  17465. this.onLoad();
  17466. return;
  17467. }
  17468. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17469. if (res) {
  17470. this.tdResMap[path] = res;
  17471. this.onLoad();
  17472. }
  17473. else
  17474. console.log("load res fail:" + path);
  17475. }));
  17476. }
  17477. onLoad() {
  17478. this.loadCount++;
  17479. this.onProgress(1);
  17480. if (this.loadCount >= this.resCount) {
  17481. this.completrCall.run();
  17482. }
  17483. }
  17484. onProgress(pro) {
  17485. let progress = (this.loadCount + pro) / this.resCount;
  17486. this.progressCall.runWith(progress);
  17487. }
  17488. }
  17489. var Handler$2 = Laya.Handler;
  17490. class ResInfo {
  17491. constructor() {
  17492. this.index = 0;
  17493. }
  17494. }
  17495. class ResMgr {
  17496. constructor() {
  17497. this.resList = [];
  17498. this.doneList = [];
  17499. this.resMap = {};
  17500. this.currentLoad = null;
  17501. this.completeHandler = new Handler$2(this, this.onComplete);
  17502. this.progressHandler = new Handler$2(this, this.onProgress);
  17503. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17504. }
  17505. static getInstance() {
  17506. if (ResMgr._instance == null) {
  17507. ResMgr._instance = new ResMgr();
  17508. }
  17509. return ResMgr._instance;
  17510. }
  17511. loadList(list, completeHandler, progressHandler) {
  17512. if (list.length < 1) {
  17513. completeHandler.run();
  17514. return;
  17515. }
  17516. let info = this.getResInfo();
  17517. info.resList = list;
  17518. info.completeHandler = completeHandler;
  17519. info.progressHandler = progressHandler;
  17520. this.resList.push(info);
  17521. this.startLoad();
  17522. }
  17523. loadFguiRes(list, completeHandler, progressHandler) {
  17524. Laya.loader.load(list, completeHandler, progressHandler);
  17525. }
  17526. loadAny(list, completeHandler, progressHandler) {
  17527. Laya.loader.load(list, completeHandler, progressHandler);
  17528. }
  17529. load(path, completeHandler, progressHandler) {
  17530. let count = this.resMap[path];
  17531. if (count && count > 0) {
  17532. if (completeHandler)
  17533. completeHandler.run();
  17534. }
  17535. else
  17536. this.loadList([path], completeHandler, progressHandler);
  17537. }
  17538. getRes(path) {
  17539. let res = this.resMap[path];
  17540. if (!res)
  17541. this.showLog("资源不存在:" + path);
  17542. else
  17543. return this.loader.getRes(path);
  17544. }
  17545. clearList(list, force = false) {
  17546. if (!list || list.length < 1)
  17547. return;
  17548. let cr = () => {
  17549. for (const k in list) {
  17550. let v = list[k];
  17551. if (!v)
  17552. continue;
  17553. if (force) {
  17554. this.loader.clearRes(v);
  17555. delete this.resMap[v];
  17556. }
  17557. else {
  17558. let count = this.resMap[v];
  17559. if (count && count > 1) {
  17560. count--;
  17561. this.resMap[v] = count;
  17562. }
  17563. else {
  17564. this.loader.clearRes(v);
  17565. delete this.resMap[v];
  17566. }
  17567. }
  17568. }
  17569. if (!window.hasOwnProperty("ks"))
  17570. Laya.Resource.destroyUnusedResources();
  17571. };
  17572. Laya.timer.clearAll(this);
  17573. Laya.timer.once(2000, this, cr);
  17574. }
  17575. clear3D() {
  17576. for (const k in this.loader.tdResMap) {
  17577. this.loader.clearRes(k);
  17578. if (this.resMap[k])
  17579. delete this.resMap[k];
  17580. }
  17581. if (!window.hasOwnProperty("ks"))
  17582. Laya.Resource.destroyUnusedResources();
  17583. }
  17584. clear(path, force = false) {
  17585. this.clearList([path], force);
  17586. }
  17587. getResInfo() {
  17588. if (this.doneList.length > 0)
  17589. return this.doneList.pop();
  17590. else
  17591. return new ResInfo();
  17592. }
  17593. startLoad() {
  17594. if (this.currentLoad)
  17595. return;
  17596. this.currentLoad = this.resList.pop();
  17597. if (this.currentLoad) {
  17598. this.loader.load(this.currentLoad.resList);
  17599. }
  17600. }
  17601. onComplete() {
  17602. if (!this.currentLoad)
  17603. return;
  17604. for (const k in this.currentLoad.resList) {
  17605. let v = this.currentLoad.resList[k];
  17606. let count = this.resMap[v];
  17607. if (count)
  17608. count++;
  17609. else
  17610. count = 1;
  17611. this.resMap[v] = count;
  17612. }
  17613. if (this.currentLoad.completeHandler)
  17614. this.currentLoad.completeHandler.run();
  17615. this.doneList.push(this.currentLoad);
  17616. this.currentLoad = null;
  17617. this.startLoad();
  17618. }
  17619. onProgress(pro) {
  17620. if (!this.currentLoad)
  17621. return;
  17622. if (this.currentLoad.progressHandler)
  17623. this.currentLoad.progressHandler.runWith(pro);
  17624. }
  17625. showLog(str, ...args) {
  17626. console.log("[ResLoader] " + str);
  17627. }
  17628. }
  17629. ResMgr._instance = null;
  17630. class EventMgr extends Laya.EventDispatcher {
  17631. }
  17632. let eventMgr = new EventMgr();
  17633. /*! *****************************************************************************
  17634. Copyright (c) Microsoft Corporation. All rights reserved.
  17635. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17636. this file except in compliance with the License. You may obtain a copy of the
  17637. License at http://www.apache.org/licenses/LICENSE-2.0
  17638. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17639. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17640. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17641. MERCHANTABLITY OR NON-INFRINGEMENT.
  17642. See the Apache Version 2.0 License for specific language governing permissions
  17643. and limitations under the License.
  17644. ***************************************************************************** */
  17645. /* global Reflect, Promise */
  17646. var extendStatics = function(d, b) {
  17647. extendStatics = Object.setPrototypeOf ||
  17648. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17649. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17650. return extendStatics(d, b);
  17651. };
  17652. function __extends(d, b) {
  17653. extendStatics(d, b);
  17654. function __() { this.constructor = d; }
  17655. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17656. }
  17657. var __assign = function() {
  17658. __assign = Object.assign || function __assign(t) {
  17659. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17660. s = arguments[i];
  17661. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17662. }
  17663. return t;
  17664. };
  17665. return __assign.apply(this, arguments);
  17666. };
  17667. function __rest(s, e) {
  17668. var t = {};
  17669. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17670. t[p] = s[p];
  17671. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17672. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17673. t[p[i]] = s[p[i]];
  17674. return t;
  17675. }
  17676. function __decorate(decorators, target, key, desc) {
  17677. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17678. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17679. 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;
  17680. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17681. }
  17682. function __param(paramIndex, decorator) {
  17683. return function (target, key) { decorator(target, key, paramIndex); }
  17684. }
  17685. function __metadata(metadataKey, metadataValue) {
  17686. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17687. }
  17688. function __awaiter(thisArg, _arguments, P, generator) {
  17689. return new (P || (P = Promise))(function (resolve, reject) {
  17690. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17691. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17692. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17693. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17694. });
  17695. }
  17696. function __generator(thisArg, body) {
  17697. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17698. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17699. function verb(n) { return function (v) { return step([n, v]); }; }
  17700. function step(op) {
  17701. if (f) throw new TypeError("Generator is already executing.");
  17702. while (_) try {
  17703. 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;
  17704. if (y = 0, t) op = [op[0] & 2, t.value];
  17705. switch (op[0]) {
  17706. case 0: case 1: t = op; break;
  17707. case 4: _.label++; return { value: op[1], done: false };
  17708. case 5: _.label++; y = op[1]; op = [0]; continue;
  17709. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17710. default:
  17711. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17712. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17713. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17714. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17715. if (t[2]) _.ops.pop();
  17716. _.trys.pop(); continue;
  17717. }
  17718. op = body.call(thisArg, _);
  17719. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17720. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17721. }
  17722. }
  17723. function __exportStar(m, exports) {
  17724. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17725. }
  17726. function __values(o) {
  17727. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17728. if (m) return m.call(o);
  17729. return {
  17730. next: function () {
  17731. if (o && i >= o.length) o = void 0;
  17732. return { value: o && o[i++], done: !o };
  17733. }
  17734. };
  17735. }
  17736. function __read(o, n) {
  17737. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17738. if (!m) return o;
  17739. var i = m.call(o), r, ar = [], e;
  17740. try {
  17741. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17742. }
  17743. catch (error) { e = { error: error }; }
  17744. finally {
  17745. try {
  17746. if (r && !r.done && (m = i["return"])) m.call(i);
  17747. }
  17748. finally { if (e) throw e.error; }
  17749. }
  17750. return ar;
  17751. }
  17752. function __spread() {
  17753. for (var ar = [], i = 0; i < arguments.length; i++)
  17754. ar = ar.concat(__read(arguments[i]));
  17755. return ar;
  17756. }
  17757. function __await(v) {
  17758. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17759. }
  17760. function __asyncGenerator(thisArg, _arguments, generator) {
  17761. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17762. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17763. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17764. 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); }); }; }
  17765. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17766. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17767. function fulfill(value) { resume("next", value); }
  17768. function reject(value) { resume("throw", value); }
  17769. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17770. }
  17771. function __asyncDelegator(o) {
  17772. var i, p;
  17773. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17774. 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; }
  17775. }
  17776. function __asyncValues(o) {
  17777. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17778. var m = o[Symbol.asyncIterator], i;
  17779. 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);
  17780. 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); }); }; }
  17781. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17782. }
  17783. function __makeTemplateObject(cooked, raw) {
  17784. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17785. return cooked;
  17786. };
  17787. function __importStar(mod) {
  17788. if (mod && mod.__esModule) return mod;
  17789. var result = {};
  17790. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17791. result.default = mod;
  17792. return result;
  17793. }
  17794. function __importDefault(mod) {
  17795. return (mod && mod.__esModule) ? mod : { default: mod };
  17796. }
  17797. class CustomAlert {
  17798. static show(title, content, buttons) {
  17799. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17800. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17801. return;
  17802. }
  17803. const bg = new Laya.Box();
  17804. bg.alpha = 0;
  17805. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17806. Laya.stage.addChild(bg);
  17807. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17808. const panel = new Laya.Box();
  17809. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17810. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17811. bg.addChild(panel);
  17812. const titleText = new Laya.Text();
  17813. titleText.text = title;
  17814. titleText.fontSize = 32;
  17815. titleText.color = "#333333";
  17816. titleText.bold = true;
  17817. titleText.pos(20, 20);
  17818. titleText.width = 360;
  17819. titleText.align = "center";
  17820. panel.addChild(titleText);
  17821. const contentText = new Laya.Text();
  17822. contentText.text = content;
  17823. contentText.fontSize = 21;
  17824. contentText.color = "#555555";
  17825. contentText.pos(20, 70);
  17826. contentText.width = 360;
  17827. contentText.wordWrap = true;
  17828. contentText.align = "center";
  17829. panel.addChild(contentText);
  17830. const buttonContainer = new Laya.Box();
  17831. buttonContainer.pos(20, 160);
  17832. panel.addChild(buttonContainer);
  17833. const btnWidth = 120;
  17834. const spacing = 30;
  17835. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17836. buttons.forEach((btn, index) => {
  17837. const button = new Laya.Button();
  17838. button.label = btn.label;
  17839. button.size(btnWidth, 40);
  17840. button.labelSize = 22;
  17841. button.pos(index * (btnWidth + spacing), 0);
  17842. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17843. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17844. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17845. button.alpha = 0.9;
  17846. });
  17847. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17848. button.alpha = 1;
  17849. });
  17850. button.on(Laya.Event.CLICK, this, () => {
  17851. btn.handler();
  17852. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17853. bg.removeSelf();
  17854. }));
  17855. });
  17856. buttonContainer.addChild(button);
  17857. });
  17858. buttonContainer.x = (panel.width - totalWidth) / 2;
  17859. }
  17860. }
  17861. class ConfigMgr {
  17862. constructor() {
  17863. this.httpReqCount = 4;
  17864. this.httpReqOkCount = 0;
  17865. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17866. try {
  17867. this.httpReqOkCount = 0;
  17868. let reqData = xGame.httpMgr.getReqData();
  17869. console.log('zh:第1个请求getClassicCfg');
  17870. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17871. this.classicCfg = classicCfg;
  17872. this.httpReqOkCount++;
  17873. console.log('zh:第2个请求getLevelCfg');
  17874. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17875. this.levelCfg = levelCfg;
  17876. this.httpReqOkCount++;
  17877. console.log('zh:第3个请求 getPlaceBallCfg');
  17878. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17879. this.placeBallCfg = placeBallCfg;
  17880. this.httpReqOkCount++;
  17881. console.log('zh:第4个请求 npc');
  17882. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17883. this.npcJson = npc.Data;
  17884. this.httpReqOkCount++;
  17885. console.log('zh:所有配置加载完成');
  17886. }
  17887. catch (error) {
  17888. console.error('zh:❌请求失败:', error);
  17889. Laya.timer.once(5000, this, () => {
  17890. let retryCount = 0;
  17891. const maxRetries = 3;
  17892. const tryFetchConfig = () => {
  17893. try {
  17894. xGame.cfgMgr.getConfigFromServer();
  17895. }
  17896. catch (error) {
  17897. if (retryCount < maxRetries) {
  17898. retryCount++;
  17899. console.log(`zh:🔄 第${retryCount}次重试获取配置...`);
  17900. Laya.timer.once(5000, this, tryFetchConfig);
  17901. }
  17902. else {
  17903. console.error("zh:❌ 达到最大重试次数,配置获取失败");
  17904. }
  17905. }
  17906. };
  17907. tryFetchConfig();
  17908. });
  17909. }
  17910. finally {
  17911. if (this.httpReqCount > this.httpReqOkCount) {
  17912. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [{
  17913. label: "Okay", handler: () => {
  17914. JSBridgeUtils.instance.exitAndCloseGame();
  17915. }
  17916. }]);
  17917. }
  17918. }
  17919. });
  17920. this.sendPostAsync = (action, reqData) => {
  17921. return new Promise((resolve, reject) => {
  17922. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17923. try {
  17924. let code = res.code;
  17925. if (code == 200) {
  17926. const parsedData = JSON.parse(res.msg);
  17927. resolve(parsedData);
  17928. }
  17929. else {
  17930. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17931. reject(new Error(`Request failed with code: ${code}`));
  17932. }
  17933. }
  17934. catch (error) {
  17935. console.error(`ERROR=${error}`);
  17936. alert("Please check your network connection.");
  17937. reject(error);
  17938. }
  17939. finally {
  17940. console.log(`zh:${action}的请求处理完毕`);
  17941. }
  17942. });
  17943. });
  17944. };
  17945. }
  17946. static getInstance() {
  17947. if (!this._instance) {
  17948. this._instance = new ConfigMgr();
  17949. }
  17950. return this._instance;
  17951. }
  17952. init() {
  17953. this.getConfigFromServer();
  17954. }
  17955. test() {
  17956. let reqData = xGame.httpMgr.getReqData();
  17957. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17958. console.log('zh:1s');
  17959. try {
  17960. let code = res.code;
  17961. let data = res.data;
  17962. if (code == 200) {
  17963. const parsedData = JSON.parse(data);
  17964. this.classicCfg = parsedData;
  17965. }
  17966. else {
  17967. console.log('zh:res = ' + JSON.stringify(res));
  17968. }
  17969. }
  17970. catch (error) {
  17971. console.log('error=' + error);
  17972. alert("Please check your network connection.");
  17973. }
  17974. finally {
  17975. console.log('zh:1');
  17976. }
  17977. });
  17978. }
  17979. getUserInfoByIndex(index) {
  17980. return this.npcJson[index];
  17981. }
  17982. getRandomUserInfo() {
  17983. let index = xGame.tools.random(0, this.npcJson.length);
  17984. let rs = this.npcJson[index];
  17985. return rs;
  17986. }
  17987. getMaxBigMoveLength() {
  17988. return Object.keys(this.levelCfg).length;
  17989. }
  17990. getBigMoveLevelByIndex(index) {
  17991. let cfg = this.levelCfg;
  17992. cfg = cfg[index];
  17993. return cfg;
  17994. }
  17995. getRandomClassicLevel() {
  17996. let cfg = this.classicCfg;
  17997. let num = Object.keys(cfg).length;
  17998. let rand = xGame.common.randomNum(1, num);
  17999. return cfg[rand];
  18000. }
  18001. getPlaceBallByLevel(level) {
  18002. return this.placeBallCfg[level];
  18003. }
  18004. getMaxPlaceBall() {
  18005. return Object.keys(this.placeBallCfg).length;
  18006. }
  18007. }
  18008. class PoolD3Mgr {
  18009. constructor() {
  18010. this.pool = {};
  18011. }
  18012. static get ins() {
  18013. return this._ins || (this._ins = new PoolD3Mgr);
  18014. }
  18015. createList(key, prefab, parent) {
  18016. if (!this.pool[key]) {
  18017. this.pool[key] = {};
  18018. this.pool[key].prefab = prefab;
  18019. this.pool[key].list = [];
  18020. this.pool[key].parent = parent;
  18021. }
  18022. }
  18023. getItem(key) {
  18024. if (!this.pool[key]) {
  18025. return;
  18026. }
  18027. let temp;
  18028. if (this.pool[key].list.length > 0) {
  18029. temp = this.pool[key].list.pop();
  18030. }
  18031. else {
  18032. temp = this.pool[key].prefab.clone();
  18033. if (this.pool[key].parent) {
  18034. this.pool[key].parent.addChild(temp);
  18035. }
  18036. }
  18037. temp.active = true;
  18038. return temp;
  18039. }
  18040. putItem(key, obj) {
  18041. if (!this.pool[key]) {
  18042. return;
  18043. }
  18044. obj.active = false;
  18045. this.pool[key].list.push(obj);
  18046. }
  18047. }
  18048. let context$1 = context;
  18049. let uiMgr = UIMgr.inst;
  18050. let soundMgr = SoundMgr.getInstance();
  18051. let resMgr = ResMgr.getInstance();
  18052. let httpMgr = HttpMgr.getInstance();
  18053. let common = Common.getInstance();
  18054. let cfgMgr = ConfigMgr.getInstance();
  18055. let poolD3Mgr = PoolD3Mgr.ins;
  18056. let d3TexUrl = "res/d3Res/";
  18057. let d3ModeUrl = "res/unityRes/";
  18058. function setStageSize(view) {
  18059. if (view.width) {
  18060. view.width = Laya.stage.width;
  18061. view.height = Laya.stage.height;
  18062. }
  18063. }
  18064. function filledBg(view) {
  18065. let wh = Laya.stage.height / Laya.stage.width;
  18066. if (wh > 16 / 9) {
  18067. view.height = Laya.stage.height;
  18068. view.width = Laya.stage.height / 1334 * 750;
  18069. }
  18070. else {
  18071. view.width = Laya.stage.width;
  18072. view.height = Laya.stage.width / 750 * 1334;
  18073. }
  18074. }
  18075. function setNotch(view) {
  18076. if (view.height) {
  18077. view.y += context$1.notchHeight;
  18078. }
  18079. }
  18080. function showTip(str) {
  18081. uiMgr.Show(UIMsg, str);
  18082. }
  18083. function log(...args) {
  18084. console.log(args);
  18085. }
  18086. let xGame = {
  18087. context: context$1,
  18088. eventMgr,
  18089. resMgr,
  18090. uiMgr,
  18091. soundMgr,
  18092. define,
  18093. tools,
  18094. httpMgr,
  18095. d3TexUrl,
  18096. d3ModeUrl,
  18097. common,
  18098. cfgMgr,
  18099. poolD3Mgr,
  18100. setStageSize,
  18101. filledBg,
  18102. setNotch,
  18103. showTip,
  18104. log,
  18105. };
  18106. window["xGame"] = xGame;
  18107. let dataName = 'tBall_';
  18108. class UserData {
  18109. constructor() {
  18110. this.userId = "";
  18111. this.isAgree = false;
  18112. this.coinNum = 0;
  18113. this.gemNum = 0;
  18114. this.sound = true;
  18115. this.vibration = true;
  18116. this.currentDate = 0;
  18117. this.createTime = 0;
  18118. this.awardTime = 0;
  18119. this.roleId = 1;
  18120. this.roleList = [];
  18121. this.roleAds = [];
  18122. this.dressId = 101;
  18123. this.itemId = 201;
  18124. this.bigSkills = [1, 1, 1, 1, 1];
  18125. this.coin = 4000;
  18126. this.diamond = 0;
  18127. this.skillSuccessTimes = 0;
  18128. this.skillGuide = 0;
  18129. this.skillAccTimes = 0;
  18130. this.placeBallData = [];
  18131. this.shareDiamondTimes = 0;
  18132. this.dailyVideoShareTimes = 0;
  18133. this.secretary = [1, 0];
  18134. this.curSecretary = 0;
  18135. this.ballRod = [1, 0, 0, 0, 0, 1];
  18136. this.curBallRod = 5;
  18137. this.signData = 0;
  18138. this.signTime = 0;
  18139. this.drawTimes = 0;
  18140. this.drawAwardTimes = 0;
  18141. this.dailyfreeDrawTimes = 1;
  18142. this.power = 5;
  18143. this.powerTime = 0;
  18144. this.challengeTimes = 0;
  18145. this.extraSign = 0;
  18146. this.classicTimes = 0;
  18147. this.guideHelpLine = 0;
  18148. this.newUser = true;
  18149. this.rootBallFoul = 0;
  18150. this.timeoutFoul = 0;
  18151. this.roleList = [1];
  18152. }
  18153. saveData() {
  18154. let data = {};
  18155. for (let k in this) {
  18156. data[k.toString()] = this[k];
  18157. }
  18158. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18159. }
  18160. getData() {
  18161. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18162. if (ld) {
  18163. let localData = JSON.parse(ld);
  18164. if (localData) {
  18165. for (let k in this) {
  18166. let key = k.toString();
  18167. let data = localData[key];
  18168. if (data != undefined) {
  18169. this[k] = data;
  18170. }
  18171. }
  18172. }
  18173. }
  18174. }
  18175. }
  18176. class ItemData {
  18177. constructor() {
  18178. this.itemList = {};
  18179. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18180. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18181. }
  18182. saveData() {
  18183. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18184. }
  18185. getData() {
  18186. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18187. if (ld) {
  18188. let localData = JSON.parse(ld);
  18189. if (localData) {
  18190. this.itemList = localData;
  18191. }
  18192. }
  18193. }
  18194. }
  18195. class GameData {
  18196. constructor() {
  18197. this.curLevel = 0;
  18198. this.gameType = 1;
  18199. this.signIdx = 0;
  18200. this.signMax = 0;
  18201. this.rotaryTime = 0;
  18202. this.rotaryCount = 0;
  18203. this.rotaryList = [];
  18204. this.diyCount = 3;
  18205. this.awardIdx = 0;
  18206. this.shareNum = 2;
  18207. this.rankWeek = 0;
  18208. this.rankScore = 0;
  18209. this.gameCount = 0;
  18210. this.trySkill = -1;
  18211. this.tryTime = 0;
  18212. }
  18213. saveData() {
  18214. let data = {};
  18215. for (let k in this) {
  18216. data[k.toString()] = this[k];
  18217. }
  18218. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18219. }
  18220. getData() {
  18221. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18222. if (ld) {
  18223. let localData = JSON.parse(ld);
  18224. if (localData) {
  18225. for (let k in this) {
  18226. let key = k.toString();
  18227. let data = localData[key];
  18228. if (data != undefined) {
  18229. this[k] = data;
  18230. }
  18231. }
  18232. }
  18233. }
  18234. }
  18235. }
  18236. class Diy2025GameData {
  18237. constructor() {
  18238. this.challengeMode_overLev = 0;
  18239. this.xszyForClassic = false;
  18240. this.xszyForChallenge = false;
  18241. }
  18242. saveData() {
  18243. let data = {};
  18244. for (let k in this) {
  18245. data[k.toString()] = this[k];
  18246. }
  18247. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18248. }
  18249. getData() {
  18250. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18251. if (ld) {
  18252. let localData = JSON.parse(ld);
  18253. if (localData) {
  18254. for (let k in this) {
  18255. let key = k.toString();
  18256. let data = localData[key];
  18257. if (data != undefined) {
  18258. this[k] = data;
  18259. }
  18260. }
  18261. }
  18262. }
  18263. }
  18264. }
  18265. class DataMgr {
  18266. static Init() {
  18267. this.userData = new UserData();
  18268. this.gameData = new GameData();
  18269. this.itemData = new ItemData();
  18270. this.diyGameData = new Diy2025GameData();
  18271. this.userData.getData();
  18272. this.gameData.getData();
  18273. this.itemData.getData();
  18274. this.diyGameData.getData();
  18275. this.roleId = this.userData.roleId;
  18276. this.resetUse();
  18277. }
  18278. static isNewDay() {
  18279. Moyu.isNewDay(this, (isnew) => {
  18280. xGame.common.isNewDay = isnew;
  18281. if (!isnew)
  18282. return;
  18283. DataMgr.setShareDiamondTimes(0, false);
  18284. DataMgr.setDailyVideoShareTimes(0, false);
  18285. DataMgr.setDailyfreeDrawTimes(1);
  18286. DataMgr.setExtraSign(0);
  18287. });
  18288. }
  18289. static deletData() {
  18290. Laya.LocalStorage.clear();
  18291. }
  18292. static upRankData() {
  18293. let num = xGame.common.getAllStarNum();
  18294. if (num > 0)
  18295. Moyu.upRankData(xGame.common.curRankID, num);
  18296. }
  18297. static addItem(id, count = 1) {
  18298. let v = this.itemData.itemList[id];
  18299. if (!v)
  18300. v = { id: id, count: count, adnum: 0, active: true };
  18301. else {
  18302. if (v.active) {
  18303. v.count += count;
  18304. }
  18305. else {
  18306. v.count = count;
  18307. v.active = true;
  18308. }
  18309. }
  18310. this.itemData.itemList[id] = v;
  18311. xGame.soundMgr.playGetSound();
  18312. this.saveItemData();
  18313. }
  18314. static hasItem(id) {
  18315. let v = this.itemData.itemList[id];
  18316. if (v && v.active)
  18317. return true;
  18318. return false;
  18319. }
  18320. static getItem(id) {
  18321. let v = this.itemData.itemList[id];
  18322. return v;
  18323. }
  18324. static getItemCount(id) {
  18325. let v = this.itemData.itemList[id];
  18326. if (v && v.active)
  18327. return v.count;
  18328. return 0;
  18329. }
  18330. static getItemAd(id) {
  18331. let v = this.itemData.itemList[id];
  18332. if (v) {
  18333. return v.adnum;
  18334. }
  18335. return 0;
  18336. }
  18337. static onItemAd(id, num = 1) {
  18338. let v = this.itemData.itemList[id];
  18339. if (!v)
  18340. v = { id: id, count: 1, adnum: num, active: false };
  18341. else
  18342. v.adnum += num;
  18343. this.itemData.itemList[id] = v;
  18344. this.saveItemData();
  18345. }
  18346. static costItem(id, count) {
  18347. let v = this.itemData.itemList[id];
  18348. if (v && v.active) {
  18349. if (v.count < count)
  18350. return false;
  18351. else {
  18352. v.count -= count;
  18353. this.itemData.itemList[id] = v;
  18354. return true;
  18355. }
  18356. }
  18357. return false;
  18358. }
  18359. static resetUse() {
  18360. this.dressId = this.userData.dressId;
  18361. this.itemId = this.userData.itemId;
  18362. }
  18363. static passLevel() {
  18364. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18365. this.gameData.curLevel++;
  18366. this.curLevel = this.gameData.curLevel;
  18367. this.saveGameData();
  18368. }
  18369. static useRole(id) {
  18370. this.roleId = id;
  18371. if (this.hasRole(id)) {
  18372. this.userData.roleId = id;
  18373. this.saveUserData();
  18374. }
  18375. }
  18376. static addRole(id) {
  18377. if (this.hasRole(id))
  18378. return;
  18379. this.userData.roleList.push(id);
  18380. this.saveUserData();
  18381. }
  18382. static hasRole(id) {
  18383. return this.userData.roleList.indexOf(id) >= 0;
  18384. }
  18385. static gemEnough(num) {
  18386. return this.userData.gemNum >= num;
  18387. }
  18388. static roleHasAd(id) {
  18389. let count = this.userData.roleAds[id];
  18390. if (count != undefined && count >= 0)
  18391. return true;
  18392. else
  18393. return false;
  18394. }
  18395. static saveUserData(time = 500, event, arg) {
  18396. if (this.userSaving)
  18397. return;
  18398. this.userSaving = true;
  18399. Laya.timer.once(time, this, () => {
  18400. this.userSaving = false;
  18401. this.userData.saveData();
  18402. if (event)
  18403. xGame.eventMgr.event(event, arg);
  18404. });
  18405. }
  18406. static updateUserNickName(loginUserName) {
  18407. let kyeStr = 'moyudata_180';
  18408. console.log('zh:################### kyeStr=' + kyeStr);
  18409. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18410. if (moyudata) {
  18411. const obj = JSON.parse(moyudata);
  18412. obj.nickName = loginUserName;
  18413. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18414. console.log('zh:################### updateUserNickName');
  18415. }
  18416. }
  18417. static saveGameData() {
  18418. if (this.gameSaving)
  18419. return;
  18420. this.gameSaving = true;
  18421. Laya.timer.once(1000, this, () => {
  18422. this.gameSaving = false;
  18423. this.gameData.saveData();
  18424. });
  18425. }
  18426. static saveItemData() {
  18427. let fun = () => {
  18428. this.itemData.saveData();
  18429. };
  18430. Laya.timer.clear(this, fun);
  18431. Laya.timer.once(500, this, fun);
  18432. }
  18433. static saveData() {
  18434. this.saveUserData();
  18435. this.saveGameData();
  18436. }
  18437. static getBigSkillList() {
  18438. return this.userData.bigSkills;
  18439. }
  18440. static getBigSkillByIndex(index) {
  18441. return this.userData.bigSkills[index];
  18442. }
  18443. static setBigSkill(index, val, addUp = true) {
  18444. if (addUp) {
  18445. this.userData.bigSkills[index] += val;
  18446. }
  18447. else {
  18448. this.userData.bigSkills[index] = val;
  18449. }
  18450. this.saveUserData();
  18451. }
  18452. static coinEnough(need) {
  18453. if (typeof need != "number") {
  18454. console.error("金币格式错误");
  18455. return;
  18456. }
  18457. return this.userData.coin >= need;
  18458. }
  18459. static setCoin(val) {
  18460. if (typeof val != "number") {
  18461. return;
  18462. }
  18463. this.userData.coin += val;
  18464. this.saveUserData();
  18465. xGame.eventMgr.event(COIN_CHANGE);
  18466. this.updateUserInfo2Server("jb");
  18467. }
  18468. static setCoin2(val) {
  18469. if (typeof val != "number") {
  18470. return;
  18471. }
  18472. this.userData.coin = val;
  18473. this.saveUserData();
  18474. xGame.eventMgr.event(COIN_CHANGE);
  18475. }
  18476. static setCoinFormServer(val) {
  18477. if (typeof val != "number") {
  18478. return;
  18479. }
  18480. this.userData.coin = val;
  18481. this.saveUserData();
  18482. console.log('zh:通知更新金币变化' + val);
  18483. xGame.eventMgr.event(COIN_CHANGE);
  18484. }
  18485. static getCoin() {
  18486. return this.userData.coin;
  18487. }
  18488. static diamondEnough(need) {
  18489. if (typeof need != "number") {
  18490. console.error("金币格式错误");
  18491. return;
  18492. }
  18493. return this.userData.diamond >= need;
  18494. }
  18495. static setDiamond(val) {
  18496. if (typeof val != "number") {
  18497. return;
  18498. }
  18499. this.userData.diamond += val;
  18500. this.saveUserData();
  18501. xGame.eventMgr.event(DIAMOND_CHANGE);
  18502. this.updateUserInfo2Server("zs");
  18503. }
  18504. static setDiamond2(val) {
  18505. if (typeof val != "number") {
  18506. return;
  18507. }
  18508. this.userData.diamond = val;
  18509. this.saveUserData();
  18510. xGame.eventMgr.event(DIAMOND_CHANGE);
  18511. }
  18512. static setDiamondFormServer(val) {
  18513. if (typeof val != "number") {
  18514. return;
  18515. }
  18516. this.userData.diamond = val;
  18517. this.saveUserData();
  18518. console.log('zh:通知更新钻石变化' + val);
  18519. xGame.eventMgr.event(DIAMOND_CHANGE);
  18520. }
  18521. static getDiamond() {
  18522. return this.userData.diamond;
  18523. }
  18524. static getSkillSuccessTimes() {
  18525. return this.userData.skillSuccessTimes;
  18526. }
  18527. static setSkillSuccessTimes(val, addUp = true) {
  18528. if (addUp)
  18529. this.userData.skillSuccessTimes += val;
  18530. else
  18531. this.userData.skillSuccessTimes = val;
  18532. this.saveUserData();
  18533. }
  18534. static getSkillAccTimes() {
  18535. return this.userData.skillAccTimes;
  18536. }
  18537. static setSkillAccTimes(val) {
  18538. this.userData.skillAccTimes += val;
  18539. this.saveUserData();
  18540. }
  18541. static getSkillGuide() {
  18542. if (!xGame.common.openGuide) {
  18543. return 1;
  18544. }
  18545. return this.userData.skillGuide;
  18546. }
  18547. static setSkillGuide(val) {
  18548. this.userData.skillGuide = val;
  18549. this.saveUserData();
  18550. }
  18551. static getPlaceBallLevelList() {
  18552. return this.userData.placeBallData;
  18553. }
  18554. static setPlaceBallLevelList(objStr) {
  18555. if (objStr) {
  18556. let obj = JSON.parse(objStr);
  18557. this.userData.placeBallData = obj;
  18558. let cd = obj.length;
  18559. console.log('zh:setPlaceBallLevelList cd=' + cd);
  18560. xGame.common.placeBallCurLevel = cd;
  18561. DataMgr.setChallengeMode_overLev(cd);
  18562. this.saveUserData();
  18563. }
  18564. else {
  18565. this.userData.placeBallData = [];
  18566. this.saveUserData();
  18567. }
  18568. }
  18569. static getPlaceBallLevel(level) {
  18570. let arr = this.userData.placeBallData;
  18571. let index = level - 1;
  18572. let out;
  18573. if (arr[index]) {
  18574. out = arr[index];
  18575. }
  18576. else {
  18577. let max = arr.length;
  18578. if (max == index) {
  18579. out = {
  18580. star: 0,
  18581. play: true,
  18582. isCur: true,
  18583. getAward: false
  18584. };
  18585. }
  18586. else {
  18587. out = {
  18588. star: 0,
  18589. play: false,
  18590. getAward: false
  18591. };
  18592. }
  18593. }
  18594. return out;
  18595. }
  18596. static setPlaceBallLevel(level, star) {
  18597. let arr = this.userData.placeBallData;
  18598. let index = level - 1;
  18599. if (arr[index]) {
  18600. arr[index].star = Math.max(arr[index].star, star);
  18601. }
  18602. else {
  18603. let max = arr.length;
  18604. if (max == index) {
  18605. arr.push({
  18606. star: star,
  18607. play: true,
  18608. getAward: false
  18609. });
  18610. }
  18611. else {
  18612. console.error("关卡存储出错");
  18613. }
  18614. }
  18615. this.saveUserData();
  18616. }
  18617. static setPlaceBallAward(level) {
  18618. let arr = this.userData.placeBallData;
  18619. let index = level - 1;
  18620. if (arr[index]) {
  18621. arr[index].getAward = true;
  18622. }
  18623. this.saveUserData();
  18624. }
  18625. static getShareDiamondTimes() {
  18626. return this.userData.shareDiamondTimes;
  18627. }
  18628. static setShareDiamondTimes(val, addUp = true) {
  18629. if (addUp) {
  18630. this.userData.shareDiamondTimes += val;
  18631. }
  18632. else {
  18633. this.userData.shareDiamondTimes = val;
  18634. }
  18635. this.saveUserData();
  18636. }
  18637. static getDailyVideoShareTimes() {
  18638. return this.userData.dailyVideoShareTimes;
  18639. }
  18640. static setDailyVideoShareTimes(val, addUp = true) {
  18641. if (addUp) {
  18642. this.userData.dailyVideoShareTimes += val;
  18643. }
  18644. else {
  18645. this.userData.dailyVideoShareTimes = val;
  18646. }
  18647. this.saveUserData();
  18648. }
  18649. static getSecretary(index) {
  18650. return this.userData.secretary[index];
  18651. }
  18652. static setSecretary(index, val) {
  18653. this.userData.secretary[index] = val;
  18654. this.saveUserData();
  18655. }
  18656. static getCurSecretary() {
  18657. return this.userData.curSecretary;
  18658. }
  18659. static setCurSecretary(index) {
  18660. this.userData.curSecretary = index;
  18661. this.saveUserData();
  18662. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18663. }
  18664. static getBallRod(index) {
  18665. return this.userData.ballRod[index];
  18666. }
  18667. static setBallRod(index, val) {
  18668. this.userData.ballRod[index] = val;
  18669. this.saveUserData();
  18670. }
  18671. static setBallRodFormServer(haveQiuGanJsonStr) {
  18672. if (!haveQiuGanJsonStr) {
  18673. console.log("setBallRodFormServer数据为空或未定义");
  18674. return;
  18675. }
  18676. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18677. const keys = Object.keys(haveQiuGanJsonObj);
  18678. keys.forEach(key => {
  18679. let v = haveQiuGanJsonObj[key];
  18680. let k = parseInt(key);
  18681. let idx = k - 1;
  18682. this.userData.ballRod[idx] = v;
  18683. });
  18684. }
  18685. static getCurBallRod() {
  18686. return this.userData.curBallRod;
  18687. }
  18688. static setCurBallRod(index) {
  18689. this.userData.curBallRod = index;
  18690. this.saveUserData();
  18691. }
  18692. static setSignData(val) {
  18693. this.userData.signData = val;
  18694. this.saveUserData();
  18695. }
  18696. static getSignData() {
  18697. return this.userData.signData;
  18698. }
  18699. static setSignTime(val) {
  18700. this.userData.signTime = val;
  18701. this.saveUserData();
  18702. }
  18703. static getSignTime() {
  18704. return this.userData.signTime;
  18705. }
  18706. static getDrawTimes() {
  18707. return this.userData.drawTimes;
  18708. }
  18709. static setDrawTimes(val, addUp = true) {
  18710. if (addUp) {
  18711. this.userData.drawTimes += val;
  18712. }
  18713. else {
  18714. this.userData.drawTimes = val;
  18715. }
  18716. this.saveUserData();
  18717. }
  18718. static getDrawAwardTimes() {
  18719. return this.userData.drawAwardTimes;
  18720. }
  18721. static setDrawAwardTimes(val) {
  18722. this.userData.drawAwardTimes = val;
  18723. this.saveUserData();
  18724. }
  18725. static getDailyfreeDrawTimes() {
  18726. return this.userData.dailyfreeDrawTimes;
  18727. }
  18728. static setDailyfreeDrawTimes(val) {
  18729. this.userData.dailyfreeDrawTimes = val;
  18730. this.saveUserData();
  18731. }
  18732. static setPower(val, addUp = true) {
  18733. if (addUp)
  18734. this.userData.power += val;
  18735. else
  18736. this.userData.power = val;
  18737. if (this.userData.power >= xGame.common.maxPower) {
  18738. this.userData.power = xGame.common.maxPower;
  18739. }
  18740. xGame.eventMgr.event(POWER_CHANGE, val);
  18741. this.saveUserData();
  18742. }
  18743. static getPower() {
  18744. return this.userData.power;
  18745. }
  18746. static setPowerTime(val) {
  18747. this.userData.powerTime = val;
  18748. this.saveUserData();
  18749. }
  18750. static getPowerTime() {
  18751. return this.userData.powerTime;
  18752. }
  18753. static powerEnough() {
  18754. return this.getPower() > 0;
  18755. }
  18756. static getChallengeTimes() {
  18757. return this.userData.challengeTimes;
  18758. }
  18759. static setChallengeTimes(val) {
  18760. this.userData.challengeTimes += val;
  18761. this.saveUserData();
  18762. }
  18763. static getExtraSign() {
  18764. return this.userData.extraSign;
  18765. }
  18766. static setExtraSign(val) {
  18767. this.userData.extraSign = val;
  18768. this.saveUserData();
  18769. }
  18770. static getClassicTimes() {
  18771. return this.userData.classicTimes;
  18772. }
  18773. static setClassicTimes() {
  18774. this.userData.classicTimes += 1;
  18775. this.saveUserData();
  18776. }
  18777. static getGuideHelpLine() {
  18778. return this.userData.guideHelpLine;
  18779. }
  18780. static setGuideHelpLine() {
  18781. this.userData.guideHelpLine = 1;
  18782. this.saveUserData();
  18783. }
  18784. static getNewUser() {
  18785. return this.userData.newUser;
  18786. }
  18787. static setNewUser() {
  18788. this.userData.newUser = false;
  18789. this.saveUserData();
  18790. }
  18791. static getRootBallFoul() {
  18792. return this.userData.rootBallFoul;
  18793. }
  18794. static setRootBallFoul() {
  18795. this.userData.rootBallFoul = 1;
  18796. this.saveUserData();
  18797. }
  18798. static getTimeoutFoul() {
  18799. return this.userData.timeoutFoul;
  18800. }
  18801. static setTimeoutFoul() {
  18802. this.userData.timeoutFoul = 1;
  18803. this.saveUserData();
  18804. }
  18805. static saveDiyGameData() {
  18806. if (this.diyGameSaving)
  18807. return;
  18808. this.diyGameSaving = true;
  18809. Laya.timer.once(500, this, () => {
  18810. this.diyGameSaving = false;
  18811. this.diyGameData.saveData();
  18812. });
  18813. }
  18814. static getChallengeMode_overLev() {
  18815. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18816. return this.challengeMode_overLev;
  18817. }
  18818. static setChallengeMode_overLev(levNum) {
  18819. this.diyGameData.challengeMode_overLev = levNum;
  18820. this.saveDiyGameData();
  18821. }
  18822. static updateUserInfo2Server(type, count = 0) {
  18823. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18824. if (userInfoData == null) {
  18825. return;
  18826. }
  18827. let reqData = xGame.httpMgr.getReqData();
  18828. let rd = JSON.parse(reqData);
  18829. rd.dataType = type;
  18830. let dataValue = 0;
  18831. if (type == "zs") {
  18832. dataValue = this.getDiamond();
  18833. }
  18834. if (type == "jb") {
  18835. dataValue = this.getCoin();
  18836. }
  18837. rd.dataValue = dataValue;
  18838. reqData = JSON.stringify(rd);
  18839. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18840. try {
  18841. let code = res.code;
  18842. let data = res.data;
  18843. if (code == 401) {
  18844. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18845. console.log('zh:保存资产信息失败,请重新登录 ');
  18846. return;
  18847. }
  18848. if (code == 200) {
  18849. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18850. }
  18851. else {
  18852. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18853. }
  18854. }
  18855. catch (error) {
  18856. console.log('error=' + error);
  18857. alert("Please check your network connection.");
  18858. }
  18859. finally {
  18860. }
  18861. });
  18862. }
  18863. static getUserZiChanInfo(winTip = false) {
  18864. console.log('zh:getUserZCI');
  18865. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18866. console.log('zh:userInfoData=' + userInfoData);
  18867. if (userInfoData == null || userInfoData == "" || userInfoData === "null") {
  18868. if (winTip) {
  18869. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18870. }
  18871. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18872. return;
  18873. }
  18874. let reqData = xGame.httpMgr.getReqData();
  18875. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18876. try {
  18877. let code = res.code;
  18878. let msg = res.msg;
  18879. if (code == 401) {
  18880. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18881. if (winTip) {
  18882. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18883. }
  18884. return;
  18885. }
  18886. if (code == 200) {
  18887. let d = res.data;
  18888. let zuanShi = d.zuanShi;
  18889. let jinBi = d.jinBi;
  18890. let haveQiuGanJson = d.haveQiuGanJson;
  18891. let signData = d.signData;
  18892. let placeBallData = d.placeBallData;
  18893. DataMgr.setDiamondFormServer(zuanShi);
  18894. DataMgr.setCoinFormServer(jinBi);
  18895. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18896. DataMgr.setPlaceBallLevelList(placeBallData);
  18897. if (signData && signData > 0) {
  18898. DataMgr.setSignData(signData);
  18899. }
  18900. }
  18901. else {
  18902. console.log("zh:更新用户资产信息error" + msg);
  18903. if (winTip) {
  18904. xGame.uiMgr.Show(UIMsg, msg);
  18905. }
  18906. }
  18907. }
  18908. catch (error) {
  18909. console.log('error=' + error);
  18910. if (winTip) {
  18911. alert(error);
  18912. }
  18913. }
  18914. finally {
  18915. console.log("zh:更新用户资产信息结束");
  18916. }
  18917. });
  18918. }
  18919. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  18920. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18921. console.log('zh:updateLocalUserData=' + userInfo);
  18922. if (userInfo != null) {
  18923. if (!userInfo.buySpids) {
  18924. userInfo.buySpids = { 1: false, 7: false };
  18925. }
  18926. else {
  18927. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  18928. }
  18929. userInfo.buySpids[spid] = isBuyOk;
  18930. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  18931. }
  18932. else {
  18933. }
  18934. }
  18935. static loadUserSpOrderForAd() {
  18936. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18937. if (userInfo == null) {
  18938. return;
  18939. }
  18940. console.log('zh:重新加载更新广告权利');
  18941. let reqData = xGame.httpMgr.getReqData();
  18942. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  18943. try {
  18944. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  18945. let code = res.code;
  18946. let msg = res.msg;
  18947. if (code == 401) {
  18948. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18949. return;
  18950. }
  18951. if (code == 200) {
  18952. let data = res.data;
  18953. let buy_spid1 = false;
  18954. let buy_spid7 = false;
  18955. for (let index = 0; index < data.length; index++) {
  18956. let element = data[index];
  18957. console.log('zh:list element.spid = ' + element.spid);
  18958. if (element.spid == 1) {
  18959. buy_spid1 = true;
  18960. }
  18961. if (element.spid == 7) {
  18962. buy_spid7 = true;
  18963. }
  18964. }
  18965. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  18966. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  18967. }
  18968. else {
  18969. }
  18970. }
  18971. catch (error) {
  18972. console.log('error=' + error);
  18973. alert(error);
  18974. }
  18975. finally {
  18976. }
  18977. });
  18978. }
  18979. }
  18980. DataMgr.isNewUser = false;
  18981. DataMgr.fristEnter = true;
  18982. DataMgr.levelType = 0;
  18983. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18984. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18985. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18986. DataMgr.challengeMode_overLev = 0;
  18987. DataMgr.xszyForClassic = false;
  18988. DataMgr.xszyForChallenge = false;
  18989. DataMgr.awardId = 0;
  18990. DataMgr.awardCoin = 0;
  18991. DataMgr.sceneId = -1;
  18992. DataMgr.tryId = 0;
  18993. DataMgr.curLevel = 1;
  18994. DataMgr.vipLevel = 0;
  18995. DataMgr.maxLevel = 0;
  18996. DataMgr.awardRatio = 1;
  18997. DataMgr.gameList = [];
  18998. DataMgr.rankList = [];
  18999. DataMgr.recoverTime = 480000;
  19000. DataMgr.minScore = 0;
  19001. DataMgr.rankDis = 0;
  19002. DataMgr.userSaving = false;
  19003. DataMgr.gameSaving = false;
  19004. DataMgr.diyGameSaving = false;
  19005. class D3Tween extends Laya.Script3D {
  19006. constructor() {
  19007. super();
  19008. this.isInited = false;
  19009. }
  19010. ;
  19011. init() {
  19012. if (this.isInited)
  19013. return;
  19014. this.isInited = true;
  19015. this.gameObj = this.owner;
  19016. this.transform = this.gameObj.transform;
  19017. }
  19018. get rotX() {
  19019. return this.transform.localRotationEulerX;
  19020. }
  19021. set rotX(v) {
  19022. this.transform.localRotationEulerX = v;
  19023. }
  19024. get rotY() {
  19025. return this.transform.localRotationEulerY;
  19026. }
  19027. set rotY(v) {
  19028. this.transform.localRotationEulerY = v;
  19029. }
  19030. get rotZ() {
  19031. return this.transform.localRotationEulerZ;
  19032. }
  19033. set rotZ(v) {
  19034. this.transform.localRotationEulerZ = v;
  19035. }
  19036. get posX() {
  19037. return this.transform.localPositionX;
  19038. }
  19039. set posX(v) {
  19040. this.transform.localPositionX = v;
  19041. }
  19042. get posY() {
  19043. return this.transform.localPositionY;
  19044. }
  19045. set posY(v) {
  19046. this.transform.localPositionY = v;
  19047. }
  19048. get posZ() {
  19049. return this.transform.localPositionZ;
  19050. }
  19051. set posZ(v) {
  19052. this.transform.localPositionZ = v;
  19053. }
  19054. get rotation() {
  19055. return this.transform.localRotation;
  19056. }
  19057. set rotation(v) {
  19058. this.transform.localRotation = v;
  19059. }
  19060. }
  19061. class D2Hole extends Laya.Script {
  19062. constructor() { super(); }
  19063. onTriggerEnter(collider) {
  19064. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  19065. return;
  19066. }
  19067. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  19068. if (collider.owner["mySrc"].isRunSkillAni) {
  19069. return;
  19070. }
  19071. if (collider.owner["mySrc"].number != 0) {
  19072. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  19073. }
  19074. xGame.common.ballColliHole(collider);
  19075. xGame.common.recoverCameraView();
  19076. }
  19077. }
  19078. }
  19079. class Table extends Laya.Script3D {
  19080. constructor() {
  19081. super();
  19082. this.isSetBorder = false;
  19083. this.inited = false;
  19084. }
  19085. ;
  19086. onAwake() {
  19087. this.init();
  19088. }
  19089. init() {
  19090. if (this.inited)
  19091. return;
  19092. this.inited = true;
  19093. this.gameObj = this.owner;
  19094. this.border = this.gameObj.getChildByName("border");
  19095. }
  19096. setBorderPos() {
  19097. if (this.isSetBorder)
  19098. return;
  19099. this.isSetBorder = true;
  19100. let ui = xGame.common.gameUI.ui;
  19101. let bar1 = this.border.getChildByName("bar1");
  19102. let bar2 = this.border.getChildByName("bar2");
  19103. let bar3 = this.border.getChildByName("bar3");
  19104. let bar4 = this.border.getChildByName("bar4");
  19105. let bar5 = this.border.getChildByName("bar5");
  19106. let bar6 = this.border.getChildByName("bar6");
  19107. this.setInfo(bar1, ui.border.bar1, "box");
  19108. this.setInfo(bar2, ui.border.bar2, "box");
  19109. this.setInfo(bar3, ui.border.bar3, "box");
  19110. this.setInfo(bar4, ui.border.bar4, "box");
  19111. this.setInfo(bar5, ui.border.bar5, "box");
  19112. this.setInfo(bar6, ui.border.bar6, "box");
  19113. let circle1 = this.border.getChildByName("circle1");
  19114. let circle2 = this.border.getChildByName("circle2");
  19115. let circle3 = this.border.getChildByName("circle3");
  19116. let circle4 = this.border.getChildByName("circle4");
  19117. let circle5 = this.border.getChildByName("circle5");
  19118. let circle6 = this.border.getChildByName("circle6");
  19119. this.setInfo(circle1, ui.border.circle1, "circle");
  19120. this.setInfo(circle2, ui.border.circle2, "circle");
  19121. this.setInfo(circle3, ui.border.circle3, "circle");
  19122. this.setInfo(circle4, ui.border.circle4, "circle");
  19123. this.setInfo(circle5, ui.border.circle5, "circle");
  19124. this.setInfo(circle6, ui.border.circle6, "circle");
  19125. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  19126. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19127. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19128. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19129. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19130. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19131. let arr = xGame.common.gameMgr.holePosList;
  19132. xGame.common.gameMgr.posObj = {
  19133. "1": arr[0],
  19134. "3": arr[2],
  19135. "4": arr[3],
  19136. "6": arr[5]
  19137. };
  19138. }
  19139. initHolePos(x, y) {
  19140. if (x < 300)
  19141. x += 25;
  19142. else if (x > 1000)
  19143. x -= 25;
  19144. else if (y > 200)
  19145. y -= 10;
  19146. else
  19147. y += 10;
  19148. if (y < 200)
  19149. y += 30;
  19150. else if (y > 500)
  19151. y -= 30;
  19152. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19153. }
  19154. setInfo(d3Obj, d2Obj, type) {
  19155. let ui = xGame.common.gameUI.ui;
  19156. let sprite = new Laya.Sprite();
  19157. ui.border.displayObject.addChild(sprite);
  19158. let colli = xGame.common.getCollider(type);
  19159. sprite.addComponentIntance(colli);
  19160. let rigy = xGame.common.getRigbody();
  19161. rigy.type = "static";
  19162. sprite.addComponentIntance(rigy);
  19163. let d3Pos = d3Obj.transform.position;
  19164. xGame.common.pos3to2Convert(d3Pos);
  19165. let scaleX = d3Obj.transform.localScaleX;
  19166. let scaleZ = d3Obj.transform.localScaleZ;
  19167. let width = xGame.common.scale3to2Convert(scaleZ);
  19168. let height = xGame.common.scale3to2Convert(scaleX);
  19169. sprite.pivotX = width / 2;
  19170. sprite.pivotY = height / 2;
  19171. sprite.x = d3Pos.x;
  19172. sprite.y = d3Pos.y;
  19173. sprite.width = width;
  19174. sprite.height = height;
  19175. d2Obj.x = d3Pos.x;
  19176. d2Obj.y = d3Pos.y;
  19177. d2Obj.width = width;
  19178. d2Obj.height = height;
  19179. if (type == "box") {
  19180. colli.width = width;
  19181. colli.height = height;
  19182. colli.isSensor = false;
  19183. colli.label = "border";
  19184. }
  19185. else {
  19186. colli.radius = width / 2;
  19187. colli.isSensor = true;
  19188. colli.label = "hole";
  19189. sprite.addComponent(D2Hole);
  19190. }
  19191. }
  19192. }
  19193. class D3World extends Laya.Script3D {
  19194. constructor() {
  19195. super();
  19196. this.loadNum = 0;
  19197. this.setLoadNum = 7;
  19198. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19199. }
  19200. onAwake() {
  19201. }
  19202. loadScene() {
  19203. this.scene = this.owner;
  19204. let url = `res/unityRes/root.lh`;
  19205. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19206. this.scene.addChild(prefab);
  19207. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19208. this.putCameraInfo();
  19209. this.camera.enableHDR = false;
  19210. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19211. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19212. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19213. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19214. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19215. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19216. this.knife.active = false;
  19217. this.loadD3Obj();
  19218. }));
  19219. }
  19220. putCameraInfo() {
  19221. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19222. this.cameraObj = new cameraType();
  19223. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19224. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19225. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19226. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19227. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19228. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19229. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19230. this.visitAngleChild.init();
  19231. this.visitRootObj.posX = this.visitAngleChild.posX;
  19232. this.visitRootObj.posY = this.visitAngleChild.posY;
  19233. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19234. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19235. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19236. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19237. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19238. xGame.common.showOneCamera("mainCamera");
  19239. }
  19240. loadD3Obj() {
  19241. this.loadTable();
  19242. this.loadRoom();
  19243. this.loadInHoleParticial();
  19244. this.loadIceParticial();
  19245. this.loadHitParticial();
  19246. this.loadFireworksParticial();
  19247. this.loadBall();
  19248. }
  19249. loadInHoleParticial() {
  19250. this.loadD3Res("inHoleEft", "", (prefab) => {
  19251. prefab.addComponent(Partical);
  19252. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19253. });
  19254. }
  19255. loadIceParticial() {
  19256. this.loadD3Res("iceEft", "", (prefab) => {
  19257. prefab.addComponent(Partical);
  19258. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19259. });
  19260. }
  19261. loadHitParticial() {
  19262. this.loadD3Res("hitEft", "", (prefab) => {
  19263. prefab.addComponent(Partical);
  19264. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19265. });
  19266. }
  19267. loadFireworksParticial() {
  19268. this.loadD3Res("fireworksEft", "", (prefab) => {
  19269. prefab.addComponent(Partical);
  19270. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19271. });
  19272. }
  19273. loadBall(index = 1) {
  19274. this.loadD3Res("ball", index, (prefab) => {
  19275. this.ballPrefab = prefab;
  19276. this.ballPrefab.addComponent(Ball);
  19277. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19278. });
  19279. }
  19280. loadTable(index = 1) {
  19281. this.loadD3Res("table", index, (prefab) => {
  19282. this.tableSrc = prefab.addComponent(Table);
  19283. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19284. this.d3Hand.init();
  19285. this.tableRoot.addChild(prefab);
  19286. });
  19287. }
  19288. loadRoom(index = 1) {
  19289. this.loadD3Res("room", index, (prefab) => {
  19290. this.roomRoot.addChild(prefab);
  19291. });
  19292. }
  19293. loadD3Res(type, index, callback) {
  19294. let url = `res/unityRes/${type}${index}.lh`;
  19295. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19296. callback && callback(prefab);
  19297. this.checkResLoad();
  19298. }));
  19299. }
  19300. checkResLoad() {
  19301. this.loadNum++;
  19302. if (this.loadNum >= this.setLoadNum) {
  19303. xGame.eventMgr.event(D3RES_LOADED);
  19304. }
  19305. }
  19306. prePlayEft() {
  19307. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19308. eft.transform.localPositionX = 0;
  19309. eft.transform.localPositionY = -5;
  19310. eft.transform.localPositionZ = 0;
  19311. eft.active = true;
  19312. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19313. ice.transform.localPositionX = 0;
  19314. ice.transform.localPositionY = -5;
  19315. ice.transform.localPositionZ = 0;
  19316. ice.active = true;
  19317. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19318. hit.transform.localPositionX = 0;
  19319. hit.transform.localPositionY = -5;
  19320. hit.transform.localPositionZ = 0;
  19321. hit.active = true;
  19322. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19323. fireworks.transform.localPositionX = 0;
  19324. fireworks.transform.localPositionY = -5;
  19325. fireworks.transform.localPositionZ = 0;
  19326. fireworks.active = true;
  19327. }
  19328. }
  19329. class cameraType {
  19330. }
  19331. class MoyuMgr$1 {
  19332. static initMoyu() {
  19333. this.moyuView = new MoyuView$1();
  19334. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19335. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19336. this.moyuView.ui.displayObject.zOrder = 1000;
  19337. this.moyuView.init();
  19338. this.moyuView.showTip(true);
  19339. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19340. window['XApk'] = this;
  19341. }
  19342. static showAge(show) {
  19343. if (this.moyuView)
  19344. this.moyuView.showAge(show);
  19345. }
  19346. static onPlatMsg(idx) {
  19347. if (!MoyuMgr$1.moyuView)
  19348. return;
  19349. if (idx == '0') {
  19350. MoyuMgr$1.moyuView.showTip(false);
  19351. }
  19352. }
  19353. static showAgree(call) {
  19354. if (this.moyuView)
  19355. this.moyuView.showAgree(call);
  19356. else
  19357. call && call();
  19358. }
  19359. static showXy(type = 1) {
  19360. if (this.moyuView)
  19361. this.moyuView.showXy(type);
  19362. }
  19363. }
  19364. MoyuMgr$1.isAdvise = false;
  19365. class MoyuView$1 {
  19366. constructor() {
  19367. this.ysxyNum = 1;
  19368. this.ysJson = null;
  19369. this.ui = ui_UIMoyu.createInstance();
  19370. }
  19371. init() {
  19372. this.ui.mainBg.visible = false;
  19373. this.ui.xyNode.visible = false;
  19374. this.ui.ageNode.visible = false;
  19375. this.ui.tipNode.visible = false;
  19376. this.ui.rnNode.visible = false;
  19377. this.ui.fcmNode.visible = false;
  19378. this.ui.ageTip.visible = false;
  19379. this.ui.msgNode.visible = false;
  19380. this.ui.visible = false;
  19381. this.ui.xyNode.xyList.setVirtual();
  19382. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19383. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19384. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19385. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19386. this.ui.xyNode.btnKnown.visible = false;
  19387. this.ui.xyNode.xy1.visible = false;
  19388. this.ui.xyNode.xy2.visible = false;
  19389. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19390. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19391. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19392. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19393. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19394. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19395. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19396. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19397. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19398. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19399. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19400. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19401. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19402. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19403. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19404. this.ysxyNum = 2;
  19405. }
  19406. }
  19407. onClick(obj) {
  19408. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19409. switch (obj) {
  19410. case this.ui.ageTip:
  19411. if (Moyu.isTTApk) {
  19412. this.ui.ageNode.visible = true;
  19413. this.ui.mainBg.visible = true;
  19414. }
  19415. break;
  19416. case this.ui.tipNode:
  19417. this.showTip(false);
  19418. break;
  19419. case this.ui.ageNode.btnAge:
  19420. this.ui.ageNode.visible = false;
  19421. this.ui.mainBg.visible = false;
  19422. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19423. this.ui.visible = false;
  19424. break;
  19425. case this.ui.xyNode.btnXy3:
  19426. case this.ui.xyNode.btnXy1:
  19427. this.loadXy(1);
  19428. break;
  19429. case this.ui.xyNode.btnXy2:
  19430. this.loadXy(2);
  19431. break;
  19432. case this.ui.xyNode.btnBack:
  19433. this.ui.xyNode.xy1.visible = true;
  19434. this.ui.xyNode.xy2.visible = false;
  19435. break;
  19436. case this.ui.xyNode.btnKnown:
  19437. this.ui.xyNode.visible = false;
  19438. this.ui.mainBg.visible = false;
  19439. this.ui.visible = false;
  19440. break;
  19441. case this.ui.rnNode.btnCheck:
  19442. this.check();
  19443. break;
  19444. case this.ui.rnNode.btnExit:
  19445. case this.ui.xyNode.btnNo:
  19446. this.ysxyNum--;
  19447. if (this.ysxyNum > 0)
  19448. this.showMsg("Refuse to quit the game once again");
  19449. else {
  19450. Moyu.userAgree(false);
  19451. Moyu.exit();
  19452. }
  19453. break;
  19454. case this.ui.xyNode.btnSure:
  19455. case this.ui.xyNode.btnYes:
  19456. DataMgr.userData.isAgree = true;
  19457. DataMgr.saveUserData();
  19458. this.onAgree();
  19459. break;
  19460. case this.ui.rnNode.btnDone:
  19461. this.ui.rnNode.visible = false;
  19462. this.ui.visible = false;
  19463. break;
  19464. case this.ui.fcmNode.btnRn:
  19465. this.showRn();
  19466. break;
  19467. }
  19468. }
  19469. showTip(show) {
  19470. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19471. return;
  19472. if (show) {
  19473. MoyuMgr$1.isAdvise = true;
  19474. this.ui.visible = true;
  19475. this.ui.tipNode.visible = true;
  19476. this.ui.tipNode.alpha = 1;
  19477. Laya.timer.once(1000, this, this.showTip, [false]);
  19478. }
  19479. else {
  19480. this.ui.tipNode.alpha = 1;
  19481. this.ui.tipNode.visible = true;
  19482. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19483. this.ui.tipNode.visible = false;
  19484. MoyuMgr$1.isAdvise = false;
  19485. }), 1000);
  19486. }
  19487. }
  19488. showAge(show, px = 0, py = 0) {
  19489. if (Moyu.platType > 10 && !Moyu.isIos) {
  19490. this.ui.ageTip.x = px;
  19491. this.ui.ageTip.y = py;
  19492. this.ui.ageTip.visible = show;
  19493. if (show)
  19494. this.ui.visible = true;
  19495. }
  19496. }
  19497. showAgree(call) {
  19498. this.agreeCall = call;
  19499. this.onAgree();
  19500. return;
  19501. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19502. this.showXy(0);
  19503. }
  19504. else
  19505. this.onAgree();
  19506. }
  19507. onAgree() {
  19508. if (!this.ui.ageNode.visible)
  19509. this.ui.visible = false;
  19510. this.ui.xyNode.visible = false;
  19511. Moyu.userAgree(true);
  19512. this.showAge(false);
  19513. this.agreeCall && this.agreeCall();
  19514. this.showRn();
  19515. }
  19516. showMsg(txt) {
  19517. this.ui.msgNode.txtMsg.text = txt;
  19518. this.ui.msgNode.visible = true;
  19519. this.ui.msgNode.alpha = 1;
  19520. this.ui.visible = true;
  19521. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19522. this.ui.msgNode.visible = false;
  19523. }), 2500, true);
  19524. }
  19525. showRn() {
  19526. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19527. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19528. this.ui.rnNode.rn1.visible = true;
  19529. this.ui.rnNode.rn2.visible = false;
  19530. this.ui.rnNode.rn3.visible = false;
  19531. this.ui.rnNode.rn4.visible = false;
  19532. this.ui.rnNode.visible = true;
  19533. this.ui.mainBg.visible = true;
  19534. this.ui.rnNode.btnDone.visible = false;
  19535. this.ui.rnNode.btnExit.visible = true;
  19536. this.ui.rnNode.btnCheck.visible = true;
  19537. this.ui.fcmNode.visible = false;
  19538. this.ui.visible = true;
  19539. return;
  19540. }
  19541. }
  19542. this.showFcm();
  19543. }
  19544. showFcm() {
  19545. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19546. Moyu.initFCM(true);
  19547. if (Moyu.gameTime < 1)
  19548. this.fcmLoop();
  19549. else if (Moyu.gameTime < 999)
  19550. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19551. }
  19552. }
  19553. fcmLoop() {
  19554. if (Moyu.gameTime < 1) {
  19555. this.ui.rnNode.visible = false;
  19556. this.ui.fcmNode.visible = true;
  19557. this.ui.mainBg.visible = true;
  19558. this.ui.visible = true;
  19559. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19560. Laya.timer.clear(this.ui, this.fcmLoop);
  19561. }
  19562. }
  19563. check() {
  19564. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19565. this.ui.rnNode.rn1.visible = false;
  19566. this.ui.rnNode.rn2.visible = false;
  19567. this.ui.rnNode.rn4.visible = true;
  19568. }
  19569. else if (this.ui.rnNode.rn4.visible) {
  19570. let name = this.ui.rnNode.inputName.text;
  19571. let code = this.ui.rnNode.inputCode.text;
  19572. if (code && code.length == 18) {
  19573. this.ui.rnNode.rn1.visible = false;
  19574. this.ui.rnNode.rn4.visible = false;
  19575. Moyu.authenticate(name, code, (res) => {
  19576. this.ui.rnNode.rn2.visible = !res;
  19577. this.ui.rnNode.rn3.visible = res;
  19578. this.ui.rnNode.btnDone.visible = res;
  19579. this.ui.rnNode.btnExit.visible = !res;
  19580. this.ui.rnNode.btnCheck.visible = !res;
  19581. if (res)
  19582. this.showFcm();
  19583. });
  19584. }
  19585. else
  19586. this.showMsg("信息填写不完整");
  19587. }
  19588. }
  19589. loadXy(type = 0) {
  19590. this.ui.xyNode.xy1.visible = false;
  19591. this.ui.xyNode.xy2.visible = true;
  19592. this.ui.xyNode.xyList.scrollToView(0);
  19593. if (type == 1) {
  19594. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19595. }
  19596. else if (type == 2) {
  19597. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19598. }
  19599. }
  19600. showXy(type = 0) {
  19601. this.xyBtn();
  19602. if (type == 0) {
  19603. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19604. this.ui.xyNode.btnSure.visible = true;
  19605. }
  19606. else {
  19607. this.ui.xyNode.btnYes.visible = true;
  19608. this.ui.xyNode.btnNo.visible = true;
  19609. }
  19610. }
  19611. else {
  19612. this.ui.xyNode.btnKnown.visible = true;
  19613. this.ui.mainBg.visible = true;
  19614. }
  19615. this.ui.xyNode.xy1.visible = true;
  19616. this.ui.xyNode.xy2.visible = false;
  19617. this.ui.xyNode.visible = true;
  19618. this.ui.visible = true;
  19619. }
  19620. xyBtn() {
  19621. this.ui.xyNode.btnSure.visible = false;
  19622. this.ui.xyNode.btnYes.visible = false;
  19623. this.ui.xyNode.btnNo.visible = false;
  19624. this.ui.xyNode.btnKnown.visible = false;
  19625. {
  19626. this.ui.xyNode.btnXy3.visible = false;
  19627. this.ui.xyNode.btnXy2.visible = true;
  19628. this.ui.xyNode.btnXy1.visible = true;
  19629. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19630. }
  19631. }
  19632. createXY(json) {
  19633. this.ysJson = json.content;
  19634. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19635. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19636. this.ui.xyNode.xy2.visible = true;
  19637. }
  19638. renderListItem(idx, cell) {
  19639. let xy = this.ysJson[idx];
  19640. cell.height = xy.line * 30;
  19641. cell.xyItem.text = xy.text;
  19642. }
  19643. onDestroy() {
  19644. this.agreeCall = null;
  19645. }
  19646. }
  19647. class UILoading extends UIBase {
  19648. constructor() {
  19649. super();
  19650. this.accTime = 0;
  19651. this.curNum = 0;
  19652. this.rate = 1;
  19653. this.loadSubOk = false;
  19654. this.loadResOK = false;
  19655. this.openLoading = true;
  19656. this.beginLoadRes = false;
  19657. this.finishD2 = false;
  19658. this.finishD3 = false;
  19659. }
  19660. onConstructor() {
  19661. this.ui = ui_UILoading.createInstance();
  19662. this.contentPane = this.ui;
  19663. this.isEject = false;
  19664. this._initUI();
  19665. this._addEvent();
  19666. }
  19667. _initUI() {
  19668. MoyuMgr$1.initMoyu();
  19669. }
  19670. _addEvent() {
  19671. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19672. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19673. }
  19674. show() {
  19675. super.show();
  19676. console.log('zh:加载分包资源');
  19677. loadSubRes(this.subResProgress.bind(this));
  19678. this.ui.txtLoad.text = "Loading...";
  19679. this.setGlobalFont(this.ui);
  19680. }
  19681. subResProgress(pro, finish) {
  19682. this.curNum = pro;
  19683. if (finish) {
  19684. this.curNum = 1;
  19685. this.loadSubOk = true;
  19686. }
  19687. }
  19688. laodD3Res() {
  19689. let scene3D = new Laya.Scene3D();
  19690. xGame.common.d3Scene = scene3D;
  19691. xGame.common.d3World = scene3D.addComponent(D3World);
  19692. xGame.common.d3World.loadScene();
  19693. }
  19694. loadD2Res() {
  19695. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19696. this.finishD2 = true;
  19697. this.checkLoadAll();
  19698. this.curNum = 1;
  19699. }), Laya.Handler.create(this, (pro) => {
  19700. this.curNum = pro;
  19701. }, null, false));
  19702. }
  19703. d3ResFinish() {
  19704. this.finishD3 = true;
  19705. this.checkLoadAll();
  19706. }
  19707. checkLoadAll() {
  19708. if (this.finishD2 && this.finishD3) {
  19709. this.loadResOK = true;
  19710. }
  19711. }
  19712. loadRes() {
  19713. this.laodD3Res();
  19714. this.loadD2Res();
  19715. }
  19716. myUpdate(dt) {
  19717. if (!this.openLoading)
  19718. return;
  19719. this.accTime += dt * this.rate;
  19720. if (this.accTime >= this.curNum)
  19721. this.accTime = this.curNum;
  19722. this.ui.loadinfo.value = this.accTime * 100;
  19723. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19724. if (!this.beginLoadRes) {
  19725. this.beginLoadRes = true;
  19726. this.ui.txtLoad.text = "Loading...";
  19727. this.curNum = 0;
  19728. this.accTime = 0;
  19729. this.loadRes();
  19730. }
  19731. if (this.loadResOK) {
  19732. this.openLoading = false;
  19733. Laya.timer.once(300, this, () => {
  19734. xGame.common.d3Scene.active = false;
  19735. MoyuMgr$1.showAgree(enterGame);
  19736. });
  19737. }
  19738. }
  19739. }
  19740. release() {
  19741. }
  19742. hide() {
  19743. super.hide();
  19744. this.release();
  19745. }
  19746. onClose() {
  19747. this.hide();
  19748. }
  19749. }
  19750. UILoading.uiName = "UILoading";
  19751. class UIRepentProp$1 extends UIBase {
  19752. constructor() {
  19753. super();
  19754. this.viewType = 0;
  19755. this.regretType = 0;
  19756. }
  19757. onConstructor() {
  19758. this.ui = ui_UIRepentProp.createInstance();
  19759. this.contentPane = this.ui;
  19760. this.isEject = false;
  19761. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19762. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19763. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19764. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19765. }
  19766. show(viewType, regretType, callback) {
  19767. PlatMgr.showInsert(true);
  19768. this.viewType = viewType;
  19769. this.regretType = regretType;
  19770. this.callback = callback;
  19771. super.show();
  19772. this.ui.t0.play();
  19773. this.ui.c1.selectedIndex = this.viewType;
  19774. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19775. if (this.viewType == 0) {
  19776. let guide = DataMgr.getGuideHelpLine();
  19777. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19778. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19779. }
  19780. xGame.common.gameMgr.gamePause = true;
  19781. this.setGlobalFont(this.ui);
  19782. }
  19783. hideSelf() {
  19784. xGame.common.gameMgr.gamePause = false;
  19785. this.callback && this.callback(false);
  19786. this.hide();
  19787. }
  19788. videoRegret() {
  19789. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19790. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19791. }
  19792. else {
  19793. console.log('zh:AD 失败,直接发放奖励');
  19794. this.qjff_AD_for_UIrepentProp_videoRegret();
  19795. }
  19796. }
  19797. qjff_AD_for_UIrepentProp_videoRegret() {
  19798. this.callback && this.callback(true);
  19799. this.hideSelf();
  19800. }
  19801. videoAddHelpLine() {
  19802. let guide = DataMgr.getGuideHelpLine();
  19803. if (guide == 0) {
  19804. this.callback && this.callback(true);
  19805. this.hideSelf();
  19806. DataMgr.setGuideHelpLine();
  19807. xGame.common.gameUI.ui.guideNode.visible = false;
  19808. }
  19809. else {
  19810. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19811. if (Laya.Browser.onAndroid) {
  19812. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19813. if (!boo) {
  19814. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19815. return;
  19816. }
  19817. }
  19818. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19819. }
  19820. else {
  19821. console.log('zh:AD 失败,直接发放奖励');
  19822. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19823. }
  19824. }
  19825. }
  19826. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19827. this.callback && this.callback(true);
  19828. this.hideSelf();
  19829. }
  19830. }
  19831. UIRepentProp$1.uiName = "UIRepentProp";
  19832. class UIRodMethod$1 extends UIBase {
  19833. constructor() {
  19834. super();
  19835. this.isPressd = false;
  19836. }
  19837. onConstructor() {
  19838. this.ui = ui_UIRodMethod.createInstance();
  19839. this.contentPane = this.ui;
  19840. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19841. this.moveDir = new Laya.Vector2();
  19842. this.moveDest = new Laya.Vector2();
  19843. this.centerPos = new Laya.Vector2();
  19844. xGame.common.uiRodMethod = this;
  19845. }
  19846. show() {
  19847. super.show();
  19848. xGame.common.gameMgr.gamePause = true;
  19849. this.openPressDotEvent();
  19850. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19851. this.centerPos.x = this.ui.white.x;
  19852. this.centerPos.y = this.ui.white.y;
  19853. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19854. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19855. this.setDot();
  19856. this.setGlobalFont(this.ui);
  19857. }
  19858. setDot() {
  19859. this.ui.dot.x = this.moveDest.x;
  19860. this.ui.dot.y = this.moveDest.y;
  19861. }
  19862. closeSelf() {
  19863. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19864. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19865. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19866. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19867. xGame.common.gameMgr.gamePause = false;
  19868. this.hide();
  19869. }
  19870. openPressDotEvent() {
  19871. this.closePressDotEvent();
  19872. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19873. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19874. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19875. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19876. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19877. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19878. }
  19879. closePressDotEvent() {
  19880. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19881. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19882. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19883. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19884. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19885. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19886. }
  19887. onDown(e) {
  19888. if (e.type == Laya.Event.MOUSE_DOWN)
  19889. this.isPressd = true;
  19890. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19891. this.isPressd = false;
  19892. if (!this.isPressd)
  19893. return;
  19894. this.moveDest.x = e.stageX;
  19895. this.moveDest.y = e.stageY;
  19896. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19897. if (dis > 6724) {
  19898. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19899. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19900. }
  19901. this.setDot();
  19902. }
  19903. resetRod() {
  19904. this.ui.dot.x = this.ui.white.x;
  19905. this.ui.dot.y = this.ui.white.y;
  19906. this.gameRod.dot.x = this.gameRod.bg.x;
  19907. this.gameRod.dot.y = this.gameRod.bg.y;
  19908. xGame.common.rodOffest.x = 0;
  19909. xGame.common.rodOffest.y = 0;
  19910. }
  19911. }
  19912. UIRodMethod$1.uiName = "UIRodMethod";
  19913. class UIMsg$1 extends UIBase {
  19914. constructor() {
  19915. super();
  19916. }
  19917. onConstructor() {
  19918. this.ui = ui_UIMsg.createInstance();
  19919. this.contentPane = this.ui;
  19920. this.isEject = false;
  19921. this.isMuti = true;
  19922. }
  19923. show(msg, callback) {
  19924. super.show();
  19925. this.ui.tipsNode.msgTxt.text = msg;
  19926. this.ui.alpha = 1;
  19927. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19928. this.hide();
  19929. callback && callback();
  19930. }), 1000);
  19931. this.setGlobalFont(this.ui);
  19932. }
  19933. }
  19934. UIMsg$1.uiName = "UIMsg";
  19935. class UITips$1 extends UIBase {
  19936. constructor() {
  19937. super();
  19938. this.type = 0;
  19939. }
  19940. onConstructor() {
  19941. this.ui = ui_UITips.createInstance();
  19942. this.contentPane = this.ui;
  19943. this.isEject = false;
  19944. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19945. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19946. }
  19947. show(tipsTxt, womanTxt, type) {
  19948. super.show();
  19949. this.ui.t0.play();
  19950. this.ui.myNode.tipsTxt.text = tipsTxt;
  19951. this.ui.myNode.womanTxt.text = womanTxt;
  19952. PlatMgr.showInsert(true);
  19953. this.ui.myNode.c1.selectedIndex = type;
  19954. this.type = type;
  19955. switch (this.type) {
  19956. case TipsType.exitGame:
  19957. xGame.common.gameMgr.gamePause = true;
  19958. break;
  19959. case TipsType.foul:
  19960. Laya.timer.once(200, this, () => {
  19961. xGame.common.gameMgr.gamePause = true;
  19962. });
  19963. break;
  19964. default:
  19965. break;
  19966. }
  19967. this.setGlobalFont(this.ui);
  19968. }
  19969. clickLeftBtn() {
  19970. this.hide();
  19971. xGame.common.gameMgr.gamePause = false;
  19972. switch (this.type) {
  19973. case TipsType.exitGame:
  19974. break;
  19975. case TipsType.foul:
  19976. break;
  19977. default:
  19978. break;
  19979. }
  19980. }
  19981. clickRightBtn() {
  19982. this.hide();
  19983. switch (this.type) {
  19984. case TipsType.exitGame:
  19985. xGame.eventMgr.event(RESET_GAME);
  19986. xGame.uiMgr.Show(UIMain$1);
  19987. Moyu.recordEnd(this, null);
  19988. xGame.common.longHelpLine = false;
  19989. break;
  19990. case TipsType.foul:
  19991. xGame.common.gameMgr.gamePause = false;
  19992. Laya.timer.clearAll(this);
  19993. break;
  19994. default:
  19995. break;
  19996. }
  19997. }
  19998. }
  19999. UITips$1.uiName = "UITips";
  20000. class UIGame$1 extends UIBase {
  20001. constructor() {
  20002. super();
  20003. this.powerNum = 0;
  20004. this.isD3Inited = false;
  20005. this.isPrePlay = false;
  20006. this.isMoveRod = false;
  20007. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  20008. this.rulerDis = 20;
  20009. this.rulerOffset = 0;
  20010. }
  20011. onConstructor() {
  20012. this.ui = ui_UIGame.createInstance();
  20013. this.contentPane = this.ui;
  20014. this.ui.x += xGame.common.sysOffestNum;
  20015. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  20016. this.isEject = false;
  20017. xGame.common.gameUI = this;
  20018. this.initSelf();
  20019. }
  20020. isTurnSelf() {
  20021. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  20022. return true;
  20023. }
  20024. }
  20025. initSelf() {
  20026. let topUI = this.ui.topNode;
  20027. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  20028. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  20029. this.barInfo = {};
  20030. this.barInfo.curY = 0;
  20031. this.barInfo.height = this.ui.powerNode.height;
  20032. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  20033. this.barInfo.powerStartY = this.ui.powerNode.y;
  20034. xGame.common.aiPlayer = new AIPlayer();
  20035. xGame.common.gameMgr = new GameMgr();
  20036. xGame.common.skillMgr = new SkillMgr();
  20037. xGame.common.wordsMgr = new WordsMgr();
  20038. xGame.common.talkMgr = new TalkMgr();
  20039. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  20040. });
  20041. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  20042. });
  20043. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  20044. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  20045. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  20046. this.addUIClick(this.ui.returnBtn, this.returnHome);
  20047. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  20048. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  20049. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  20050. }
  20051. getGanZiImg() {
  20052. let index = DataMgr.getCurBallRod();
  20053. let data = cfgTable.ballrodData[index + 1];
  20054. let gan_url = xGame.common.getGameIconUrl(data.img);
  20055. this.ui.powerNode.showImg.url = gan_url;
  20056. }
  20057. returnHome() {
  20058. let tips = "Are you sure to exit the game?";
  20059. let woman = "Boss, why don't you play for a while longer?";
  20060. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  20061. }
  20062. addRodMethodClick() {
  20063. if (this.isTurnSelf()) {
  20064. xGame.uiMgr.Show(UIRodMethod$1);
  20065. }
  20066. }
  20067. clickHelpLineBtn(force = false) {
  20068. if (!this.isTurnSelf())
  20069. return;
  20070. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  20071. if (success) {
  20072. xGame.common.longHelpLine = true;
  20073. xGame.common.d2World.getHelpLine();
  20074. Moyu.sendDataEvent("guideNum");
  20075. }
  20076. else {
  20077. }
  20078. });
  20079. }
  20080. renderSelfDisplayBalls(index, target) {
  20081. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  20082. target.myImg.url = xGame.common.getGameIconUrl(str);
  20083. }
  20084. renderAIDisplayBalls(index, target) {
  20085. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  20086. target.myImg.url = xGame.common.getGameIconUrl(str);
  20087. ;
  20088. }
  20089. updateMode() {
  20090. if (xGame.common.gameMode == GameMode.classic) {
  20091. this.ui.topNode.scoreNode.visible = false;
  20092. }
  20093. else if (xGame.common.gameMode == GameMode.bigMove) {
  20094. this.ui.topNode.scoreNode.visible = true;
  20095. }
  20096. }
  20097. show() {
  20098. super.show();
  20099. this.ui.alpha = 0;
  20100. this.updateSelf();
  20101. xGame.common.gameMgr.gamePause = false;
  20102. xGame.common.gameUI.ui.blackAni.visible = false;
  20103. xGame.common.gameUI.ui.whiteAni.visible = false;
  20104. this.ui.powerEft.visible = false;
  20105. this.ui.colorNode.visible = false;
  20106. this.updateHead();
  20107. let curUse = DataMgr.getCurBallRod();
  20108. this.getGanZiImg();
  20109. this.setGlobalFont(this.ui);
  20110. }
  20111. updateSelf() {
  20112. if (xGame.common.gameMode == GameMode.classic) {
  20113. this.ui.c1.selectedIndex = 0;
  20114. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  20115. this.ui.topNode.middleNode.visible = true;
  20116. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  20117. }
  20118. else if (xGame.common.gameMode == GameMode.bigMove) {
  20119. this.ui.c1.selectedIndex = 0;
  20120. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  20121. this.ui.topNode.middleNode.visible = false;
  20122. let max = xGame.cfgMgr.getMaxBigMoveLength();
  20123. let rand = xGame.common.randomNum(1, max);
  20124. let guide = DataMgr.getSkillGuide();
  20125. if (guide == 0)
  20126. rand = 1;
  20127. xGame.common.bigMoveLevelIndex = rand;
  20128. }
  20129. else if (xGame.common.gameMode == GameMode.placeBall) {
  20130. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20131. this.ui.c1.selectedIndex = 1 + data.type;
  20132. this.ui.alpha = 1;
  20133. this.startGame();
  20134. }
  20135. this.updateMode();
  20136. this.initD3world();
  20137. this.initD2world();
  20138. }
  20139. startGame() {
  20140. this.ui.snowNode.visible = Math.random() <= 0.1;
  20141. this.ui.d2Node.visible = false;
  20142. xGame.common.d3World.d3Hand.gameObj.active = false;
  20143. xGame.common.d3World.tableSrc.init();
  20144. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20145. this.cameraViewChange(() => {
  20146. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20147. switch (xGame.common.gameMode) {
  20148. case GameMode.classic:
  20149. xGame.common.d3World.d3Hand.gameObj.active = true;
  20150. this.playPutBallD3Ani();
  20151. break;
  20152. case GameMode.bigMove:
  20153. this.enterGame();
  20154. Laya.timer.once(500, this, () => {
  20155. this.ui.topNode.middleNode.visible = true;
  20156. this.ui.topNode.middleNode.t0.play();
  20157. });
  20158. break;
  20159. case GameMode.placeBall:
  20160. this.enterGame();
  20161. break;
  20162. default:
  20163. break;
  20164. }
  20165. });
  20166. PlatMgr.showBanner(false);
  20167. }
  20168. enterGame() {
  20169. this.ui.d2Node.visible = true;
  20170. xGame.common.d3World.d3Hand.gameObj.active = false;
  20171. xGame.common.showOneCamera("mainCamera");
  20172. Moyu.recordGame(30, true);
  20173. if (!this.isPrePlay) {
  20174. this.isPrePlay = true;
  20175. xGame.common.d3World.prePlayEft();
  20176. }
  20177. xGame.common.gameMgr.gameReady();
  20178. this.openAllEvent();
  20179. this.ui.snowNode.visible = false;
  20180. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20181. this.ui.helpBtn.visible = condition;
  20182. }
  20183. showHelpLineGuide() {
  20184. let longGuide = DataMgr.getGuideHelpLine();
  20185. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20186. this.ui.helpBtn.visible = true;
  20187. this.ui.guideNode.visible = true;
  20188. }
  20189. }
  20190. setTurnAlpha(alpha) {
  20191. this.ui.keduNode.alpha = alpha;
  20192. this.ui.ganNode.alpha = alpha;
  20193. this.ui.rodMethodNode.alpha = alpha;
  20194. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20195. }
  20196. cameraViewChange(callback) {
  20197. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20198. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20199. xGame.common.showOneCamera("visitAngle");
  20200. cameraSrc.localRotationEulerY = 180;
  20201. cameraSrc.localRotationEulerZ = 0;
  20202. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20203. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20204. callback && callback();
  20205. }));
  20206. }));
  20207. }
  20208. playPutBallD3Ani() {
  20209. xGame.common.showOneCamera("mainCamera");
  20210. let handSrc = xGame.common.d3World.d3Hand;
  20211. handSrc.gameObj.active = true;
  20212. handSrc.transform.localPositionZ = 3;
  20213. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20214. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20215. handSrc.gameObj.active = false;
  20216. this.enterGame();
  20217. }), 400);
  20218. }));
  20219. }
  20220. updateHead() {
  20221. let user = Moyu.getUserInfo();
  20222. this.ui.topNode.selfNameTxt.text = user.nickName;
  20223. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20224. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20225. if (DataMgr.getSkillGuide() < 1) {
  20226. this.ui.topNode.aiNameTxt.text = 'billiards';
  20227. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20228. }
  20229. else {
  20230. this.ui.topNode.aiNameTxt.text = aiData.name;
  20231. let randNo = Math.floor(Math.random() * 10) + 1;
  20232. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20233. }
  20234. }
  20235. initD2world() {
  20236. let node = this.ui.d2Root.displayObject;
  20237. let src = node.getComponent(D2World);
  20238. if (!src) {
  20239. xGame.common.d2World = node.addComponent(D2World);
  20240. }
  20241. xGame.common.d2World.initSelf();
  20242. }
  20243. initD3world() {
  20244. if (this.isD3Inited)
  20245. return;
  20246. this.isD3Inited = true;
  20247. let scene3D = xGame.common.d3Scene;
  20248. this.ui.d3Root.displayObject.addChild(scene3D);
  20249. scene3D.active = true;
  20250. xGame.common.d3World.tableSrc.setBorderPos();
  20251. }
  20252. onRootMove(e) {
  20253. let rootBall = xGame.common.d2World.rootBall;
  20254. this.ui.moveNode.x = e.x;
  20255. this.ui.moveNode.y = e.y;
  20256. rootBall.gameObj.x = e.x;
  20257. rootBall.gameObj.y = e.y;
  20258. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20259. }
  20260. aiRootMove(move) {
  20261. if (move)
  20262. this.hideBallUI();
  20263. else {
  20264. this.showBallUI();
  20265. xGame.common.d2World.getHelpLine();
  20266. }
  20267. }
  20268. aiForce(type, force = 0) {
  20269. this.pressTarget = PressType.powerNode;
  20270. if (type == 1)
  20271. this.onEventUp({ force: true });
  20272. else if (type == 2)
  20273. this.onEventMove({ stageY: force, force: true });
  20274. }
  20275. onEventPress(e) {
  20276. if (e.stopPropagation)
  20277. e.stopPropagation();
  20278. if (!this.isTurnSelf())
  20279. return;
  20280. let target = e.target;
  20281. switch (target) {
  20282. case this.ui.myPowerNode.displayObject:
  20283. this.pressTarget = PressType.powerNode;
  20284. this.barInfo.curY = e.stageY;
  20285. this.updateBarInfo();
  20286. break;
  20287. case this.ui.moveNode.displayObject:
  20288. this.pressTarget = PressType.moveNode;
  20289. this.hideBallUI();
  20290. this.eventObj.curX = this.ui.moveNode.x;
  20291. this.eventObj.curY = this.ui.moveNode.y;
  20292. this.ui.moveNode.finger.visible = false;
  20293. this.eventObj.lastX = e.stageX;
  20294. this.eventObj.lastY = e.stageY;
  20295. break;
  20296. case this.ui.rulerClickNode.displayObject:
  20297. this.pressTarget = PressType.rulerNode;
  20298. this.eventObj.lastY = e.stageY;
  20299. break;
  20300. case this.ui.d2Root.displayObject:
  20301. this.pressTarget = PressType.d2Root;
  20302. this.eventObj.lastX = e.stageX;
  20303. this.eventObj.lastY = e.stageY;
  20304. this.eventObj.starX = e.stageX;
  20305. this.eventObj.starY = e.stageY;
  20306. this.eventObj.curX = 0;
  20307. this.eventObj.curY = 0;
  20308. xGame.common.d2World.d2Gan.setGanLastInfo();
  20309. this.rulerOffset = 0;
  20310. break;
  20311. default:
  20312. break;
  20313. }
  20314. }
  20315. onEventMove(e) {
  20316. if (e.stopPropagation)
  20317. e.stopPropagation();
  20318. if (e && e.force) {
  20319. }
  20320. else {
  20321. if (!this.isTurnSelf())
  20322. return;
  20323. }
  20324. switch (this.pressTarget) {
  20325. case PressType.powerNode:
  20326. this.barInfo.curY = e.stageY;
  20327. this.updateBarInfo();
  20328. this.isMoveRod = true;
  20329. break;
  20330. case PressType.moveNode:
  20331. let rootBall = xGame.common.d2World.rootBall;
  20332. let radius = rootBall.gameObj.width / 2;
  20333. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20334. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20335. let border = xGame.common.d2World.borderRect;
  20336. if (curX <= border.x + radius)
  20337. curX = border.x + radius;
  20338. else if (curX >= border.x + border.width - radius)
  20339. curX = border.x + border.width - radius;
  20340. if (curY <= border.y + radius)
  20341. curY = border.y + radius;
  20342. else if (curY >= border.y + border.height - radius)
  20343. curY = border.y + border.height - radius;
  20344. if (xGame.common.gameMgr.isOpenBall) {
  20345. if (curX >= border.x + border.openBallW - radius)
  20346. curX = border.x + border.openBallW - radius;
  20347. }
  20348. this.ui.moveNode.x = curX;
  20349. this.ui.moveNode.y = curY;
  20350. rootBall.gameObj.x = curX;
  20351. rootBall.gameObj.y = curY;
  20352. rootBall.d3BallSrc.setTransPos(curX, curY);
  20353. this.isMoveRod = true;
  20354. break;
  20355. case PressType.rulerNode:
  20356. let yy = e.stageY - this.eventObj.lastY;
  20357. this.eventObj.lastY = e.stageY;
  20358. let ruler1 = this.ui.rulerNode.img1;
  20359. let ruler2 = this.ui.rulerNode.img2;
  20360. ruler1.y += yy;
  20361. ruler2.y += yy;
  20362. this.rulerOffset += yy;
  20363. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20364. this.rulerOffset = 0;
  20365. xGame.soundMgr.playSound("inch", 1, 10);
  20366. }
  20367. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20368. let h = ruler1.height;
  20369. this.checkGuide();
  20370. this.isMoveRod = true;
  20371. if (ruler1.y >= h) {
  20372. ruler1.y = -h;
  20373. ruler2.y = 0;
  20374. return;
  20375. }
  20376. else if (ruler1.y <= -h) {
  20377. ruler1.y = h;
  20378. ruler2.y = 0;
  20379. return;
  20380. }
  20381. if (ruler2.y >= h) {
  20382. ruler2.y = -h;
  20383. ruler1.y = 0;
  20384. return;
  20385. }
  20386. else if (ruler2.y <= -h) {
  20387. ruler2.y = h;
  20388. ruler1.y = 0;
  20389. return;
  20390. }
  20391. break;
  20392. case PressType.d2Root:
  20393. this.eventObj.curX = e.stageX;
  20394. this.eventObj.curY = e.stageY;
  20395. let offset = this.checkRodMoveDir();
  20396. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20397. this.eventObj.lastX = e.stageX;
  20398. this.eventObj.lastY = e.stageY;
  20399. break;
  20400. default:
  20401. break;
  20402. }
  20403. }
  20404. onEventUp(e) {
  20405. if (e.stopPropagation)
  20406. e.stopPropagation();
  20407. if (e && e.force) {
  20408. }
  20409. else {
  20410. if (!this.isTurnSelf())
  20411. return;
  20412. }
  20413. switch (this.pressTarget) {
  20414. case PressType.powerNode:
  20415. this.ui.powerNode.value = 0;
  20416. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20417. this.ui.powerTxt.text = "";
  20418. if (this.powerNum > 0) {
  20419. xGame.eventMgr.event(BALL_SHOOT);
  20420. xGame.common.d2World.shoot(this.powerNum);
  20421. xGame.common.d2World.d2Gan.shoot();
  20422. xGame.common.d2World.d2HelpLine.shoot();
  20423. this.finishGuide();
  20424. this.ui.powerEft.visible = false;
  20425. this.ui.colorNode.visible = false;
  20426. let ganStr = "";
  20427. if (this.powerNum <= 30) {
  20428. ganStr = "gan_30";
  20429. }
  20430. else if (this.powerNum <= 60) {
  20431. ganStr = "gan_50";
  20432. }
  20433. else {
  20434. ganStr = "gan_80";
  20435. }
  20436. xGame.soundMgr.playSound(ganStr);
  20437. }
  20438. break;
  20439. case PressType.moveNode:
  20440. let rootBall = xGame.common.d2World.rootBall;
  20441. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20442. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20443. let isIntersect = this.judgeBallIntersect();
  20444. if (isIntersect) {
  20445. this.ui.moveNode.x = lastX;
  20446. this.ui.moveNode.y = lastY;
  20447. rootBall.gameObj.x = lastX;
  20448. rootBall.gameObj.y = lastY;
  20449. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20450. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20451. }
  20452. else {
  20453. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20454. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20455. }
  20456. this.showBallUI();
  20457. this.ui.moveNode.finger.visible = true;
  20458. xGame.common.d2World.getHelpLine();
  20459. break;
  20460. case PressType.rulerNode:
  20461. break;
  20462. case PressType.d2Root:
  20463. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20464. if (dis <= 25) {
  20465. this.moveToClickDot(e);
  20466. }
  20467. break;
  20468. default:
  20469. break;
  20470. }
  20471. this.pressTarget = -1;
  20472. }
  20473. checkGuide() {
  20474. let guide = DataMgr.getSkillGuide();
  20475. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20476. xGame.common.guideStep++;
  20477. xGame.common.gameUI.ui.guide2.visible = false;
  20478. xGame.common.gameUI.ui.guide3.visible = true;
  20479. }
  20480. }
  20481. finishGuide() {
  20482. let guide = DataMgr.getSkillGuide();
  20483. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20484. xGame.common.guideStep = 10;
  20485. this.closeAllGuide();
  20486. console.log('zh: 新手引导完毕');
  20487. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20488. }
  20489. }
  20490. closeAllGuide() {
  20491. xGame.common.gameUI.ui.guide1.visible = false;
  20492. xGame.common.gameUI.ui.guide2.visible = false;
  20493. xGame.common.gameUI.ui.guide3.visible = false;
  20494. }
  20495. updateBarInfo() {
  20496. let star = this.ui.powerNode.y;
  20497. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20498. if (rate >= 1)
  20499. rate = 1;
  20500. if (rate <= 0)
  20501. rate = 0;
  20502. this.powerNum = Math.ceil(rate * 100);
  20503. this.ui.powerNode.value = this.powerNum;
  20504. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20505. this.ui.colorNode.value = this.powerNum;
  20506. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20507. this.ui.powerEft.visible = this.powerNum != 0;
  20508. this.ui.colorNode.visible = this.powerNum != 0;
  20509. this.ui.powerTxt.text = this.powerNum + "";
  20510. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20511. }
  20512. forceCancel() {
  20513. this.ui.powerNode.value = 0;
  20514. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20515. this.ui.powerTxt.text = "";
  20516. }
  20517. checkRodMoveDir() {
  20518. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20519. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20520. if (tempX >= 0 && tempY <= 0) {
  20521. return this.checkDir();
  20522. }
  20523. else if (tempX < 0 && tempY < 0) {
  20524. return this.checkDir(1, -1);
  20525. }
  20526. else if (tempX < 0 && tempY > 0) {
  20527. return this.checkDir(-1, -1);
  20528. }
  20529. else {
  20530. return this.checkDir(-1, 1);
  20531. }
  20532. }
  20533. checkDir(flagX = 1, flagY = 1) {
  20534. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20535. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20536. if (offsetY == 0) {
  20537. return offsetX * flagX;
  20538. }
  20539. if (offsetX == 0) {
  20540. return offsetY * flagY;
  20541. }
  20542. let angle = offsetY / offsetX;
  20543. if (Math.abs(angle) >= 1) {
  20544. return offsetY * flagY;
  20545. }
  20546. else {
  20547. return offsetX * flagX;
  20548. }
  20549. }
  20550. judgeBallIntersect() {
  20551. let rootBall = xGame.common.d2World.rootBall;
  20552. let ballArr = xGame.common.d2World.ballArr;
  20553. let radius = rootBall.gameObj.width / 2;
  20554. let temp;
  20555. let isIntersect = false;
  20556. for (let index = 0; index < ballArr.length; index++) {
  20557. temp = ballArr[index];
  20558. if (temp.number == rootBall.number)
  20559. continue;
  20560. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20561. if (isIntersect) {
  20562. break;
  20563. }
  20564. }
  20565. return isIntersect;
  20566. }
  20567. hideBallUI() {
  20568. let d2Gan = xGame.common.d2World.d2Gan;
  20569. if (!d2Gan.ui.isDisposed)
  20570. d2Gan.ui.visible = false;
  20571. let d2Help = xGame.common.d2World.d2HelpLine;
  20572. if (!d2Help.ui.isDisposed)
  20573. d2Help.ui.visible = false;
  20574. let rootBall = xGame.common.d2World.rootBall;
  20575. if (!rootBall.destroyed) {
  20576. rootBall.gameObj.active = false;
  20577. }
  20578. }
  20579. showBallUI() {
  20580. let d2Gan = xGame.common.d2World.d2Gan;
  20581. if (!d2Gan.ui.isDisposed)
  20582. d2Gan.ui.visible = true;
  20583. let d2Help = xGame.common.d2World.d2HelpLine;
  20584. if (!d2Help.ui.isDisposed)
  20585. d2Help.ui.visible = true;
  20586. let rootBall = xGame.common.d2World.rootBall;
  20587. if (!rootBall.destroyed) {
  20588. rootBall.gameObj.active = true;
  20589. }
  20590. }
  20591. moveToClickDot(e) {
  20592. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20593. let root = xGame.common.d2World.rootBall.gameObj;
  20594. let xx = e.stageX - xGame.common.sysOffestNum;
  20595. let yy = e.stageY;
  20596. let x = xx - root.x;
  20597. let y = yy - root.y;
  20598. let angle = xGame.common.getfguiRotation(x, y);
  20599. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20600. xGame.common.d2World.getHelpLine();
  20601. }
  20602. this.isMoveRod = false;
  20603. xGame.common.clickedBall = false;
  20604. }
  20605. openAllEvent() {
  20606. this.closeAllEvent();
  20607. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20608. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20609. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20610. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20611. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20612. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20613. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20614. }
  20615. closeAllEvent() {
  20616. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20617. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20618. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20619. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20620. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20621. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20622. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20623. }
  20624. resetGame() {
  20625. this.closeAllEvent();
  20626. this.hideBallUI();
  20627. xGame.common.gameMgr.gamePause = true;
  20628. }
  20629. }
  20630. UIGame$1.uiName = "UIGame";
  20631. class UIAddCoin$1 extends UIBase {
  20632. constructor() {
  20633. super();
  20634. this.coinNum = 2000;
  20635. }
  20636. onConstructor() {
  20637. this.ui = ui_UIAddCoin.createInstance();
  20638. this.contentPane = this.ui;
  20639. this.isEject = false;
  20640. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20641. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20642. }
  20643. show() {
  20644. super.show();
  20645. this.ui.t0.play();
  20646. this.setGlobalFont(this.ui);
  20647. }
  20648. videoAddCoin() {
  20649. console.log('zh:qjff_AD_for_UIAddCoin');
  20650. if (Laya.Browser.onAndroid) {
  20651. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20652. if (!boo) {
  20653. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20654. return;
  20655. }
  20656. }
  20657. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20658. }
  20659. else {
  20660. console.log('zh:AD 失败,直接发放奖励');
  20661. this.qjff_AD_for_UIAddCoin();
  20662. }
  20663. }
  20664. qjff_AD_for_UIAddCoin() {
  20665. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20666. this.hide();
  20667. }
  20668. }
  20669. UIAddCoin$1.uiName = "UIAddCoin";
  20670. class UIInvitation$1 extends UIBase {
  20671. constructor() {
  20672. super();
  20673. }
  20674. onConstructor() {
  20675. this.ui = ui_UIInvitation.createInstance();
  20676. this.contentPane = this.ui;
  20677. this.isEject = false;
  20678. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20679. }
  20680. show() {
  20681. super.show();
  20682. this.setGlobalFont(this.ui);
  20683. }
  20684. enterGame() {
  20685. xGame.common.gameMode = GameMode.classic;
  20686. DataMgr.setChallengeTimes(1);
  20687. xGame.common.passAwardCoin = 2000;
  20688. let need = xGame.common.classicNiceNeddCoin;
  20689. if (DataMgr.coinEnough(need)) {
  20690. DataMgr.setCoin(-need);
  20691. xGame.eventMgr.event(RESTART_GAME, true);
  20692. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20693. }
  20694. else {
  20695. xGame.eventMgr.event(RESTART_GAME, true);
  20696. }
  20697. this.hide();
  20698. }
  20699. hide() {
  20700. super.hide();
  20701. }
  20702. }
  20703. UIInvitation$1.uiName = "UIInvitation";
  20704. class UIPower$1 extends UIBase {
  20705. constructor() {
  20706. super();
  20707. }
  20708. onConstructor() {
  20709. this.ui = ui_UIPower.createInstance();
  20710. this.contentPane = this.ui;
  20711. this.isEject = false;
  20712. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20713. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20714. }
  20715. show() {
  20716. super.show();
  20717. this.ui.t0.play();
  20718. this.setGlobalFont(this.ui);
  20719. }
  20720. videoGetPower() {
  20721. console.log('zh:qjff_AD_for_uipower');
  20722. if (Laya.Browser.onAndroid) {
  20723. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20724. if (!boo) {
  20725. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20726. return;
  20727. }
  20728. }
  20729. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20730. }
  20731. else {
  20732. console.log('zh:AD 失败,直接发放奖励');
  20733. this.qjff_AD_for_uipower();
  20734. }
  20735. }
  20736. qjff_AD_for_uipower() {
  20737. DataMgr.setPower(xGame.common.videoPower, true);
  20738. xGame.eventMgr.event(POWER_TIME);
  20739. this.hide();
  20740. }
  20741. }
  20742. UIPower$1.uiName = "UIPower";
  20743. class UIGameEnd$1 extends UIBase {
  20744. constructor() {
  20745. super();
  20746. this.success = false;
  20747. this.awardCoinNum = 1000;
  20748. this.awardDiamondNum = 10;
  20749. }
  20750. onConstructor() {
  20751. this.ui = ui_UIGameEnd.createInstance();
  20752. this.contentPane = this.ui;
  20753. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20754. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20755. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20756. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20757. this.ui.talkNode.visible = false;
  20758. if (Moyu.isKs)
  20759. this.ui.closeNode.closeBtn.x += 100;
  20760. }
  20761. updateType() {
  20762. switch (xGame.common.gameMode) {
  20763. case GameMode.classic:
  20764. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20765. this.ui.coinNode.visible = this.success;
  20766. if (!this.success) {
  20767. Laya.timer.once(500, this, () => {
  20768. xGame.uiMgr.Show(UIAddCoin$1);
  20769. });
  20770. }
  20771. else {
  20772. this.logEventForClassic_win();
  20773. }
  20774. this.logEventForClassic_complete();
  20775. this.ui.isGetAward.visible = false;
  20776. this.ui.leftBtn.c1.selectedIndex = 3;
  20777. this.ui.rightBtn.c1.selectedIndex = 0;
  20778. this.moneyNode.ui.c1.selectedIndex = 1;
  20779. break;
  20780. case GameMode.bigMove:
  20781. console.log('zh:招法模式 aaaaaa bigMove');
  20782. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20783. this.ui.coinNode.visible = this.success;
  20784. if (xGame.common.gameMode == GameMode.bigMove) {
  20785. if (this.success) {
  20786. DataMgr.setSkillSuccessTimes(1, true);
  20787. DataMgr.setSkillAccTimes(1);
  20788. }
  20789. else {
  20790. DataMgr.setSkillSuccessTimes(0, false);
  20791. }
  20792. }
  20793. this.logEventForRod_complete_N();
  20794. if (!this.success) {
  20795. Laya.timer.once(500, this, () => {
  20796. xGame.uiMgr.Show(UIAddCoin$1);
  20797. });
  20798. }
  20799. else {
  20800. this.logEventForRod_win();
  20801. }
  20802. this.ui.isGetAward.visible = false;
  20803. this.ui.leftBtn.c1.selectedIndex = 3;
  20804. this.ui.rightBtn.c1.selectedIndex = 0;
  20805. this.moneyNode.ui.c1.selectedIndex = 1;
  20806. break;
  20807. case GameMode.placeBall:
  20808. this.ui.coinNode.visible = false;
  20809. if (this.success) {
  20810. if (xGame.common.placeBallStarNum == 3) {
  20811. this.ui.c1.selectedIndex = 2;
  20812. }
  20813. else {
  20814. this.ui.c1.selectedIndex = 3;
  20815. }
  20816. let level = xGame.common.placeBallCurLevel;
  20817. if (level > 59) {
  20818. this.logEventForChallenge_level_complete(level);
  20819. }
  20820. else {
  20821. this.logEventForChallenge_level_N(level);
  20822. }
  20823. }
  20824. else {
  20825. this.ui.c1.selectedIndex = 4;
  20826. }
  20827. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20828. if (cfg.type == PlaceBallType.challenge) {
  20829. this.ui.c1.selectedIndex = 2;
  20830. }
  20831. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20832. this.updatePlaceBallBtn();
  20833. this.updatePlaceBallStarNum();
  20834. this.updatePlaceBallAwardState();
  20835. this.moneyNode.ui.c1.selectedIndex = 2;
  20836. this.moneyNode.checkPowerTime();
  20837. this.moneyNode.powerChange();
  20838. DataMgr.upRankData();
  20839. break;
  20840. default:
  20841. break;
  20842. }
  20843. }
  20844. logEventForRod_complete_N() {
  20845. let gfmsIdx = xGame.common.curPlayerSkillType;
  20846. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20847. let gfmc = 'Skyfall Shot';
  20848. if (gfmsIdx == 0) {
  20849. gfmc = 'Skyfall Shot';
  20850. }
  20851. if (gfmsIdx == 1) {
  20852. gfmc = 'Surging break';
  20853. }
  20854. if (gfmsIdx == 2) {
  20855. gfmc = 'Frost Lock';
  20856. }
  20857. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20858. console.log('zh:logEventForRod_complete_N level = ' + level);
  20859. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20860. let jsonStr = {
  20861. "count": 0,
  20862. "name": gfmc
  20863. };
  20864. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20865. const d = LocalStorageManager.getItem(keyStr);
  20866. jsonStr.count = d.count + 1;
  20867. LocalStorageManager.setItem(keyStr, jsonStr);
  20868. }
  20869. else {
  20870. LocalStorageManager.setItem(keyStr, jsonStr);
  20871. }
  20872. const d2 = LocalStorageManager.getItem(keyStr);
  20873. let count = d2.count;
  20874. console.log('zh:logEventForRod_complete_N count = ' + count);
  20875. if (count % 5 == 0) {
  20876. const reqStr = JSON.stringify(jsonStr);
  20877. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20878. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20879. }
  20880. }
  20881. logEventForRod_win() {
  20882. console.log('zh:logEventForRod_win,胜利');
  20883. let gfmsIdx = xGame.common.curPlayerSkillType;
  20884. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20885. let gfmc = 'Skyfall Shot';
  20886. if (gfmsIdx == 0) {
  20887. gfmc = 'Skyfall Shot';
  20888. }
  20889. if (gfmsIdx == 1) {
  20890. gfmc = 'Surging break';
  20891. }
  20892. if (gfmsIdx == 2) {
  20893. gfmc = 'Frost Lock';
  20894. }
  20895. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20896. console.log('zh:logEventForRod_win level = ' + level);
  20897. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20898. let jsonStr = {
  20899. "count": 1,
  20900. "name": gfmc + ' Lev' + level
  20901. };
  20902. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20903. const d = LocalStorageManager.getItem(keyStr);
  20904. jsonStr.count = d.count + 1;
  20905. LocalStorageManager.setItem(keyStr, jsonStr);
  20906. }
  20907. else {
  20908. LocalStorageManager.setItem(keyStr, jsonStr);
  20909. }
  20910. const reqStr = JSON.stringify(jsonStr);
  20911. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20912. }
  20913. logEventForClassic_win() {
  20914. console.log('zh:logEventForClassic_win,胜利');
  20915. let rtype = xGame.common.classicRoomType;
  20916. let msmc = '';
  20917. if (rtype == 1) {
  20918. msmc = 'beginner';
  20919. }
  20920. if (rtype == 2) {
  20921. msmc = 'expert';
  20922. }
  20923. if (rtype == 3) {
  20924. msmc = 'master';
  20925. }
  20926. let keyStr = 'sjmd_classic_win_' + rtype;
  20927. let jsonStr = {
  20928. "difficulty": msmc,
  20929. "classic_count": 1,
  20930. "difficulty_count": 1
  20931. };
  20932. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20933. const d = LocalStorageManager.getItem(keyStr);
  20934. jsonStr.classic_count = d.classic_count + 1;
  20935. jsonStr.difficulty_count = d.difficulty_count + 1;
  20936. LocalStorageManager.setItem(keyStr, jsonStr);
  20937. }
  20938. else {
  20939. LocalStorageManager.setItem(keyStr, jsonStr);
  20940. }
  20941. const reqStr = JSON.stringify(jsonStr);
  20942. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20943. }
  20944. logEventForClassic_complete() {
  20945. console.log('zh:logEventForClassic_complete,胜利');
  20946. let rtype = xGame.common.classicRoomType;
  20947. let msmc = '';
  20948. if (rtype == 1) {
  20949. msmc = 'beginner';
  20950. }
  20951. if (rtype == 2) {
  20952. msmc = 'expert';
  20953. }
  20954. if (rtype == 3) {
  20955. msmc = 'master';
  20956. }
  20957. let keyStr = 'sjmd_classic_complete_' + rtype;
  20958. let jsonStr = {
  20959. "msmc": msmc,
  20960. "count": 0
  20961. };
  20962. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20963. const d = LocalStorageManager.getItem(keyStr);
  20964. jsonStr.count = d.count + 1;
  20965. LocalStorageManager.setItem(keyStr, jsonStr);
  20966. }
  20967. else {
  20968. LocalStorageManager.setItem(keyStr, jsonStr);
  20969. }
  20970. if (jsonStr.count % 5 == 0) {
  20971. const reqStr = JSON.stringify(jsonStr);
  20972. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20973. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20974. }
  20975. }
  20976. updatePlaceBallBtn() {
  20977. this.ui.leftBtn.c1.selectedIndex = 5;
  20978. if (this.success) {
  20979. this.ui.rightBtn.c1.selectedIndex = 14;
  20980. }
  20981. else {
  20982. if (xGame.common.placeBallStarNum == 3) {
  20983. this.ui.rightBtn.c1.selectedIndex = 14;
  20984. }
  20985. else {
  20986. this.ui.rightBtn.c1.selectedIndex = 1;
  20987. }
  20988. }
  20989. }
  20990. updatePlaceBallStarNum() {
  20991. let starNum = xGame.common.placeBallStarNum;
  20992. if (starNum == 0)
  20993. this.ui.starNumNode.c1.selectedIndex = 3;
  20994. else {
  20995. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20996. }
  20997. }
  20998. updatePlaceBallAwardState() {
  20999. let level = xGame.common.placeBallCurLevel;
  21000. let starNum = xGame.common.placeBallStarNum;
  21001. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21002. let data = cfgTable.placeballData[level].award;
  21003. let cfg = cfgTable.placeballData[level];
  21004. this.awardDiamondNum = data[1];
  21005. this.awardCoinNum = data[0];
  21006. if (cfg.type == PlaceBallType.challenge) {
  21007. this.awardDiamondNum = 0;
  21008. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21009. }
  21010. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  21011. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  21012. if (cfg.type == PlaceBallType.challenge) {
  21013. this.ui.awardNode.coinNode.visible = true;
  21014. }
  21015. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  21016. this.ui.awardNode.diamondNode.x = 265;
  21017. this.ui.awardNode.coinNode.x = 354;
  21018. }
  21019. else {
  21020. this.ui.awardNode.diamondNode.x = 291;
  21021. this.ui.awardNode.coinNode.x = 291;
  21022. }
  21023. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  21024. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  21025. if (this.awardCoinNum == 0) {
  21026. this.ui.awardNode.coinNode.numTxt.text = "";
  21027. }
  21028. if (getAward) {
  21029. this.ui.isGetAward.visible = true;
  21030. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  21031. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  21032. }
  21033. else {
  21034. this.ui.isGetAward.visible = false;
  21035. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  21036. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  21037. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  21038. }
  21039. else {
  21040. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  21041. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  21042. }
  21043. }
  21044. }
  21045. show(success) {
  21046. super.show();
  21047. xGame.eventMgr.event(RESET_GAME);
  21048. this.success = success;
  21049. Laya.timer.clearAll(this);
  21050. this.playSecretaryAni();
  21051. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  21052. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  21053. offsetTime = Math.floor(offsetTime / 1000);
  21054. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  21055. this.updateType();
  21056. Laya.timer.once(200, this, () => {
  21057. this.addAward(() => {
  21058. this.updateType();
  21059. Laya.timer.once(500, this, () => {
  21060. this.showChallengeLevel();
  21061. });
  21062. });
  21063. });
  21064. if (this.success) {
  21065. JSBridgeUtils.instance.showInternAd('gameend_success');
  21066. console.log('zh:game end 成功');
  21067. xGame.soundMgr.playSound('slots_roll01');
  21068. xGame.soundMgr.playSound("s_win");
  21069. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21070. this.diyGameDataUtilForGameWin();
  21071. this.updateGamePlaceBallData2Server();
  21072. }
  21073. else {
  21074. JSBridgeUtils.instance.showInternAd('gameend_faill');
  21075. console.log('zh:game end失败');
  21076. xGame.soundMgr.playSound('matchwin01');
  21077. xGame.soundMgr.playSound("s_lose");
  21078. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21079. }
  21080. let challengeNum = DataMgr.getChallengeTimes();
  21081. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  21082. DataMgr.setChallengeTimes(1);
  21083. }
  21084. if (this.success && xGame.common.gameMode == GameMode.classic) {
  21085. DataMgr.setClassicTimes();
  21086. }
  21087. this.setGlobalFont(this.ui);
  21088. }
  21089. diyGameDataUtilForGameWin() {
  21090. console.log('zh: DiyGameDataUtilForGameWin diy ');
  21091. switch (xGame.common.gameMode) {
  21092. case GameMode.classic:
  21093. console.log('zh:DiyGameDataUtilForGameWin 111');
  21094. case GameMode.bigMove:
  21095. console.log('zh:DiyGameDataUtilForGameWin 222');
  21096. this.restartGame();
  21097. break;
  21098. case GameMode.placeBall:
  21099. console.log('zh:DiyGameDataUtilForGameWin 333');
  21100. var level = xGame.common.placeBallCurLevel;
  21101. console.log('zh:练习模式 联系了多少LEV=' + level);
  21102. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21103. if (level > db_over_lev) {
  21104. DataMgr.setChallengeMode_overLev(level);
  21105. }
  21106. break;
  21107. default:
  21108. console.log('zh:DiyGameDataUtilForGameWin 444');
  21109. break;
  21110. }
  21111. }
  21112. updateGamePlaceBallData2Server() {
  21113. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  21114. if (userInfo == null) {
  21115. return;
  21116. }
  21117. let pbdObj = DataMgr.getPlaceBallLevelList();
  21118. let reqData = xGame.httpMgr.getReqData();
  21119. let pd = JSON.parse(reqData);
  21120. pd.placeBallData = JSON.stringify(pbdObj);
  21121. reqData = JSON.stringify(pd);
  21122. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  21123. try {
  21124. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  21125. let code = res.code;
  21126. let msg = res.msg;
  21127. if (code == 401) {
  21128. Laya.LocalStorage.removeItem(keyForLoginInfo);
  21129. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  21130. return;
  21131. }
  21132. if (code == 200) {
  21133. let data = res.data;
  21134. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21135. }
  21136. else {
  21137. xGame.uiMgr.Show(UIMsg$1, msg);
  21138. }
  21139. }
  21140. catch (error) {
  21141. console.log('error=' + error);
  21142. alert(error);
  21143. }
  21144. finally {
  21145. }
  21146. });
  21147. }
  21148. showChallengeLevel() {
  21149. if (DataMgr.getChallengeTimes() != 0)
  21150. return;
  21151. let skill = DataMgr.getSkillAccTimes();
  21152. let put = DataMgr.getPlaceBallLevelList().length;
  21153. if (skill >= 3 || put >= 5) {
  21154. xGame.uiMgr.Show(UIInvitation$1);
  21155. this.hide();
  21156. }
  21157. }
  21158. addAward(callback) {
  21159. if (!this.success) {
  21160. callback && callback();
  21161. return;
  21162. }
  21163. switch (xGame.common.gameMode) {
  21164. case GameMode.classic:
  21165. this.awardCoinNum = xGame.common.passAwardCoin;
  21166. this.awardDiamondNum = 0;
  21167. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21168. break;
  21169. case GameMode.bigMove:
  21170. this.awardCoinNum = xGame.common.passAwardCoin;
  21171. this.awardDiamondNum = 0;
  21172. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21173. callback && callback();
  21174. break;
  21175. case GameMode.placeBall:
  21176. let level = xGame.common.placeBallCurLevel;
  21177. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21178. if (xGame.common.placeBallStarNum != 3) {
  21179. callback && callback();
  21180. return;
  21181. }
  21182. else {
  21183. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21184. if (getAward) {
  21185. callback && callback();
  21186. return;
  21187. }
  21188. }
  21189. let cfg = cfgTable.placeballData[level];
  21190. let data = cfgTable.placeballData[level].award;
  21191. this.awardCoinNum = data[0];
  21192. this.awardDiamondNum = data[1];
  21193. if (cfg.type == PlaceBallType.challenge) {
  21194. this.awardDiamondNum = 0;
  21195. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21196. }
  21197. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21198. let diamondAward;
  21199. if (this.awardDiamondNum > 0) {
  21200. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21201. xGame.common.getAward([diamondAward, coinAward], callback);
  21202. }
  21203. else {
  21204. xGame.common.getAward([coinAward], callback);
  21205. }
  21206. if (cfg.type == PlaceBallType.normal) {
  21207. DataMgr.setPlaceBallAward(level);
  21208. }
  21209. break;
  21210. default:
  21211. break;
  21212. }
  21213. }
  21214. playSecretaryAni_old() {
  21215. let parent = this.ui.secretary.displayObject;
  21216. parent.destroyChildren();
  21217. let xx = this.ui.secretary.width / 2;
  21218. let yy = this.ui.secretary.height;
  21219. let scale = xGame.common.getSecretaryScale();
  21220. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21221. if (this.success) {
  21222. let rand = Math.random() <= 0.5 ? 2 : 3;
  21223. xGame.common.secretary.play(data, rand, false, parent, () => {
  21224. xGame.common.secretary.play(data, 1, true, parent);
  21225. });
  21226. }
  21227. else {
  21228. xGame.common.secretary.play(data, 0, true, parent);
  21229. }
  21230. }
  21231. playSecretaryAni() {
  21232. let parent = this.ui.secretary.displayObject;
  21233. parent.destroyChildren();
  21234. let xx = this.ui.secretary.width / 2;
  21235. let yy = this.ui.secretary.height;
  21236. let scale = xGame.common.getSecretaryScale();
  21237. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21238. if (this.success) {
  21239. let rand = 0;
  21240. xGame.common.secretary.play(data, 0, true, parent);
  21241. }
  21242. else {
  21243. xGame.common.secretary.play(data, 0, true, parent);
  21244. }
  21245. }
  21246. restartGame() {
  21247. switch (xGame.common.gameMode) {
  21248. case GameMode.classic:
  21249. xGame.eventMgr.event(RESTART_GAME);
  21250. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21251. break;
  21252. case GameMode.bigMove:
  21253. this.hide();
  21254. xGame.eventMgr.event(RESTART_GAME);
  21255. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21256. break;
  21257. default:
  21258. break;
  21259. }
  21260. }
  21261. hide() {
  21262. super.hide();
  21263. xGame.common.stopGirlPop(this.ui.talkNode);
  21264. PlatMgr.showBanner(false);
  21265. }
  21266. returnHome() {
  21267. this.hide();
  21268. let showFailWords = !this.success;
  21269. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21270. }
  21271. clickLeftBtn() {
  21272. switch (xGame.common.gameMode) {
  21273. case GameMode.classic:
  21274. case GameMode.bigMove:
  21275. this.returnHome();
  21276. break;
  21277. case GameMode.placeBall:
  21278. let level = xGame.common.placeBallCurLevel;
  21279. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21280. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21281. break;
  21282. default:
  21283. break;
  21284. }
  21285. }
  21286. powerStartPlaceBallLevel(level, btn) {
  21287. if (DataMgr.powerEnough()) {
  21288. btn.touchable = false;
  21289. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21290. btn.touchable = true;
  21291. DataMgr.setPower(-1);
  21292. xGame.eventMgr.event(POWER_TIME);
  21293. this.startPlaceBallLevel(level);
  21294. this.logEventForChallenge_level_start(level);
  21295. }));
  21296. }
  21297. else {
  21298. xGame.uiMgr.Show(UIPower$1, 0);
  21299. }
  21300. }
  21301. clickRightBtn() {
  21302. switch (xGame.common.gameMode) {
  21303. case GameMode.classic:
  21304. console.log('zh:clickRightBtn 111');
  21305. case GameMode.bigMove:
  21306. console.log('zh:clickRightBtn 222');
  21307. this.restartGame();
  21308. break;
  21309. case GameMode.placeBall:
  21310. console.log('zh:clickRightBtn 333');
  21311. let level = xGame.common.placeBallCurLevel;
  21312. let data = DataMgr.getPlaceBallLevel(level);
  21313. let curPss = data.play && !data.isCur;
  21314. if (curPss) {
  21315. console.log('zh:clickRightBtn 333-111');
  21316. console.log('zh:当前LV=' + level);
  21317. if (level == 60) {
  21318. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21319. Laya.timer.once(3000, this, () => {
  21320. this.returnHome();
  21321. });
  21322. }
  21323. else {
  21324. let lev = level + 1;
  21325. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21326. }
  21327. }
  21328. else {
  21329. console.log('zh:clickRightBtn 333-000');
  21330. Moyu.sendDataEvent("placeBallNextLevel");
  21331. console.log('zh:qjff_AD_for_uiGameEnd');
  21332. if (Laya.Browser.onAndroid) {
  21333. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21334. if (!boo) {
  21335. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21336. return;
  21337. }
  21338. }
  21339. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21340. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21341. }
  21342. else {
  21343. console.log('zh:AD 失败,直接发放奖励');
  21344. this.qjff_AD_for_uiGameEnd(level);
  21345. }
  21346. }
  21347. break;
  21348. default:
  21349. console.log('zh:clickRightBtn 444');
  21350. break;
  21351. }
  21352. }
  21353. logEventForChallenge_level_start(level) {
  21354. let keyStr = 'sjmd_challenge_level_start';
  21355. let jsonStr = {
  21356. "count": 0,
  21357. "gold_balance ": DataMgr.getCoin(),
  21358. "level": level,
  21359. "diamond_balance ": DataMgr.getDiamond()
  21360. };
  21361. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21362. const d = LocalStorageManager.getItem(keyStr);
  21363. if (level > d.level) {
  21364. jsonStr.count = d.count + 1;
  21365. LocalStorageManager.setItem(keyStr, jsonStr);
  21366. }
  21367. else {
  21368. }
  21369. }
  21370. else {
  21371. LocalStorageManager.setItem(keyStr, jsonStr);
  21372. }
  21373. const reqStr = JSON.stringify(jsonStr);
  21374. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21375. }
  21376. qjff_AD_for_uiGameEnd(level) {
  21377. DataMgr.setPlaceBallLevel(level, 1);
  21378. this.startPlaceBallLevel(level + 1);
  21379. }
  21380. startPlaceBallLevel(level) {
  21381. xGame.common.gameMode = GameMode.placeBall;
  21382. xGame.common.placeBallCurLevel = level;
  21383. xGame.uiMgr.Show(UIGame$1);
  21384. this.hide();
  21385. }
  21386. logEventForChallenge_level_complete(level) {
  21387. let keyStr = 'sjmd_challenge_level_complete';
  21388. let jsonStr = {
  21389. "count": 1,
  21390. "gold_balance ": DataMgr.getCoin(),
  21391. "level": level,
  21392. "diamond_balance ": DataMgr.getDiamond()
  21393. };
  21394. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21395. const d = LocalStorageManager.getItem(keyStr);
  21396. jsonStr.count = d.count + 1;
  21397. LocalStorageManager.setItem(keyStr, jsonStr);
  21398. }
  21399. else {
  21400. LocalStorageManager.setItem(keyStr, jsonStr);
  21401. }
  21402. const reqStr = JSON.stringify(jsonStr);
  21403. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21404. }
  21405. logEventForChallenge_level_N(level) {
  21406. console.log('zh:logEventForChallenge_level_N ' + level);
  21407. let keyStr = 'sjmd_challenge_level_N';
  21408. if (LocalStorageManager.hasKey(keyStr)) {
  21409. let lev = LocalStorageManager.getItem(keyStr);
  21410. if (level > lev) {
  21411. LocalStorageManager.setItem(keyStr, level);
  21412. }
  21413. if ((level) % 5 == 0) {
  21414. console.log('zh:每5关上报1次');
  21415. let sjmc = 'challenge_level_' + level;
  21416. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21417. let sjmcForFirebase = 'challenge_level_' + level;
  21418. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21419. }
  21420. else {
  21421. console.log('zh:5 no 上报');
  21422. }
  21423. }
  21424. else {
  21425. LocalStorageManager.setItem(keyStr, level);
  21426. }
  21427. }
  21428. }
  21429. UIGameEnd$1.uiName = "UIGameEnd";
  21430. class ShowItem$1 {
  21431. constructor() {
  21432. this.ui = ui_ShowItem.createInstance();
  21433. }
  21434. destroySelf() {
  21435. if (!this.ui.isDisposed) {
  21436. this.ui.removeFromParent();
  21437. this.ui.dispose();
  21438. }
  21439. }
  21440. setParent(parent) {
  21441. parent.addChild(this.ui);
  21442. }
  21443. setPos(x, y) {
  21444. this.ui.x = x;
  21445. this.ui.y = y;
  21446. }
  21447. setUrl(index) {
  21448. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21449. }
  21450. }
  21451. class UILevelProp$1 extends UIBase {
  21452. constructor() {
  21453. super();
  21454. this.firstPos = 385;
  21455. this.secondPos = 467;
  21456. this.showItemArr = [];
  21457. }
  21458. onConstructor() {
  21459. this.ui = ui_UILevelProp.createInstance();
  21460. this.contentPane = this.ui;
  21461. this.isEject = false;
  21462. this.addUIClick(this.ui.closeBtn, this.hide);
  21463. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21464. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21465. }
  21466. show(level) {
  21467. super.show();
  21468. this.ui.t1.play();
  21469. this.level = level;
  21470. this.data = cfgTable.placeballData[this.level];
  21471. this.updateSelf();
  21472. this.showPreView();
  21473. this.moneyNode.ui.c1.selectedIndex = 2;
  21474. this.moneyNode.checkPowerTime();
  21475. this.moneyNode.powerChange();
  21476. this.setGlobalFont(this.ui);
  21477. }
  21478. showPreView() {
  21479. let item;
  21480. let data;
  21481. for (let index = 0; index < this.showItemArr.length; index++) {
  21482. item = this.showItemArr[index];
  21483. item.destroySelf();
  21484. }
  21485. this.showItemArr = [];
  21486. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21487. for (const key in cfgData) {
  21488. data = cfgData[key];
  21489. item = new ShowItem$1();
  21490. item.setParent(this.ui.myNode.displayRoot);
  21491. item.setPos(data.x, data.y);
  21492. item.setUrl(data.value);
  21493. this.showItemArr.push(item);
  21494. }
  21495. }
  21496. updateSelf() {
  21497. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21498. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21499. if (this.data.ball == -1) {
  21500. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21501. }
  21502. else {
  21503. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21504. }
  21505. let localData = DataMgr.getPlaceBallLevel(this.level);
  21506. let getAward = localData.getAward;
  21507. let cfg = cfgTable.placeballData[this.level];
  21508. let coin = this.data.award[0];
  21509. let diamond = this.data.award[1];
  21510. if (cfg.type == PlaceBallType.challenge) {
  21511. diamond = 0;
  21512. coin = 100;
  21513. }
  21514. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21515. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21516. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21517. if (cfg.type == PlaceBallType.challenge) {
  21518. this.ui.myNode.coinNode.numTxt.text = "";
  21519. }
  21520. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21521. if (coin > 0 && diamond > 0) {
  21522. this.ui.myNode.diamondNode.x = 385;
  21523. this.ui.myNode.coinNode.x = 467;
  21524. }
  21525. else {
  21526. this.ui.myNode.diamondNode.x = 385;
  21527. this.ui.myNode.coinNode.x = 385;
  21528. }
  21529. if (!getAward) {
  21530. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21531. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21532. }
  21533. else {
  21534. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21535. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21536. }
  21537. }
  21538. startGame() {
  21539. if (DataMgr.powerEnough()) {
  21540. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21541. this.ui.myNode.startBtn.touchable = false;
  21542. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21543. console.log('zh:startGame ');
  21544. this.ui.myNode.startBtn.touchable = true;
  21545. DataMgr.setPower(-1);
  21546. xGame.eventMgr.event(POWER_TIME);
  21547. xGame.common.gameMode = GameMode.placeBall;
  21548. xGame.common.placeBallCurLevel = this.level;
  21549. xGame.uiMgr.Show(UIGame$1);
  21550. this.logEventForChallenge_level_start(this.level);
  21551. xGame.uiMgr.Hide(UILevelDisplay$1);
  21552. xGame.uiMgr.Hide(UIMain$1);
  21553. this.hide();
  21554. }));
  21555. }
  21556. else {
  21557. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21558. xGame.uiMgr.Show(UIPower$1);
  21559. }
  21560. }
  21561. logEventForChallenge_level_start(level) {
  21562. let keyStr = 'sjmd_challenge_level_start';
  21563. let jsonStr = {
  21564. "count": 1,
  21565. "gold_balance ": DataMgr.getCoin(),
  21566. "level": level,
  21567. "diamond_balance ": DataMgr.getDiamond()
  21568. };
  21569. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21570. const d = LocalStorageManager.getItem(keyStr);
  21571. if (level > d.level) {
  21572. jsonStr.count = d.count + 1;
  21573. LocalStorageManager.setItem(keyStr, jsonStr);
  21574. }
  21575. else {
  21576. }
  21577. }
  21578. else {
  21579. LocalStorageManager.setItem(keyStr, jsonStr);
  21580. }
  21581. const reqStr = JSON.stringify(jsonStr);
  21582. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21583. }
  21584. hide() {
  21585. super.hide();
  21586. }
  21587. }
  21588. UILevelProp$1.uiName = "UILevelProp";
  21589. class PutBallLevelDisplay$1 {
  21590. constructor(ui, index) {
  21591. this.index = 0;
  21592. this.ui = ui;
  21593. this.index = index;
  21594. this.ui.onClick(this, this.clickSelf);
  21595. this.updateSelf();
  21596. this.ui.levelTxt.text = (this.index + 1) + "";
  21597. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21598. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21599. }
  21600. updateSelf() {
  21601. let level = this.index + 1;
  21602. this.data = DataMgr.getPlaceBallLevel(level);
  21603. this.ui.starNode.c1.selectedIndex = this.data.star;
  21604. let isChallenge = cfgTable.placeballData[level].type;
  21605. if (this.data.isCur) {
  21606. if (isChallenge) {
  21607. this.ui.c1.selectedIndex = 5;
  21608. }
  21609. else {
  21610. this.ui.c1.selectedIndex = 2;
  21611. }
  21612. }
  21613. else {
  21614. if (this.data.play) {
  21615. if (this.data.star == 3) {
  21616. this.ui.c1.selectedIndex = 0;
  21617. }
  21618. else {
  21619. this.ui.c1.selectedIndex = 1;
  21620. }
  21621. }
  21622. else {
  21623. if (isChallenge) {
  21624. this.ui.c1.selectedIndex = 4;
  21625. }
  21626. else {
  21627. this.ui.c1.selectedIndex = 3;
  21628. }
  21629. }
  21630. }
  21631. }
  21632. clickSelf() {
  21633. if (!this.data.play)
  21634. return;
  21635. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21636. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21637. }
  21638. }
  21639. class UILevelDisplay$1 extends UIBase {
  21640. constructor() {
  21641. super();
  21642. }
  21643. onConstructor() {
  21644. this.ui = ui_UILevelDisplay.createInstance();
  21645. this.contentPane = this.ui;
  21646. this.isEject = false;
  21647. this.myList = this.ui.myNode.myList;
  21648. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21649. this.levelItemArr = [];
  21650. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21651. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21652. this.myList.numItems = levelNum;
  21653. }
  21654. levelItemRender(index, target) {
  21655. let item = new PutBallLevelDisplay$1(target, index);
  21656. this.levelItemArr.push(item);
  21657. }
  21658. show() {
  21659. super.show();
  21660. this.updateLevel();
  21661. this.scrollToPlace();
  21662. this.setGlobalFont(this.ui);
  21663. }
  21664. updateLevel() {
  21665. let temp;
  21666. for (let index = 0; index < this.levelItemArr.length; index++) {
  21667. temp = this.levelItemArr[index];
  21668. temp.updateSelf();
  21669. }
  21670. }
  21671. scrollToPlace() {
  21672. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21673. let passArr = DataMgr.getPlaceBallLevelList();
  21674. let offest = passArr.length;
  21675. if (offest >= maxNum - 1)
  21676. offest = maxNum - 1;
  21677. this.myList.scrollToView(offest, true, true);
  21678. }
  21679. hide() {
  21680. super.hide();
  21681. }
  21682. }
  21683. UILevelDisplay$1.uiName = "UILevelDisplay";
  21684. class UIMatching$1 extends UIBase {
  21685. constructor() {
  21686. super();
  21687. }
  21688. onConstructor() {
  21689. this.ui = ui_UIMatching.createInstance();
  21690. this.contentPane = this.ui;
  21691. this.isEject = false;
  21692. }
  21693. show(callback) {
  21694. super.show();
  21695. PlatMgr.showBanner(true);
  21696. this.callback = callback;
  21697. let user = Moyu.getUserInfo();
  21698. if (!this.selfPot) {
  21699. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21700. }
  21701. if (!this.aiPot) {
  21702. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21703. }
  21704. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21705. this.ui.selfHead.nameTxt.text = user.nickName;
  21706. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21707. this.ui.aiHead.nameTxt.text = "???";
  21708. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21709. this.ui.selfHead.c1.selectedIndex = 0;
  21710. this.ui.aiHead.c1.selectedIndex = 0;
  21711. this.ui.selfHead.x = this.selfPot.x;
  21712. this.ui.selfHead.y = this.selfPot.y;
  21713. this.ui.aiHead.x = this.aiPot.x;
  21714. this.ui.aiHead.y = this.aiPot.y;
  21715. switch (xGame.common.gameMode) {
  21716. case GameMode.classic:
  21717. break;
  21718. case GameMode.bigMove:
  21719. this.initSkillData();
  21720. break;
  21721. default:
  21722. break;
  21723. }
  21724. this.ui.t1.play(Laya.Handler.create(this, () => {
  21725. this.ui.t2.play(Laya.Handler.create(this, () => {
  21726. switch (xGame.common.gameMode) {
  21727. case GameMode.classic:
  21728. this.waitingPeople();
  21729. break;
  21730. case GameMode.bigMove:
  21731. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21732. break;
  21733. default:
  21734. break;
  21735. }
  21736. }));
  21737. }));
  21738. this.setGlobalFont(this.ui);
  21739. }
  21740. initSkillData() {
  21741. this.skillSelectData = [];
  21742. let skillUrl = xGame.common.skillIconList;
  21743. let skillName = xGame.common.skillNameList;
  21744. let skillLevel = DataMgr.getBigSkillList();
  21745. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21746. for (let index = 0; index < 5; index++) {
  21747. let obj = {};
  21748. obj.skillImg = skillUrl[index];
  21749. obj.skillName = skillName[index];
  21750. obj.skillType = skillType[index];
  21751. obj.skillLevel = skillLevel[index];
  21752. this.skillSelectData.push(obj);
  21753. }
  21754. }
  21755. getAISkillLevel(myLevel) {
  21756. let video = xGame.common.upSkillLevel;
  21757. let aiLevel;
  21758. let temp;
  21759. if (video) {
  21760. temp = xGame.common.randomNum(-2, -1);
  21761. }
  21762. else {
  21763. if (myLevel <= 5) {
  21764. temp = xGame.common.randomNum(1, 3);
  21765. }
  21766. else if (myLevel <= 9) {
  21767. temp = xGame.common.randomNum(-2, 1);
  21768. }
  21769. else {
  21770. temp = xGame.common.randomNum(-4, 0);
  21771. }
  21772. }
  21773. aiLevel = temp + myLevel;
  21774. if (aiLevel <= 1)
  21775. aiLevel = 1;
  21776. if (aiLevel >= 10)
  21777. aiLevel = 10;
  21778. return aiLevel;
  21779. }
  21780. getAISkillType() {
  21781. return xGame.common.randomNum(1, 4);
  21782. let successTimes = DataMgr.getSkillSuccessTimes();
  21783. let info = cfgTable.aiskillData[successTimes];
  21784. if (!info) {
  21785. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21786. info = cfgTable.aiskillData[max];
  21787. }
  21788. let dataArr = info.skillselect;
  21789. let myCfg = {};
  21790. for (let index = 0; index < dataArr.length; index++) {
  21791. let temp = dataArr[index].split('-');
  21792. myCfg[temp[0]] = {};
  21793. myCfg[temp[0]].id = parseInt(temp[0]);
  21794. myCfg[temp[0]].weight = parseInt(temp[1]);
  21795. }
  21796. let aiCfg = xGame.common.initWeight(myCfg);
  21797. let curData = xGame.common.getRandomWeightData(aiCfg);
  21798. return parseInt(curData.id);
  21799. }
  21800. getAISkillData(index) {
  21801. let myLevel = this.skillSelectData[index].skillLevel;
  21802. let aiLevel = this.getAISkillLevel(myLevel);
  21803. let aiType = this.getAISkillType() - 1;
  21804. return { aiLevel, aiType } = { aiLevel, aiType };
  21805. }
  21806. skillSelectFinish(index) {
  21807. let aiInfo = this.getAISkillData(index);
  21808. xGame.common.gameMgr.selfCurSkill = index;
  21809. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21810. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21811. this.ui.selfHead.c1.selectedIndex = 1;
  21812. this.ui.aiHead.c1.selectedIndex = 1;
  21813. let myData = this.skillSelectData[index];
  21814. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21815. let guide = DataMgr.getSkillGuide();
  21816. if (guide == 0) {
  21817. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21818. }
  21819. else {
  21820. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21821. }
  21822. let aiData = this.skillSelectData[aiInfo.aiType];
  21823. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21824. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21825. this.waitingPeople();
  21826. }
  21827. waitingPeople() {
  21828. let time = xGame.common.randomNum(1000, 3000);
  21829. time += 1000;
  21830. Laya.timer.once(time, this, () => {
  21831. this.matchingSuccess();
  21832. });
  21833. }
  21834. matchingSuccess() {
  21835. let gameUI = xGame.common.gameUI;
  21836. let name = gameUI.ui.topNode.aiNameTxt.text;
  21837. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21838. this.ui.aiHead.nameTxt.text = name;
  21839. this.ui.aiHead.headImg.url = url;
  21840. name = gameUI.ui.topNode.selfNameTxt.text;
  21841. url = gameUI.ui.topNode.selfHeadLoader.url;
  21842. this.ui.selfHead.nameTxt.text = name;
  21843. this.ui.selfHead.headImg.url = url;
  21844. this.ui.t3.play(Laya.Handler.create(this, () => {
  21845. this.callback && this.callback();
  21846. this.ui.t4.play(Laya.Handler.create(this, () => {
  21847. this.destroySelf();
  21848. }));
  21849. }));
  21850. }
  21851. destroySelf() {
  21852. this.callback = null;
  21853. this.skillSelectData = null;
  21854. this.selfPot = null;
  21855. this.aiPot = null;
  21856. if (!this.ui.isDisposed) {
  21857. this.ui.removeFromParent();
  21858. this.ui.dispose();
  21859. }
  21860. xGame.uiMgr.destroyUI(this);
  21861. }
  21862. }
  21863. UIMatching$1.uiName = "UIMatching";
  21864. class SkillDisplay$1 {
  21865. constructor(ui, data, uiIndex) {
  21866. this.starX = 0;
  21867. this.starY = 0;
  21868. this.index = 0;
  21869. this.ui = ui;
  21870. this.data = data;
  21871. this.index = uiIndex;
  21872. this.initSelf();
  21873. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21874. }
  21875. initSelf() {
  21876. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21877. this.ui.nameTxt.text = this.data.name;
  21878. this.ui.describeTxt.text = this.data.describe;
  21879. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21880. this.ui.startBtn.onClick(this, this.startGame);
  21881. this.updateSelf();
  21882. }
  21883. updateSelf() {
  21884. this.checkTry();
  21885. let level = DataMgr.getBigSkillByIndex(this.index);
  21886. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21887. }
  21888. checkTry() {
  21889. let index = this.index;
  21890. let level = DataMgr.getBigSkillByIndex(index);
  21891. if (level == null) {
  21892. DataMgr.setBigSkill(index, 1, false);
  21893. level = 1;
  21894. }
  21895. this.ui.levelTxt.text = "LV." + level;
  21896. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21897. this.ui.tryNode.visible = true;
  21898. else
  21899. this.ui.tryNode.visible = false;
  21900. }
  21901. clickAddLevel() {
  21902. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21903. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21904. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21905. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21906. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21907. }
  21908. else {
  21909. console.log('zh:AD 失败,直接发放奖励');
  21910. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21911. }
  21912. }
  21913. qjff_AD_for_skilldisplay_clickAddLevel() {
  21914. DataMgr.setBigSkill(this.data.index, 1);
  21915. this.updateSelf();
  21916. xGame.common.upSkillLevel = true;
  21917. }
  21918. startGame() {
  21919. console.log('zh:rod skill startgame');
  21920. if (this.data.index == 3) {
  21921. alert('Coming soon!');
  21922. return;
  21923. }
  21924. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21925. let needCoin = xGame.common.bigMoveNeedCoin;
  21926. xGame.common.passAwardCoin = 2000;
  21927. let guide = DataMgr.getSkillGuide();
  21928. console.log('zh:startGame guide=' + guide);
  21929. xGame.common.temSelfLevel = 0;
  21930. if (guide == 0) {
  21931. needCoin = 0;
  21932. xGame.common.temSelfLevel = 100;
  21933. }
  21934. if (DataMgr.coinEnough(needCoin)) {
  21935. DataMgr.setCoin(-needCoin);
  21936. xGame.common.curPlayerSkillType = this.index;
  21937. if (guide == 0)
  21938. xGame.common.curPlayerSkillType = 0;
  21939. console.log('zh: skilldisplay 1');
  21940. xGame.uiMgr.Show(UIGame$1);
  21941. xGame.uiMgr.Hide(UIMain$1);
  21942. xGame.uiMgr.Show(UIMatching$1, () => {
  21943. xGame.common.gameUI.ui.alpha = 1;
  21944. xGame.common.gameUI.startGame();
  21945. xGame.uiMgr.Hide(UISkill$1);
  21946. });
  21947. this.logEventForRod_start();
  21948. }
  21949. else {
  21950. console.log('zh: skilldisplay 2');
  21951. xGame.uiMgr.Show(UIAddProp$1, 0);
  21952. Moyu.sendDataEvent("AddCoinVideo");
  21953. }
  21954. }
  21955. logEventForRod_start() {
  21956. let gfmsIdx = xGame.common.curPlayerSkillType;
  21957. console.log('zh:选择的技能=' + gfmsIdx);
  21958. let gfmc = 'Skyfall Shot';
  21959. if (gfmsIdx == 0) {
  21960. gfmc = 'Skyfall Shot';
  21961. }
  21962. if (gfmsIdx == 1) {
  21963. gfmc = 'Surging break';
  21964. }
  21965. if (gfmsIdx == 2) {
  21966. gfmc = 'Frost Lock';
  21967. }
  21968. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21969. let jsonStr = {
  21970. "count": 0,
  21971. "name": gfmc
  21972. };
  21973. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21974. const d = LocalStorageManager.getItem(keyStr);
  21975. jsonStr.count = d.count + 1;
  21976. LocalStorageManager.setItem(keyStr, jsonStr);
  21977. }
  21978. else {
  21979. LocalStorageManager.setItem(keyStr, jsonStr);
  21980. }
  21981. const reqStr = JSON.stringify(jsonStr);
  21982. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21983. }
  21984. }
  21985. class UISkill$1 extends UIBase {
  21986. constructor() {
  21987. super();
  21988. this.skillData = [];
  21989. }
  21990. onConstructor() {
  21991. this.ui = ui_UISkill.createInstance();
  21992. this.contentPane = this.ui;
  21993. this.isEject = false;
  21994. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21995. this.initSkillData();
  21996. console.log('zh:aaaaaa1111111111');
  21997. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21998. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21999. console.log('zh:aaaaaa22222222');
  22000. this.displayList = [];
  22001. this.ui.skillNode.skillList.numItems = 3;
  22002. this.addUIClick(this.ui, this.interuptSecretary);
  22003. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  22004. this.ui.talkNode.visible = false;
  22005. if (Moyu.isKs)
  22006. this.ui.closeNode.closeBtn.x += 100;
  22007. }
  22008. show() {
  22009. super.show();
  22010. this.playSecretaryIdle();
  22011. this.moneyNode.ui.c1.selectedIndex = 1;
  22012. Laya.timer.clearAll(this);
  22013. xGame.soundMgr.playSound("s_start");
  22014. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22015. let guide = DataMgr.getSkillGuide();
  22016. this.ui.guideNode.visible = guide == 0;
  22017. let item = this.getSkillItemByUIIndex(0);
  22018. if (guide == 0) {
  22019. item.ui.c1.selectedIndex = 1;
  22020. }
  22021. else {
  22022. item.ui.c1.selectedIndex = 0;
  22023. }
  22024. this.ui.guideNode.guideBtn.visible = guide == 0;
  22025. for (let index = 0; index < this.displayList.length; index++) {
  22026. this.displayList[index].checkTry();
  22027. }
  22028. this.setGlobalFont(this.ui);
  22029. }
  22030. getSkillItemByUIIndex(cur) {
  22031. for (let index = 0; index < this.displayList.length; index++) {
  22032. if (this.displayList[index].index == cur) {
  22033. return this.displayList[index];
  22034. }
  22035. }
  22036. }
  22037. enterGuideLevel() {
  22038. let item = this.getSkillItemByUIIndex(0);
  22039. item.startGame();
  22040. if (DataMgr.getNewUser())
  22041. Moyu.sendDataEvent("gameStart1");
  22042. }
  22043. initSkillData() {
  22044. this.skillData = [];
  22045. let nameList = xGame.common.skillNameList;
  22046. let iconList = xGame.common.skillIconList;
  22047. let describeList = [
  22048. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  22049. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  22050. "The power of frost descends—freezing the flow and taking full control of the game!"
  22051. ];
  22052. console.log('zh:initSkillData 111111111');
  22053. let data;
  22054. for (let index = 0; index < nameList.length; index++) {
  22055. data = {};
  22056. data.name = nameList[index];
  22057. data.icon = iconList[index];
  22058. data.describe = describeList[index];
  22059. data.index = index;
  22060. this.skillData.push(data);
  22061. }
  22062. }
  22063. updateSkillItem(index, target) {
  22064. if (this.displayList[index] == null) {
  22065. let uiIndex;
  22066. switch (index) {
  22067. case 0:
  22068. uiIndex = 1;
  22069. break;
  22070. case 1:
  22071. uiIndex = 0;
  22072. break;
  22073. case 2:
  22074. uiIndex = 2;
  22075. break;
  22076. case 3:
  22077. uiIndex = 3;
  22078. break;
  22079. default:
  22080. break;
  22081. }
  22082. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  22083. this.displayList.push(temp);
  22084. }
  22085. }
  22086. playSecretaryIdle() {
  22087. let parent = this.ui.secretary.displayObject;
  22088. parent.destroyChildren();
  22089. let xx = this.ui.secretary.width / 2;
  22090. let yy = this.ui.secretary.height;
  22091. let scale = xGame.common.getSecretaryScale();
  22092. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22093. xGame.common.secretary.play(data, 0, true, parent);
  22094. }
  22095. returnUIMain() {
  22096. this.hide();
  22097. xGame.common.stopGirlPop(this.ui.talkNode);
  22098. xGame.uiMgr.Show(UIMain$1);
  22099. }
  22100. interuptSecretary() {
  22101. Laya.timer.clearAll(this);
  22102. this.playSecretaryRandomSound();
  22103. }
  22104. playSecretaryRandomSound() {
  22105. if (this.isHide)
  22106. return;
  22107. let time = xGame.common.randomNum(45000, 60000);
  22108. Laya.timer.once(time, this, () => {
  22109. if (this.isHide)
  22110. return;
  22111. let index = xGame.common.randomNum(4, 7);
  22112. xGame.soundMgr.playSound("s_main0" + index);
  22113. let words = 1;
  22114. switch (index) {
  22115. case 4:
  22116. words = 5;
  22117. break;
  22118. case 5:
  22119. words = 3;
  22120. break;
  22121. case 6:
  22122. words = 6;
  22123. break;
  22124. case 7:
  22125. words = 7;
  22126. break;
  22127. default:
  22128. break;
  22129. }
  22130. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22131. this.playSecretaryRandomSound();
  22132. });
  22133. }
  22134. }
  22135. UISkill$1.uiName = "UISkill";
  22136. class UIAddProp$1 extends UIBase {
  22137. constructor() {
  22138. super();
  22139. this.curType = "";
  22140. }
  22141. onConstructor() {
  22142. this.ui = ui_UIAddProp.createInstance();
  22143. this.contentPane = this.ui;
  22144. this.isEject = false;
  22145. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22146. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22147. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22148. this.updateUI();
  22149. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22150. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22151. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22152. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22153. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22154. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22155. }
  22156. show(type) {
  22157. super.show();
  22158. this.curType = type == 0 ? "coin" : "diamond";
  22159. this.switchBtn("");
  22160. this.ui.t0.play();
  22161. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22162. PlatMgr.showInsert(true);
  22163. this.setGlobalFont(this.ui);
  22164. }
  22165. closeSelf() {
  22166. this.hide();
  22167. }
  22168. updateUI() {
  22169. let data = cfgTable.moneyData;
  22170. let temp;
  22171. let obj;
  22172. for (const key in data) {
  22173. temp = data[key];
  22174. obj = this.ui.myNode["node" + key];
  22175. if (parseInt(key) <= 2) {
  22176. obj.diamondTxt.text = "+" + temp.num;
  22177. }
  22178. else {
  22179. obj.coinTxt.text = temp.num;
  22180. obj.diamondTxt.text = temp.get.split('_')[1];
  22181. }
  22182. }
  22183. this.updateDiamondShare();
  22184. }
  22185. updateDiamondShare() {
  22186. let data = DataMgr.getShareDiamondTimes();
  22187. if (data >= xGame.common.maxShareDiamondTimes) {
  22188. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22189. this.ui.myNode.node1.touchable = false;
  22190. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22191. }
  22192. else {
  22193. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22194. this.ui.myNode.node1.touchable = true;
  22195. }
  22196. }
  22197. switchBtn(type) {
  22198. if (type == "")
  22199. type = this.curType;
  22200. else {
  22201. if (this.curType == type) {
  22202. return;
  22203. }
  22204. else {
  22205. this.curType = type;
  22206. }
  22207. }
  22208. if (type == "coin") {
  22209. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22210. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22211. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22212. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22213. this.ui.myNode.c1.selectedIndex = 0;
  22214. }
  22215. else {
  22216. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22217. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22218. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22219. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22220. this.ui.myNode.c1.selectedIndex = 1;
  22221. }
  22222. }
  22223. convertCoin(index) {
  22224. let data = cfgTable.moneyData[index];
  22225. let coinNum = data.num;
  22226. let str = data.get.split('_')[1];
  22227. let needDiamond = parseInt(str);
  22228. if (DataMgr.diamondEnough(needDiamond)) {
  22229. DataMgr.setDiamond(-needDiamond);
  22230. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22231. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22232. }
  22233. else {
  22234. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22235. this.switchBtn("diamond");
  22236. }
  22237. }
  22238. videoGetDiamond() {
  22239. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22240. if (Laya.Browser.onAndroid) {
  22241. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22242. if (!boo) {
  22243. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22244. return;
  22245. }
  22246. }
  22247. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22248. }
  22249. else {
  22250. console.log('zh:AD 失败,直接发放奖励');
  22251. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22252. }
  22253. }
  22254. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22255. let num = cfgTable.moneyData[2].num;
  22256. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22257. this.closeSelf();
  22258. }
  22259. videoGetCoin() {
  22260. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22261. if (Laya.Browser.onAndroid) {
  22262. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22263. if (!boo) {
  22264. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22265. return;
  22266. }
  22267. }
  22268. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22269. }
  22270. else {
  22271. console.log('zh:AD 失败,直接发放奖励');
  22272. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22273. }
  22274. }
  22275. qjff_AD_for_uiAddProp_videoGetCoin() {
  22276. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22277. this.closeSelf();
  22278. }
  22279. shareGetDiamond() {
  22280. let times = DataMgr.getShareDiamondTimes();
  22281. if (times >= xGame.common.maxShareDiamondTimes) {
  22282. console.log('zh: 233333333333 maxShareDiamondTimes');
  22283. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22284. }
  22285. else {
  22286. console.log('zh:33333333333333ad');
  22287. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22288. if (Laya.Browser.onAndroid) {
  22289. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22290. if (!boo) {
  22291. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22292. return;
  22293. }
  22294. }
  22295. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22296. }
  22297. else {
  22298. console.log('zh:AD 失败,直接发放奖励');
  22299. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22300. }
  22301. }
  22302. }
  22303. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22304. let diamond = xGame.common.randomNum(50, 100);
  22305. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22306. DataMgr.setShareDiamondTimes(1);
  22307. this.updateDiamondShare();
  22308. }
  22309. openPutBallView() {
  22310. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22311. let skill = xGame.uiMgr.getUI(UISkill$1);
  22312. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22313. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22314. if (end && !end.isHide) {
  22315. xGame.uiMgr.Hide(UIGameEnd$1);
  22316. xGame.uiMgr.Show(UIMain$1);
  22317. }
  22318. if (skill && !skill.isHide)
  22319. xGame.uiMgr.Hide(UISkill$1);
  22320. if (uigame && !uigame.isHide)
  22321. xGame.uiMgr.Hide(UIGame$1);
  22322. if (level && !level.isHide) {
  22323. }
  22324. else {
  22325. xGame.uiMgr.Show(UILevelDisplay$1);
  22326. }
  22327. this.closeSelf();
  22328. }
  22329. }
  22330. UIAddProp$1.uiName = "UIAddProp";
  22331. class MoneyNode$1 {
  22332. constructor(ui) {
  22333. this.leftTime = 0;
  22334. this.ui = ui;
  22335. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22336. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22337. this.ui.addPowerBtn.onClick(this, this.addPower);
  22338. this.ui.c1.selectedIndex = 1;
  22339. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22340. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22341. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22342. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22343. this.coinChange();
  22344. this.diamondChange();
  22345. this.powerChange();
  22346. }
  22347. addPower() {
  22348. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22349. xGame.uiMgr.Show(UIPower$1);
  22350. }
  22351. powerChange() {
  22352. let powerNum = DataMgr.getPower();
  22353. this.ui.powerTxt.text = powerNum + "";
  22354. }
  22355. checkPowerTime() {
  22356. let cur = new Date().getTime();
  22357. let last = DataMgr.getPowerTime();
  22358. if (last == 0) {
  22359. last = cur;
  22360. DataMgr.setPowerTime(cur);
  22361. }
  22362. let power = DataMgr.getPower();
  22363. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22364. Laya.timer.clearAll(this);
  22365. if (power >= xGame.common.natureMaxPower) {
  22366. this.ui.powerTimeTxt.text = "";
  22367. DataMgr.setPowerTime(cur);
  22368. return;
  22369. }
  22370. if (power + offset >= xGame.common.natureMaxPower) {
  22371. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22372. this.ui.powerTimeTxt.text = "";
  22373. DataMgr.setPowerTime(cur);
  22374. }
  22375. else {
  22376. if (offset > 0) {
  22377. DataMgr.setPower(offset);
  22378. DataMgr.setPowerTime(cur);
  22379. }
  22380. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22381. this.leftTime = xGame.common.powerRecoverNum - time;
  22382. if (this.leftTime <= 0)
  22383. this.leftTime = 0;
  22384. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22385. Laya.timer.loop(1000, this, this.updatePowerTime);
  22386. }
  22387. }
  22388. updatePowerTime() {
  22389. this.leftTime -= 1;
  22390. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22391. if (this.leftTime <= 0) {
  22392. this.checkPowerTime();
  22393. }
  22394. }
  22395. coinChange() {
  22396. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22397. }
  22398. diamondChange() {
  22399. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22400. }
  22401. addCoin() {
  22402. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22403. Moyu.sendDataEvent("AddCoinBtn");
  22404. xGame.uiMgr.Show(UIAddProp$1, 0);
  22405. }
  22406. addDiamond() {
  22407. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22408. Moyu.sendDataEvent("AddDiamondBtn");
  22409. xGame.uiMgr.Show(UIAddProp$1, 1);
  22410. }
  22411. }
  22412. class SettingNode$1 {
  22413. constructor(ui) {
  22414. this.showSetting = false;
  22415. this.openSound = true;
  22416. this.openShake = true;
  22417. this.ui = ui;
  22418. this.ui.soundBtn.onClick(this, this.switchSound);
  22419. this.ui.shakeBtn.onClick(this, this.switchShake);
  22420. this.ui.xyBtn.onClick(this, this.onXy);
  22421. this.ui.clickNode.onClick(this, this.changeSetting);
  22422. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22423. this.ui.xyBtn.visible = false;
  22424. this.ui.shakeBtn.visible = false;
  22425. }
  22426. changeSetting() {
  22427. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22428. this.showSetting = !this.showSetting;
  22429. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22430. }
  22431. switchSound() {
  22432. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22433. this.openSound = !this.openSound;
  22434. Moyu.onSetting(this.openSound, this.openShake);
  22435. xGame.soundMgr.onSetting(this.openSound);
  22436. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22437. }
  22438. switchShake() {
  22439. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22440. this.openShake = !this.openShake;
  22441. Moyu.onSetting(this.openSound, this.openShake);
  22442. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22443. }
  22444. onXy() {
  22445. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22446. MoyuMgr$1.showXy(1);
  22447. }
  22448. }
  22449. class UIDraw$1 extends UIBase {
  22450. constructor() {
  22451. super();
  22452. this.curKey = 0;
  22453. }
  22454. onConstructor() {
  22455. this.ui = ui_UIDraw.createInstance();
  22456. this.contentPane = this.ui;
  22457. this.isEject = false;
  22458. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22459. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22460. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22461. this.initDraw();
  22462. this.initUI();
  22463. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22464. }
  22465. show() {
  22466. super.show();
  22467. this.ui.t0.play();
  22468. this.playSecretaryIdle();
  22469. this.updateDraw();
  22470. this.checkFree();
  22471. if (PlatMgr.bannerDelay > 0) {
  22472. this.ui.closeNode.closeBtn.visible = false;
  22473. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22474. this.ui.closeNode.closeBtn.visible = true;
  22475. });
  22476. }
  22477. PlatMgr.showRateBanner();
  22478. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22479. this.setGlobalFont(this.ui);
  22480. }
  22481. hide() {
  22482. Laya.timer.clearAll(this);
  22483. super.hide();
  22484. }
  22485. checkFree() {
  22486. let isFree = DataMgr.getDailyfreeDrawTimes();
  22487. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22488. }
  22489. initDraw() {
  22490. this.drawObj = [];
  22491. let data = cfgTable.drawData;
  22492. let temp;
  22493. let weight = 0;
  22494. for (const key in data) {
  22495. temp = data[key];
  22496. weight += temp.weight;
  22497. this.drawObj.push(weight);
  22498. }
  22499. this.allWeight = weight;
  22500. }
  22501. initUI() {
  22502. let data = cfgTable.drawData;
  22503. let temp;
  22504. let img;
  22505. let txt;
  22506. for (const key in data) {
  22507. temp = data[key];
  22508. img = this.ui.myNode.rotNode["img" + key];
  22509. txt = this.ui.myNode.rotNode["txt" + key];
  22510. img.url = xGame.common.getGameIconUrl(temp.icon);
  22511. txt.visible = true;
  22512. if (temp.award > 2) {
  22513. img.rotation = 0;
  22514. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22515. }
  22516. else {
  22517. img.rotation = temp.rotation;
  22518. txt.text = temp.num;
  22519. }
  22520. }
  22521. }
  22522. getCurkey() {
  22523. let rand = Math.random() * this.allWeight;
  22524. let temp;
  22525. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22526. temp = this.drawObj[index];
  22527. if (index == 0) {
  22528. if (rand < temp) {
  22529. return index + 1;
  22530. }
  22531. }
  22532. else {
  22533. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22534. return index + 1;
  22535. }
  22536. }
  22537. }
  22538. return 2;
  22539. }
  22540. startDraw() {
  22541. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22542. if (freeTimes > 0) {
  22543. this.beginDraw();
  22544. DataMgr.setDailyfreeDrawTimes(0);
  22545. this.checkFree();
  22546. }
  22547. else {
  22548. if (Laya.Browser.onAndroid) {
  22549. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22550. if (!boo) {
  22551. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22552. return;
  22553. }
  22554. }
  22555. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22556. }
  22557. else {
  22558. console.log('zh:AD 失败,直接发放奖励');
  22559. this.qjff_chouJiang();
  22560. }
  22561. }
  22562. }
  22563. qjff_chouJiang() {
  22564. this.beginDraw();
  22565. }
  22566. beginDraw() {
  22567. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22568. this.ui.drawBtn.touchable = false;
  22569. this.curKey = this.getCurkey();
  22570. console.log("当前key", this.curKey);
  22571. let cell = 60;
  22572. let lap = 3;
  22573. let angle = cell * (this.curKey - 1) + lap * 360;
  22574. let target = this.ui.myNode.rotNode;
  22575. target.rotation = 0;
  22576. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22577. console.log("旋转完成");
  22578. this.ui.drawBtn.touchable = true;
  22579. this.getAward();
  22580. }));
  22581. }
  22582. getAward() {
  22583. let data = cfgTable.drawData[this.curKey];
  22584. let temp = new AwardType();
  22585. temp.type = data.award;
  22586. temp.num = data.num;
  22587. xGame.common.getAward([temp], () => {
  22588. DataMgr.setDrawTimes(1);
  22589. this.updateDraw();
  22590. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22591. });
  22592. }
  22593. updateDraw() {
  22594. let drawTimes = DataMgr.getDrawTimes();
  22595. let awardTimes = DataMgr.getDrawAwardTimes();
  22596. if (Math.floor(drawTimes / 3) > awardTimes) {
  22597. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22598. this.ui.extraNode.boxBtn.touchable = true;
  22599. this.ui.extraNode.tipsTxt.text = "3/3";
  22600. this.ui.extraNode.barNode.width = 265;
  22601. this.getExtraAward();
  22602. }
  22603. else {
  22604. this.ui.extraNode.boxBtn.t0.stop();
  22605. this.ui.extraNode.boxBtn.touchable = false;
  22606. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22607. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22608. }
  22609. let data = cfgTable.drawData[1];
  22610. if (awardTimes == 0) {
  22611. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22612. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22613. this.ui.myNode.rotNode.img1.rotation = 0;
  22614. }
  22615. else {
  22616. let award = data.nextid;
  22617. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22618. this.ui.myNode.rotNode.txt1.text = award[1];
  22619. this.ui.myNode.rotNode.img1.rotation = 0;
  22620. }
  22621. }
  22622. getExtraAward() {
  22623. let drawTimes = DataMgr.getDrawTimes();
  22624. let awardTimes = DataMgr.getDrawAwardTimes();
  22625. let data = cfgTable.drawData[1];
  22626. let award = new AwardType();
  22627. if (awardTimes == 0) {
  22628. award.num = data.num;
  22629. award.type = data.award;
  22630. xGame.common.getAward([award], () => {
  22631. let all = Math.floor(drawTimes / 3);
  22632. DataMgr.setDrawAwardTimes(all);
  22633. this.updateDraw();
  22634. });
  22635. }
  22636. else {
  22637. award.num = parseInt(data.nextid[1]);
  22638. award.type = parseInt(data.nextid[0]);
  22639. xGame.common.getAward([award], () => {
  22640. let all = Math.floor(drawTimes / 3);
  22641. DataMgr.setDrawAwardTimes(all);
  22642. this.updateDraw();
  22643. });
  22644. }
  22645. }
  22646. closeSelf() {
  22647. this.hide();
  22648. }
  22649. playSecretaryIdle() {
  22650. let parent = this.ui.secretary.displayObject;
  22651. parent.destroyChildren();
  22652. let xx = this.ui.secretary.width / 2;
  22653. let yy = this.ui.secretary.height;
  22654. let scale = xGame.common.getSecretaryScale();
  22655. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22656. xGame.common.secretary.play(data, 0, true, parent);
  22657. }
  22658. }
  22659. UIDraw$1.uiName = "UIDraw";
  22660. class UIRanking$1 extends UIBase {
  22661. constructor() {
  22662. super();
  22663. this.showSelf = true;
  22664. this.rankType = 1;
  22665. this.rankList = [];
  22666. this.topX = 10;
  22667. this.myIndex = this.topX + 1;
  22668. this.myStar = 0;
  22669. }
  22670. onConstructor() {
  22671. this.ui = ui_UIRanking.createInstance();
  22672. this.contentPane = this.ui;
  22673. this.isEject = false;
  22674. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22675. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22676. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22677. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22678. this.ui.myNode.myList.setVirtual();
  22679. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22680. }
  22681. show() {
  22682. super.show();
  22683. this.getPaiHangBangDataFormJosnFile();
  22684. this.updateSelf();
  22685. let self = Moyu.getUserInfo();
  22686. if (!self.isAuth) {
  22687. Moyu.initUser(this, () => {
  22688. DataMgr.upRankData();
  22689. });
  22690. }
  22691. this.setGlobalFont(this.ui);
  22692. }
  22693. getPaiHangBangDataFormJosnFile() {
  22694. const rankingList = cfgTable.paiHangBangData.list;
  22695. this.updateItemData(rankingList);
  22696. }
  22697. updateSelfItem() {
  22698. console.log('zh:Moyu.platType =' + Moyu.platType);
  22699. let self = Moyu.getUserInfo();
  22700. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22701. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22702. if (this.myIndex > this.topX) {
  22703. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22704. }
  22705. else {
  22706. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22707. }
  22708. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22709. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22710. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22711. }
  22712. updateItemData(data) {
  22713. this.myStar = xGame.common.getAllStarNum();
  22714. if (this.rankList.length < 2) {
  22715. this.rankList = data;
  22716. let self = Moyu.getUserInfo();
  22717. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22718. self.headIcon = self.headIcon;
  22719. for (let i = 0; i < data.length; i++) {
  22720. let data = this.rankList[i];
  22721. if (data.userId == self.userId) {
  22722. this.rankList.splice(i, 1);
  22723. break;
  22724. }
  22725. }
  22726. for (let i = 0; i < data.length; i++) {
  22727. let data = this.rankList[i];
  22728. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22729. this.myIndex = i + 1;
  22730. let user = { headIcon: self.headIcon, nickName: "myself" };
  22731. let ud = { user: user, data: {} };
  22732. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22733. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22734. if (Moyu.platType < 11) {
  22735. user.headIcon = self.headIcon;
  22736. user.nickName = self.nickName;
  22737. }
  22738. this.rankList.splice(i, 0, md);
  22739. break;
  22740. }
  22741. }
  22742. }
  22743. this.updateSelfItem();
  22744. this.ui.myNode.myList.numItems = this.rankList.length;
  22745. }
  22746. updateItemUI(index, obj) {
  22747. let data = this.rankList[index];
  22748. let userData = JSON.parse(data.userData).user;
  22749. obj.nameTxt.text = userData.nickName.toString();
  22750. obj.valueTxt.text = data.rankScore;
  22751. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22752. obj.rankTxt.text = index + 1;
  22753. switch (index) {
  22754. case 0:
  22755. this.setImg(obj, 1, 0, 0);
  22756. obj.rankTxt.color = "#FFC047";
  22757. break;
  22758. case 1:
  22759. this.setImg(obj, 0, 1, 0);
  22760. obj.rankTxt.color = "#ACACAC";
  22761. break;
  22762. case 2:
  22763. this.setImg(obj, 0, 0, 1);
  22764. obj.rankTxt.color = "#D09672";
  22765. break;
  22766. default:
  22767. this.setImg(obj, 0, 0, 0);
  22768. obj.rankTxt.color = "#496FAB";
  22769. break;
  22770. }
  22771. }
  22772. setImg(obj, a, b, c) {
  22773. obj.img1.visible = a ? true : false;
  22774. obj.img2.visible = b ? true : false;
  22775. obj.img3.visible = c ? true : false;
  22776. }
  22777. changeList(type) {
  22778. this.rankType = type;
  22779. this.updateSelf();
  22780. }
  22781. changeSelfNode() {
  22782. this.showSelf = !this.showSelf;
  22783. this.updateSelf();
  22784. }
  22785. updateSelf() {
  22786. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22787. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22788. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22789. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22790. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22791. }
  22792. }
  22793. UIRanking$1.uiName = "UIRanking";
  22794. class UISecretary$1 extends UIBase {
  22795. constructor() {
  22796. super();
  22797. this.curIndex = 1;
  22798. }
  22799. onConstructor() {
  22800. this.ui = ui_UISecretary.createInstance();
  22801. this.contentPane = this.ui;
  22802. this.isEject = false;
  22803. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22804. this.nodeObj = { left: null, right: null, cur: null };
  22805. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22806. }
  22807. show() {
  22808. super.show();
  22809. this.ui.t0.play();
  22810. this.updateData();
  22811. this.setGlobalFont(this.ui);
  22812. }
  22813. addSecretarySpine(node, spineName) {
  22814. if (spineName == "mishu") {
  22815. if (this.secretarySpine1) {
  22816. node.displayObject.destroyChildren();
  22817. this.playWoman(this.secretarySpine1, node.displayObject);
  22818. }
  22819. else {
  22820. let spine1 = new SpineMgr("mishu", () => {
  22821. this.secretarySpine1 = spine1;
  22822. this.playWoman(this.secretarySpine1, node.displayObject);
  22823. });
  22824. }
  22825. }
  22826. else {
  22827. if (this.secretarySpine2) {
  22828. node.displayObject.destroyChildren();
  22829. this.playWoman(this.secretarySpine2, node.displayObject);
  22830. }
  22831. else {
  22832. let spine2 = new SpineMgr("xiaomishu2", () => {
  22833. this.secretarySpine2 = spine2;
  22834. this.playWoman(this.secretarySpine2, node.displayObject);
  22835. });
  22836. }
  22837. }
  22838. }
  22839. playWoman(node, parent) {
  22840. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22841. let yy = this.ui.myNode.gameNode3.secretary.height;
  22842. let scale = 1.5;
  22843. if (node == this.secretarySpine2) {
  22844. scale = 1.2;
  22845. }
  22846. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22847. node.play(data, 0, true, parent);
  22848. }
  22849. turnLeft() {
  22850. this.curIndex--;
  22851. if (this.curIndex < 1) {
  22852. this.curIndex = 2;
  22853. }
  22854. let left = this.nodeObj.left;
  22855. let right = this.nodeObj.right;
  22856. let cur = this.nodeObj.cur;
  22857. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22858. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22859. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22860. this.updateData();
  22861. }));
  22862. this.ui.myNode.setChildIndex(right, 2);
  22863. this.nodeObj.left = cur;
  22864. this.nodeObj.right = left;
  22865. this.nodeObj.cur = right;
  22866. }
  22867. turnRight() {
  22868. this.curIndex++;
  22869. if (this.curIndex > 2) {
  22870. this.curIndex = 1;
  22871. }
  22872. let left = this.nodeObj.left;
  22873. let right = this.nodeObj.right;
  22874. let cur = this.nodeObj.cur;
  22875. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22876. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22877. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22878. this.updateData();
  22879. }));
  22880. this.ui.myNode.setChildIndex(left, 2);
  22881. this.nodeObj.left = right;
  22882. this.nodeObj.right = cur;
  22883. this.nodeObj.cur = left;
  22884. }
  22885. updateData() {
  22886. console.log('zh: updateData FFFFFFFFFF');
  22887. let data = cfgTable.secretaryshopData;
  22888. let children = this.ui.myNode._children;
  22889. let temp;
  22890. let curData;
  22891. for (let index = 0; index < children.length; index++) {
  22892. temp = children[index];
  22893. curData = data[1];
  22894. temp.heightTxt.text = curData.height;
  22895. temp.foodTxt.text = curData.food;
  22896. temp.historyTxt.text = curData.history;
  22897. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22898. this.addSecretarySpine(temp.secretary, curData.spine);
  22899. let womanIndex = curData.id - 1;
  22900. let getWoman = DataMgr.getSecretary(womanIndex);
  22901. let curUse = DataMgr.getCurSecretary();
  22902. if (getWoman) {
  22903. if (curUse == womanIndex) {
  22904. temp.purchaseBtn.c1.selectedIndex = 1;
  22905. }
  22906. else {
  22907. temp.purchaseBtn.c1.selectedIndex = 2;
  22908. }
  22909. }
  22910. else {
  22911. temp.purchaseBtn.c1.selectedIndex = 0;
  22912. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22913. }
  22914. temp.purchaseBtn.visible = false;
  22915. }
  22916. }
  22917. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22918. console.log('zh: 点击了clickSecretary ');
  22919. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22920. if (getWoman) {
  22921. if (curUse != womanIndex) {
  22922. console.log();
  22923. DataMgr.setCurSecretary(womanIndex);
  22924. this.updateData();
  22925. }
  22926. }
  22927. else {
  22928. console.log('zh:点击购买了');
  22929. let need = needDiamond;
  22930. if (DataMgr.diamondEnough(need)) {
  22931. DataMgr.setDiamond(-need);
  22932. DataMgr.setSecretary(womanIndex, 1);
  22933. DataMgr.setCurSecretary(womanIndex);
  22934. this.updateData();
  22935. }
  22936. else {
  22937. xGame.uiMgr.Show(UIAddProp$1, 1);
  22938. }
  22939. }
  22940. }
  22941. closeSelf() {
  22942. this.hide();
  22943. }
  22944. }
  22945. UISecretary$1.uiName = "UISecretary";
  22946. class BallRodDisplay$1 {
  22947. constructor(ui, index) {
  22948. this.index = 0;
  22949. this.uiIndex = 0;
  22950. this.ui = ui;
  22951. this.index = index;
  22952. this.initData();
  22953. }
  22954. initData() {
  22955. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22956. let data = cfgTable.ballrodData[this.index + 1];
  22957. this.ui.nameTxt.text = data.name;
  22958. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22959. this.ui.levelNode.c1.selectedIndex = data.quality;
  22960. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22961. if (data.spine) {
  22962. this.mySpine = new SpineMgr(data.spine, () => {
  22963. let xx = 150;
  22964. let yy = 70;
  22965. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22966. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22967. });
  22968. }
  22969. }
  22970. updateSelf() {
  22971. let get = DataMgr.getBallRod(this.index);
  22972. if (get == null)
  22973. get = 1;
  22974. let curUse = DataMgr.getCurBallRod();
  22975. if (get) {
  22976. if (curUse == this.index) {
  22977. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22978. }
  22979. else {
  22980. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22981. }
  22982. }
  22983. else {
  22984. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22985. }
  22986. }
  22987. buyBallRod() {
  22988. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22989. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22990. switch (selectedIndex) {
  22991. case 0:
  22992. break;
  22993. case 1:
  22994. console.log('zh:点击了 USE THIS');
  22995. DataMgr.setCurBallRod(this.index);
  22996. let curUse = DataMgr.getCurBallRod();
  22997. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22998. let ui = xGame.uiMgr.getUI(UIShop$1);
  22999. ui.updateBallRod();
  23000. break;
  23001. case 2:
  23002. let data = cfgTable.ballrodData[this.index + 1];
  23003. let need = data.price;
  23004. if (DataMgr.diamondEnough(need)) {
  23005. this.buyQiuGan(data);
  23006. DataMgr.setDiamond(-need);
  23007. DataMgr.setBallRod(this.index, 1);
  23008. DataMgr.setCurBallRod(this.index);
  23009. let ui = xGame.uiMgr.getUI(UIShop$1);
  23010. ui.updateBallRod();
  23011. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  23012. }
  23013. else {
  23014. xGame.uiMgr.Show(UIAddProp$1, 1);
  23015. }
  23016. break;
  23017. default:
  23018. break;
  23019. }
  23020. }
  23021. buyQiuGan(qgItem) {
  23022. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  23023. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23024. if (userInfo == null) {
  23025. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23026. return;
  23027. }
  23028. let reqData = xGame.httpMgr.getReqData();
  23029. let pd = JSON.parse(reqData);
  23030. pd.qiuGanData = qgItem;
  23031. reqData = JSON.stringify(pd);
  23032. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  23033. try {
  23034. console.log('zh:buySp res = ' + JSON.stringify(res));
  23035. let code = res.code;
  23036. let msg = res.msg;
  23037. if (code == 401) {
  23038. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23039. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.loginTimeOut);
  23040. return;
  23041. }
  23042. if (code == 200) {
  23043. xGame.uiMgr.Show(UIMsg$1, msg);
  23044. DataMgr.getUserZiChanInfo(false);
  23045. }
  23046. else {
  23047. xGame.uiMgr.Show(UIMsg$1, msg);
  23048. }
  23049. }
  23050. catch (error) {
  23051. console.log('error=' + error);
  23052. alert(error);
  23053. }
  23054. finally {
  23055. }
  23056. });
  23057. }
  23058. logEventForGouMaiGan(qiuGanName) {
  23059. const ev = {
  23060. value: qiuGanName
  23061. };
  23062. const jsonStr = JSON.stringify(ev);
  23063. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  23064. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  23065. }
  23066. }
  23067. class DaoJuDisplay$1 {
  23068. constructor(ui, index) {
  23069. this.index = 0;
  23070. this.uiIndex = 0;
  23071. this.ggSpid = "";
  23072. this.spid = 0;
  23073. this.ui = ui;
  23074. this.index = index;
  23075. this.initData();
  23076. }
  23077. initData() {
  23078. this.ui.btn_buy.onClick(this, this.gotoBuy);
  23079. let data = cfgTable.daoJuData[this.index + 1];
  23080. this.ui.nameTxt.text = data.spbt;
  23081. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  23082. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  23083. this.ggSpid = data.ggSpid;
  23084. this.spid = data.spid;
  23085. let baseUrl = "asset/sound/ogg/";
  23086. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  23087. }
  23088. gotoBuy() {
  23089. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23090. if (userInfo != null) {
  23091. let token = userInfo.token;
  23092. let ggSpid = this.ggSpid;
  23093. let spid = this.spid;
  23094. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  23095. console.log('zh:gotoBuy1 spid =' + spid);
  23096. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  23097. return;
  23098. }
  23099. else {
  23100. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23101. }
  23102. }
  23103. gotoBuy1() {
  23104. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23105. let djItem = cfgTable.daoJuData[this.index + 1];
  23106. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  23107. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23108. if (userInfo == null) {
  23109. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23110. return;
  23111. }
  23112. let reqData = xGame.httpMgr.getReqData();
  23113. let pd = JSON.parse(reqData);
  23114. pd.spItem = djItem;
  23115. reqData = JSON.stringify(pd);
  23116. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  23117. try {
  23118. console.log('zh:buySp res = ' + JSON.stringify(res));
  23119. let code = res.code;
  23120. let msg = res.msg;
  23121. if (code == 401) {
  23122. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23123. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23124. return;
  23125. }
  23126. if (code == 200) {
  23127. xGame.uiMgr.Show(UIMsg$1, msg);
  23128. DataMgr.getUserZiChanInfo(false);
  23129. }
  23130. else {
  23131. xGame.uiMgr.Show(UIMsg$1, msg);
  23132. }
  23133. }
  23134. catch (error) {
  23135. console.log('error=' + error);
  23136. alert(error);
  23137. }
  23138. finally {
  23139. }
  23140. });
  23141. }
  23142. }
  23143. class UIShop$1 extends UIBase {
  23144. constructor() {
  23145. super();
  23146. this.itemNums = 0;
  23147. this.itemNumsForDj = 0;
  23148. this.curType = "";
  23149. }
  23150. onConstructor() {
  23151. this.ui = ui_UIShop.createInstance();
  23152. this.contentPane = this.ui;
  23153. this.isEject = false;
  23154. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23155. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23156. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23157. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23158. this.addUIClick(this.ui, this.interuptSecretary);
  23159. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23160. this.ballRodArr = [];
  23161. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23162. this.ui.myNode.myList.numItems = this.itemNums;
  23163. this.loadDjdata_old();
  23164. }
  23165. loadDjdata_old() {
  23166. let fff = cfgTable.daoJuData;
  23167. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23168. this.daoJuArr = [];
  23169. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23170. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23171. }
  23172. getProductList() {
  23173. let reqData = xGame.httpMgr.getReqData();
  23174. let pd = JSON.parse(reqData);
  23175. pd.splx = "Consumable";
  23176. reqData = JSON.stringify(pd);
  23177. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23178. try {
  23179. let code = res.code;
  23180. let msg = res.msg;
  23181. if (code == 401) {
  23182. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23183. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23184. return;
  23185. }
  23186. if (code == 200) {
  23187. let data = res.data;
  23188. for (let index = 0; index < data.length; index++) {
  23189. let element = data[index];
  23190. cfgTable.daoJuData[element.spid] = element;
  23191. }
  23192. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23193. }
  23194. else {
  23195. xGame.uiMgr.Show(UIMsg, msg);
  23196. }
  23197. }
  23198. catch (error) {
  23199. console.log('error=' + error);
  23200. alert(error);
  23201. }
  23202. finally {
  23203. }
  23204. });
  23205. }
  23206. show(type) {
  23207. super.show();
  23208. this.curType = type == 0 ? "qiugan" : "daoju";
  23209. this.switchBtn("");
  23210. this.playSecretaryIdle();
  23211. this.updateBallRod();
  23212. this.setGlobalFont(this.ui);
  23213. }
  23214. test123() {
  23215. console.log('zh:test123 ');
  23216. }
  23217. switchBtn(type) {
  23218. console.log('zh:1111切換 sel type=' + type);
  23219. if (type == "") {
  23220. type = this.curType;
  23221. }
  23222. else {
  23223. if (this.curType == type) {
  23224. return;
  23225. }
  23226. else {
  23227. this.curType = type;
  23228. }
  23229. }
  23230. if (type == "qiugan") {
  23231. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23232. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23233. this.ui.myNode.c1.selectedIndex = 0;
  23234. this.ui.myNode.myList.visible = true;
  23235. this.ui.myNode.djList.visible = false;
  23236. }
  23237. else {
  23238. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23239. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23240. this.ui.myNode.c1.selectedIndex = 1;
  23241. this.ui.myNode.myList.visible = false;
  23242. this.ui.myNode.djList.visible = true;
  23243. }
  23244. }
  23245. updateBallRod() {
  23246. for (let index = 0; index < this.ballRodArr.length; index++) {
  23247. this.ballRodArr[index].updateSelf();
  23248. }
  23249. }
  23250. renderBallRod(sort, obj) {
  23251. let index = this.getIndexBySort(sort + 1) - 1;
  23252. let ballRod = new BallRodDisplay$1(obj, index);
  23253. this.ballRodArr.push(ballRod);
  23254. }
  23255. renderDaoJu(idx, obj) {
  23256. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23257. let b = new DaoJuDisplay$1(obj, index);
  23258. this.daoJuArr.push(b);
  23259. }
  23260. getIndexBySort(sort) {
  23261. let object = cfgTable.ballrodData;
  23262. for (const key in object) {
  23263. if (object[key].sort == sort) {
  23264. return parseInt(key);
  23265. }
  23266. }
  23267. }
  23268. getIndexBySortForDj(idx) {
  23269. let object = cfgTable.daoJuData;
  23270. for (const key in object) {
  23271. if (object[key].idx == idx) {
  23272. return parseInt(key);
  23273. }
  23274. }
  23275. }
  23276. playSecretaryIdle() {
  23277. let parent = this.ui.secretary.displayObject;
  23278. parent.destroyChildren();
  23279. let xx = this.ui.secretary.width / 2;
  23280. let yy = this.ui.secretary.height;
  23281. let scale = xGame.common.getSecretaryScale();
  23282. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23283. xGame.common.secretary.play(data, 0, true, parent);
  23284. }
  23285. interuptSecretary() {
  23286. Laya.timer.clearAll(this);
  23287. this.playSecretaryRandomSound();
  23288. }
  23289. playSecretaryRandomSound() {
  23290. if (this.isHide)
  23291. return;
  23292. let time = xGame.common.randomNum(45000, 60000);
  23293. Laya.timer.once(time, this, () => {
  23294. if (this.isHide)
  23295. return;
  23296. let index = xGame.common.randomNum(4, 7);
  23297. xGame.soundMgr.playSound("s_main0" + index);
  23298. let words = 1;
  23299. switch (index) {
  23300. case 4:
  23301. words = 5;
  23302. break;
  23303. case 5:
  23304. words = 3;
  23305. break;
  23306. case 6:
  23307. words = 6;
  23308. break;
  23309. case 7:
  23310. words = 7;
  23311. break;
  23312. default:
  23313. break;
  23314. }
  23315. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23316. this.playSecretaryRandomSound();
  23317. });
  23318. }
  23319. closeSelf() {
  23320. this.hide();
  23321. }
  23322. }
  23323. UIShop$1.uiName = "UIShop";
  23324. class SignMax$1 {
  23325. constructor(ui) {
  23326. this.ui = ui;
  23327. }
  23328. updateSelf(index, sameDay, curDayIndex) {
  23329. let data = cfgTable.signData[index + 1];
  23330. this.ui.titleTxt.text = data.title;
  23331. let arr1 = data.award[0].split('-');
  23332. let arr2 = data.award[1].split('-');
  23333. let num1 = parseInt(arr1[1]);
  23334. let num2 = parseInt(arr2[1]);
  23335. this.ui.numTxt1.text = num1 + "";
  23336. this.ui.numTxt2.text = num2 + "";
  23337. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23338. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23339. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23340. this.ui.numTxt1.visible = false;
  23341. }
  23342. else {
  23343. this.ui.numTxt1.visible = true;
  23344. }
  23345. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23346. this.ui.numTxt2.visible = false;
  23347. }
  23348. else {
  23349. this.ui.numTxt2.visible = true;
  23350. }
  23351. if (index < curDayIndex) {
  23352. this.ui.c1.selectedIndex = 1;
  23353. }
  23354. else if (index == curDayIndex) {
  23355. if (sameDay) {
  23356. this.ui.c1.selectedIndex = 2;
  23357. }
  23358. else {
  23359. this.ui.c1.selectedIndex = 2;
  23360. }
  23361. }
  23362. else {
  23363. this.ui.c1.selectedIndex = 0;
  23364. }
  23365. }
  23366. }
  23367. class SignNormal$1 {
  23368. constructor(ui) {
  23369. this.ui = ui;
  23370. }
  23371. updateSelf(index, sameDay, curDayIndex) {
  23372. let data = cfgTable.signData[index + 1];
  23373. this.ui.titleTxt.text = data.title;
  23374. let arr = data.award[0].split('-');
  23375. let type = parseInt(arr[0]);
  23376. let num = parseInt(arr[1]);
  23377. this.ui.numTxt.text = num + "";
  23378. if (type > 2) {
  23379. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23380. this.ui.myIcon.rotation = 0;
  23381. }
  23382. else {
  23383. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23384. this.ui.myIcon.rotation = 0;
  23385. }
  23386. if (xGame.common.signAwardContainsRod(data.award)) {
  23387. this.ui.numTxt.visible = false;
  23388. }
  23389. else {
  23390. this.ui.numTxt.visible = true;
  23391. }
  23392. if (index < curDayIndex) {
  23393. this.ui.c1.selectedIndex = 1;
  23394. }
  23395. else if (index == curDayIndex) {
  23396. if (sameDay) {
  23397. this.ui.c1.selectedIndex = 2;
  23398. }
  23399. else {
  23400. this.ui.c1.selectedIndex = 2;
  23401. }
  23402. }
  23403. else {
  23404. this.ui.c1.selectedIndex = 0;
  23405. }
  23406. }
  23407. }
  23408. class UISign$1 extends UIBase {
  23409. constructor() {
  23410. super();
  23411. this.curDayIndex = 0;
  23412. this.starX = 0;
  23413. }
  23414. onConstructor() {
  23415. this.ui = ui_UISign.createInstance();
  23416. this.contentPane = this.ui;
  23417. this.isEject = false;
  23418. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23419. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23420. this.initSignItem();
  23421. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23422. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23423. }
  23424. show() {
  23425. super.show();
  23426. this.ui.t0.play();
  23427. this.playSecretaryIdle();
  23428. this.updateSign();
  23429. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23430. this.setGlobalFont(this.ui);
  23431. }
  23432. initSignItem() {
  23433. this.signArr = [];
  23434. for (let index = 0; index < 6; index++) {
  23435. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23436. this.signArr.push(temp);
  23437. }
  23438. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23439. if (Moyu.isKs)
  23440. this.ui.closeNode.closeBtn.x += 100;
  23441. }
  23442. updateSign() {
  23443. let sameDay = xGame.common.judgeSameDay();
  23444. let max = 7;
  23445. this.curDayIndex = DataMgr.getSignData();
  23446. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23447. this.curDayIndex = 0;
  23448. if (!sameDay) {
  23449. this.ui.normalBtn.visible = true;
  23450. this.ui.tipsNode.visible = false;
  23451. this.ui.againBtn.visible = false;
  23452. }
  23453. else {
  23454. this.ui.normalBtn.visible = false;
  23455. let again = DataMgr.getExtraSign();
  23456. let isCurrency = false;
  23457. let index = this.curDayIndex;
  23458. if (index == 0)
  23459. index = 7;
  23460. let award = cfgTable.signData[index].award;
  23461. let num = award[0].split("-")[0];
  23462. if (num == "1" || num == "2")
  23463. isCurrency = true;
  23464. let showAgain = again == 0 && isCurrency;
  23465. this.ui.againBtn.visible = showAgain;
  23466. this.ui.tipsNode.visible = !showAgain;
  23467. }
  23468. for (let index = 0; index < this.signArr.length; index++) {
  23469. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23470. }
  23471. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23472. }
  23473. playSecretaryIdle() {
  23474. let parent = this.ui.secretary.displayObject;
  23475. parent.destroyChildren();
  23476. let xx = this.ui.secretary.width / 2;
  23477. let yy = this.ui.secretary.height;
  23478. let scale = xGame.common.getSecretaryScale();
  23479. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23480. xGame.common.secretary.play(data, 0, true, parent);
  23481. }
  23482. closeSelf() {
  23483. this.hide();
  23484. }
  23485. normalGetAward() {
  23486. let sameDay = xGame.common.judgeSameDay();
  23487. if (!sameDay) {
  23488. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23489. let temp;
  23490. let type;
  23491. let num;
  23492. let arr = [];
  23493. for (let index = 0; index < award.length; index++) {
  23494. temp = award[index].split("-");
  23495. type = parseInt(temp[0]);
  23496. num = parseInt(temp[1]);
  23497. let awardType = new AwardType();
  23498. awardType.num = num;
  23499. awardType.type = type;
  23500. arr.push(awardType);
  23501. }
  23502. xGame.common.getAward(arr, (watchVideo) => {
  23503. this.curDayIndex++;
  23504. if (this.curDayIndex > 7)
  23505. this.curDayIndex = 0;
  23506. DataMgr.setSignData(this.curDayIndex);
  23507. this.updateSignData2Server(this.curDayIndex);
  23508. DataMgr.setSignTime(new Date().getTime());
  23509. if (watchVideo) {
  23510. DataMgr.setExtraSign(1);
  23511. Moyu.sendDataEvent("signIn1");
  23512. }
  23513. this.updateSign();
  23514. });
  23515. }
  23516. }
  23517. againGetAward() {
  23518. Moyu.sendDataEvent("signIn2");
  23519. console.log('zh:qjff_AD_for_uisign');
  23520. if (Laya.Browser.onAndroid) {
  23521. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23522. if (!boo) {
  23523. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23524. return;
  23525. }
  23526. }
  23527. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23528. }
  23529. else {
  23530. console.log('zh:AD 失败,直接发放奖励');
  23531. this.qjff_AD_for_uisign();
  23532. }
  23533. }
  23534. qjff_AD_for_uisign() {
  23535. let index = this.curDayIndex;
  23536. if (index == 0)
  23537. index = 7;
  23538. let award = cfgTable.signData[index].award;
  23539. let temp;
  23540. let type;
  23541. let num;
  23542. for (let index = 0; index < award.length; index++) {
  23543. temp = award[index].split("-");
  23544. type = parseInt(temp[0]);
  23545. num = parseInt(temp[1]) * 3;
  23546. xGame.common.playObjFlyAnim(num, type);
  23547. }
  23548. DataMgr.setExtraSign(1);
  23549. this.updateSign();
  23550. }
  23551. updateSignData2Server(day) {
  23552. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23553. if (userInfo == null) {
  23554. return;
  23555. }
  23556. let reqData = xGame.httpMgr.getReqData();
  23557. let pd = JSON.parse(reqData);
  23558. pd.signData = day;
  23559. reqData = JSON.stringify(pd);
  23560. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  23561. try {
  23562. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  23563. let code = res.code;
  23564. let msg = res.msg;
  23565. if (code == 401) {
  23566. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23567. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23568. return;
  23569. }
  23570. if (code == 200) {
  23571. let data = res.data;
  23572. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  23573. }
  23574. else {
  23575. xGame.uiMgr.Show(UIMsg$1, msg);
  23576. }
  23577. }
  23578. catch (error) {
  23579. console.log('error=' + error);
  23580. alert(error);
  23581. }
  23582. finally {
  23583. }
  23584. });
  23585. }
  23586. }
  23587. UISign$1.uiName = "UISign";
  23588. class UIModeSelection$1 extends UIBase {
  23589. constructor() {
  23590. super();
  23591. }
  23592. onConstructor() {
  23593. this.ui = ui_UIModeSelection.createInstance();
  23594. this.contentPane = this.ui;
  23595. this.isEject = false;
  23596. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23597. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23598. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23599. this.addUIClick(this.ui.closeBtn, this.hide);
  23600. this.peopleArr = [65, 990, 580];
  23601. this.peopleOffest = [5, 10, 10];
  23602. }
  23603. show(callback) {
  23604. this.updateSelf();
  23605. super.show();
  23606. this.ui.t0.play();
  23607. this.callback = callback;
  23608. this.setGlobalFont(this.ui);
  23609. }
  23610. updateSelf() {
  23611. let cfg = cfgTable.modeselectData;
  23612. for (let index = 1; index <= 3; index++) {
  23613. let node = this.ui.myNode["type" + index];
  23614. node.need.text = cfg[index].need;
  23615. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23616. node.peopleTxt.text = this.getRandPeople(index - 1);
  23617. }
  23618. }
  23619. enterGame(type) {
  23620. console.log('zh: 进入经典模式 type: ' + type);
  23621. xGame.common.classicRoomType = type;
  23622. let cfg = cfgTable.modeselectData[type];
  23623. let need = cfg.need;
  23624. xGame.common.passAwardCoin = cfg.award;
  23625. if (DataMgr.coinEnough(need)) {
  23626. DataMgr.setCoin(-need);
  23627. this.ui.myNode["type" + type].t0.play();
  23628. Laya.timer.once(200, this, () => {
  23629. this.callback && this.callback();
  23630. });
  23631. this.logEventForClassic_start();
  23632. }
  23633. else {
  23634. Moyu.sendDataEvent("AddCoinVideo");
  23635. xGame.uiMgr.Show(UIAddProp$1, 0);
  23636. }
  23637. }
  23638. getRandPeople(index) {
  23639. let rand = this.peopleOffest[index];
  23640. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23641. }
  23642. logEventForClassic_start() {
  23643. let rtype = xGame.common.classicRoomType;
  23644. let msmc = '';
  23645. if (rtype == 1) {
  23646. msmc = 'beginner';
  23647. }
  23648. if (rtype == 2) {
  23649. msmc = 'expert';
  23650. }
  23651. if (rtype == 3) {
  23652. msmc = 'master';
  23653. }
  23654. let keyStr = 'sjmd_classic_start_' + rtype;
  23655. let jsonStr = {
  23656. "difficulty": msmc,
  23657. "classic_count": 1,
  23658. "difficulty_count": 1
  23659. };
  23660. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23661. const d = LocalStorageManager.getItem(keyStr);
  23662. jsonStr.classic_count = d.classic_count + 1;
  23663. jsonStr.difficulty_count = d.difficulty_count + 1;
  23664. LocalStorageManager.setItem(keyStr, jsonStr);
  23665. }
  23666. else {
  23667. LocalStorageManager.setItem(keyStr, jsonStr);
  23668. }
  23669. const reqStr = JSON.stringify(jsonStr);
  23670. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23671. }
  23672. }
  23673. UIModeSelection$1.uiName = "UIModeSelection";
  23674. class UILogin$1 extends UIBase {
  23675. constructor() {
  23676. super();
  23677. this.fontStr = 'big-john-woff2-2';
  23678. try {
  23679. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  23680. console.log("zh: constructor加载arial字体成功");
  23681. }
  23682. catch (error) {
  23683. console.log("zh: constructor加载arial字体失败");
  23684. }
  23685. }
  23686. onFontLoaded() {
  23687. try {
  23688. Laya.Text.defaultFont = this.fontStr;
  23689. this.ui.txt_ua.font = this.fontStr;
  23690. this.ui.txt_up.font = this.fontStr;
  23691. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  23692. }
  23693. catch (error) {
  23694. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  23695. }
  23696. }
  23697. onConstructor() {
  23698. this.ui = ui_UILogin.createInstance();
  23699. this.contentPane = this.ui;
  23700. this.isEject = false;
  23701. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23702. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23703. this.addUIClick(this.ui.btn_login, this.userLogin);
  23704. }
  23705. show() {
  23706. super.show();
  23707. this.x = (Laya.stage.width - this.width) / 2;
  23708. this.y = (Laya.stage.height - this.height) / 2;
  23709. this.onFontLoaded();
  23710. }
  23711. closeSelf() {
  23712. this.hide();
  23713. }
  23714. userLogin() {
  23715. let ua = this.ui.txt_ua.text;
  23716. let up = this.ui.txt_up.text;
  23717. console.log('zh:ua font' + this.ui.txt_ua.font);
  23718. if (ua && up) {
  23719. let reqData = JSON.stringify({
  23720. username: ua.trim(),
  23721. password: up.trim(),
  23722. fromMark: 'app_game'
  23723. });
  23724. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23725. try {
  23726. console.log('zh:res = ' + JSON.stringify(res));
  23727. let code = res.code;
  23728. let msg = res.msg;
  23729. if (code == 200) {
  23730. let keyStr = keyForLoginInfo;
  23731. let jsonStr = {
  23732. "username": res.username,
  23733. "token": res.token,
  23734. "buySpids": { 1: false, 7: false }
  23735. };
  23736. LocalStorageManager.setItem(keyStr, jsonStr);
  23737. let myu = Moyu.getUserInfo();
  23738. console.log('zh:myu = ' + JSON.stringify(myu));
  23739. DataMgr.updateUserNickName(res.username);
  23740. Moyu.updateUserInfo(res.username);
  23741. xGame.uiMgr.Show(UIMsg$1, msg);
  23742. DataMgr.loadUserSpOrderForAd();
  23743. DataMgr.getUserZiChanInfo(false);
  23744. xGame.eventMgr.event(LOGIN_IN);
  23745. this.closeSelf();
  23746. }
  23747. else {
  23748. xGame.uiMgr.Show(UIMsg$1, msg);
  23749. }
  23750. }
  23751. catch (error) {
  23752. console.log('error=' + error);
  23753. alert(error);
  23754. }
  23755. finally {
  23756. }
  23757. });
  23758. }
  23759. else {
  23760. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23761. }
  23762. }
  23763. gotoRegPage() {
  23764. this.closeSelf();
  23765. xGame.uiMgr.Show(UIReg$1);
  23766. }
  23767. }
  23768. UILogin$1.uiName = "UILogin";
  23769. class UIReg$1 extends UIBase {
  23770. constructor() {
  23771. super();
  23772. this.fontStr = 'big-john-woff2-2';
  23773. try {
  23774. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  23775. console.log("zh: constructor加载arial字体成功");
  23776. }
  23777. catch (error) {
  23778. console.log("zh: constructor加载arial字体失败");
  23779. }
  23780. }
  23781. onFontLoaded() {
  23782. try {
  23783. Laya.Text.defaultFont = this.fontStr;
  23784. this.ui.txt_ua.font = this.fontStr;
  23785. this.ui.txt_up1.font = this.fontStr;
  23786. this.ui.txt_up2.font = this.fontStr;
  23787. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  23788. }
  23789. catch (error) {
  23790. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  23791. }
  23792. }
  23793. onConstructor() {
  23794. this.ui = ui_UIReg.createInstance();
  23795. this.contentPane = this.ui;
  23796. this.isEject = false;
  23797. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23798. this.addUIClick(this.ui.btn_reg, this.regUser);
  23799. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23800. }
  23801. show() {
  23802. super.show();
  23803. this.x = (Laya.stage.width - this.width) / 2;
  23804. this.y = (Laya.stage.height - this.height) / 2;
  23805. this.onFontLoaded();
  23806. }
  23807. closeSelf() {
  23808. this.hide();
  23809. }
  23810. regUser() {
  23811. this.ui.lab_tip.visible = false;
  23812. let ua = this.ui.txt_ua.text;
  23813. let up1 = this.ui.txt_up1.text;
  23814. let up2 = this.ui.txt_up2.text;
  23815. if (ua && up1 && up2 && up1 == up2) {
  23816. let reqData = JSON.stringify({
  23817. username: ua.trim(),
  23818. password: up1.trim(),
  23819. fromMark: 'app_game'
  23820. });
  23821. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23822. try {
  23823. console.log('zh:res = ' + JSON.stringify(res));
  23824. let code = res.code;
  23825. let msg = res.msg;
  23826. xGame.uiMgr.Show(UIMsg$1, msg);
  23827. if (code == 200) {
  23828. this.ui.lab_tip.color = "#FFFFFF";
  23829. xGame.uiMgr.Show(UIMsg$1, msg);
  23830. this.closeSelf();
  23831. }
  23832. else {
  23833. this.ui.lab_tip.color = "#FF0000";
  23834. xGame.uiMgr.Show(UIMsg$1, msg);
  23835. }
  23836. }
  23837. catch (error) {
  23838. console.log('error=' + error);
  23839. alert(error);
  23840. }
  23841. finally {
  23842. }
  23843. });
  23844. }
  23845. else {
  23846. if (up1 != up2) {
  23847. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23848. }
  23849. else {
  23850. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23851. }
  23852. }
  23853. }
  23854. gotoLogin() {
  23855. this.closeSelf();
  23856. xGame.uiMgr.Show(UILogin$1);
  23857. }
  23858. }
  23859. UIReg$1.uiName = "UIReg";
  23860. class UIFuli1$1 extends UIBase {
  23861. constructor() {
  23862. super();
  23863. this.jiage = 4.99;
  23864. }
  23865. onConstructor() {
  23866. this.ui = ui_UIFuli1.createInstance();
  23867. this.contentPane = this.ui;
  23868. this.isEject = false;
  23869. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23870. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23871. }
  23872. show() {
  23873. super.show();
  23874. this.x = (Laya.stage.width - this.width) / 2;
  23875. this.y = (Laya.stage.height - this.height) / 2;
  23876. this.ui.n2.txt_price.text = "$" + this.jiage;
  23877. this.ui.n2.n_zzq_fl1.url = 'res/fuli1.png';
  23878. this.setGlobalFont(this.ui);
  23879. }
  23880. closeSelf() {
  23881. DataMgr.loadUserSpOrderForAd();
  23882. this.hide();
  23883. }
  23884. gotoBuy() {
  23885. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23886. if (userInfo != null) {
  23887. let token = userInfo.token;
  23888. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  23889. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  23890. DataMgr.loadUserSpOrderForAd();
  23891. return;
  23892. }
  23893. else {
  23894. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23895. }
  23896. }
  23897. gotoBuy2() {
  23898. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23899. if (userInfo == null) {
  23900. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23901. return;
  23902. }
  23903. let reqData = xGame.httpMgr.getReqData();
  23904. let pd = JSON.parse(reqData);
  23905. pd.productId = 1;
  23906. reqData = JSON.stringify(pd);
  23907. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23908. try {
  23909. console.log('zh:buySp res = ' + JSON.stringify(res));
  23910. let code = res.code;
  23911. let msg = res.msg;
  23912. if (code == 401) {
  23913. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23914. alert(TIP_MSG_key.loginTimeOut);
  23915. xGame.uiMgr.Show(UIMsg$1, msg);
  23916. return;
  23917. }
  23918. if (code == 200) {
  23919. xGame.uiMgr.Show(UIMsg$1, msg);
  23920. DataMgr.loadUserSpOrderForAd();
  23921. DataMgr.getUserZiChanInfo(false);
  23922. this.closeSelf();
  23923. }
  23924. else {
  23925. xGame.uiMgr.Show(UIMsg$1, msg);
  23926. }
  23927. }
  23928. catch (error) {
  23929. console.log('error=' + error);
  23930. alert(error);
  23931. }
  23932. finally {
  23933. }
  23934. });
  23935. }
  23936. }
  23937. UIFuli1$1.uiName = "UIFuli1";
  23938. class UIFuli2$1 extends UIBase {
  23939. constructor() {
  23940. super();
  23941. this.jiage = 14.99;
  23942. }
  23943. onConstructor() {
  23944. this.ui = ui_UIFuli2.createInstance();
  23945. this.contentPane = this.ui;
  23946. this.isEject = false;
  23947. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23948. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23949. }
  23950. show() {
  23951. super.show();
  23952. this.x = (Laya.stage.width - this.width) / 2;
  23953. this.y = (Laya.stage.height - this.height) / 2;
  23954. this.ui.n2.txt_price.text = "$" + this.jiage;
  23955. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  23956. this.setGlobalFont(this.ui);
  23957. }
  23958. closeSelf() {
  23959. DataMgr.loadUserSpOrderForAd();
  23960. this.hide();
  23961. }
  23962. gotoBuy() {
  23963. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23964. if (userInfo != null) {
  23965. let token = userInfo.token;
  23966. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  23967. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  23968. DataMgr.loadUserSpOrderForAd();
  23969. return;
  23970. }
  23971. else {
  23972. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23973. }
  23974. }
  23975. gotoBuy1() {
  23976. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23977. if (userInfo == null) {
  23978. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23979. return;
  23980. }
  23981. let reqData = xGame.httpMgr.getReqData();
  23982. let pd = JSON.parse(reqData);
  23983. pd.productId = 2;
  23984. reqData = JSON.stringify(pd);
  23985. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23986. try {
  23987. console.log('zh:buySp res = ' + JSON.stringify(res));
  23988. let code = res.code;
  23989. let msg = res.msg;
  23990. if (code == 401) {
  23991. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23992. alert(TIP_MSG_key.loginTimeOut);
  23993. xGame.uiMgr.Show(UIMsg$1, msg);
  23994. return;
  23995. }
  23996. if (code == 200) {
  23997. xGame.uiMgr.Show(UIMsg$1, msg);
  23998. DataMgr.loadUserSpOrderForAd();
  23999. DataMgr.getUserZiChanInfo(false);
  24000. this.closeSelf();
  24001. }
  24002. else {
  24003. xGame.uiMgr.Show(UIMsg$1, msg);
  24004. }
  24005. }
  24006. catch (error) {
  24007. console.log('error=' + error);
  24008. alert(error);
  24009. }
  24010. finally {
  24011. }
  24012. });
  24013. }
  24014. }
  24015. UIFuli2$1.uiName = "UIFuli2";
  24016. class UITry$1 extends UIBase {
  24017. constructor() {
  24018. super();
  24019. this.closeTime = 0;
  24020. this.closeNum = 0;
  24021. this.skillUrl = xGame.common.skillIconList;
  24022. }
  24023. onConstructor() {
  24024. this.ui = ui_UITry.createInstance();
  24025. this.contentPane = this.ui;
  24026. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  24027. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  24028. }
  24029. show() {
  24030. super.show();
  24031. this.closeNum = 0;
  24032. this.closeTime = 15;
  24033. this.ui.t0.play();
  24034. PlatMgr.showRateBanner();
  24035. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24036. Laya.timer.loop(1000, this, this.updateTime);
  24037. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  24038. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  24039. xGame.common.gameMgr.gamePause = true;
  24040. this.setGlobalFont(this.ui);
  24041. }
  24042. updateTime() {
  24043. if (this.closeTime > 1) {
  24044. this.closeTime--;
  24045. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24046. }
  24047. else
  24048. this.hide();
  24049. }
  24050. hide() {
  24051. Laya.timer.clearAll(this);
  24052. Moyu.showBannerAd(false);
  24053. super.hide();
  24054. xGame.common.gameMgr.gamePause = false;
  24055. }
  24056. onTry() {
  24057. console.log('zh:qjff_AD_for_uitry');
  24058. if (Laya.Browser.onAndroid) {
  24059. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24060. if (!boo) {
  24061. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24062. return;
  24063. }
  24064. }
  24065. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  24066. }
  24067. else {
  24068. console.log('zh:AD 失败,直接发放奖励');
  24069. this.qjff_AD_for_uitry();
  24070. }
  24071. }
  24072. qjff_AD_for_uitry() {
  24073. let select = xGame.common.curPlayerSkillType;
  24074. DataMgr.gameData.trySkill = select;
  24075. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  24076. DataMgr.saveGameData();
  24077. DataMgr.setBigSkill(select, 1);
  24078. xGame.showTip("Trial Successful");
  24079. this.hide();
  24080. }
  24081. onCancel() {
  24082. if (this.closeNum > 0) {
  24083. this.closeNum--;
  24084. if (this.closeNum < 2)
  24085. this.hide();
  24086. return;
  24087. }
  24088. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  24089. this.onTry();
  24090. }
  24091. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  24092. this.closeNum = 3;
  24093. }
  24094. else
  24095. this.hide();
  24096. }
  24097. }
  24098. UITry$1.uiName = "UITry";
  24099. class UIGetAward$1 extends UIBase {
  24100. constructor() {
  24101. super();
  24102. this.showTriple = true;
  24103. }
  24104. onConstructor() {
  24105. this.ui = ui_UIGetAward.createInstance();
  24106. this.contentPane = this.ui;
  24107. this.isEject = false;
  24108. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  24109. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  24110. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  24111. }
  24112. show(arr, showTriple, callback) {
  24113. super.show();
  24114. this.ui.t0.play();
  24115. this.ui.eftNode.visible = true;
  24116. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  24117. this.ui.eftNode.visible = false;
  24118. }), 1, 0, 0, 0.9);
  24119. this.awardArr = arr;
  24120. this.showTriple = showTriple;
  24121. this.callback = callback;
  24122. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  24123. this.ui.myList.numItems = arr.length;
  24124. xGame.soundMgr.playSound("getaward");
  24125. this.setGlobalFont(this.ui);
  24126. }
  24127. updateSelf(index, obj) {
  24128. let temp = this.awardArr[index];
  24129. let icon = this.getIcon(temp.type);
  24130. let str = icon;
  24131. if (temp.type > 2) {
  24132. str = "s" + icon;
  24133. }
  24134. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  24135. obj.myIcon.rotation = 0;
  24136. obj.numTxt.text = temp.num + "";
  24137. obj.numTxt.visible = temp.type > 2 ? false : true;
  24138. obj.nameTxt.text = this.getNameStr(temp.type);
  24139. }
  24140. renderItem(index, obj) {
  24141. this.updateSelf(index, obj);
  24142. }
  24143. tripleGetAward() {
  24144. console.log('zh:qjff_AD_for_uigetAward');
  24145. if (Laya.Browser.onAndroid) {
  24146. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24147. if (!boo) {
  24148. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24149. return;
  24150. }
  24151. }
  24152. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  24153. }
  24154. else {
  24155. console.log('zh:AD 失败,直接发放奖励');
  24156. this.qjff_AD_for_uigetAward();
  24157. }
  24158. }
  24159. qjff_AD_for_uigetAward() {
  24160. this.getAward(3);
  24161. }
  24162. normalGetAward() {
  24163. if (PlatMgr.isMisVideo())
  24164. this.tripleGetAward();
  24165. else
  24166. this.getAward();
  24167. }
  24168. getAward(times = 1) {
  24169. this.hide();
  24170. for (let index = 0; index < this.awardArr.length; index++) {
  24171. this.awardArr[index].num *= times;
  24172. }
  24173. this.callback && this.callback(times != 1);
  24174. }
  24175. getIcon(type) {
  24176. switch (type) {
  24177. case Prop.diamond:
  24178. return "ty_zs";
  24179. case Prop.coin:
  24180. return "ty_jb";
  24181. case Prop.gan1:
  24182. return "qg1";
  24183. case Prop.gan2:
  24184. return "qg2";
  24185. case Prop.gan3:
  24186. return "qg3";
  24187. case Prop.gan4:
  24188. return "qg4";
  24189. default:
  24190. break;
  24191. }
  24192. }
  24193. getNameStr(type) {
  24194. switch (type) {
  24195. case Prop.diamond:
  24196. return "Diamond";
  24197. case Prop.coin:
  24198. return "Coins";
  24199. case Prop.gan1:
  24200. case Prop.gan2:
  24201. case Prop.gan3:
  24202. case Prop.gan4:
  24203. return cfgTable.ballrodData[type - 1].name;
  24204. default:
  24205. break;
  24206. }
  24207. }
  24208. }
  24209. UIGetAward$1.uiName = "UIGetAward";
  24210. class UIBox$1 extends UIBase {
  24211. constructor() {
  24212. super();
  24213. this.boxNum = 0;
  24214. this.boxMax = 10;
  24215. this.inAd = false;
  24216. this.isClose = false;
  24217. }
  24218. onConstructor() {
  24219. this.ui = ui_UIBox.createInstance();
  24220. this.contentPane = this.ui;
  24221. this.isEject = false;
  24222. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24223. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24224. Laya.timer.loop(1000, this, this.update);
  24225. }
  24226. update() {
  24227. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24228. this.boxNum -= 1;
  24229. this.upBar();
  24230. }
  24231. }
  24232. upBar() {
  24233. if (this.boxNum > this.boxMax)
  24234. this.boxNum = this.boxMax;
  24235. this.ui.bar.value = this.boxNum * 10;
  24236. }
  24237. show() {
  24238. super.show();
  24239. this.isClose = false;
  24240. this.boxNum = 0;
  24241. this.inAd = false;
  24242. this.upBar();
  24243. this.ui.t0.play();
  24244. this.ui.closeBtn.visible = false;
  24245. Laya.timer.once(3000, this, () => {
  24246. this.ui.closeBtn.visible = true;
  24247. this.ui.bar.alpha = 1;
  24248. });
  24249. Laya.timer.once(500, this, () => {
  24250. this.ui.t1.play();
  24251. });
  24252. this.setGlobalFont(this.ui);
  24253. }
  24254. hide() {
  24255. Laya.timer.clearAll(this);
  24256. Moyu.showBannerAd(false);
  24257. super.hide();
  24258. }
  24259. onOpenBox() {
  24260. this.boxNum++;
  24261. if (this.boxNum < this.boxMax) {
  24262. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24263. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24264. }
  24265. }
  24266. else if (this.boxNum == this.boxMax) {
  24267. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24268. this.ui.openBtn.c1.selectedIndex = 13;
  24269. this.inAd = true;
  24270. }
  24271. else
  24272. this.getAward();
  24273. }
  24274. else if (this.inAd) {
  24275. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24276. if (Laya.Browser.onAndroid) {
  24277. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24278. if (!boo) {
  24279. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24280. return;
  24281. }
  24282. }
  24283. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24284. }
  24285. else {
  24286. console.log('zh:AD 失败,直接发放奖励');
  24287. this.qjff_AD_for_UIBOX_onOpenBox();
  24288. }
  24289. }
  24290. this.upBar();
  24291. }
  24292. qjff_AD_for_UIBOX_onOpenBox() {
  24293. this.getAward();
  24294. }
  24295. onCloseBox() {
  24296. if (this.isClose)
  24297. this.hide();
  24298. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24299. this.isClose = true;
  24300. PlatMgr.showBanner(true, 0, 3000);
  24301. }
  24302. else
  24303. this.hide();
  24304. }
  24305. getAward() {
  24306. let str = "";
  24307. if (Math.random() < 0.5) {
  24308. let max = Moyu.isLegal ? 500 : 2500;
  24309. let num = xGame.tools.random(max, 500 + max);
  24310. DataMgr.setCoin(num);
  24311. str = "金币x" + num;
  24312. }
  24313. else {
  24314. let max = Moyu.isLegal ? 10 : 30;
  24315. let num = xGame.tools.random(max, 30 + max);
  24316. DataMgr.setDiamond(num);
  24317. str = "钻石x" + num;
  24318. }
  24319. xGame.showTip("恭喜获得-" + str);
  24320. this.hide();
  24321. }
  24322. }
  24323. UIBox$1.uiName = "UIBox";
  24324. class UIMain$1 extends UIBase {
  24325. constructor() {
  24326. super();
  24327. this.firstEnter = true;
  24328. }
  24329. nativeCallJs(msg) {
  24330. let t = msg;
  24331. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24332. switch (t) {
  24333. case 'qjff_chouJiang':
  24334. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24335. dui.qjff_chouJiang();
  24336. break;
  24337. case 'qjff_AD_for_uisign':
  24338. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24339. dui2.qjff_AD_for_uisign();
  24340. break;
  24341. case 'qjff_AD_for_uitry':
  24342. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24343. dui3.qjff_AD_for_uitry();
  24344. break;
  24345. case 'qjff_AD_for_uipower':
  24346. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24347. dui4.qjff_AD_for_uipower();
  24348. break;
  24349. case 'qjff_AD_for_uigetAward':
  24350. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24351. dui5.qjff_AD_for_uigetAward();
  24352. break;
  24353. case 'qjff_AD_for_uiGameEnd':
  24354. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24355. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24356. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24357. break;
  24358. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24359. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24360. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24361. break;
  24362. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24363. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24364. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24365. break;
  24366. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24367. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24368. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24369. break;
  24370. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24371. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24372. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24373. break;
  24374. case 'qjff_AD_for_UIBOX_onOpenBox':
  24375. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24376. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24377. break;
  24378. case 'qjff_AD_for_UIAddCoin':
  24379. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24380. dui12.qjff_AD_for_UIAddCoin();
  24381. break;
  24382. case 'app_sign_for_buyProduct_onSuccess':
  24383. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  24384. DataMgr.getUserZiChanInfo(false);
  24385. break;
  24386. case '222axxxxxx':
  24387. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24388. dui15.qjff_AD_for_uisign();
  24389. break;
  24390. case '333axsxxxxxx':
  24391. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24392. dui16.qjff_AD_for_uisign();
  24393. break;
  24394. default:
  24395. console.log('zh:未知的方法名字' + t);
  24396. break;
  24397. }
  24398. }
  24399. onConstructor() {
  24400. console.log('zh: UIMain onConstructor');
  24401. this.ui = ui_UIMain.createInstance();
  24402. this.contentPane = this.ui;
  24403. this.isEject = false;
  24404. this.addEvent();
  24405. this.addClickSpine();
  24406. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24407. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24408. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24409. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24410. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24411. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24412. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24413. let curUse = DataMgr.getCurSecretary();
  24414. this.changeSecretary(curUse);
  24415. this.ui.talkNode.visible = false;
  24416. let guide = DataMgr.getSkillGuide();
  24417. if (xGame.common.isNewDay && guide == 1) {
  24418. xGame.common.isNewDay = false;
  24419. xGame.soundMgr.playSound("s_main01");
  24420. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24421. console.log("zh:播放小秘书每天语音");
  24422. }
  24423. this.onGetUserInfo();
  24424. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24425. DataMgr.getUserZiChanInfo(false);
  24426. }
  24427. this.ui.n83.visible = false;
  24428. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24429. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24430. let ua = d.username;
  24431. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24432. }
  24433. this.c_btn_for_user();
  24434. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24435. }
  24436. Logout() {
  24437. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24438. LocalStorageManager.removeItem(keyForLoginInfo);
  24439. this.freshUser();
  24440. }
  24441. JSBridgeUtils.instance.loginOutForApp();
  24442. this.setUserDefaultNickname();
  24443. DataMgr.setCoin2(4000);
  24444. DataMgr.setDiamond2(0);
  24445. this.setDefaultQiuGanInfo();
  24446. DataMgr.setPlaceBallLevelList("");
  24447. DataMgr.setChallengeMode_overLev(1);
  24448. this.setDefaultSignData();
  24449. }
  24450. setDefaultSignData() {
  24451. DataMgr.setSignData(1);
  24452. DataMgr.setSignTime(new Date().getTime());
  24453. }
  24454. setDefaultQiuGanInfo() {
  24455. DataMgr.setBallRod(0, 1);
  24456. DataMgr.setBallRod(1, 0);
  24457. DataMgr.setBallRod(2, 0);
  24458. DataMgr.setBallRod(3, 0);
  24459. DataMgr.setBallRod(4, 0);
  24460. DataMgr.setBallRod(5, 1);
  24461. }
  24462. setUserDefaultNickname() {
  24463. let defUsername = "player";
  24464. this.ui.headNode.nameTxt.text = defUsername;
  24465. DataMgr.updateUserNickName(defUsername);
  24466. Moyu.updateUserInfo(defUsername);
  24467. }
  24468. gotoLogin() {
  24469. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  24470. xGame.uiMgr.Show(UILogin$1);
  24471. }
  24472. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  24473. this.Logout();
  24474. }
  24475. }
  24476. gotoRegUser() {
  24477. xGame.uiMgr.Show(UIReg$1);
  24478. }
  24479. showFuLiSp1() {
  24480. console.log('zh:福利1');
  24481. this.checkForShowFuLi17(1);
  24482. }
  24483. showFuLiSp7() {
  24484. console.log('zh:福利7');
  24485. this.checkForShowFuLi17(7);
  24486. }
  24487. checkForShowFuLi17(alert_spid) {
  24488. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24489. if (userInfo == null) {
  24490. if (alert_spid === 1) {
  24491. xGame.uiMgr.Show(UIFuli1$1);
  24492. }
  24493. if (alert_spid === 7) {
  24494. xGame.uiMgr.Show(UIFuli2$1);
  24495. }
  24496. return;
  24497. }
  24498. console.log('zh:是否需要展示福利 ' + alert_spid + ' 的弹窗');
  24499. let reqData = xGame.httpMgr.getReqData();
  24500. let pd = JSON.parse(reqData);
  24501. pd.productId = alert_spid;
  24502. reqData = JSON.stringify(pd);
  24503. xGame.httpMgr.sendPost2025('order/getOrderForBuyFuLiSpid17', reqData, (res) => {
  24504. try {
  24505. let code = res.code;
  24506. let msg = res.msg;
  24507. if (code == 401) {
  24508. Laya.LocalStorage.removeItem(keyForLoginInfo);
  24509. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24510. return;
  24511. }
  24512. if (code == 200) {
  24513. let data = res.data;
  24514. let buyOkSpid = [];
  24515. for (let i = 0; i < data.length; i++) {
  24516. let item = data[i];
  24517. let temp_spid = item.spid;
  24518. DataMgr.updateLocalUserDataForSpid17(temp_spid, true);
  24519. buyOkSpid.push(temp_spid);
  24520. }
  24521. let isBuyOk7 = buyOkSpid.indexOf(7) >= 0 ? true : false;
  24522. if (isBuyOk7) {
  24523. return;
  24524. }
  24525. let isBuyOk = buyOkSpid.indexOf(alert_spid) >= 0 ? true : false;
  24526. if (isBuyOk && alert_spid === 1) {
  24527. return;
  24528. }
  24529. else {
  24530. if (isBuyOk === false) {
  24531. if (alert_spid === 1) {
  24532. xGame.uiMgr.Show(UIFuli1$1);
  24533. }
  24534. if (alert_spid === 7) {
  24535. xGame.uiMgr.Show(UIFuli2$1);
  24536. }
  24537. }
  24538. else {
  24539. console.log('zh:已经购买了SPID=' + alert_spid + ',不需要再提示用户了');
  24540. }
  24541. }
  24542. }
  24543. else {
  24544. xGame.uiMgr.Show(UIMsg$1, msg);
  24545. }
  24546. }
  24547. catch (error) {
  24548. console.log('error=' + error);
  24549. alert(error);
  24550. }
  24551. finally {
  24552. }
  24553. });
  24554. }
  24555. c_btn_for_user() {
  24556. this.ui.n_dengLu.c1.selectedIndex = 0;
  24557. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24558. this.ui.n_dengLu.c1.selectedIndex = 1;
  24559. }
  24560. else {
  24561. this.ui.n_dengLu.c1.selectedIndex = 0;
  24562. }
  24563. }
  24564. changeSecretary(curUse) {
  24565. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24566. xGame.common.secretary && xGame.common.secretary.dispose();
  24567. this.addSecretarySpine(name);
  24568. }
  24569. addSecretarySpine(name) {
  24570. let spine = new SpineMgr(name, () => {
  24571. this.playSecretaryIdle();
  24572. });
  24573. xGame.common.secretary = spine;
  24574. }
  24575. addClickSpine() {
  24576. let clickSpine = new SpineMgr("dianji", () => {
  24577. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24578. let parent = Laya.stage;
  24579. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24580. clickSpine.play(data, 0, false, parent, (spine) => {
  24581. spine.destroy(true);
  24582. });
  24583. });
  24584. });
  24585. }
  24586. addEvent() {
  24587. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24588. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24589. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  24590. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24591. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24592. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24593. this.addUIClick(this.ui, this.interuptSecretary);
  24594. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24595. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24596. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24597. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24598. this.addUIClick(this.ui.signBtn, this.openSignView);
  24599. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24600. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24601. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24602. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24603. }
  24604. show(showFailWords) {
  24605. super.show();
  24606. DataMgr.loadUserSpOrderForAd();
  24607. this.moneyNode.ui.c1.selectedIndex = 1;
  24608. this.playSecretaryIdle();
  24609. xGame.soundMgr.playMusic("caromhall01", 0);
  24610. Laya.timer.clearAll(this);
  24611. this.playSecretaryRandomSound();
  24612. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24613. if (showFailWords) {
  24614. console.log('zh:uimain.ts ');
  24615. setTimeout(() => {
  24616. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24617. let words = -1;
  24618. if (str == "s_main02") {
  24619. words = 2;
  24620. }
  24621. else {
  24622. words = 3;
  24623. }
  24624. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24625. xGame.soundMgr.playSound(str);
  24626. }, 300);
  24627. }
  24628. this.showGuide();
  24629. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24630. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24631. let guide = DataMgr.getSkillGuide();
  24632. if (guide == 1) {
  24633. let randTime = xGame.common.randomNum(300, 800);
  24634. if (this.firstEnter) {
  24635. console.log("zh: firstEnter");
  24636. this.firstEnter = false;
  24637. randTime += 900;
  24638. }
  24639. else {
  24640. console.log("zh: no firstEnter");
  24641. }
  24642. Laya.timer.once(randTime, this, () => {
  24643. });
  24644. Laya.timer.once(1000, this, () => {
  24645. console.log('zh: 1秒后 showFuLiSp1');
  24646. this.showFuLiSp1();
  24647. });
  24648. Laya.timer.once(10000, this, () => {
  24649. console.log('zh: 10秒后 showFuLiSp1');
  24650. this.showFuLiSp7();
  24651. });
  24652. }
  24653. this.setGlobalFont(this.ui);
  24654. }
  24655. checkActive(show) {
  24656. }
  24657. showGuide() {
  24658. let guide = DataMgr.getSkillGuide();
  24659. this.ui.guideBtn.visible = guide == 0;
  24660. this.ui.enterGuide.visible = false;
  24661. this.ui.secretaryGuide.visible = guide == 0;
  24662. if (guide == 0) {
  24663. console.log("zh:显示引导");
  24664. xGame.soundMgr.playSound("s_guide");
  24665. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24666. }
  24667. else {
  24668. console.log("zh:不需要显示引导");
  24669. }
  24670. }
  24671. ensureSecretary() {
  24672. console.log('zh: ensureSecretary ');
  24673. this.ui.secretaryGuide.visible = false;
  24674. this.ui.enterGuide.visible = true;
  24675. this.ui.wordsNode.t0.play();
  24676. if (DataMgr.getNewUser())
  24677. Moyu.sendDataEvent("gameReady");
  24678. }
  24679. playSecretaryIdle() {
  24680. let parent = this.ui.secretary.displayObject;
  24681. parent.destroyChildren();
  24682. let xx = this.ui.secretary.width / 2;
  24683. let yy = this.ui.secretary.height;
  24684. let scale = xGame.common.getSecretaryScale();
  24685. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24686. xGame.common.secretary.play(data, 0, true, parent);
  24687. }
  24688. startGame(type) {
  24689. if (!this.isReadyForLoadNetSource()) {
  24690. return;
  24691. }
  24692. xGame.common.gameMode = type;
  24693. Moyu.sendDataEvent("PlayGame", { type: type });
  24694. let gm = xGame.common.gameMode;
  24695. console.log('zh:进入游戏gameMode =' + gm);
  24696. switch (gm) {
  24697. case GameMode.classic:
  24698. console.log('zh:进入经典模式111111111');
  24699. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24700. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24701. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  24702. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24703. console.log('zh:判断是否可以玩该模式classic =NO');
  24704. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24705. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24706. return;
  24707. }
  24708. else {
  24709. console.log('zh:可以玩该模式classic');
  24710. this.beginGame();
  24711. }
  24712. }
  24713. else {
  24714. console.log('zh:不需要判断是否可以玩该classic');
  24715. let challengeTimes = DataMgr.getChallengeTimes();
  24716. if (challengeTimes == 0) {
  24717. xGame.uiMgr.Show(UIInvitation$1);
  24718. }
  24719. else {
  24720. this.beginGame();
  24721. }
  24722. }
  24723. break;
  24724. case GameMode.bigMove:
  24725. console.info('zh:bigMove check 大招');
  24726. let guide = DataMgr.getSkillGuide();
  24727. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24728. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24729. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24730. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24731. console.log('zh:提示不可以玩');
  24732. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24733. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24734. return;
  24735. }
  24736. else {
  24737. console.log('zh:可以玩该模式 bigMove');
  24738. this.beginGame();
  24739. if (DataMgr.getNewUser())
  24740. Moyu.sendDataEvent("gameStart0");
  24741. }
  24742. }
  24743. else {
  24744. this.beginGame();
  24745. if (DataMgr.getNewUser())
  24746. Moyu.sendDataEvent("gameStart0");
  24747. }
  24748. break;
  24749. default:
  24750. console.error('zh:未知错误!!!!');
  24751. break;
  24752. }
  24753. }
  24754. beginGame(isNice = false) {
  24755. console.log('zh:beginGame ');
  24756. let guide = DataMgr.getSkillGuide();
  24757. if (guide == 1) {
  24758. console.log('zh:非新手引导,showInternAd ');
  24759. JSBridgeUtils.instance.showInternAd('beginGame');
  24760. }
  24761. else {
  24762. console.log('zh:新手引导,不显示AD ');
  24763. }
  24764. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  24765. console.log('zh:beginGame 1');
  24766. if (xGame.common.gameMode == GameMode.classic) {
  24767. console.log('zh:beginGame 2');
  24768. if (isNice) {
  24769. console.log('zh:进入巅峰赛');
  24770. this.enterClassic();
  24771. }
  24772. else {
  24773. console.log('zh:beginGame 3-1');
  24774. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24775. console.log('zh:beginGame 3-2');
  24776. this.enterClassic();
  24777. });
  24778. }
  24779. }
  24780. else if (xGame.common.gameMode == GameMode.bigMove) {
  24781. console.log('zh:beginGame 5');
  24782. this.ui.enterGuide.visible = false;
  24783. xGame.uiMgr.Show(UISkill$1);
  24784. }
  24785. }
  24786. enterClassic() {
  24787. console.log('zh:beginGame 7');
  24788. xGame.uiMgr.Show(UIGame$1);
  24789. xGame.uiMgr.Show(UIMatching$1, () => {
  24790. if (!this.isHide)
  24791. this.hide();
  24792. xGame.common.gameUI.ui.alpha = 1;
  24793. console.log('zh:beginGame 8');
  24794. xGame.common.gameUI.startGame();
  24795. xGame.uiMgr.Hide(UIGameEnd$1);
  24796. });
  24797. }
  24798. start_debug_for_moni_payOk() {
  24799. console.log('zh:start_debug_for_moni_payOk');
  24800. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24801. if (userInfo != null) {
  24802. let token = userInfo.token;
  24803. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24804. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  24805. alert('模拟支付OK');
  24806. return;
  24807. }
  24808. else {
  24809. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24810. }
  24811. }
  24812. startGlobal() {
  24813. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24814. }
  24815. startWeekly() {
  24816. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24817. }
  24818. zhouSaiMonth() {
  24819. console.log('zh: zhouSaiMonth 被调用');
  24820. }
  24821. isReadyForLoadNetSource() {
  24822. let reqCount = xGame.cfgMgr.httpReqCount;
  24823. let ok = xGame.cfgMgr.httpReqOkCount;
  24824. if (reqCount > ok) {
  24825. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24826. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24827. Laya.timer.once(5000, this, () => {
  24828. let retryCount = 0;
  24829. const maxRetries = 3;
  24830. const tryFetchConfig = () => {
  24831. try {
  24832. xGame.cfgMgr.getConfigFromServer();
  24833. }
  24834. catch (error) {
  24835. if (retryCount < maxRetries) {
  24836. retryCount++;
  24837. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24838. Laya.timer.once(5000, this, tryFetchConfig);
  24839. }
  24840. else {
  24841. console.error("❌ 达到最大重试次数,配置获取失败");
  24842. }
  24843. }
  24844. };
  24845. tryFetchConfig();
  24846. });
  24847. return false;
  24848. }
  24849. return true;
  24850. }
  24851. startPlaceBall() {
  24852. if (!this.isReadyForLoadNetSource()) {
  24853. return;
  24854. }
  24855. xGame.uiMgr.Show(UILevelDisplay$1);
  24856. }
  24857. hide() {
  24858. console.log('zh:uimain hide ...');
  24859. super.hide();
  24860. xGame.common.stopGirlPop(this.ui.talkNode);
  24861. }
  24862. onGetUserInfo(force = false) {
  24863. if (Moyu.isWx) {
  24864. let info = Moyu.getSystemInfo();
  24865. if (info)
  24866. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24867. }
  24868. else {
  24869. Moyu.initUser(this, this.freshUser, force);
  24870. }
  24871. this.freshUser();
  24872. console.log('zh:5秒后更新用户信息');
  24873. setTimeout(() => {
  24874. DataMgr.getUserZiChanInfo(true);
  24875. }, 5000);
  24876. }
  24877. event_login_in() {
  24878. console.log("zh:event_login_in被触发");
  24879. this.freshUser();
  24880. }
  24881. freshUser() {
  24882. let user = Moyu.getUserInfo();
  24883. if (!user.isAuth) {
  24884. user.headIcon = 'res/ty_touxiang.png';
  24885. }
  24886. else {
  24887. DataMgr.upRankData();
  24888. }
  24889. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24890. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24891. let keyStr = keyForLoginInfo;
  24892. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24893. const d = LocalStorageManager.getItem(keyStr);
  24894. let ua = d.username;
  24895. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24896. }
  24897. else {
  24898. }
  24899. this.c_btn_for_user();
  24900. }
  24901. interuptSecretary() {
  24902. Laya.timer.clearAll(this);
  24903. this.playSecretaryRandomSound();
  24904. }
  24905. playSecretaryRandomSound() {
  24906. if (this.isHide)
  24907. return;
  24908. let time = xGame.common.randomNum(45000, 60000);
  24909. Laya.timer.once(time, this, () => {
  24910. if (this.isHide)
  24911. return;
  24912. let index = xGame.common.randomNum(4, 7);
  24913. xGame.soundMgr.playSound("s_main0" + index);
  24914. let words = 1;
  24915. switch (index) {
  24916. case 4:
  24917. words = 5;
  24918. break;
  24919. case 5:
  24920. words = 3;
  24921. break;
  24922. case 6:
  24923. words = 6;
  24924. break;
  24925. case 7:
  24926. words = 7;
  24927. break;
  24928. default:
  24929. break;
  24930. }
  24931. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24932. this.playSecretaryRandomSound();
  24933. });
  24934. }
  24935. openSecretaryView() {
  24936. xGame.uiMgr.Show(UISecretary$1);
  24937. Moyu.sendDataEvent("secretary");
  24938. }
  24939. openShopView() {
  24940. xGame.uiMgr.Show(UIShop$1, 1);
  24941. }
  24942. openShopView0() {
  24943. xGame.uiMgr.Show(UIShop$1, 0);
  24944. }
  24945. openSignView() {
  24946. xGame.uiMgr.Show(UISign$1);
  24947. }
  24948. openDrawView() {
  24949. xGame.uiMgr.Show(UIDraw$1);
  24950. }
  24951. openRanking() {
  24952. console.log('zh:phb openRanking');
  24953. xGame.uiMgr.Show(UIRanking$1);
  24954. Moyu.sendDataEvent("rankingList");
  24955. }
  24956. }
  24957. UIMain$1.uiName = "UIMain";
  24958. function InitShader() {
  24959. }
  24960. function appInit() {
  24961. xGame.context.init(getLoadingResList(), initCallback);
  24962. }
  24963. function getLoadingResList() {
  24964. return [
  24965. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24966. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24967. ];
  24968. }
  24969. function getGameResList() {
  24970. return [
  24971. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24972. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24973. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24974. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24975. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24976. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24977. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24978. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24979. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24980. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24981. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24982. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24983. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24984. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24985. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24986. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24987. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24988. ];
  24989. }
  24990. function initCallback() {
  24991. window["DataMgr"] = DataMgr;
  24992. DataMgr.Init();
  24993. Moyu.init(getPlat(), this, () => {
  24994. DataMgr.isNewDay();
  24995. PlatMgr.initConfig();
  24996. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24997. }, true);
  24998. console.log('zh:开始sm init1 start');
  24999. xGame.soundMgr.init();
  25000. console.log('zh:开始sm init1 end');
  25001. xGame.uiMgr.init();
  25002. xGame.uiMgr.clearTempData();
  25003. xGame.uiMgr.bindFUI(fguiRes.loading);
  25004. xGame.uiMgr.Show(UILoading);
  25005. }
  25006. function onFontLoaded() {
  25007. try {
  25008. Laya.Text.defaultFont = "arial";
  25009. console.log("zh: onFontLoaded 设置arial字体成功");
  25010. }
  25011. catch (error) {
  25012. console.log("zh: constructor onFontLoaded加载arial字体失败");
  25013. }
  25014. }
  25015. function loadSubRes(callback) {
  25016. var tab = ["asset", "res", "spine"];
  25017. let subDone = 0;
  25018. for (var i = 0; i < tab.length; i++) {
  25019. let sub = tab[i];
  25020. Moyu.loadSubRes(sub, (pro) => {
  25021. callback && callback(pro, false);
  25022. }).then(() => {
  25023. subDone++;
  25024. if (subDone >= tab.length)
  25025. callback && callback(1, true);
  25026. });
  25027. }
  25028. }
  25029. function enterGame() {
  25030. xGame.cfgMgr.init();
  25031. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  25032. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  25033. xGame.uiMgr.Hide(UILoading);
  25034. fgui.UIPackage.removePackage(fguiRes.loading);
  25035. xGame.uiMgr.bindFUI(fguiRes.game);
  25036. xGame.uiMgr.Show(UIMain$1);
  25037. if (DataMgr.getNewUser())
  25038. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  25039. }
  25040. function getPlat() {
  25041. let cfg = new MoyuCfg();
  25042. cfg.plat = MoyuPlat.web;
  25043. cfg.myId = 180;
  25044. cfg.myKey = '8848a885774230a4';
  25045. cfg.version = 0;
  25046. if (window.hasOwnProperty("gamebox")) {
  25047. cfg.plat = MoyuPlat.f399;
  25048. cfg.version = 0;
  25049. }
  25050. else if (window.hasOwnProperty("ks")) {
  25051. cfg.plat = MoyuPlat.ks;
  25052. cfg.version = 0;
  25053. cfg.ads.ksVideoId = '2300002254_01';
  25054. cfg.ads.ksInsertId = '2300002254_02';
  25055. }
  25056. else if (Laya.Browser.onTTMiniGame) {
  25057. cfg.plat = MoyuPlat.tt;
  25058. cfg.version = 0;
  25059. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  25060. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  25061. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  25062. }
  25063. else if (Laya.Browser.onMiniGame) {
  25064. cfg.plat = MoyuPlat.wx;
  25065. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  25066. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  25067. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  25068. }
  25069. else if (Laya.Browser.onQQMiniGame) {
  25070. cfg.plat = MoyuPlat.qq;
  25071. }
  25072. else if (Laya.Browser.onQGMiniGame) {
  25073. cfg.plat = MoyuPlat.op;
  25074. cfg.ads.opVideoId = '455502';
  25075. cfg.ads.opBannerId = '455507';
  25076. }
  25077. else if (Laya.Browser.onVVMiniGame) {
  25078. cfg.plat = MoyuPlat.vv;
  25079. cfg.version = 0;
  25080. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  25081. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  25082. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  25083. }
  25084. else if (Laya.Browser.onHWMiniGame) {
  25085. cfg.plat = MoyuPlat.hw;
  25086. }
  25087. else if (window["mz"]) {
  25088. cfg.plat = MoyuPlat.mz;
  25089. }
  25090. else {
  25091. let cfg = window['conchConfig'];
  25092. if (cfg) {
  25093. var os = cfg.getOS();
  25094. if (os == "Conch-ios") {
  25095. cfg.plat = MoyuPlat.ios;
  25096. }
  25097. else if (os == "Conch-android") {
  25098. }
  25099. }
  25100. }
  25101. return cfg;
  25102. }
  25103. class Main {
  25104. constructor() {
  25105. if (window["Laya3D"])
  25106. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  25107. else {
  25108. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  25109. this.initMain();
  25110. }
  25111. }
  25112. initMain() {
  25113. Laya["Physics"] && Laya["Physics"].enable();
  25114. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  25115. Laya.stage.scaleMode = GameConfig.scaleMode;
  25116. Laya.stage.screenMode = GameConfig.screenMode;
  25117. Laya.stage.alignV = GameConfig.alignV;
  25118. Laya.stage.alignH = GameConfig.alignH;
  25119. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  25120. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  25121. Laya.enableDebugPanel();
  25122. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  25123. Laya["PhysicsDebugDraw"].enable();
  25124. if (GameConfig.stat)
  25125. Laya.Stat.show();
  25126. Laya.alertGlobalError(true);
  25127. this.loadFont();
  25128. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  25129. }
  25130. loadFont() {
  25131. try {
  25132. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoaded));
  25133. console.log("zh: constructor加载arial字体成功1");
  25134. }
  25135. catch (error) {
  25136. console.log("zh: constructor加载arial字体失败1");
  25137. }
  25138. }
  25139. onFontLoaded() {
  25140. try {
  25141. Laya.Text.defaultFont = "Arial";
  25142. console.log("zh: onFontLoaded 设置arial字体成功1");
  25143. }
  25144. catch (error) {
  25145. console.log("zh: constructor onFontLoaded加载arial字体失败1");
  25146. }
  25147. }
  25148. onVersionLoaded() {
  25149. appInit();
  25150. }
  25151. }
  25152. new Main();
  25153. }());
  25154. //# sourceMappingURL=bundle.js.map