bundle.js 948 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755
  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 keyForLoginInfo = "userInfo";
  52. let TIP_MSG_key = {
  53. loginTimeOut: "Login timed out, please log in again.",
  54. pleaseLoginIn: "Please log in."
  55. };
  56. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  57. let poolKey = {
  58. inHoleEft: "inHoleEft",
  59. d3ball: "d3ball",
  60. iceEft: "iceEft",
  61. hitEft: "hitEft",
  62. fireworksEft: "fireworksEft",
  63. };
  64. var GameMode;
  65. (function (GameMode) {
  66. GameMode[GameMode["classic"] = 0] = "classic";
  67. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  68. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  69. })(GameMode || (GameMode = {}));
  70. var SkillType;
  71. (function (SkillType) {
  72. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  73. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  74. SkillType[SkillType["ice"] = 2] = "ice";
  75. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  76. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  77. })(SkillType || (SkillType = {}));
  78. var ClassicWordsType;
  79. (function (ClassicWordsType) {
  80. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  81. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  82. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  83. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  84. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  85. })(ClassicWordsType || (ClassicWordsType = {}));
  86. var PressType;
  87. (function (PressType) {
  88. PressType[PressType["powerNode"] = 0] = "powerNode";
  89. PressType[PressType["d2Root"] = 1] = "d2Root";
  90. PressType[PressType["moveNode"] = 2] = "moveNode";
  91. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  92. })(PressType || (PressType = {}));
  93. var PlaceBallType;
  94. (function (PlaceBallType) {
  95. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  96. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  97. })(PlaceBallType || (PlaceBallType = {}));
  98. var EAdType;
  99. (function (EAdType) {
  100. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  101. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  102. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  103. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  104. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  105. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  106. EAdType[EAdType["sign"] = 6] = "sign";
  107. EAdType[EAdType["draw"] = 7] = "draw";
  108. EAdType[EAdType["triple"] = 8] = "triple";
  109. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  110. EAdType[EAdType["getPower"] = 10] = "getPower";
  111. EAdType[EAdType["box"] = 11] = "box";
  112. EAdType[EAdType["try"] = 12] = "try";
  113. EAdType[EAdType["againSign"] = 13] = "againSign";
  114. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  115. })(EAdType || (EAdType = {}));
  116. var Prop;
  117. (function (Prop) {
  118. Prop[Prop["diamond"] = 1] = "diamond";
  119. Prop[Prop["coin"] = 2] = "coin";
  120. Prop[Prop["gan1"] = 3] = "gan1";
  121. Prop[Prop["gan2"] = 4] = "gan2";
  122. Prop[Prop["gan3"] = 5] = "gan3";
  123. Prop[Prop["gan4"] = 6] = "gan4";
  124. })(Prop || (Prop = {}));
  125. var TipsType;
  126. (function (TipsType) {
  127. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  128. TipsType[TipsType["foul"] = 1] = "foul";
  129. })(TipsType || (TipsType = {}));
  130. class AwardType {
  131. constructor(type, num) {
  132. this.type = type;
  133. this.num = num;
  134. }
  135. }
  136. var define = /*#__PURE__*/Object.freeze({
  137. fguiRes: fguiRes,
  138. ballCamp: ballCamp,
  139. FoulType: FoulType,
  140. ALL_BALL_STOP: ALL_BALL_STOP,
  141. WAIT_SHOOT: WAIT_SHOOT,
  142. D3RES_LOADED: D3RES_LOADED,
  143. BALL_SHOOT: BALL_SHOOT,
  144. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  145. RESET_GAME: RESET_GAME,
  146. COIN_CHANGE: COIN_CHANGE,
  147. DIAMOND_CHANGE: DIAMOND_CHANGE,
  148. RESTART_GAME: RESTART_GAME,
  149. GET_USER_INFO: GET_USER_INFO,
  150. CHANGE_SECRETARY: CHANGE_SECRETARY,
  151. POWER_CHANGE: POWER_CHANGE,
  152. POWER_TIME: POWER_TIME,
  153. keyForLoginInfo: keyForLoginInfo,
  154. TIP_MSG_key: TIP_MSG_key,
  155. baseHeadUrl: baseHeadUrl,
  156. poolKey: poolKey,
  157. get GameMode () { return GameMode; },
  158. get SkillType () { return SkillType; },
  159. get ClassicWordsType () { return ClassicWordsType; },
  160. get PressType () { return PressType; },
  161. get PlaceBallType () { return PlaceBallType; },
  162. get EAdType () { return EAdType; },
  163. get Prop () { return Prop; },
  164. get TipsType () { return TipsType; },
  165. AwardType: AwardType
  166. });
  167. class CContext {
  168. constructor() {
  169. this.winSize = { width: 0, height: 0 };
  170. this.notchHeight = 0;
  171. this.bannerHeight = 0;
  172. }
  173. init(resList, callback) {
  174. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  175. this.notchHeight = this.getNotchHeight();
  176. this.bannerHeight = this.getBannerHeight();
  177. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  178. callback && callback();
  179. }));
  180. }
  181. getNotchHeight() {
  182. let notchHeight = 50;
  183. if (Laya.Browser.onMiniGame) {
  184. let deviceInfo = wx.getSystemInfoSync();
  185. if (Laya.Browser.onIOS) {
  186. if (deviceInfo.model.search('iPhone X') != -1) {
  187. notchHeight = deviceInfo.statusBarHeight - 10;
  188. }
  189. else {
  190. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  191. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  192. notchHeight = deviceInfo.statusBarHeight - 10;
  193. }
  194. }
  195. }
  196. else if (Laya.Browser.onAndroid) {
  197. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  198. notchHeight = deviceInfo.statusBarHeight;
  199. }
  200. }
  201. }
  202. return notchHeight;
  203. }
  204. getBannerHeight() {
  205. return 0;
  206. }
  207. }
  208. let context = new CContext();
  209. var Handler = Laya.Handler;
  210. var Tween = Laya.Tween;
  211. function playClickEffect(btn) {
  212. if (!btn)
  213. return;
  214. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  215. if (!btn)
  216. return;
  217. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  218. if (!btn)
  219. return;
  220. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  221. }), 0, true);
  222. }), 0, true);
  223. }
  224. function getNumList(strList) {
  225. let dataList = [];
  226. if (strList) {
  227. let list = strList;
  228. let array = list.split(',');
  229. for (var v in array) {
  230. dataList.push(Number(array[v]));
  231. }
  232. }
  233. return dataList;
  234. }
  235. function getStrList(strList) {
  236. let dataList = [];
  237. if (strList) {
  238. let list = strList;
  239. let array = list.split('|');
  240. for (var v in array) {
  241. dataList.push(String(array[v]));
  242. }
  243. }
  244. return dataList;
  245. }
  246. function getRandStr(len) {
  247. 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'];
  248. let str = "";
  249. for (let i = 0; i < len; i++) {
  250. let rand = random(0, list.length);
  251. str += list[rand];
  252. }
  253. return str;
  254. }
  255. function getUserId() {
  256. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  257. return str;
  258. }
  259. function formatPos(pos, len = 2) {
  260. let v = Math.pow(10, len);
  261. pos.x = Math.floor(pos.x * v) / v;
  262. pos.y = Math.floor(pos.y * v) / v;
  263. if (pos.z)
  264. pos.z = Math.floor(pos.z * v) / v;
  265. return pos;
  266. }
  267. function setPosInt(pos) {
  268. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  269. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  270. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  271. return pos;
  272. }
  273. function random(min, max) {
  274. var rang = max - min;
  275. var rand = Math.random() * rang;
  276. return Math.floor(rand) + min;
  277. }
  278. function randomList(list, num) {
  279. if (list.length <= num)
  280. return list;
  281. let arry = [];
  282. list.forEach(item => {
  283. arry.push(item);
  284. });
  285. let nums = [];
  286. for (let i = 0; i < num; i++) {
  287. let rand = random(0, arry.length);
  288. let v = arry[rand];
  289. nums.push(v);
  290. arry.splice(rand, 1);
  291. }
  292. return nums;
  293. }
  294. function worldToScreen(camera, point, pos) {
  295. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  296. pos.x = pos.x / Laya.stage.clientScaleX;
  297. pos.y = pos.y / Laya.stage.clientScaleY;
  298. }
  299. function getStringLenght(str) {
  300. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. }
  302. function reviseString(str, len) {
  303. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  304. if (ld > len) {
  305. let sl = Math.floor(len / 2);
  306. let rs = str.substring(0, sl);
  307. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  308. while (d + 2 < len) {
  309. sl++;
  310. rs = str.substring(0, sl);
  311. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  312. }
  313. return rs + "...";
  314. }
  315. return str;
  316. }
  317. function getCoinString(coin) {
  318. if (coin < 10000)
  319. return coin.toString();
  320. else if (coin < 1000000) {
  321. let vh = Math.ceil(coin / 100);
  322. return (vh / 10) + "k";
  323. }
  324. else if (coin < 1000000000) {
  325. var vh = Math.ceil(coin / 100000);
  326. return (vh / 10) + "m";
  327. }
  328. else if (coin < 1000000000000) {
  329. var vh = Math.ceil(coin / 100000000);
  330. return (vh / 10) + "b";
  331. }
  332. else if (coin < 1000000000000000) {
  333. var vh = Math.ceil(coin / 100000000000);
  334. return (vh / 10) + "t";
  335. }
  336. }
  337. function getV3Dest(pos, dir, dis, dest) {
  338. dir.x *= dis;
  339. dir.y *= dis;
  340. dir.z *= dis;
  341. Laya.Vector3.add(pos, dir, dest);
  342. return dest;
  343. }
  344. function getV2Dest(x1, y1, dir, dis, dest) {
  345. dest.x = x1 + dir.x * dis;
  346. dest.y = y1 + dir.y * dis;
  347. return dest;
  348. }
  349. function getV2Dir(x1, y1, x2, y2, dir) {
  350. dir.x = x2 - x1;
  351. dir.y = y2 - y1;
  352. Laya.Vector2.normalize(dir, dir);
  353. return dir;
  354. }
  355. function getV3Dir(p1, p2, dir) {
  356. Laya.Vector3.subtract(p1, p2, dir);
  357. Laya.Vector3.normalize(dir, dir);
  358. return dir;
  359. }
  360. function copyPos(ip, op) {
  361. op.x = ip.x;
  362. op.y = ip.y;
  363. if (ip.z)
  364. op.z = ip.z;
  365. return op;
  366. }
  367. function getScreenImg() {
  368. let gl = Laya.WebGLContext.mainContext;
  369. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  370. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  371. let w = gl.drawingBufferWidth;
  372. let h = gl.drawingBufferHeight;
  373. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  374. texture2d.setPixels(pixels);
  375. return new Laya.Texture(texture2d);
  376. }
  377. function playMoveByPositions(sp, positions, v, completeCallback) {
  378. let p;
  379. let play = () => {
  380. if (positions.length == 0) {
  381. completeCallback();
  382. return;
  383. }
  384. p = positions[0];
  385. positions.splice(0, 1);
  386. 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, () => {
  387. play();
  388. }));
  389. };
  390. play();
  391. }
  392. function setStarPos(node, num, max) {
  393. for (let i = 1; i <= 5; i++) {
  394. let img = node.getChildAt(i - 1);
  395. img.width = img.height = 30;
  396. img.pivotX = img.pivotY = 0.5;
  397. img.gray = i > num;
  398. img.visible = i <= max;
  399. if (max == 3) {
  400. img.x = node.width / 2 + (i - 2) * 30 - 15;
  401. img.y = node.height - 40;
  402. if (i == 2)
  403. img.y = node.height - 30;
  404. }
  405. else if (max == 5) {
  406. let ly = Math.abs(i - 3);
  407. img.x = node.width / 2 + (i - 3) * 20 - 15;
  408. img.y = node.height - ly * 8 - 30;
  409. }
  410. }
  411. }
  412. function playLoopAnimRotate(sp, time, clockwise = true) {
  413. let rotation;
  414. sp.rotation = sp.rotation % 360;
  415. if (clockwise) {
  416. rotation = -360;
  417. }
  418. else {
  419. rotation = 360;
  420. }
  421. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  422. this.playLoopAnimRotate(sp, time, clockwise);
  423. }));
  424. }
  425. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  426. let x, y;
  427. if (isBig) {
  428. x = valueXMin;
  429. y = valueYMin;
  430. }
  431. else {
  432. x = valueXMax;
  433. y = valueYMax;
  434. }
  435. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  436. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  437. }));
  438. }
  439. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  440. let scale;
  441. if (isBig) {
  442. scale = valueMin;
  443. }
  444. else {
  445. scale = valueMax;
  446. }
  447. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  448. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  449. }));
  450. }
  451. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  452. let value;
  453. if (isBig) {
  454. value = valueMin;
  455. }
  456. else {
  457. value = valueMax;
  458. }
  459. if (count) {
  460. count--;
  461. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  462. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  463. }));
  464. }
  465. else {
  466. sp.rotation = 0;
  467. }
  468. }
  469. function inRect(rect, p) {
  470. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  471. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  472. return true;
  473. }
  474. }
  475. return false;
  476. }
  477. function getNumberK(number) {
  478. if (number < 1000) {
  479. return number.toString();
  480. }
  481. else {
  482. return (number / 1000).toFixed(1) + "k";
  483. }
  484. }
  485. function pointInsideCircle(point, circle, r) {
  486. if (r === 0)
  487. return false;
  488. var dx = circle.x - point.x;
  489. var dy = circle.y - point.y;
  490. return dx * dx + dy * dy <= r * r;
  491. }
  492. function formatString(str, data) {
  493. if (!str || data == undefined) {
  494. return str;
  495. }
  496. if (typeof data === "object") {
  497. for (var key in data) {
  498. if (data.hasOwnProperty(key)) {
  499. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  500. }
  501. }
  502. }
  503. else {
  504. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  505. return str.replace(reg, function (match, index) {
  506. return args[index - (-1)];
  507. });
  508. }
  509. return str;
  510. }
  511. function getIntersection(a, b) {
  512. let t = [];
  513. for (var i = 0; i < a.length; i++) {
  514. for (var j = 0; j < b.length; j++) {
  515. if (a[i] == b[j]) {
  516. t.push(a[i]);
  517. }
  518. }
  519. }
  520. return t;
  521. }
  522. function getComplement(a, b) {
  523. let t = [];
  524. let count = false;
  525. for (var i = 0; i < a.length; i++) {
  526. count = false;
  527. for (var j = 0; j < b.length; j++) {
  528. if (a[i] == b[j]) {
  529. count = true;
  530. break;
  531. }
  532. }
  533. if (!count) {
  534. t.push(a[i]);
  535. }
  536. }
  537. return t;
  538. }
  539. function geSpriteStageRect(sp) {
  540. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  541. let rect = {
  542. x: point.x,
  543. y: point.y,
  544. width: sp.width * sp.globalScaleX,
  545. height: sp.height * sp.globalScaleY
  546. };
  547. return rect;
  548. }
  549. function touchButton(button) {
  550. let event = new Laya.Event();
  551. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  552. }
  553. function setColor(sprite, r, g, b) {
  554. var redMat = [
  555. r / 255, 0, 0, 0, 0,
  556. g / 255, 0, 0, 0, 0,
  557. b / 255, 0, 0, 0, 0,
  558. 0, 0, 0, 1, 0,
  559. ];
  560. var filter = new Laya.ColorFilter(redMat);
  561. sprite.filters = [filter];
  562. }
  563. function clone(obj, newobj = {}) {
  564. for (var attr in obj) {
  565. if (typeof obj[attr] == "object") {
  566. newobj[attr] = clone(obj[attr], newobj[attr]);
  567. }
  568. else {
  569. newobj[attr] = obj[attr];
  570. }
  571. }
  572. return newobj;
  573. }
  574. function _ms(arr, compare, begin, end) {
  575. const size = end - begin;
  576. if (size <= 1) {
  577. return;
  578. }
  579. const middle = (end + begin) >> 1;
  580. _ms(arr, compare, begin, middle);
  581. _ms(arr, compare, middle, end);
  582. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  583. return;
  584. }
  585. const merged = [];
  586. let leftIndex = begin, rightIndex = middle;
  587. while (merged.length < size) {
  588. if (leftIndex === middle) {
  589. merged.push(arr[rightIndex++]);
  590. }
  591. else if (rightIndex === end) {
  592. merged.push(arr[leftIndex++]);
  593. }
  594. else {
  595. const c = compare(arr[leftIndex], arr[rightIndex]);
  596. if (c <= 0) {
  597. merged.push(arr[leftIndex++]);
  598. }
  599. else {
  600. merged.push(arr[rightIndex++]);
  601. }
  602. }
  603. }
  604. arr.splice(begin, size, ...merged);
  605. }
  606. function sort(arr, compare) {
  607. if (!Array.isArray(arr)) {
  608. throw new Error('sort的参数必须为数组');
  609. }
  610. _ms(arr, compare, 0, arr.length);
  611. return arr;
  612. }
  613. function getLanguage(id) {
  614. }
  615. function getLanguageByTip(id) {
  616. }
  617. function toWeights(array) {
  618. let max = 0;
  619. for (var i = 0; i < array.length; i++) {
  620. max = max + array[i];
  621. if (array[i] == 0) {
  622. array[i] = 0;
  623. }
  624. else {
  625. array[i] = max;
  626. }
  627. }
  628. return array;
  629. }
  630. function unique(array) {
  631. var n = {}, r = [], len = array.length, val, type;
  632. for (var i = 0; i < array.length; i++) {
  633. val = array[i];
  634. type = typeof val;
  635. if (!n[val]) {
  636. n[val] = [type];
  637. r.push(val);
  638. }
  639. else if (n[val].indexOf(type) < 0) {
  640. n[val].push(type);
  641. r.push(val);
  642. }
  643. }
  644. return r;
  645. }
  646. function unique1(array) {
  647. var r = [];
  648. for (var i = 0, l = array.length; i < l; i++) {
  649. for (var j = i + 1; j < l; j++)
  650. if (array[i] == array[j])
  651. j == ++i;
  652. r.push(array[i]);
  653. }
  654. return r;
  655. }
  656. function getDistance(x1, y1, x2, y2) {
  657. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  658. }
  659. function getV2Dis(pos1, pos2) {
  660. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  661. }
  662. function getV2SqDis(pos1, pos2) {
  663. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  664. }
  665. function getDis(x1, y1, x2, y2) {
  666. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  667. }
  668. function getDeltaxy(x1, y1, x2, y2) {
  669. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  670. }
  671. function getSymbolNumber(num) {
  672. if (num > 0) {
  673. return "+" + num;
  674. }
  675. else if (num < 0) {
  676. return num.toString();
  677. }
  678. return num.toString();
  679. }
  680. function fixNumber(num, length) {
  681. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  682. }
  683. function toThousands(num) {
  684. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  685. }
  686. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  687. function fmtMoney(money) {
  688. money = toThousands(money.replace(/^0+/, ''));
  689. if (money.length == 0) {
  690. money = "0";
  691. }
  692. let unit = 0;
  693. for (var i = 0; i < money.length; i++) {
  694. if (money.charAt(i) == ",") {
  695. unit++;
  696. }
  697. }
  698. if (unit == 0) {
  699. return money;
  700. }
  701. else {
  702. let idx = money.indexOf(",");
  703. if (idx) {
  704. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  705. }
  706. return money.replace(",", ".");
  707. }
  708. }
  709. function flatten(arr) {
  710. while (arr.some(item => Array.isArray(item))) {
  711. arr = [].concat(...arr);
  712. }
  713. return arr;
  714. }
  715. function getDistanceByPoint(p1, p2) {
  716. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  717. }
  718. function getAngleByPoint(p1, p2) {
  719. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  720. }
  721. function toIntByArray(array) {
  722. for (var index = 0; index < array.length; index++) {
  723. array[index] = parseInt(array[index]);
  724. }
  725. return array;
  726. }
  727. function getAngle0To360(angle) {
  728. while (angle < 0) {
  729. angle += 360;
  730. }
  731. while (angle >= 360) {
  732. angle -= 360;
  733. }
  734. return angle;
  735. }
  736. function toAngle(radian) {
  737. return radian * 180 / Math.PI;
  738. }
  739. function toRadian(angle) {
  740. return angle * Math.PI / 180;
  741. }
  742. function getArrayValueRandom(array) {
  743. return array[random(0, array.length - 1)];
  744. }
  745. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  746. }
  747. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  748. }
  749. function fmtTimeMMSS(time) {
  750. if (time < 0) {
  751. time = 0;
  752. }
  753. else
  754. time = Math.floor(time);
  755. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  756. }
  757. function fmtTimeMS(time) {
  758. if (time < 0) {
  759. time = 0;
  760. }
  761. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  762. }
  763. function fmtTimeHHMM(time) {
  764. if (time < 0) {
  765. time = 0;
  766. }
  767. time = Math.floor(time / 1000);
  768. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  769. }
  770. let severTime = 0;
  771. function getServerTime() {
  772. return new Date(new Date().getTime() - severTime);
  773. }
  774. function setServerTime(data) {
  775. severTime = (new Date().getTime() - data);
  776. }
  777. var tools = /*#__PURE__*/Object.freeze({
  778. playClickEffect: playClickEffect,
  779. getNumList: getNumList,
  780. getStrList: getStrList,
  781. getRandStr: getRandStr,
  782. getUserId: getUserId,
  783. formatPos: formatPos,
  784. setPosInt: setPosInt,
  785. random: random,
  786. randomList: randomList,
  787. worldToScreen: worldToScreen,
  788. getStringLenght: getStringLenght,
  789. reviseString: reviseString,
  790. getCoinString: getCoinString,
  791. getV3Dest: getV3Dest,
  792. getV2Dest: getV2Dest,
  793. getV2Dir: getV2Dir,
  794. getV3Dir: getV3Dir,
  795. copyPos: copyPos,
  796. getScreenImg: getScreenImg,
  797. playMoveByPositions: playMoveByPositions,
  798. setStarPos: setStarPos,
  799. playLoopAnimRotate: playLoopAnimRotate,
  800. playLoopAnimPosition: playLoopAnimPosition,
  801. playLoopAnimScale: playLoopAnimScale,
  802. playLoopAnimRotation: playLoopAnimRotation,
  803. inRect: inRect,
  804. getNumberK: getNumberK,
  805. pointInsideCircle: pointInsideCircle,
  806. formatString: formatString,
  807. getIntersection: getIntersection,
  808. getComplement: getComplement,
  809. geSpriteStageRect: geSpriteStageRect,
  810. touchButton: touchButton,
  811. setColor: setColor,
  812. clone: clone,
  813. sort: sort,
  814. getLanguage: getLanguage,
  815. getLanguageByTip: getLanguageByTip,
  816. toWeights: toWeights,
  817. unique: unique,
  818. unique1: unique1,
  819. getDistance: getDistance,
  820. getV2Dis: getV2Dis,
  821. getV2SqDis: getV2SqDis,
  822. getDis: getDis,
  823. getDeltaxy: getDeltaxy,
  824. getSymbolNumber: getSymbolNumber,
  825. fixNumber: fixNumber,
  826. toThousands: toThousands,
  827. fmtMoney: fmtMoney,
  828. flatten: flatten,
  829. getDistanceByPoint: getDistanceByPoint,
  830. getAngleByPoint: getAngleByPoint,
  831. toIntByArray: toIntByArray,
  832. getAngle0To360: getAngle0To360,
  833. toAngle: toAngle,
  834. toRadian: toRadian,
  835. getArrayValueRandom: getArrayValueRandom,
  836. promptByTip: promptByTip,
  837. promptByErrorCode: promptByErrorCode,
  838. fmtTimeMMSS: fmtTimeMMSS,
  839. fmtTimeMS: fmtTimeMS,
  840. fmtTimeHHMM: fmtTimeHHMM,
  841. getServerTime: getServerTime,
  842. setServerTime: setServerTime
  843. });
  844. class HttpMgr {
  845. constructor() {
  846. this.isDev = true;
  847. HttpMgr._instance = this;
  848. }
  849. static getInstance() {
  850. if (!this._instance) {
  851. this._instance = new HttpMgr();
  852. }
  853. return this._instance;
  854. }
  855. sendPost(url, data, call) {
  856. let httpObj = new Laya.HttpRequest();
  857. httpObj.http.timeout = 5000;
  858. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  859. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  860. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  861. function errorHandler(error) {
  862. console.log("errorHandler:" + error);
  863. alert("Please check your network connection.");
  864. }
  865. function completeHandler(data) {
  866. if (data && data.length > 0) {
  867. let jsonData = JSON.parse(data);
  868. if (call)
  869. call(jsonData);
  870. }
  871. }
  872. }
  873. getReqData() {
  874. let reqData = JSON.stringify({
  875. gameName: "TQ",
  876. gameUserName: "zhangSan",
  877. isDev: this.isDev
  878. });
  879. return reqData;
  880. }
  881. sendPost2025(reqUrl, data, call) {
  882. let isDev = this.isDev;
  883. let urlTop = "https://api.kessongame.site/";
  884. let urlMid = urlTop + "prod-api/api/";
  885. if (isDev) {
  886. urlTop = "http://192.168.1.13:8090/";
  887. urlMid = urlTop + "api/";
  888. }
  889. let url = urlMid + reqUrl;
  890. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  891. if (isDev) {
  892. url = urlTop + reqUrl;
  893. }
  894. else {
  895. url = urlTop + "prod-api/" + reqUrl;
  896. }
  897. }
  898. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  899. if (reqUrl.indexOf("/api/game/") >= 0) {
  900. }
  901. const keyForLoginInfo = "userInfo";
  902. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  903. if (userInfoData != null) {
  904. try {
  905. let bb = JSON.parse(userInfoData);
  906. if (bb) {
  907. let token = bb.token;
  908. headers.push("Authorization");
  909. headers.push(`Bearer ${token}`);
  910. }
  911. }
  912. catch (e) {
  913. }
  914. }
  915. let httpObj = new Laya.HttpRequest();
  916. httpObj.http.timeout = 5000;
  917. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  918. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  919. httpObj.send(url, data, 'post', 'text', headers);
  920. function errorHandler(error) {
  921. if (call) {
  922. call("{'msg':'Network exception','code':500}");
  923. }
  924. else {
  925. alert("Tip:Please check your network connection.");
  926. }
  927. }
  928. function completeHandler(data) {
  929. if (data && data.length > 0) {
  930. let jsonData = JSON.parse(data);
  931. if (call)
  932. call(jsonData);
  933. }
  934. }
  935. }
  936. sendGet(url, call) {
  937. let httpObj = new Laya.HttpRequest();
  938. httpObj.http.timeout = 5000;
  939. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  940. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  941. httpObj.send(url, '', 'get');
  942. function errorHandler(error) {
  943. console.log("errorHandler:" + error);
  944. }
  945. function completeHandler(data) {
  946. if (data && data.length > 0) {
  947. if (call)
  948. call(data);
  949. }
  950. }
  951. }
  952. }
  953. HttpMgr._instance = null;
  954. class LightShader extends Laya.Sprite {
  955. constructor() {
  956. super();
  957. this._time = 0;
  958. this._sin = 0;
  959. this.initShader();
  960. }
  961. initShader() {
  962. var vs = `
  963. #define FSHIGHPRECISION
  964. attribute vec4 posuv;
  965. uniform vec2 size;
  966. varying vec4 v_texcoord;
  967. void main() {
  968. vec4 pos = vec4(posuv.xy,0.,1.);
  969. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  970. gl_Position=pos1;
  971. v_texcoord.xy = posuv.xy;
  972. }
  973. `;
  974. var ps = `
  975. #define FSHIGHPRECISION
  976. precision highp float;
  977. varying vec4 v_texcoord;
  978. uniform vec2 size;
  979. uniform sampler2D texture;
  980. uniform float u_Time;
  981. void main() {
  982. vec4 color= texture2D(texture, v_texcoord.xy);
  983. float width = 0.2;
  984. float start = u_Time;
  985. float offset = 1.0;
  986. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  987. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  988. {
  989. color.r=1.1;
  990. color.g=1.1;
  991. color.b=1.1;
  992. gl_FragColor = color;
  993. } else {
  994. gl_FragColor = color;
  995. }
  996. }
  997. `;
  998. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  999. this.customRenderEnable = true;
  1000. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1001. }
  1002. customRender(context, x, y) {
  1003. this.onUpdate();
  1004. if (!this.texture)
  1005. return;
  1006. let xx = x - this.pivotX;
  1007. let yy = y - this.pivotY;
  1008. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1009. }
  1010. onUpdate() {
  1011. this._time += 2 * Laya.timer.delta * 0.001;
  1012. this._sin = Math.sin(this._time);
  1013. if (this._sin > 0.99) {
  1014. this._sin = 0;
  1015. this._time = 0;
  1016. }
  1017. this.shaderValue['u_Time'] = this._sin;
  1018. }
  1019. }
  1020. LightShader.DissolveSurfaceSaveName = 9997;
  1021. class UIBase extends fairygui.Window {
  1022. constructor() {
  1023. super();
  1024. this.isEject = true;
  1025. this.isHide = true;
  1026. this.showbanner = true;
  1027. this.className = "";
  1028. this.isMuti = false;
  1029. this.showbanner = false;
  1030. this.onConstructor();
  1031. }
  1032. checkActive(show) {
  1033. }
  1034. getUIName() {
  1035. return UIBase.uiName;
  1036. }
  1037. onConstructor() {
  1038. }
  1039. onInit() {
  1040. if (!!this.contentPane) {
  1041. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1042. }
  1043. this.setPivot(0.5, 0.5, false);
  1044. }
  1045. doShowAnimation() {
  1046. if (!this.isEject)
  1047. return;
  1048. super.doShowAnimation();
  1049. Laya.Tween.clearTween(this);
  1050. this.scaleX = this.scaleY = 0.8;
  1051. let tweenFunc1 = (func) => {
  1052. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1053. };
  1054. let tweenFunc2 = (func) => {
  1055. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1056. };
  1057. tweenFunc1(tweenFunc2);
  1058. }
  1059. show(...args) {
  1060. super.show();
  1061. this._openParam = args;
  1062. this.isHide = false;
  1063. xGame.uiMgr.checkUIState();
  1064. }
  1065. moveBannerButton() {
  1066. }
  1067. showBannerButton() {
  1068. this.bannerButton.visible = true;
  1069. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1070. this.bannerButton.touchable = true;
  1071. }));
  1072. }
  1073. hide() {
  1074. super.hide();
  1075. this.isHide = true;
  1076. xGame.uiMgr.checkUIState();
  1077. }
  1078. Dispose() {
  1079. super.dispose();
  1080. }
  1081. myUpdate(delay) {
  1082. }
  1083. refresh() { }
  1084. addUIClick(obj, func, arr = null) {
  1085. obj.onClick(this, func, arr);
  1086. obj.onClick(this, this.playBtnSound);
  1087. }
  1088. offUIClick(obj, func) {
  1089. obj.offClick(this, func);
  1090. }
  1091. playBtnSound() {
  1092. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1093. }
  1094. }
  1095. UIBase.lastShowBanner = 0;
  1096. UIBase.showBannerNum = 0;
  1097. UIBase.uiName = "";
  1098. class ui_UIDraw extends fgui.GComponent {
  1099. static createInstance() {
  1100. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1101. }
  1102. onConstruct() {
  1103. this.n1 = (this.getChild("n1"));
  1104. this.extraNode = (this.getChild("extraNode"));
  1105. this.myNode = (this.getChild("myNode"));
  1106. this.closeNode = (this.getChild("closeNode"));
  1107. this.moneyNode = (this.getChild("moneyNode"));
  1108. this.n38 = (this.getChild("n38"));
  1109. this.secretary = (this.getChild("secretary"));
  1110. this.drawBtn = (this.getChild("drawBtn"));
  1111. this.talkNode = (this.getChild("talkNode"));
  1112. this.t0 = this.getTransition("t0");
  1113. }
  1114. }
  1115. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1116. class ui_UIBox extends fgui.GComponent {
  1117. static createInstance() {
  1118. return (fgui.UIPackage.createObject("game", "UIBox"));
  1119. }
  1120. onConstruct() {
  1121. this.n0 = (this.getChild("n0"));
  1122. this.n12 = (this.getChild("n12"));
  1123. this.n1 = (this.getChild("n1"));
  1124. this.n2 = (this.getChild("n2"));
  1125. this.bar = (this.getChild("bar"));
  1126. this.closeBtn = (this.getChild("closeBtn"));
  1127. this.openBtn = (this.getChild("openBtn"));
  1128. this.t0 = this.getTransition("t0");
  1129. this.t1 = this.getTransition("t1");
  1130. }
  1131. }
  1132. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1133. class GlobalManager {
  1134. constructor() {
  1135. }
  1136. registerMethod(name, method) {
  1137. console.log('zh: 注册全局方法', name);
  1138. this[name] = method;
  1139. }
  1140. callMethod(name, ...args) {
  1141. console.log('zh: 调用全局方法', name);
  1142. if (this[name]) {
  1143. return this[name](...args);
  1144. }
  1145. else {
  1146. console.error(`zh: 全局方法 Method ${name} not found`);
  1147. }
  1148. }
  1149. }
  1150. GlobalManager.instance = new GlobalManager();
  1151. class JSBridgeUtils {
  1152. constructor() { }
  1153. static get instance() {
  1154. if (!this._instance) {
  1155. this._instance = new JSBridgeUtils();
  1156. }
  1157. return this._instance;
  1158. }
  1159. initBridge() {
  1160. if (!Laya.Browser.onAndroid) {
  1161. console.log('zh:非android dev');
  1162. return;
  1163. }
  1164. let cfg = window['conchConfig'];
  1165. if (cfg) {
  1166. var os = cfg.getOS();
  1167. if (os == "Conch-android") {
  1168. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1169. if (this.bridge) {
  1170. return true;
  1171. }
  1172. else {
  1173. return false;
  1174. }
  1175. }
  1176. else {
  1177. return false;
  1178. }
  1179. }
  1180. else {
  1181. return false;
  1182. }
  1183. }
  1184. testAd1() {
  1185. if (!Laya.Browser.onAndroid) {
  1186. console.log('zh:非android dev');
  1187. return;
  1188. }
  1189. if (!this.initBridge()) {
  1190. return;
  1191. }
  1192. let rs = this.bridge.call("testString", "hello");
  1193. console.log('zh:testString rs=' + rs);
  1194. }
  1195. testAdCallBack() {
  1196. if (!this.initBridge()) {
  1197. return;
  1198. }
  1199. console.log("zh:testAdCallBack start");
  1200. const defaultObj = { code: 200, msg: "req update Ui" };
  1201. const reqObj = { code: 300, msg: "hello java ui" };
  1202. this.bridge.callWithBack((rsStr) => {
  1203. const rsObj = JSON.parse(rsStr);
  1204. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1205. }, "testAsyncCallback", JSON.stringify(reqObj));
  1206. }
  1207. showInternAd(mark) {
  1208. console.log('zh:showInternAd start');
  1209. if (!Laya.Browser.onAndroid) {
  1210. console.log('zh:showInternAd 非android dev');
  1211. return false;
  1212. }
  1213. if (!this.initBridge()) {
  1214. return false;
  1215. }
  1216. let rs = this.bridge.call("showInternAd", mark);
  1217. try {
  1218. const result = JSON.parse(rs);
  1219. if (result.code === 200) {
  1220. console.log("zh:showInternAd OK");
  1221. return true;
  1222. }
  1223. else {
  1224. console.warn("zh:showInternAd FAILL:", result.msg);
  1225. return false;
  1226. }
  1227. }
  1228. catch (e) {
  1229. console.error("zh:解析桥接返回值失败:", e);
  1230. return false;
  1231. }
  1232. }
  1233. exitAndCloseGame() {
  1234. if (!Laya.Browser.onAndroid) {
  1235. return;
  1236. }
  1237. if (!this.initBridge()) {
  1238. return;
  1239. }
  1240. console.log('zh:开始关闭游戏-');
  1241. this.bridge.call("exitAndCloseGame");
  1242. }
  1243. showRewardAd(mark) {
  1244. if (!Laya.Browser.onAndroid) {
  1245. return false;
  1246. }
  1247. if (!this.initBridge()) {
  1248. return false;
  1249. }
  1250. let rs = this.bridge.call("showRewardAd", mark);
  1251. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1252. try {
  1253. const result = JSON.parse(rs);
  1254. if (result.code === 200) {
  1255. console.log("zh:广告显示成功");
  1256. return true;
  1257. }
  1258. else {
  1259. console.warn("zh:广告显示失败:", result.msg);
  1260. return false;
  1261. }
  1262. }
  1263. catch (e) {
  1264. console.error("zh:解析桥接返回值失败:", e);
  1265. return false;
  1266. }
  1267. }
  1268. logEventForAdNoParams(eventName) {
  1269. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1270. if (!Laya.Browser.onAndroid) {
  1271. return;
  1272. }
  1273. if (!this.initBridge()) {
  1274. return;
  1275. }
  1276. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1277. this.bridge.call("logEventForAdNoParams", eventName);
  1278. }
  1279. logEventForAdHaveParams(eventName, jsonStr) {
  1280. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1281. if (!Laya.Browser.onAndroid) {
  1282. return;
  1283. }
  1284. if (!this.initBridge()) {
  1285. return;
  1286. }
  1287. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1288. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1289. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1290. }
  1291. logEventForFirebase(eventName, jsonStr) {
  1292. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1293. if (!Laya.Browser.onAndroid) {
  1294. return;
  1295. }
  1296. if (!this.initBridge()) {
  1297. return;
  1298. }
  1299. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1300. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1301. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1302. }
  1303. testNetTip() {
  1304. if (Laya.Browser.onAndroid) {
  1305. let boo = this.getNetworkAvailable();
  1306. this.showToast2("Network error, reward unavailable");
  1307. return;
  1308. }
  1309. }
  1310. getNetworkAvailable() {
  1311. if (!Laya.Browser.onAndroid) {
  1312. return;
  1313. }
  1314. if (!this.initBridge()) {
  1315. return;
  1316. }
  1317. let boo = this.bridge.call("getNetworkAvailable");
  1318. console.log("zh:getNetworkAvailable boo=" + boo);
  1319. return boo;
  1320. }
  1321. showToast2(msg) {
  1322. if (!Laya.Browser.onAndroid) {
  1323. return;
  1324. }
  1325. if (!this.initBridge()) {
  1326. return;
  1327. }
  1328. this.bridge.call("showToast2", msg);
  1329. }
  1330. loginOutForApp() {
  1331. if (!Laya.Browser.onAndroid) {
  1332. return;
  1333. }
  1334. if (!this.initBridge()) {
  1335. return;
  1336. }
  1337. this.bridge.call("loginOutForApp");
  1338. }
  1339. testPay1(token, ggSpid) {
  1340. if (!Laya.Browser.onAndroid) {
  1341. return;
  1342. }
  1343. if (!this.initBridge()) {
  1344. return;
  1345. }
  1346. let jsonObj = {
  1347. token: token,
  1348. ggSpid: ggSpid,
  1349. spsl: 1
  1350. };
  1351. let reqData = JSON.stringify(jsonObj);
  1352. console.log("zh:testPay1 ts reqData=" + reqData);
  1353. this.bridge.call("testPay1", reqData);
  1354. }
  1355. nativeCallJs(msg) {
  1356. console.log("zh:nativeCallJs received data: 1111", msg);
  1357. if (msg === 'Ad1') {
  1358. GlobalManager.instance.callMethod('Ad1');
  1359. console.log("zh: Ad1 奖励发送成功");
  1360. }
  1361. else if (msg === 'Ad2') {
  1362. GlobalManager.instance.callMethod('Ad2');
  1363. console.log("zh: Ad2 奖励发送成功");
  1364. }
  1365. else if (msg === 'Ad3') {
  1366. GlobalManager.instance.callMethod('Ad3');
  1367. console.log("zh: Ad3 奖励发送成功");
  1368. }
  1369. else if (msg === 'Ad4') {
  1370. GlobalManager.instance.callMethod('Ad4');
  1371. console.log("zh: Ad4 奖励发送成功");
  1372. }
  1373. else if (msg === 'Ad5') {
  1374. console.log("zh: Ad5 奖励发送成功");
  1375. GlobalManager.instance.callMethod('Ad5');
  1376. }
  1377. }
  1378. }
  1379. class UIBox extends UIBase {
  1380. constructor() {
  1381. super();
  1382. this.boxNum = 0;
  1383. this.boxMax = 10;
  1384. this.inAd = false;
  1385. this.isClose = false;
  1386. }
  1387. onConstructor() {
  1388. this.ui = ui_UIBox.createInstance();
  1389. this.contentPane = this.ui;
  1390. this.isEject = false;
  1391. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1392. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1393. Laya.timer.loop(1000, this, this.update);
  1394. }
  1395. update() {
  1396. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1397. this.boxNum -= 1;
  1398. this.upBar();
  1399. }
  1400. }
  1401. upBar() {
  1402. if (this.boxNum > this.boxMax)
  1403. this.boxNum = this.boxMax;
  1404. this.ui.bar.value = this.boxNum * 10;
  1405. }
  1406. show() {
  1407. super.show();
  1408. this.isClose = false;
  1409. this.boxNum = 0;
  1410. this.inAd = false;
  1411. this.upBar();
  1412. this.ui.t0.play();
  1413. this.ui.closeBtn.visible = false;
  1414. Laya.timer.once(3000, this, () => {
  1415. this.ui.closeBtn.visible = true;
  1416. this.ui.bar.alpha = 1;
  1417. });
  1418. Laya.timer.once(500, this, () => {
  1419. this.ui.t1.play();
  1420. });
  1421. }
  1422. hide() {
  1423. Laya.timer.clearAll(this);
  1424. Moyu.showBannerAd(false);
  1425. super.hide();
  1426. }
  1427. onOpenBox() {
  1428. this.boxNum++;
  1429. if (this.boxNum < this.boxMax) {
  1430. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1431. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1432. }
  1433. }
  1434. else if (this.boxNum == this.boxMax) {
  1435. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1436. this.ui.openBtn.c1.selectedIndex = 13;
  1437. this.inAd = true;
  1438. }
  1439. else
  1440. this.getAward();
  1441. }
  1442. else if (this.inAd) {
  1443. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1444. if (Laya.Browser.onAndroid) {
  1445. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1446. if (!boo) {
  1447. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1448. return;
  1449. }
  1450. }
  1451. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1452. }
  1453. else {
  1454. console.log('zh:AD 失败,直接发放奖励');
  1455. this.qjff_AD_for_UIBOX_onOpenBox();
  1456. }
  1457. }
  1458. this.upBar();
  1459. }
  1460. qjff_AD_for_UIBOX_onOpenBox() {
  1461. this.getAward();
  1462. }
  1463. onCloseBox() {
  1464. if (this.isClose)
  1465. this.hide();
  1466. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1467. this.isClose = true;
  1468. PlatMgr.showBanner(true, 0, 3000);
  1469. }
  1470. else
  1471. this.hide();
  1472. }
  1473. getAward() {
  1474. let str = "";
  1475. if (Math.random() < 0.5) {
  1476. let max = Moyu.isLegal ? 500 : 2500;
  1477. let num = xGame.tools.random(max, 500 + max);
  1478. DataMgr.setCoin(num);
  1479. str = "金币x" + num;
  1480. }
  1481. else {
  1482. let max = Moyu.isLegal ? 10 : 30;
  1483. let num = xGame.tools.random(max, 30 + max);
  1484. DataMgr.setDiamond(num);
  1485. str = "钻石x" + num;
  1486. }
  1487. xGame.showTip("恭喜获得-" + str);
  1488. this.hide();
  1489. }
  1490. }
  1491. UIBox.uiName = "UIBox";
  1492. class ui_UITry extends fgui.GComponent {
  1493. static createInstance() {
  1494. return (fgui.UIPackage.createObject("game", "UITry"));
  1495. }
  1496. onConstruct() {
  1497. this.n11 = (this.getChild("n11"));
  1498. this.myNode = (this.getChild("myNode"));
  1499. this.t0 = this.getTransition("t0");
  1500. }
  1501. }
  1502. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1503. class UITry extends UIBase {
  1504. constructor() {
  1505. super();
  1506. this.closeTime = 0;
  1507. this.closeNum = 0;
  1508. this.skillUrl = xGame.common.skillIconList;
  1509. }
  1510. onConstructor() {
  1511. this.ui = ui_UITry.createInstance();
  1512. this.contentPane = this.ui;
  1513. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1514. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1515. }
  1516. show() {
  1517. super.show();
  1518. this.closeNum = 0;
  1519. this.closeTime = 15;
  1520. this.ui.t0.play();
  1521. PlatMgr.showRateBanner();
  1522. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1523. Laya.timer.loop(1000, this, this.updateTime);
  1524. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1525. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1526. xGame.common.gameMgr.gamePause = true;
  1527. }
  1528. updateTime() {
  1529. if (this.closeTime > 1) {
  1530. this.closeTime--;
  1531. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1532. }
  1533. else
  1534. this.hide();
  1535. }
  1536. hide() {
  1537. Laya.timer.clearAll(this);
  1538. Moyu.showBannerAd(false);
  1539. super.hide();
  1540. xGame.common.gameMgr.gamePause = false;
  1541. }
  1542. onTry() {
  1543. console.log('zh:qjff_AD_for_uitry');
  1544. if (Laya.Browser.onAndroid) {
  1545. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1546. if (!boo) {
  1547. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1548. return;
  1549. }
  1550. }
  1551. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1552. }
  1553. else {
  1554. console.log('zh:AD 失败,直接发放奖励');
  1555. this.qjff_AD_for_uitry();
  1556. }
  1557. }
  1558. qjff_AD_for_uitry() {
  1559. let select = xGame.common.curPlayerSkillType;
  1560. DataMgr.gameData.trySkill = select;
  1561. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1562. DataMgr.saveGameData();
  1563. DataMgr.setBigSkill(select, 1);
  1564. xGame.showTip("Trial Successful");
  1565. this.hide();
  1566. }
  1567. onCancel() {
  1568. if (this.closeNum > 0) {
  1569. this.closeNum--;
  1570. if (this.closeNum < 2)
  1571. this.hide();
  1572. return;
  1573. }
  1574. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1575. this.onTry();
  1576. }
  1577. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1578. this.closeNum = 3;
  1579. }
  1580. else
  1581. this.hide();
  1582. }
  1583. }
  1584. UITry.uiName = "UITry";
  1585. class PlatMgr {
  1586. static initConfig() {
  1587. this.lastVt = 0;
  1588. if (!Moyu.platConfig)
  1589. return;
  1590. for (let k in Moyu.platConfig) {
  1591. let pd = this[k];
  1592. let pc = Moyu.platConfig[k];
  1593. if (pd != undefined && pc != undefined)
  1594. this[k] = pc;
  1595. }
  1596. Moyu.setBannerPos(0.5, 1);
  1597. }
  1598. static rand100(num) {
  1599. return xGame.tools.random(0, 100) < num;
  1600. }
  1601. static isMisVideo() {
  1602. let dt = Laya.timer.currTimer - this.lastVt;
  1603. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1604. this.lastVt = Laya.timer.currTimer;
  1605. return true;
  1606. }
  1607. else {
  1608. if (this.rand100(this.fullVideoRate)) {
  1609. console.log('zh:插屏 ad start');
  1610. JSBridgeUtils.instance.showInternAd('platMgr');
  1611. }
  1612. return false;
  1613. }
  1614. }
  1615. static showVideo(call, type) {
  1616. Moyu.showVideoAd(() => {
  1617. this.lastVt = Laya.timer.currTimer;
  1618. call && call();
  1619. }, type);
  1620. }
  1621. static showInsert(delay = false) {
  1622. if (this.getRand() < this.insertRate) {
  1623. let dt = delay ? this.insertDelay : 0;
  1624. console.log('zh:插屏 ad start');
  1625. JSBridgeUtils.instance.showInternAd('gameInsert');
  1626. }
  1627. }
  1628. static gameInsert() {
  1629. let t = this.getRand();
  1630. let r = this.gameInsertRate;
  1631. if (t < r) {
  1632. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1633. }
  1634. }
  1635. static showRateBanner() {
  1636. if (this.getRand() < this.bannerRate)
  1637. this.showBanner(true, this.bannerDelay, 3000);
  1638. }
  1639. static showBanner(show, delay = 0, hide = 0) {
  1640. if (2 > 1) {
  1641. console.log('zh:显示showBanner广告 直接返回');
  1642. return;
  1643. }
  1644. if (!show)
  1645. Moyu.showBannerAd(false);
  1646. else {
  1647. Laya.timer.clear(this, this.bannerShow);
  1648. if (delay > 0)
  1649. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1650. else
  1651. this.bannerShow(true);
  1652. if (hide > 0)
  1653. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1654. }
  1655. }
  1656. static bannerShow(show) {
  1657. if (2 > 1) {
  1658. console.log('zh:显示showBanner广告 直接返回');
  1659. return;
  1660. }
  1661. Moyu.showBannerAd(show);
  1662. console.log("showBanner" + show);
  1663. }
  1664. static getRand() {
  1665. return xGame.tools.random(0, 100);
  1666. }
  1667. static openBox() {
  1668. if (this.getRand() < this.boxRate)
  1669. xGame.uiMgr.Show(UIBox);
  1670. }
  1671. static openTry() {
  1672. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1673. return;
  1674. if (this.getRand() < this.tryRate)
  1675. xGame.uiMgr.Show(UITry);
  1676. else if (DataMgr.gameData.gameCount == 1)
  1677. xGame.uiMgr.Show(UITry);
  1678. }
  1679. }
  1680. PlatMgr.forceShare = 0;
  1681. PlatMgr.signAdRate = 0;
  1682. PlatMgr.forceVideoRate = 0;
  1683. PlatMgr.forceVideoGap = 0;
  1684. PlatMgr.fullVideoRate = 0;
  1685. PlatMgr.gameInsertRate = 0;
  1686. PlatMgr.insertGap = 0;
  1687. PlatMgr.insertDelay = 0;
  1688. PlatMgr.insertRate = 0;
  1689. PlatMgr.boxRate = 0;
  1690. PlatMgr.boxVideoRate = 0;
  1691. PlatMgr.boxInsertRate = 0;
  1692. PlatMgr.boxBannerRate = 0;
  1693. PlatMgr.tryRate = 0;
  1694. PlatMgr.tryClose3Rate = 0;
  1695. PlatMgr.tryVideoRate = 0;
  1696. PlatMgr.bannerRate = 0;
  1697. PlatMgr.lastVt = 0;
  1698. class ui_UIAddProp extends fgui.GComponent {
  1699. static createInstance() {
  1700. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1701. }
  1702. onConstruct() {
  1703. this.n11 = (this.getChild("n11"));
  1704. this.myNode = (this.getChild("myNode"));
  1705. this.closeBtn = (this.getChild("closeBtn"));
  1706. this.t0 = this.getTransition("t0");
  1707. }
  1708. }
  1709. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1710. class SpineMgr {
  1711. constructor(name, loadCb = null) {
  1712. this.loaded = false;
  1713. this.spineName = '';
  1714. this.loadedCallback = loadCb;
  1715. this.templet = new Laya.Templet();
  1716. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1717. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1718. if (name === 'mishu') {
  1719. this.templet.loadAni('spine/nvmishu.sk');
  1720. }
  1721. else {
  1722. this.templet.loadAni(`spine/${name}.sk`);
  1723. }
  1724. this.templet.lock = true;
  1725. this.spineName = name;
  1726. }
  1727. onError() {
  1728. console.log("zh:spine加载出错");
  1729. }
  1730. parseComplete() {
  1731. this.loaded = true;
  1732. this.loadedCallback && this.loadedCallback();
  1733. }
  1734. dispose() {
  1735. if (this.templet && !this.templet.destroyed) {
  1736. this.templet.destroy();
  1737. }
  1738. this.templet = null;
  1739. }
  1740. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1741. if (!this.loaded) {
  1742. return;
  1743. }
  1744. let spine;
  1745. if (mySpine) {
  1746. spine = mySpine;
  1747. }
  1748. else {
  1749. spine = this.createSpine(data, parent);
  1750. }
  1751. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1752. if (!isLoop) {
  1753. spine.on(Laya.Event.STOPPED, this, () => {
  1754. spine.offAll(Laya.Event.STOPPED);
  1755. callback && callback(spine);
  1756. });
  1757. }
  1758. return spine;
  1759. }
  1760. createSpine(data, parent, type = 1) {
  1761. let spine;
  1762. spine = this.templet.buildArmature(type);
  1763. spine.showSkinByIndex(0);
  1764. parent.addChild(spine);
  1765. spine.pos(data.x, data.y);
  1766. spine.scale(data.scaleX, data.scaleY, true);
  1767. return spine;
  1768. }
  1769. }
  1770. var AIState;
  1771. (function (AIState) {
  1772. AIState[AIState["none"] = 0] = "none";
  1773. AIState[AIState["idle"] = 1] = "idle";
  1774. AIState[AIState["reset"] = 2] = "reset";
  1775. AIState[AIState["move"] = 3] = "move";
  1776. AIState[AIState["wait"] = 4] = "wait";
  1777. AIState[AIState["select"] = 5] = "select";
  1778. AIState[AIState["turn"] = 6] = "turn";
  1779. AIState[AIState["shoot"] = 7] = "shoot";
  1780. AIState[AIState["leave"] = 8] = "leave";
  1781. })(AIState || (AIState = {}));
  1782. class AIPlayer {
  1783. constructor() {
  1784. this.dtime = 30;
  1785. this.awayTime = 0;
  1786. this.awayNum = 0;
  1787. this.hideTime = 0;
  1788. this.rootMoveTime = 0;
  1789. this.isGuide = false;
  1790. this.state = AIState.none;
  1791. this.waitTime = 0;
  1792. this.forceNum = 0;
  1793. this.forceMax = 0;
  1794. this.ballSize = 33;
  1795. this.selectNum = 0;
  1796. this.destRot = 0;
  1797. this.aiLv = 10;
  1798. this.kickBall = [];
  1799. this.lineBall = [];
  1800. this.scoreBall = [];
  1801. this.holeBall = [];
  1802. this.turnNum = 0;
  1803. this.setNum = 0;
  1804. this.setMax = 0;
  1805. this.setRate = 0;
  1806. this.rectL = 0;
  1807. this.rectR = 0;
  1808. this.rectT = 0;
  1809. this.rectB = 0;
  1810. this.rootPos = { x: 0, y: 0 };
  1811. this.bestForce = 0;
  1812. this.bestAngle = 180;
  1813. this.bestPos = { x: 0, y: 0 };
  1814. this.bestKick = { x: 0, y: 0 };
  1815. this.posList = [];
  1816. this.posIdx = 0;
  1817. this.chatTime = 3000;
  1818. this.tempDir1 = new Laya.Vector2();
  1819. this.tempDir2 = new Laya.Vector2();
  1820. this.tempDir3 = new Laya.Vector2();
  1821. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1822. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1823. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1824. this.gameSrc = xGame.common.gameUI;
  1825. this.hideTime = Laya.timer.currTimer;
  1826. Moyu.setOnTipCall((id) => {
  1827. if (id == 20012)
  1828. this.hideTime = Laya.timer.currTimer;
  1829. else
  1830. (id == 20011);
  1831. {
  1832. let dt = Laya.timer.currTimer - this.hideTime;
  1833. console.log("onshow" + dt);
  1834. if (dt > 30000 && this.state > AIState.none)
  1835. xGame.common.gameMgr.aiGameEnd(false);
  1836. }
  1837. }, this);
  1838. }
  1839. init() {
  1840. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1841. this.awayTime = xGame.tools.random(5000, 10000);
  1842. this.awayNum = 0;
  1843. this.hideTime = Laya.timer.currTimer;
  1844. let rect = xGame.common.d2World.borderRect;
  1845. this.rectL = Math.ceil(rect.x) + 17;
  1846. this.rectT = Math.ceil(rect.y) + 17;
  1847. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1848. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1849. this.wBall = xGame.common.d2World.rootBall;
  1850. this.ballSize = this.wBall.gameObj.width - 1;
  1851. if (this.posList.length < 1) {
  1852. let dp = 40;
  1853. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1854. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1855. let dx = i < this.rectR ? i : this.rectR;
  1856. let dy = j < this.rectB ? j : this.rectB;
  1857. let order = xGame.tools.random(0, 1000);
  1858. this.posList.push({ x: dx, y: dy, order: order });
  1859. }
  1860. }
  1861. this.posList.sort(function (a, b) {
  1862. return a.order - b.order;
  1863. });
  1864. this.setMax = this.posList.length;
  1865. }
  1866. this.state = AIState.idle;
  1867. }
  1868. setAiLevel(num) {
  1869. this.aiLv = num;
  1870. }
  1871. initBall() {
  1872. this.rootPos.x = this.wBall.gameObj.x;
  1873. this.rootPos.y = this.wBall.gameObj.y;
  1874. this.initHoleBall();
  1875. }
  1876. initHoleBall() {
  1877. this.kickBall = [];
  1878. this.lineBall = [];
  1879. this.scoreBall = [];
  1880. this.holeBall = [];
  1881. this.selectNum = 0;
  1882. this.forceNum = 0;
  1883. this.forceMax = 0;
  1884. this.turnNum = 0;
  1885. let list = xGame.common.d2World.ballArr;
  1886. if (list.length < 20 && !this.isGuide) {
  1887. let holes = xGame.common.gameMgr.holePosList;
  1888. for (let i = 0; i < list.length; i++) {
  1889. let obj = list[i];
  1890. if (!obj)
  1891. continue;
  1892. obj.kickPos.x = 0;
  1893. obj.kickPos.y = 0;
  1894. obj.poleAngle = 0;
  1895. obj.hard = 0;
  1896. obj.borderDis = 0;
  1897. obj.kickAngle = 180;
  1898. if (obj.number == 0)
  1899. continue;
  1900. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1901. continue;
  1902. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1903. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1904. continue;
  1905. }
  1906. let b = obj.gameObj;
  1907. let wbp = this.rootPos;
  1908. let bx = wbp.x - b.x;
  1909. let by = wbp.y - b.y;
  1910. obj.borderDis = xGame.tools.random(0, 100);
  1911. this.kickBall.push(obj);
  1912. if (!this.isLine(wbp, obj))
  1913. continue;
  1914. obj.kickAngle = xGame.tools.random(90, 180);
  1915. obj.kickPos.x = b.x;
  1916. obj.kickPos.y = b.y;
  1917. this.lineBall.push(obj);
  1918. let minDis = 999999;
  1919. let hole = false;
  1920. for (let j = 0; j < holes.length; j++) {
  1921. let hp = holes[j];
  1922. if (bx >= 0 && hp.x > b.x + 100)
  1923. continue;
  1924. if (bx <= 0 && hp.x < b.x - 100)
  1925. continue;
  1926. if (by < -10 && hp.y < wbp.y)
  1927. continue;
  1928. if (by > 10 && hp.y > wbp.y)
  1929. continue;
  1930. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1931. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1932. if (dis < minDis) {
  1933. let dx = b.x - this.tempDir1.x * this.ballSize;
  1934. let dy = b.y - this.tempDir1.y * this.ballSize;
  1935. this.tempDir3.x = this.tempDir1.x;
  1936. this.tempDir3.y = this.tempDir1.y;
  1937. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1938. obj.kickPos.x = dx;
  1939. obj.kickPos.y = dy;
  1940. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1941. if (num > 1)
  1942. num = 1;
  1943. obj.kickAngle = Math.acos(num) * 57.3;
  1944. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1945. dis = dis * 2;
  1946. if (Math.abs(hp.x - 600) < 100)
  1947. dis += 50;
  1948. obj.hard = dis + obj.kickAngle * 3;
  1949. hole = true;
  1950. }
  1951. }
  1952. }
  1953. }
  1954. if (hole) {
  1955. this.scoreBall.push(obj);
  1956. this.holeBall.push(obj);
  1957. }
  1958. }
  1959. this.scoreBall.sort(function (a, b) {
  1960. return a.hard - b.hard;
  1961. });
  1962. this.holeBall.sort(function (a, b) {
  1963. return a.kickAngle - b.kickAngle;
  1964. });
  1965. this.kickBall.sort(function (a, b) {
  1966. return a.borderDis - b.borderDis;
  1967. });
  1968. }
  1969. else {
  1970. let max = list.length - 1;
  1971. let i = xGame.tools.random(0, max);
  1972. for (i; i <= max; i++) {
  1973. let idx = i >= max ? i -= max : i;
  1974. let obj = list[idx];
  1975. if (obj && obj.number != 0) {
  1976. obj.kickAngle = xGame.tools.random(90, 180);
  1977. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1978. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1979. this.lineBall.push(obj);
  1980. break;
  1981. }
  1982. }
  1983. }
  1984. }
  1985. selectBall() {
  1986. let ball = null;
  1987. this.destRot = 0;
  1988. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1989. let ai = 110 - this.aiLv * 10;
  1990. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1991. let score = false;
  1992. if (this.scoreBall.length < 1) {
  1993. if (this.lineBall.length < 1) {
  1994. for (let i = 0; i < this.kickBall.length; i++) {
  1995. let list = [];
  1996. let bo = this.kickBall[i];
  1997. let bobj = bo.gameObj;
  1998. let rect = xGame.common.d2World.borderRect;
  1999. let mobj = this.wBall.gameObj;
  2000. let minb = bobj.y - rect.y - 20;
  2001. let minw = mobj.y - rect.y - 50;
  2002. if (minb > 0 && minw > 0) {
  2003. let dlenx = 0;
  2004. let dleny = mobj.y - rect.y;
  2005. let spx = mobj.x;
  2006. let spy = rect.y - dleny;
  2007. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2008. }
  2009. minb = rect.y + rect.height - bobj.y - 20;
  2010. minw = rect.y + rect.height - mobj.y - 50;
  2011. if (minb > 0 && minw > 0) {
  2012. let dlenx = 0;
  2013. let dleny = rect.y + rect.height - mobj.y;
  2014. let spx = mobj.x;
  2015. let spy = rect.y + rect.height + dleny;
  2016. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2017. }
  2018. minb = bobj.x - rect.x - 20;
  2019. minw = mobj.x - rect.x - 50;
  2020. if (minb > 0 && minw > 0) {
  2021. let dlenx = mobj.x - rect.x;
  2022. let dleny = 0;
  2023. let spx = rect.x - dlenx;
  2024. let spy = mobj.y;
  2025. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2026. }
  2027. minb = rect.x + rect.width - bobj.x - 20;
  2028. minw = rect.x + rect.width - mobj.x - 50;
  2029. if (minb > 0 && minw > 0) {
  2030. let dlenx = rect.x + rect.width - mobj.x;
  2031. let dleny = 0;
  2032. let spx = rect.x + rect.width + dlenx;
  2033. let spy = mobj.y;
  2034. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2035. }
  2036. list.sort(function (a, b) {
  2037. return a.order - b.order;
  2038. });
  2039. for (let i = 0; i < list.length; i++) {
  2040. let data = list[i];
  2041. let mx = mobj.x - bobj.x;
  2042. let my = mobj.y - bobj.y;
  2043. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2044. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2045. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2046. if (num > 1)
  2047. num = 1;
  2048. let cos = Math.acos(num);
  2049. if (cos > 1.57)
  2050. cos = 1.57;
  2051. else if (cos < 0.01)
  2052. cos = 0.01;
  2053. let tan = Math.tan(cos);
  2054. let dx = tan * data.dleny;
  2055. let dy = tan * data.dlenx;
  2056. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2057. if (Math.abs(bx - 667) < 40)
  2058. continue;
  2059. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2060. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2061. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2062. this.forceMax = dis * 0.08;
  2063. this.destRot += mis * 0.1;
  2064. this.setKick(bx, by);
  2065. return true;
  2066. }
  2067. }
  2068. }
  2069. }
  2070. else {
  2071. ball = xGame.common.getRandArrEle(this.lineBall);
  2072. }
  2073. }
  2074. else {
  2075. for (let i = 0; i < this.scoreBall.length; i++) {
  2076. if (i < this.scoreBall.length - 1) {
  2077. let rand = 70 + this.aiLv * 10 + i * 10;
  2078. if (xGame.tools.random(0, 100) < rand) {
  2079. ball = this.scoreBall[i];
  2080. break;
  2081. }
  2082. }
  2083. else {
  2084. ball = this.scoreBall[i];
  2085. break;
  2086. }
  2087. }
  2088. score = true;
  2089. this.selectNum++;
  2090. }
  2091. if (!ball)
  2092. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2093. if (this.selectNum >= max) {
  2094. let dx = ball.gameObj.x;
  2095. let dy = ball.gameObj.y;
  2096. let kickAngle = 0;
  2097. if (score) {
  2098. dx = ball.kickPos.x;
  2099. dy = ball.kickPos.y;
  2100. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2101. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2102. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2103. if (adot > 1)
  2104. adot = 1;
  2105. kickAngle = Math.acos(adot) * 57.3;
  2106. if (kickAngle > 45) {
  2107. let kdx = ball.kickPos.x - ball.gameObj.x;
  2108. let kdy = ball.kickPos.y - ball.gameObj.y;
  2109. dx = ball.kickPos.x - kdx * mis * 0.3;
  2110. dy = ball.kickPos.y - kdy * mis * 0.3;
  2111. }
  2112. else
  2113. this.destRot += mis;
  2114. }
  2115. else if (ball.poleAngle != 0) {
  2116. this.destRot += ball.poleAngle;
  2117. }
  2118. if (xGame.common.gameMode == 0) {
  2119. let af = kickAngle * 0.08;
  2120. this.forceMax = ball.hard * 0.1 + af * af;
  2121. }
  2122. this.setKick(dx, dy);
  2123. }
  2124. else {
  2125. let rand = this.aiLv * 5 + 40;
  2126. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2127. ball = xGame.common.getRandArrEle(this.scoreBall);
  2128. else
  2129. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2130. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2131. if (xGame.tools.random(0, 100) > rand) {
  2132. this.selectNum = max;
  2133. }
  2134. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2135. this.selectNum++;
  2136. }
  2137. ball.onClick(0, true);
  2138. }
  2139. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2140. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2141. let balls = xGame.common.d2World.ballArr;
  2142. let max = xGame.tools.getDis(hx, hy, bx, by);
  2143. for (let index = 0; index < balls.length; index++) {
  2144. let obj = balls[index];
  2145. if (obj.number == 0)
  2146. continue;
  2147. if (obj.number == bn || obj.number == dn)
  2148. continue;
  2149. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2150. if (dis * dis > max)
  2151. continue;
  2152. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2153. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2154. if (num > 1)
  2155. num = 1;
  2156. if (num < 0)
  2157. continue;
  2158. let gap = Math.sin(Math.acos(num)) * dis;
  2159. if (gap < this.ballSize)
  2160. return true;
  2161. }
  2162. return false;
  2163. }
  2164. isLine(xy, ball) {
  2165. let bx = xy.x;
  2166. let by = xy.y;
  2167. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2168. let dis = ball.getDestDis(xy);
  2169. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2170. let sin = Math.sin(angle);
  2171. let cos = Math.cos(angle);
  2172. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2173. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2174. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2175. let dx = bx + this.tempDir2.x * dis;
  2176. let dy = by + this.tempDir2.y * dis;
  2177. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2178. sin = Math.sin(-angle);
  2179. cos = Math.cos(-angle);
  2180. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2181. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2182. dx = bx + this.tempDir2.x * dis;
  2183. dy = by + this.tempDir2.y * dis;
  2184. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2185. if (isr && isl)
  2186. return false;
  2187. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2188. }
  2189. return true;
  2190. }
  2191. turnPole() {
  2192. this.turnNum++;
  2193. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2194. let dr = rot - this.destRot;
  2195. let abs = Math.abs(dr) % 360;
  2196. if (abs > 180) {
  2197. if (rot > 180)
  2198. rot -= 360;
  2199. if (this.destRot > 180)
  2200. this.destRot -= 360;
  2201. }
  2202. let max = this.turnNum * 5 + this.aiLv * 5;
  2203. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2204. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2205. let at = xGame.tools.random(1000, 2000);
  2206. if (!this.onAway(3))
  2207. at += xGame.tools.random(10000, 15000);
  2208. this.setState(AIState.shoot, at);
  2209. }
  2210. else {
  2211. let mr = 0;
  2212. if (abs > 3)
  2213. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2214. else if (Math.random() > 0.6)
  2215. mr = xGame.tools.random(1, 10) * 0.1;
  2216. mr = dr > 0 ? -mr : mr;
  2217. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2218. }
  2219. }
  2220. setKick(dx, dy) {
  2221. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2222. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2223. this.tempDir1.x = 0;
  2224. this.tempDir1.y = 1;
  2225. this.tempDir2.y = -this.tempDir2.y;
  2226. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2227. if (num > 1)
  2228. num = 1;
  2229. let rot = Math.acos(num) * 57.3;
  2230. if (this.tempDir2.x < 0)
  2231. rot = 360 - rot;
  2232. this.destRot += rot;
  2233. if (!xGame.common.gameMgr.finishOneShoot) {
  2234. this.forceMax += xGame.tools.random(10, 50);
  2235. this.forceMax -= this.aiLv * 2;
  2236. if (this.forceMax < 20)
  2237. this.forceMax = 20;
  2238. }
  2239. if (this.forceMax > 100)
  2240. this.forceMax = 101;
  2241. else if (this.forceMax < 10)
  2242. this.forceMax += xGame.tools.random(0, 10);
  2243. if (xGame.common.gameMode == 1)
  2244. this.forceMax = xGame.tools.random(80, 100);
  2245. else
  2246. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2247. let max = 2000 - this.aiLv * 100;
  2248. if (Math.random() > 0.8)
  2249. max += xGame.tools.random(100, 2000);
  2250. this.setState(AIState.turn, xGame.tools.random(500, max));
  2251. }
  2252. shoot() {
  2253. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2254. if (Math.random() > 0.8) {
  2255. this.gameSrc.aiForce(1);
  2256. this.setState(AIState.wait);
  2257. }
  2258. }
  2259. else {
  2260. let df = xGame.tools.random(3, 8);
  2261. if (this.forceNum < this.forceMax)
  2262. this.forceNum += df;
  2263. else
  2264. this.forceNum -= df;
  2265. let startY = this.gameSrc.ui.powerNode.y;
  2266. let height = this.gameSrc.ui.powerNode.height;
  2267. let force = startY + height * this.forceNum * 0.01;
  2268. this.gameSrc.aiForce(2, force);
  2269. }
  2270. }
  2271. reset() {
  2272. for (let i = 0; i < 4; i++) {
  2273. this.setRate--;
  2274. this.setNum++;
  2275. let pos = this.posList[this.posIdx];
  2276. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2277. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2278. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2279. this.rootPos.x = 387;
  2280. if (this.rootPos.x < this.rectL)
  2281. this.rootPos.x = this.rectL;
  2282. else if (this.rootPos.x > this.rectR)
  2283. this.rootPos.x = this.rectR;
  2284. if (this.rootPos.y < this.rectT)
  2285. this.rootPos.y = this.rectT;
  2286. else if (this.rootPos.y > this.rectB)
  2287. this.rootPos.y = this.rectB;
  2288. this.posIdx++;
  2289. let max = this.posList.length;
  2290. if (this.posIdx >= max)
  2291. this.posIdx -= max;
  2292. this.initHoleBall();
  2293. let ball = null;
  2294. if (this.scoreBall.length > 0)
  2295. ball = this.scoreBall[0];
  2296. else if (this.lineBall.length > 0)
  2297. ball = xGame.common.getRandArrEle(this.lineBall);
  2298. if (ball && ball.kickAngle < this.bestAngle) {
  2299. this.bestAngle = ball.kickAngle;
  2300. this.bestKick.x = ball.kickPos.x;
  2301. this.bestKick.y = ball.kickPos.y;
  2302. this.bestPos.x = this.rootPos.x;
  2303. this.bestPos.y = this.rootPos.y;
  2304. this.bestForce = ball.hard * 0.08;
  2305. }
  2306. }
  2307. if (this.setNum >= this.setMax)
  2308. this.setMax = 0;
  2309. if (this.setRate < 1) {
  2310. this.setState(AIState.move, 0);
  2311. this.rootMoveTime = Laya.timer.currTimer;
  2312. this.gameSrc.aiRootMove(true);
  2313. }
  2314. }
  2315. delayLine() {
  2316. this.gameSrc.aiRootMove(false);
  2317. }
  2318. move() {
  2319. if (this.bestPos.x < 1)
  2320. this.bestPos = this.rootPos;
  2321. let wObj = this.wBall.gameObj;
  2322. let destx = wObj.x;
  2323. let desty = wObj.y;
  2324. let dx = Math.abs(destx - this.bestPos.x);
  2325. let dy = Math.abs(desty - this.bestPos.y);
  2326. let mx = 3 + dx * 0.03;
  2327. let my = 3 + dy * 0.03;
  2328. if (dx < 4 && dy < 4) {
  2329. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2330. dt = dt < 1000 ? 1000 - dt : 0;
  2331. if (this.setMax > 0) {
  2332. let min = this.setMax * 0.3 + this.aiLv * 5;
  2333. this.setRate = xGame.tools.random(min, this.setMax);
  2334. this.setState(AIState.reset, 0);
  2335. }
  2336. else {
  2337. this.destRot = 0;
  2338. this.forceMax = this.bestForce;
  2339. this.setKick(this.bestKick.x, this.bestKick.y);
  2340. }
  2341. if (dt > 100) {
  2342. Laya.timer.clear(this, this.delayLine);
  2343. Laya.timer.once(dt, this, this.delayLine);
  2344. }
  2345. else
  2346. this.gameSrc.aiRootMove(false);
  2347. }
  2348. else {
  2349. if (dx > 4)
  2350. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2351. if (dy > 4)
  2352. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2353. this.gameSrc.onRootMove({ x: destx, y: desty });
  2354. }
  2355. }
  2356. resetRoot() {
  2357. this.bestAngle = 180;
  2358. this.bestForce = 0;
  2359. this.setMax = this.posList.length;
  2360. this.posIdx = xGame.tools.random(0, this.setMax);
  2361. let min = this.setMax * 0.3 + this.aiLv * 5;
  2362. this.setRate = xGame.tools.random(min, this.setMax);
  2363. let max = 2000 - this.aiLv * 100;
  2364. if (Math.random() > 0.8)
  2365. max += xGame.tools.random(100, 1000);
  2366. if (this.isGuide)
  2367. this.setState(AIState.select, 500);
  2368. else if (this.onAway(2))
  2369. this.setState(AIState.reset, xGame.tools.random(400, max));
  2370. else
  2371. this.setState(AIState.none);
  2372. if (xGame.common.gameMgr.finishOneShoot)
  2373. this.chat();
  2374. }
  2375. runAI() {
  2376. if (this.state > AIState.idle)
  2377. return;
  2378. this.initBall();
  2379. this.onGame(2500);
  2380. if (Math.random() > 0.6)
  2381. this.chat();
  2382. }
  2383. stopRun() {
  2384. this.setState(AIState.idle);
  2385. }
  2386. onGame(base) {
  2387. let max = base - this.aiLv * 100;
  2388. if (Math.random() > 0.8)
  2389. max += xGame.tools.random(100, 1000);
  2390. if (this.onAway(2))
  2391. this.setState(AIState.select, xGame.tools.random(500, max));
  2392. else
  2393. this.setState(AIState.none);
  2394. }
  2395. setState(sta, wt = 0) {
  2396. if (this.state == AIState.none)
  2397. return;
  2398. this.state = sta;
  2399. this.waitTime = wt;
  2400. }
  2401. onUpdate() {
  2402. if (this.state == AIState.none)
  2403. return;
  2404. this.awayTime -= this.dtime;
  2405. if (this.awayTime < 1) {
  2406. this.awayTime = xGame.tools.random(6000, 10000);
  2407. this.awayNum += (11 - this.aiLv);
  2408. this.onAway(1);
  2409. }
  2410. if (this.waitTime >= 0) {
  2411. this.waitTime -= this.dtime;
  2412. return;
  2413. }
  2414. switch (this.state) {
  2415. case AIState.idle:
  2416. this.chat();
  2417. break;
  2418. case AIState.reset:
  2419. this.reset();
  2420. break;
  2421. case AIState.move:
  2422. this.move();
  2423. break;
  2424. case AIState.leave:
  2425. this.state = AIState.none;
  2426. xGame.common.gameMgr.aiGameEnd(true);
  2427. break;
  2428. case AIState.select:
  2429. this.selectBall();
  2430. break;
  2431. case AIState.turn:
  2432. this.turnPole();
  2433. break;
  2434. case AIState.shoot:
  2435. this.shoot();
  2436. break;
  2437. }
  2438. }
  2439. onAway(type) {
  2440. if (type == 1) {
  2441. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2442. let num = this.awayNum + db * 20;
  2443. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2444. xGame.common.gameMgr.aiLeave();
  2445. this.setState(AIState.leave, 6666);
  2446. }
  2447. }
  2448. else if (type == 2) {
  2449. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2450. let num = this.awayNum + db * 30;
  2451. if (xGame.tools.random(0, 10000) < num)
  2452. return false;
  2453. }
  2454. else if (type == 3) {
  2455. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2456. let num = this.awayNum + db * 10;
  2457. if (xGame.tools.random(0, 4000) < num)
  2458. return false;
  2459. }
  2460. return true;
  2461. }
  2462. chat() {
  2463. if (this.chatTime > 0) {
  2464. this.chatTime -= this.dtime;
  2465. return;
  2466. }
  2467. this.chatTime = xGame.tools.random(2000, 10000);
  2468. let rand = xGame.tools.random(0, 100);
  2469. if (rand < 15)
  2470. this.talk();
  2471. else if (rand < 35)
  2472. this.emotion();
  2473. }
  2474. talk() {
  2475. xGame.common.talkMgr.showAITalk(0);
  2476. }
  2477. emotion() {
  2478. xGame.common.talkMgr.showAIEmotion(0);
  2479. }
  2480. resetAI() {
  2481. this.stopRun();
  2482. this.state = AIState.none;
  2483. }
  2484. }
  2485. class Partical extends Laya.Script3D {
  2486. constructor() {
  2487. super();
  2488. this.duration = 2000;
  2489. }
  2490. ;
  2491. onAwake() {
  2492. this.gameObj = this.owner;
  2493. }
  2494. onEnable() {
  2495. this.openTimer();
  2496. }
  2497. openTimer() {
  2498. Laya.timer.once(this.duration, this, this.disappear);
  2499. }
  2500. setCallback(obj, callback) {
  2501. this.obj = obj;
  2502. this.callback = callback;
  2503. Laya.timer.clearAll(this);
  2504. Laya.timer.once(this.duration, this, this.disappear);
  2505. }
  2506. disappear() {
  2507. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2508. this.callback && this.callback(this.obj);
  2509. }
  2510. }
  2511. class Ball extends Laya.Script3D {
  2512. constructor() {
  2513. super();
  2514. this.posV3 = new Laya.Vector3();
  2515. this.rotRate = 2.1;
  2516. this.rotSpeed = new Laya.Vector3();
  2517. this.myIndex = 0;
  2518. }
  2519. onAwake() {
  2520. this.gameObj = this.owner;
  2521. this.transform = this.gameObj.transform;
  2522. this.ballNode = this.gameObj.getChildByName("Ball");
  2523. this.shadowNode = this.gameObj.getChildByName("shadow");
  2524. }
  2525. initSelf(index, x, y, owner) {
  2526. this.d2BallSrc = owner;
  2527. this.myIndex = index;
  2528. this.setAlbedoTexture();
  2529. this.setTransPos(x, y);
  2530. this.setScale();
  2531. this.ballNode.transform.localRotationEulerX = 90;
  2532. if (index == 0) {
  2533. }
  2534. }
  2535. setAlbedoTexture(isIce = false) {
  2536. let url;
  2537. if (isIce) {
  2538. url = `res/d3Res/ballTexture/ice.jpg`;
  2539. }
  2540. else {
  2541. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2542. }
  2543. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2544. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2545. }));
  2546. }
  2547. runFireworks(obj, delay, callback) {
  2548. Laya.timer.clearAll(this);
  2549. Laya.timer.once(delay + 1, this, () => {
  2550. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2551. fire.transform.localPositionX = this.transform.localPositionX;
  2552. fire.transform.localPositionY = this.transform.localPositionY;
  2553. fire.transform.localPositionZ = this.transform.localPositionZ;
  2554. let src = fire.getComponent(Partical);
  2555. src.duration = 1000;
  2556. src.setCallback(obj, callback);
  2557. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2558. eft.transform.localPositionX = this.transform.localPositionX;
  2559. eft.transform.localPositionY = this.transform.localPositionY;
  2560. eft.transform.localPositionZ = this.transform.localPositionZ;
  2561. });
  2562. }
  2563. setTransPos(x, y) {
  2564. this.setRotation();
  2565. xGame.common.pos2to3Convert(x, y, this.posV3);
  2566. this.transform.localPositionX = this.posV3.x;
  2567. this.transform.localPositionY = 0;
  2568. this.transform.localPositionZ = this.posV3.z;
  2569. this.transform.localRotationEulerX = 0;
  2570. this.transform.localRotationEulerY = 0;
  2571. this.transform.localRotationEulerZ = 0;
  2572. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2573. this.shadowNode.transform.localPositionY = 0.1;
  2574. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2575. }
  2576. setRotation() {
  2577. if (this.d2BallSrc.canRot) {
  2578. let speed = this.d2BallSrc.rigy.linearVelocity;
  2579. this.rotSpeed.x = speed.x * this.rotRate;
  2580. this.rotSpeed.z = speed.y * this.rotRate;
  2581. this.rotSpeed.y = this.d2BallSrc.rotY;
  2582. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2583. }
  2584. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2585. this.rotSpeed.x = this.rotSpeed.y = 0;
  2586. this.rotSpeed.y = this.d2BallSrc.rotY;
  2587. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2588. }
  2589. }
  2590. setScale() {
  2591. let radius = xGame.common.d2World.rootBall.ui.width;
  2592. let scale = xGame.common.scale2to3Convert(radius);
  2593. this.transform.localScaleX = scale;
  2594. this.transform.localScaleY = scale;
  2595. this.transform.localScaleZ = scale;
  2596. }
  2597. playInHoleEft() {
  2598. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2599. eft.transform.position = this.transform.position;
  2600. }
  2601. playIceEft() {
  2602. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2603. eft.transform.position = this.transform.position;
  2604. }
  2605. get scaleXYZ() {
  2606. return this.transform.localScaleX;
  2607. }
  2608. set scaleXYZ(val) {
  2609. this.transform.localScaleX = val;
  2610. this.transform.localScaleY = val;
  2611. this.transform.localScaleZ = val;
  2612. }
  2613. get posX() {
  2614. return this.transform.localPositionX;
  2615. }
  2616. set posX(val) {
  2617. this.transform.localPositionX = val;
  2618. }
  2619. get posY() {
  2620. return this.transform.localPositionY;
  2621. }
  2622. set posY(val) {
  2623. this.transform.localPositionY = val;
  2624. }
  2625. get posZ() {
  2626. return this.transform.localPositionZ;
  2627. }
  2628. set posZ(val) {
  2629. this.transform.localPositionZ = val;
  2630. }
  2631. destroySelf() {
  2632. this.posV3 = null;
  2633. this.rotSpeed = null;
  2634. this.d2BallSrc = null;
  2635. this.ballNode = null;
  2636. this.gameObj.destroy(true);
  2637. this.transform = null;
  2638. this.destroy();
  2639. }
  2640. }
  2641. class ui_D2Ball extends fgui.GComponent {
  2642. static createInstance() {
  2643. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2644. }
  2645. onConstruct() {
  2646. this.myIcon = (this.getChild("myIcon"));
  2647. this.inner = (this.getChild("inner"));
  2648. this.n8 = (this.getChild("n8"));
  2649. this.n4 = (this.getChild("n4"));
  2650. this.wrongTips = (this.getChild("wrongTips"));
  2651. this.rightTips = (this.getChild("rightTips"));
  2652. this.breathAni = this.getTransition("breathAni");
  2653. }
  2654. }
  2655. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2656. class D2BallSrc extends Laya.Script {
  2657. constructor() {
  2658. super();
  2659. this.number = 0;
  2660. this.startX = 0;
  2661. this.startY = 0;
  2662. this.angleV2 = new Laya.Vector2();
  2663. this.isRootBall = false;
  2664. this.isBlackBall = false;
  2665. this.ballType = "";
  2666. this.canRot = true;
  2667. this.rotY = 0;
  2668. this.poleAngle = 0;
  2669. this.kickPos = { x: 0, y: 0 };
  2670. this.hard = 0;
  2671. this.kickAngle = 0;
  2672. this.borderDis = 0;
  2673. this.speedP10 = 5.6;
  2674. this.lastSpeed = { x: 0, y: 0 };
  2675. this.stillSpeed = 0.12;
  2676. this.ballFunc = "normal";
  2677. this.isRunSkillAni = false;
  2678. this.isInHole = false;
  2679. this.iceOwner = "";
  2680. this.forceRun = false;
  2681. this.myUNID = "";
  2682. this.rectL = 0;
  2683. this.rectR = 0;
  2684. this.rectT = 0;
  2685. this.rectB = 0;
  2686. this.forceVec = new Laya.Vector2();
  2687. this.lastDis = 0;
  2688. this.helpOut = { type: "", x: 0, y: 0 };
  2689. }
  2690. initSelf(number, x, y, d3Ball) {
  2691. if (!this.gameObj)
  2692. this.gameObj = this.owner;
  2693. this.number = number;
  2694. this.startX = x;
  2695. this.startY = y;
  2696. this.d3Ball = d3Ball;
  2697. this.isRootBall = false;
  2698. this.isBlackBall = false;
  2699. this.ballType = "";
  2700. if (number == 0) {
  2701. this.isRootBall = true;
  2702. }
  2703. else if (number == 8) {
  2704. this.isBlackBall = true;
  2705. }
  2706. else {
  2707. if (number <= 7) {
  2708. this.ballType = ballCamp.full;
  2709. }
  2710. else {
  2711. this.ballType = ballCamp.flower;
  2712. }
  2713. }
  2714. this.setInfo();
  2715. this.setD3Ball();
  2716. this.owner["mySrc"] = this;
  2717. this.rigy.linearDamping = 1;
  2718. D2BallSrc._unid++;
  2719. this.myUNID = "d2ball" + D2BallSrc._unid;
  2720. let rect = xGame.common.d2World.borderRect;
  2721. this.rectL = Math.ceil(rect.x) + 20;
  2722. this.rectT = Math.ceil(rect.y) + 20;
  2723. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2724. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2725. }
  2726. setInfo() {
  2727. this.gameObj.x = this.startX;
  2728. this.gameObj.y = this.startY;
  2729. let radius = this.ui.width / 2;
  2730. this.gameObj.width = radius * 2;
  2731. this.gameObj.height = radius * 2;
  2732. if (xGame.common.showDebug) {
  2733. this.ui.myIcon.alpha = 1;
  2734. this.ui.inner.alpha = 1;
  2735. }
  2736. else {
  2737. this.ui.myIcon.alpha = 0;
  2738. this.ui.inner.alpha = 0;
  2739. }
  2740. }
  2741. setD3Ball() {
  2742. this.d3Ball = this.d3Ball;
  2743. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2744. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2745. }
  2746. onUpdate() {
  2747. if (xGame.common.gameMgr.gamePause)
  2748. return;
  2749. if (this.isInHole)
  2750. return;
  2751. if (!xGame.common.d2World.openCheckStill)
  2752. return;
  2753. this.runBall();
  2754. }
  2755. runBall() {
  2756. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2757. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2758. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2759. this.judgeBorder();
  2760. }
  2761. getDestDis(dest) {
  2762. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2763. }
  2764. setmyXY(x, y) {
  2765. this.d3BallSrc.setTransPos(x, y);
  2766. }
  2767. getSpeed() {
  2768. let speed = this.rigy.linearVelocity;
  2769. return speed.x * speed.x + speed.y * speed.y;
  2770. }
  2771. onTriggerEnter(collider) {
  2772. if (!collider || !collider.owner)
  2773. return;
  2774. let coll = "collide";
  2775. let speed = this.getSpeed();
  2776. let sv2 = this.speedP10 * this.speedP10;
  2777. if (collider.label == "ball") {
  2778. if (speed < 9 && this.number != 0)
  2779. coll = "";
  2780. else if (speed < sv2)
  2781. coll = "collide_4";
  2782. else if (speed < sv2 * 6.2)
  2783. coll = "collide_3";
  2784. else if (speed < sv2 * 25)
  2785. coll = "collide_2";
  2786. else if (speed < sv2 * 56)
  2787. coll = "collide_1";
  2788. xGame.soundMgr.playSound(coll);
  2789. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2790. if (collider.owner) {
  2791. let rig = collider.owner.getComponent(D2BallSrc);
  2792. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2793. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2794. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2795. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2796. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2797. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2798. let rx = 0;
  2799. let ry = 0;
  2800. if (this.gameObj.x < this.rectL)
  2801. rx = vx;
  2802. else if (this.gameObj.x > this.rectR)
  2803. rx = -vx;
  2804. else if (this.gameObj.y < this.rectT)
  2805. ry = vy;
  2806. else if (this.gameObj.y > this.rectB)
  2807. ry = -vy;
  2808. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2809. }
  2810. }
  2811. if (this.number != 0) {
  2812. return;
  2813. }
  2814. else {
  2815. if (this.forceRun) {
  2816. console.log("randon force");
  2817. this.applyForce(collider);
  2818. }
  2819. }
  2820. if (xGame.common.d2World.isOnSameLine) {
  2821. xGame.common.d2World.isOnSameLine = false;
  2822. this.rigy.linearVelocity = { x: 0, y: 0 };
  2823. }
  2824. if (xGame.common.gameMgr.firstColliObj == null) {
  2825. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2826. xGame.common.gameMgr.isTouchedBall = true;
  2827. }
  2828. }
  2829. else {
  2830. xGame.common.recoverCameraView();
  2831. let wallStr = "";
  2832. if (speed < 9) { }
  2833. else if (speed < sv2) { }
  2834. else if (speed < sv2 * 6.2)
  2835. wallStr = "wall_30";
  2836. else if (speed < sv2 * 25)
  2837. wallStr = "wall_50";
  2838. else if (speed < sv2 * 56)
  2839. wallStr = "wall_80";
  2840. xGame.soundMgr.playSound(wallStr);
  2841. }
  2842. }
  2843. applyForce(collider) {
  2844. let src = collider.owner.mySrc;
  2845. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2846. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2847. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2848. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2849. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2850. }
  2851. checkWrongBall(playEft = true) {
  2852. if (this.isInHole)
  2853. return;
  2854. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2855. if (this.number != 0 && playEft)
  2856. this.d3BallSrc.playInHoleEft();
  2857. let coll = "inpocket_1";
  2858. let speed = this.getSpeed();
  2859. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2860. if (speed < 9 && this.number != 0)
  2861. coll = "";
  2862. else if (speed < sv2 * 6.2)
  2863. coll = "inpocket_4";
  2864. else if (speed < sv2 * 25)
  2865. coll = "collide_3";
  2866. else if (speed < sv2 * 56)
  2867. coll = "collide_2";
  2868. xGame.soundMgr.playSound(coll);
  2869. this.isInHole = true;
  2870. if (this.number == 0) {
  2871. console.log("白球进了。。");
  2872. this.reset();
  2873. this.rigy.linearVelocity = { x: 0, y: 0 };
  2874. this.hideSelf();
  2875. xGame.common.gameUI.ui.whiteAni.visible = true;
  2876. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2877. xGame.common.gameUI.ui.whiteAni.visible = false;
  2878. }));
  2879. }
  2880. else {
  2881. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2882. xGame.common.d2World.removeOneBall(this);
  2883. this.destroySelf();
  2884. xGame.common.playHappySound(this.number);
  2885. this.runFlyEft();
  2886. }
  2887. }
  2888. runFlyEft() {
  2889. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2890. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2891. }
  2892. }
  2893. hideSelf() {
  2894. if (this.d3Ball)
  2895. this.d3Ball.active = false;
  2896. }
  2897. showSelf() {
  2898. this.isInHole = false;
  2899. if (this.d3Ball && !this.d3Ball.active)
  2900. this.d3Ball.active = true;
  2901. }
  2902. isStill() {
  2903. let speed = this.rigy.linearVelocity;
  2904. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2905. this.rigy.linearVelocity = { x: 0, y: 0 };
  2906. return true;
  2907. }
  2908. return false;
  2909. }
  2910. reset() {
  2911. }
  2912. destroySelf() {
  2913. this.d3BallSrc.destroySelf();
  2914. if (!this.ui.isDisposed) {
  2915. this.ui.removeFromParent();
  2916. this.ui.dispose();
  2917. this.ui = null;
  2918. }
  2919. this.outColli = null;
  2920. this.innerColli = null;
  2921. this.rigy = null;
  2922. this.d3Ball = null;
  2923. this.d3BallSrc = null;
  2924. this.angleV2 = null;
  2925. this.gameObj.destroy(true);
  2926. this.destroy();
  2927. }
  2928. judgeBorder() {
  2929. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2930. return;
  2931. }
  2932. if (this.destroyed)
  2933. return;
  2934. if (xGame.common.gameMode == GameMode.classic)
  2935. return;
  2936. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2937. if (isOver) {
  2938. this.checkWrongBall();
  2939. }
  2940. }
  2941. onClick(e, force = false) {
  2942. if (this.number == 0)
  2943. return;
  2944. if (force) {
  2945. }
  2946. else {
  2947. if (xGame.common.d2World.openCheckStill)
  2948. return;
  2949. if (!xGame.common.gameMgr.selfTurn) {
  2950. return;
  2951. }
  2952. }
  2953. if (!xGame.common.gameMgr.finishOneShoot)
  2954. return;
  2955. let root = xGame.common.d2World.rootBall.gameObj;
  2956. let x = this.gameObj.x - root.x;
  2957. let y = this.gameObj.y - root.y;
  2958. let angle = xGame.common.getfguiRotation(x, y);
  2959. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2960. xGame.common.d2World.getHelpLine();
  2961. xGame.common.clickedBall = true;
  2962. this.checkGuide();
  2963. }
  2964. checkGuide() {
  2965. let guide = DataMgr.getSkillGuide();
  2966. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2967. xGame.common.guideStep++;
  2968. xGame.common.gameUI.ui.guide1.visible = false;
  2969. xGame.common.gameUI.ui.guide2.visible = true;
  2970. }
  2971. }
  2972. checkDistance(disX, disY, angle) {
  2973. let diameter = this.gameObj.width - 1;
  2974. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2975. if (!this.lastDis)
  2976. this.lastDis = dis;
  2977. else {
  2978. if (dis > this.lastDis) {
  2979. this.helpOut.type = "remove";
  2980. return this.helpOut;
  2981. }
  2982. }
  2983. if (dis <= Math.pow(diameter, 2)) {
  2984. let del = 0.01;
  2985. let offest = 0;
  2986. let realX = disX - this.gameObj.x;
  2987. let realY = disY - this.gameObj.y;
  2988. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2989. offest += del;
  2990. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2991. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2992. }
  2993. this.helpOut.type = "ok";
  2994. this.helpOut.x = realX + this.gameObj.x;
  2995. this.helpOut.y = realY + this.gameObj.y;
  2996. return this.helpOut;
  2997. }
  2998. else {
  2999. this.helpOut.type = "no";
  3000. return this.helpOut;
  3001. }
  3002. }
  3003. clearBallEft() {
  3004. this.clearBallRightEft();
  3005. this.clearBallWrongEft();
  3006. }
  3007. clearBallRightEft() {
  3008. this.ui.breathAni.stop();
  3009. this.ui.rightTips.visible = false;
  3010. }
  3011. clearBallWrongEft() {
  3012. this.ui.wrongTips.visible = false;
  3013. }
  3014. showWrongEft() {
  3015. if (!xGame.common.gameMgr.selfTurn)
  3016. return;
  3017. this.ui.wrongTips.visible = true;
  3018. }
  3019. showRightEft() {
  3020. if (!xGame.common.gameMgr.selfTurn)
  3021. return;
  3022. this.ui.rightTips.visible = true;
  3023. this.ui.rightTips.scaleX = 1;
  3024. this.ui.rightTips.scaleY = 1;
  3025. this.ui.breathAni.play();
  3026. }
  3027. setBallFunc(type, owner) {
  3028. if (type == "ice") {
  3029. this.ballFunc = type;
  3030. this.d3BallSrc.setAlbedoTexture(true);
  3031. this.rigy.type = "static";
  3032. this.iceOwner = owner;
  3033. }
  3034. else {
  3035. if (owner == this.iceOwner) {
  3036. this.ballFunc = type;
  3037. this.d3BallSrc.setAlbedoTexture(false);
  3038. this.rigy.type = "dynamic";
  3039. }
  3040. }
  3041. }
  3042. }
  3043. D2BallSrc._unid = 0;
  3044. class D2RootBallSrc extends D2BallSrc {
  3045. constructor() {
  3046. super();
  3047. this.maxSpeed = 0;
  3048. this.classicMaxSpeed = 2.2;
  3049. this.bigSkillMaxSpeed = 4;
  3050. this.angle = 0;
  3051. this.allPercent = 0;
  3052. this.linearPercent = 0;
  3053. this.anglePercent = 0;
  3054. this.maxAngleRate = 0.6;
  3055. this.baseRot = 7;
  3056. this.angleMax = 0;
  3057. this.speed = new Laya.Vector2();
  3058. this.rotSpeed = new Laya.Vector2();
  3059. }
  3060. isStill() {
  3061. let speed = this.rigy.linearVelocity;
  3062. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3063. if (this.anglePercent <= 0.1) {
  3064. this.rigy.linearVelocity = { x: 0, y: 0 };
  3065. return true;
  3066. }
  3067. }
  3068. return false;
  3069. }
  3070. reset() {
  3071. this.linearPercent = 0;
  3072. this.anglePercent = 0;
  3073. }
  3074. setSpeed(percent, angle) {
  3075. this.allPercent = percent;
  3076. this.angle = angle;
  3077. this.setAngleSpeed();
  3078. this.setLinearSpeed();
  3079. let hit = "hit";
  3080. if (percent < 25)
  3081. hit = "hit03";
  3082. else if (percent < 50)
  3083. hit = "hit02";
  3084. else if (percent < 75)
  3085. hit = "hit01";
  3086. xGame.soundMgr.playSound(hit);
  3087. }
  3088. setAngleSpeed() {
  3089. let offest = xGame.common.rodOffest;
  3090. let radius = 82;
  3091. let rate = Math.abs(offest.y / radius) * 0.5;
  3092. if (offest.y > 0)
  3093. this.angleMax = -this.baseRot * 2;
  3094. else
  3095. this.angleMax = this.baseRot;
  3096. this.rotY = -offest.x / radius * 100;
  3097. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3098. this.linearPercent = this.allPercent - this.anglePercent;
  3099. }
  3100. setLinearSpeed() {
  3101. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3102. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3103. if (!xGame.common.longHelpLine) {
  3104. let offset = -150 + xGame.common.randomNum(0, 300);
  3105. offset /= 100;
  3106. this.angle += offset;
  3107. }
  3108. }
  3109. }
  3110. let sin = Math.sin(this.angle * Math.PI / 180);
  3111. let cos = Math.cos(this.angle * Math.PI / 180);
  3112. switch (xGame.common.gameMode) {
  3113. case GameMode.classic:
  3114. this.maxSpeed = this.classicMaxSpeed;
  3115. break;
  3116. case GameMode.bigMove:
  3117. this.maxSpeed = this.bigSkillMaxSpeed;
  3118. break;
  3119. case GameMode.placeBall:
  3120. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3121. if (data.type == 1) {
  3122. this.maxSpeed = this.bigSkillMaxSpeed;
  3123. }
  3124. else {
  3125. this.maxSpeed = this.classicMaxSpeed;
  3126. }
  3127. break;
  3128. default:
  3129. break;
  3130. }
  3131. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3132. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3133. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3134. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3135. this.rigy.applyLinearImpulseToCenter(this.speed);
  3136. }
  3137. onUpdate() {
  3138. if (this.anglePercent > 0.1) {
  3139. this.anglePercent *= 0.97;
  3140. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3141. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3142. this.rigy.applyForceToCenter(this.rotSpeed);
  3143. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3144. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3145. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3146. if (num > 0.9)
  3147. this.canRot = true;
  3148. }
  3149. else
  3150. this.canRot = true;
  3151. if (Math.abs(this.rotY) > 0.1)
  3152. this.rotY *= 0.98;
  3153. super.onUpdate();
  3154. }
  3155. destroySelf() {
  3156. super.destroySelf();
  3157. this.speed = null;
  3158. }
  3159. }
  3160. class D2Ball extends Laya.Sprite {
  3161. constructor(isRootBall = false) {
  3162. super();
  3163. this.ui = ui_D2Ball.createInstance();
  3164. this.pivotX = this.ui.width / 2;
  3165. this.pivotY = this.ui.width / 2;
  3166. this.x = 0;
  3167. this.y = 0;
  3168. this.addChild(this.ui.displayObject);
  3169. this.ui.displayObject.x += this.ui.width / 2;
  3170. this.ui.displayObject.y += this.ui.width / 2;
  3171. if (isRootBall) {
  3172. this.d2Src = this.addComponent(D2RootBallSrc);
  3173. }
  3174. else {
  3175. this.d2Src = this.addComponent(D2BallSrc);
  3176. }
  3177. this.d2Src.ui = this.ui;
  3178. this.addCircleCollider();
  3179. this.addInnerCircleCollider();
  3180. this.addRigyBody();
  3181. }
  3182. addCircleCollider() {
  3183. let colli = xGame.common.getCollider("circle");
  3184. colli.radius = this.ui.width / 2;
  3185. this.addComponentIntance(colli);
  3186. this.d2Src.outColli = colli;
  3187. colli.label = "ball";
  3188. }
  3189. addInnerCircleCollider() {
  3190. let colli = xGame.common.getCollider("circle");
  3191. colli.radius = this.ui.inner.width / 2;
  3192. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3193. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3194. this.addComponentIntance(colli);
  3195. this.d2Src.innerColli = colli;
  3196. colli.label = "inner";
  3197. }
  3198. addRigyBody() {
  3199. let rigy = xGame.common.getRigbody();
  3200. rigy.type = "dynamic";
  3201. this.addComponentIntance(rigy);
  3202. this.d2Src.rigy = rigy;
  3203. }
  3204. disposeSelf() {
  3205. if (!this.ui.isDisposed) {
  3206. this.ui.dispose();
  3207. this.ui.removeFromParent();
  3208. this.ui = null;
  3209. }
  3210. }
  3211. }
  3212. class ui_D2Gan extends fgui.GComponent {
  3213. static createInstance() {
  3214. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3215. }
  3216. onConstruct() {
  3217. this.myIcon = (this.getChild("myIcon"));
  3218. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3219. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3220. this.self = (this.getChild("self"));
  3221. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3222. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3223. this.ai = (this.getChild("ai"));
  3224. }
  3225. }
  3226. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3227. class D2Gan {
  3228. constructor() {
  3229. this.offset = 0.15;
  3230. this.cell = 1.5;
  3231. this.onBallCell = 0.4;
  3232. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3233. this.moveNum = 70;
  3234. this.rulerRate = 0.1;
  3235. this.ui = ui_D2Gan.createInstance();
  3236. this.changeSelfRod();
  3237. this.changeAIRod();
  3238. }
  3239. changeSelfRod() {
  3240. let index = DataMgr.getCurBallRod();
  3241. let data = cfgTable.ballrodData[index + 1];
  3242. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3243. this.selfMySpine && this.selfMySpine.dispose();
  3244. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3245. if (data.spine) {
  3246. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3247. this.selfMySpine = new SpineMgr(data.spine, () => {
  3248. let xx = this.ui.selfEftRoot.width / 2;
  3249. let yy = this.ui.selfEftRoot.height / 2;
  3250. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3251. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3252. outSpine.rotation = -90;
  3253. });
  3254. }
  3255. }
  3256. changeAIRod() {
  3257. let length = Object.keys(cfgTable.ballrodData).length;
  3258. let rand = Math.floor(length * Math.random()) + 1;
  3259. let data = cfgTable.ballrodData[rand];
  3260. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3261. this.aiMySpine && this.aiMySpine.dispose();
  3262. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3263. if (data.spine) {
  3264. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3265. this.aiMySpine = new SpineMgr(data.spine, () => {
  3266. let xx = this.ui.aiEftRoot.width / 2;
  3267. let yy = this.ui.aiEftRoot.height / 2;
  3268. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3269. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3270. outSpine.rotation = -90;
  3271. });
  3272. }
  3273. }
  3274. setGanLastInfo() {
  3275. this.lastInfo.rotation = this.ui.rotation;
  3276. this.lastInfo.x = this.ui.x;
  3277. this.lastInfo.y = this.ui.y;
  3278. }
  3279. rotateSelf(flag, isRuler = false) {
  3280. let angle;
  3281. flag = flag * this.offset;
  3282. if (xGame.common.d2World.isHelpLineOnBall) {
  3283. angle = flag * this.onBallCell;
  3284. }
  3285. else {
  3286. angle = flag * this.cell;
  3287. }
  3288. if (isRuler) {
  3289. angle *= this.rulerRate;
  3290. }
  3291. this.ui.rotation += angle;
  3292. xGame.common.d2World.getHelpLine();
  3293. }
  3294. checkDistance() {
  3295. let target = xGame.common.d2World.targetBall;
  3296. let root = xGame.common.d2World.rootBall;
  3297. if (target == null) {
  3298. return 1;
  3299. }
  3300. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3301. if (dis <= 2500) {
  3302. return 5;
  3303. }
  3304. return 1;
  3305. }
  3306. rotDest(rot) {
  3307. this.ui.rotation = rot;
  3308. xGame.common.d2World.getHelpLine();
  3309. }
  3310. storagePower(powerNum) {
  3311. let pos = (powerNum / 100) * this.moveNum;
  3312. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3313. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3314. this.ui.x = this.lastInfo.x + xx;
  3315. this.ui.y = this.lastInfo.y + yy;
  3316. }
  3317. shoot() {
  3318. this.storagePower(0);
  3319. this.ui.visible = false;
  3320. }
  3321. destroySelf() {
  3322. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3323. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3324. this.selfMySpine && this.selfMySpine.dispose();
  3325. this.aiMySpine && this.aiMySpine.dispose();
  3326. this.lastInfo = null;
  3327. if (!this.ui.isDisposed) {
  3328. this.ui.removeFromParent();
  3329. this.ui.dispose();
  3330. }
  3331. }
  3332. }
  3333. class ui_HelpLine extends fgui.GComponent {
  3334. static createInstance() {
  3335. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3336. }
  3337. onConstruct() {
  3338. this.n10 = (this.getChild("n10"));
  3339. this.rect = (this.getChild("rect"));
  3340. this.dir11 = (this.getChild("dir11"));
  3341. this.dir = (this.getChild("dir"));
  3342. this.rootDir = (this.getChild("rootDir"));
  3343. this.dirDot = (this.getChild("dirDot"));
  3344. }
  3345. }
  3346. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3347. class D2HelpLine {
  3348. constructor() {
  3349. this.starX = 0;
  3350. this.starY = 0;
  3351. this.ui = ui_HelpLine.createInstance();
  3352. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3353. this.starX = this.ui.rect.x;
  3354. this.starY = this.ui.rect.y;
  3355. }
  3356. shoot() {
  3357. this.ui.visible = false;
  3358. }
  3359. destroySelf() {
  3360. if (this.ui.isDisposed) {
  3361. this.ui.removeFromParent();
  3362. this.ui.dispose();
  3363. }
  3364. }
  3365. }
  3366. class D2World extends Laya.Script {
  3367. constructor() {
  3368. super();
  3369. this.ballArr = [];
  3370. this.openCheckStill = false;
  3371. this.checkArr = [];
  3372. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3373. this.isHelpLineOnBall = false;
  3374. this.isOnSameLine = false;
  3375. this.reflectAngle = 0;
  3376. this.powerPercent = 0;
  3377. this.inHolesSpeed = [];
  3378. this.outDir = new Laya.Vector2();
  3379. this.rootDir = new Laya.Vector2();
  3380. this.aiLv = 0;
  3381. this.rootPos = new Laya.Vector2();
  3382. this.tempDir1 = new Laya.Vector2();
  3383. this.tempDir2 = new Laya.Vector2();
  3384. this.tempDir3 = new Laya.Vector2();
  3385. this.ballSize = 33;
  3386. this.destRot = 0;
  3387. }
  3388. initSelf() {
  3389. this.createBalls();
  3390. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3391. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3392. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3393. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3394. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3395. }
  3396. setBorderRect() {
  3397. let ui = xGame.common.gameUI.ui;
  3398. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3399. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3400. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3401. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3402. this.borderRect.x = starX;
  3403. this.borderRect.y = starY;
  3404. this.borderRect.width = width;
  3405. this.borderRect.height = height;
  3406. }
  3407. resetGame() {
  3408. this.openCheckStill = false;
  3409. let temp;
  3410. for (let index = 0; index < this.ballArr.length; index++) {
  3411. temp = this.ballArr[index];
  3412. temp.destroySelf();
  3413. }
  3414. xGame.common.d3World.ballRoot.destroyChildren();
  3415. xGame.common.gameUI.ui.ballNode.removeChildren();
  3416. console.log("进入摧毁逻辑");
  3417. this.d2Gan.destroySelf();
  3418. this.d2HelpLine.destroySelf();
  3419. this.ballArr = [];
  3420. }
  3421. setD2Gan() {
  3422. let ballNode = this.rootBall.ui;
  3423. let d2Gan = new D2Gan();
  3424. this.d2Gan = d2Gan;
  3425. let ganNode = d2Gan.ui;
  3426. ballNode.addChild(ganNode);
  3427. ganNode.pivotX = ganNode.pivotX;
  3428. ganNode.pivotY = ganNode.pivotY;
  3429. ganNode.x = ganNode.myIcon.width / 2;
  3430. ganNode.y = this.rootBall.gameObj.width;
  3431. d2Gan.setGanLastInfo();
  3432. }
  3433. setHelpLine() {
  3434. let d2Help = new D2HelpLine();
  3435. this.d2HelpLine = d2Help;
  3436. }
  3437. createBalls() {
  3438. let cfg;
  3439. switch (xGame.common.gameMode) {
  3440. case GameMode.classic:
  3441. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3442. break;
  3443. case GameMode.bigMove:
  3444. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3445. break;
  3446. case GameMode.placeBall:
  3447. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3448. break;
  3449. default:
  3450. break;
  3451. }
  3452. cfg = JSON.parse(JSON.stringify(cfg));
  3453. for (const key in cfg) {
  3454. if (cfg[key].value == 0) {
  3455. this.createRootBall(cfg[key]);
  3456. delete cfg[key];
  3457. break;
  3458. }
  3459. }
  3460. this.createOtherBalls(cfg);
  3461. }
  3462. createRootBall(data) {
  3463. let root = new D2Ball(true);
  3464. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3465. this.rootBall = root.d2Src;
  3466. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3467. let d3BallSrc = d3Ball.getComponent(Ball);
  3468. xGame.common.d3World.rootBall = d3Ball;
  3469. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3470. let xx = data.x;
  3471. let yy = data.y;
  3472. let numer = data.value;
  3473. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3474. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3475. this.ballArr.push(this.rootBall);
  3476. this.setD2Gan();
  3477. this.setHelpLine();
  3478. }
  3479. createOtherBalls(cfg) {
  3480. let temp;
  3481. let src;
  3482. let data;
  3483. for (const key in cfg) {
  3484. data = cfg[key];
  3485. temp = new D2Ball();
  3486. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3487. src = temp.d2Src;
  3488. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3489. src.initSelf(data.value, data.x, data.y, d3Ball);
  3490. this.ballArr.push(src);
  3491. }
  3492. }
  3493. shoot(percent) {
  3494. this.powerPercent = percent;
  3495. this.openCheckStill = true;
  3496. let d2Angle = this.d2Gan.ui.rotation;
  3497. this.rootBall.setSpeed(percent, d2Angle);
  3498. this.clearBallAllEft();
  3499. this.changePlayerView();
  3500. }
  3501. onUpdate() {
  3502. if (!this.openCheckStill)
  3503. return;
  3504. this.checkStill();
  3505. }
  3506. checkStill() {
  3507. for (let index = 0; index < this.ballArr.length; index++) {
  3508. if (!this.ballArr[index].isStill()) {
  3509. return;
  3510. }
  3511. }
  3512. xGame.eventMgr.event(ALL_BALL_STOP);
  3513. }
  3514. allBallStop() {
  3515. this.openCheckStill = false;
  3516. xGame.common.recoverCameraView();
  3517. }
  3518. waitShoot() {
  3519. if (!this.d2Gan.ui.isDisposed) {
  3520. this.d2Gan.ui.visible = true;
  3521. }
  3522. if (!this.d2HelpLine.ui.isDisposed) {
  3523. this.d2HelpLine.ui.visible = true;
  3524. }
  3525. this.clearBallAllEft();
  3526. this.showBallRightEft();
  3527. this.getHelpLine();
  3528. this.inHolesSpeed = [];
  3529. this.selectOneBall();
  3530. }
  3531. _getAllBallArr() {
  3532. let arr = this.ballArr;
  3533. let outArr = [];
  3534. for (let index = 0; index < arr.length; index++) {
  3535. if (arr[index] instanceof D2RootBallSrc)
  3536. continue;
  3537. if (arr[index].ballFunc == "ice")
  3538. continue;
  3539. if (arr[index].destroyed)
  3540. continue;
  3541. outArr.push(arr[index]);
  3542. }
  3543. return outArr;
  3544. }
  3545. _getBlackObj() {
  3546. let arr = this.ballArr;
  3547. for (let index = 0; index < arr.length; index++) {
  3548. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3549. return arr[index];
  3550. }
  3551. }
  3552. }
  3553. selectOneBall() {
  3554. let all = this._getAllBallArr();
  3555. let target;
  3556. switch (xGame.common.gameMode) {
  3557. case GameMode.classic:
  3558. if (xGame.common.gameMgr.selfTurn) {
  3559. let self = xGame.common.gameMgr.selfBallArr;
  3560. let black = this._getBlackObj();
  3561. if (xGame.common.gameMgr.ensureBallType) {
  3562. if (self.length > 0) {
  3563. let out = [];
  3564. for (let j = 0; j < all.length; j++) {
  3565. if (self.indexOf(all[j].number) > -1) {
  3566. out.push(all[j]);
  3567. }
  3568. }
  3569. target = this.selectBestEnterOne(out);
  3570. }
  3571. else {
  3572. target = this.selectBestEnterOne([black]);
  3573. }
  3574. }
  3575. else {
  3576. target = this.selectBestEnterOne(all);
  3577. }
  3578. }
  3579. else {
  3580. target = this.selectBestEnterOne(all);
  3581. }
  3582. break;
  3583. case GameMode.bigMove:
  3584. target = this.selectBestEnterOne(all);
  3585. break;
  3586. case GameMode.placeBall:
  3587. if (all.length > 0) {
  3588. target = this.selectBestEnterOne(all);
  3589. }
  3590. break;
  3591. default:
  3592. break;
  3593. }
  3594. if (target && !target.destroyed && target.onClick) {
  3595. target.onClick(0, true);
  3596. let num = -200 + xGame.common.randomNum(0, 400);
  3597. num /= 150;
  3598. if (xGame.common.longHelpLine) {
  3599. num = 0;
  3600. }
  3601. this.destRot += num;
  3602. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3603. }
  3604. }
  3605. removeOneBall(ball) {
  3606. for (let index = 0; index < this.ballArr.length; index++) {
  3607. if (this.ballArr[index].id == ball.id) {
  3608. this.ballArr.splice(index, 1);
  3609. break;
  3610. }
  3611. }
  3612. }
  3613. getHelpLine() {
  3614. this.d2HelpLine.ui.dirDot.visible = false;
  3615. this.isOnSameLine = false;
  3616. let startX = this.rootBall.gameObj.x;
  3617. let startY = this.rootBall.gameObj.y;
  3618. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3619. if (dis == null) {
  3620. this.d2HelpLine.ui.visible = false;
  3621. console.error("辅助线异常");
  3622. return;
  3623. }
  3624. this.d2HelpLine.ui.visible = true;
  3625. let angle = this.d2Gan.ui.rotation;
  3626. let radius = 16.5;
  3627. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3628. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3629. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3630. if (colliObj == null) {
  3631. this.getColliPos(disX, disY, radius, angle);
  3632. xGame.common.d2World.isHelpLineOnBall = false;
  3633. this.targetBall = null;
  3634. this.reflectAngle = 0;
  3635. this.showBallWrongEft();
  3636. }
  3637. else {
  3638. let target = colliObj.src;
  3639. let radius = 16.5;
  3640. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3641. dis1 = Math.sqrt(dis1);
  3642. let realDis = colliObj.disHon - dis1;
  3643. let dir = colliObj.dir;
  3644. let xx = startX + dir.x * realDis;
  3645. let yy = startY + dir.y * realDis;
  3646. this.getColliPos(xx, yy, radius, angle);
  3647. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3648. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3649. let offset = xGame.common.rodOffest;
  3650. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3651. this.isOnSameLine = true;
  3652. }
  3653. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3654. xGame.common.d2World.isHelpLineOnBall = true;
  3655. this.targetBall = target;
  3656. this.reflectAngle = reflectAngle;
  3657. this.showBallWrongEft();
  3658. if (xGame.common.longHelpLine) {
  3659. this.delayReflectLine(target, reflectAngle);
  3660. }
  3661. }
  3662. }
  3663. getBorderDot(startX, startY, angle) {
  3664. let radius = 17;
  3665. let distance;
  3666. let isDone;
  3667. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3668. isDone = this.judgeUpDown(distance, angle, startX);
  3669. if (isDone != null) {
  3670. return isDone;
  3671. }
  3672. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3673. isDone = this.judgeUpDown(distance, angle, startX);
  3674. if (isDone != null) {
  3675. return isDone;
  3676. }
  3677. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3678. isDone = this.judgeLeftRight(distance, angle, startY);
  3679. if (isDone != null) {
  3680. return isDone;
  3681. }
  3682. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3683. isDone = this.judgeLeftRight(distance, angle, startY);
  3684. if (isDone != null) {
  3685. return isDone;
  3686. }
  3687. }
  3688. judgeUpDown(distance, angle, startX) {
  3689. let flag = Math.sin(angle * Math.PI / 180);
  3690. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3691. if (distance >= 0) {
  3692. if (flag > 0) {
  3693. if (temp < this.borderRect.x + this.borderRect.width) {
  3694. return distance;
  3695. }
  3696. }
  3697. else {
  3698. if (temp > this.borderRect.x) {
  3699. return distance;
  3700. }
  3701. }
  3702. }
  3703. }
  3704. judgeLeftRight(distance, angle, starY) {
  3705. let flag = -Math.cos(angle * Math.PI / 180);
  3706. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3707. if (distance >= 0) {
  3708. if (flag > 0) {
  3709. if (temp < this.borderRect.y + this.borderRect.height) {
  3710. return distance;
  3711. }
  3712. }
  3713. else {
  3714. if (temp > this.borderRect.y) {
  3715. return distance;
  3716. }
  3717. }
  3718. }
  3719. }
  3720. clearBallAllEft() {
  3721. let temp;
  3722. for (let index = 0; index < this.ballArr.length; index++) {
  3723. temp = this.ballArr[index];
  3724. temp.clearBallEft();
  3725. }
  3726. }
  3727. showBallRightEft() {
  3728. let gameMgr = xGame.common.gameMgr;
  3729. let temp;
  3730. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3731. if (targetArr.length <= 0)
  3732. return;
  3733. for (let index = 0; index < this.ballArr.length; index++) {
  3734. temp = this.ballArr[index];
  3735. if (targetArr.indexOf(temp.number) > -1) {
  3736. temp.showRightEft();
  3737. }
  3738. }
  3739. }
  3740. showBallWrongEft() {
  3741. let gameMgr = xGame.common.gameMgr;
  3742. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3743. if (targetArr.length <= 0)
  3744. return;
  3745. let temp;
  3746. for (let index = 0; index < this.ballArr.length; index++) {
  3747. temp = this.ballArr[index];
  3748. if (this.targetBall && this.targetBall.number == temp.number) {
  3749. if (targetArr.indexOf(temp.number) <= -1) {
  3750. temp.showWrongEft();
  3751. }
  3752. else {
  3753. temp.clearBallWrongEft();
  3754. }
  3755. }
  3756. else {
  3757. temp.clearBallWrongEft();
  3758. }
  3759. }
  3760. }
  3761. getColliPos(x, y, radius, angle) {
  3762. this.d2HelpLine.ui.x = x;
  3763. this.d2HelpLine.ui.y = y;
  3764. let dirX = x - this.rootBall.gameObj.x;
  3765. let dirY = y - this.rootBall.gameObj.y;
  3766. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3767. if (rectH <= 0)
  3768. rectH = 0;
  3769. this.d2HelpLine.ui.rect.height = 0;
  3770. this.d2HelpLine.ui.rect.height = rectH;
  3771. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3772. if (rectH < this.rootBall.gameObj.width) {
  3773. this.d2HelpLine.ui.rect.visible = false;
  3774. }
  3775. else {
  3776. this.d2HelpLine.ui.rect.visible = true;
  3777. }
  3778. this.d2HelpLine.ui.dir.visible = false;
  3779. this.d2HelpLine.ui.rootDir.visible = false;
  3780. }
  3781. getReflectLine(x, y, radius, target) {
  3782. this.d2HelpLine.ui.dir.visible = true;
  3783. let dirX = target.x - x;
  3784. let dirY = target.y - y;
  3785. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3786. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3787. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3788. this.d2HelpLine.ui.dir.height = 48;
  3789. this.d2HelpLine.ui.dir.rotation = angle;
  3790. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3791. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3792. return angle;
  3793. }
  3794. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3795. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3796. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3797. let targetX = target.gameObj.x;
  3798. let targetY = target.gameObj.y;
  3799. this.outDir.setValue(targetX - xx, targetY - yy);
  3800. this.rootDir.setValue(rtX - xx, rtY - yy);
  3801. let ver = Math.PI / 2;
  3802. let sin = Math.sin(ver);
  3803. let cos = Math.cos(ver);
  3804. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3805. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3806. this.outDir.setValue(outX, outY);
  3807. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3808. Laya.Vector2.normalize(this.outDir, this.outDir);
  3809. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3810. if (Math.abs(result) <= 0.08) {
  3811. this.d2HelpLine.ui.rootDir.visible = false;
  3812. return;
  3813. }
  3814. if (result > 0) {
  3815. angle += 90;
  3816. }
  3817. else if (result < 0) {
  3818. angle -= 90;
  3819. }
  3820. this.d2HelpLine.ui.rootDir.visible = true;
  3821. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3822. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3823. this.d2HelpLine.ui.rootDir.rotation = angle;
  3824. }
  3825. delayReflectLine(obj, angle) {
  3826. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3827. return;
  3828. }
  3829. this.isOnSameLine = false;
  3830. let startX = obj.gameObj.x;
  3831. let startY = obj.gameObj.y;
  3832. let dis = this.getBorderDot(startX, startY, angle);
  3833. if (dis == null) {
  3834. this.d2HelpLine.ui.dirDot.visible = false;
  3835. return;
  3836. }
  3837. this.d2HelpLine.ui.visible = true;
  3838. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3839. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3840. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3841. if (colliObj == null) {
  3842. this.setDelayLine(disX, disY, obj, angle);
  3843. }
  3844. else {
  3845. let radius = 16;
  3846. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3847. dis1 = Math.sqrt(dis1);
  3848. let realDis = colliObj.disHon - dis1;
  3849. let dir = colliObj.dir;
  3850. let xx = startX + dir.x * realDis;
  3851. let yy = startY + dir.y * realDis;
  3852. this.setDelayLine(xx, yy, obj, angle);
  3853. }
  3854. }
  3855. setDelayLine(x, y, obj, angle) {
  3856. let dirX = x - obj.gameObj.x;
  3857. let dirY = y - obj.gameObj.y;
  3858. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3859. if (rectH <= 0)
  3860. rectH = 0;
  3861. this.d2HelpLine.ui.dir.height = rectH;
  3862. this.d2HelpLine.ui.dirDot.visible = true;
  3863. this.d2HelpLine.ui.dirDot.x = 17;
  3864. this.d2HelpLine.ui.dirDot.y = 17;
  3865. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3866. ;
  3867. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3868. }
  3869. changePlayerView() {
  3870. if (Math.random() >= 0.7)
  3871. return;
  3872. if (!this.targetBall) {
  3873. return;
  3874. }
  3875. if (!xGame.common.gameMgr.selfTurn)
  3876. return;
  3877. switch (xGame.common.gameMode) {
  3878. case GameMode.classic:
  3879. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3880. if (this.targetBall.number != 8) {
  3881. return;
  3882. }
  3883. }
  3884. break;
  3885. case GameMode.bigMove:
  3886. return;
  3887. case GameMode.placeBall:
  3888. break;
  3889. default:
  3890. break;
  3891. }
  3892. let startX = this.targetBall.gameObj.x;
  3893. let startY = this.targetBall.gameObj.y;
  3894. let angle = this.reflectAngle;
  3895. let dis = this.getBorderDot(startX, startY, angle);
  3896. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3897. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3898. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3899. if (colliObj) {
  3900. return;
  3901. }
  3902. let offset = 40;
  3903. let posObj = xGame.common.gameMgr.posObj;
  3904. let temp;
  3905. let radius;
  3906. let tarX, tarY;
  3907. for (const key in posObj) {
  3908. temp = posObj[key];
  3909. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3910. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3911. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3912. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3913. xGame.common.showOneCamera("angle" + key);
  3914. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3915. Laya.physicsTimer.scale = 0.7;
  3916. break;
  3917. }
  3918. }
  3919. }
  3920. selectBestEnterOne(arr) {
  3921. this.aiLv = xGame.tools.random(1, 11);
  3922. this.aiLv = 10;
  3923. this.wBall = xGame.common.d2World.rootBall;
  3924. this.rootPos.x = this.wBall.gameObj.x;
  3925. this.rootPos.y = this.wBall.gameObj.y;
  3926. this.initHoleBall(arr);
  3927. return this.selectBall();
  3928. }
  3929. selectBall() {
  3930. let ball = null;
  3931. this.destRot = 0;
  3932. let ai = 110 - this.aiLv * 10;
  3933. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3934. let score = false;
  3935. if (this.scoreBall.length < 1) {
  3936. if (this.lineBall.length < 1) {
  3937. for (let i = 0; i < this.kickBall.length; i++) {
  3938. let list = [];
  3939. let bo = this.kickBall[i];
  3940. let bobj = bo.gameObj;
  3941. let rect = xGame.common.d2World.borderRect;
  3942. let mobj = this.wBall.gameObj;
  3943. let minb = bobj.y - rect.y - 20;
  3944. let minw = mobj.y - rect.y - 50;
  3945. if (minb > 0 && minw > 0) {
  3946. let dlenx = 0;
  3947. let dleny = mobj.y - rect.y;
  3948. let spx = mobj.x;
  3949. let spy = rect.y - dleny;
  3950. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3951. }
  3952. minb = rect.y + rect.height - bobj.y - 20;
  3953. minw = rect.y + rect.height - mobj.y - 50;
  3954. if (minb > 0 && minw > 0) {
  3955. let dlenx = 0;
  3956. let dleny = rect.y + rect.height - mobj.y;
  3957. let spx = mobj.x;
  3958. let spy = rect.y + rect.height + dleny;
  3959. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3960. }
  3961. minb = bobj.x - rect.x - 20;
  3962. minw = mobj.x - rect.x - 50;
  3963. if (minb > 0 && minw > 0) {
  3964. let dlenx = mobj.x - rect.x;
  3965. let dleny = 0;
  3966. let spx = rect.x - dlenx;
  3967. let spy = mobj.y;
  3968. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3969. }
  3970. minb = rect.x + rect.width - bobj.x - 20;
  3971. minw = rect.x + rect.width - mobj.x - 50;
  3972. if (minb > 0 && minw > 0) {
  3973. let dlenx = rect.x + rect.width - mobj.x;
  3974. let dleny = 0;
  3975. let spx = rect.x + rect.width + dlenx;
  3976. let spy = mobj.y;
  3977. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3978. }
  3979. list.sort(function (a, b) {
  3980. return a.order - b.order;
  3981. });
  3982. for (let i = 0; i < list.length; i++) {
  3983. let data = list[i];
  3984. let mx = mobj.x - bobj.x;
  3985. let my = mobj.y - bobj.y;
  3986. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3987. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3988. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3989. if (num > 1)
  3990. num = 1;
  3991. let cos = Math.acos(num);
  3992. if (cos > 1.57)
  3993. cos = 1.57;
  3994. else if (cos < 0.01)
  3995. cos = 0.01;
  3996. let tan = Math.tan(cos);
  3997. let dx = tan * data.dleny;
  3998. let dy = tan * data.dlenx;
  3999. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4000. if (Math.abs(bx - 667) < 40)
  4001. continue;
  4002. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4003. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4004. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4005. this.forceMax = dis * 0.08;
  4006. this.destRot += mis * 0.1;
  4007. this.setKick(bx, by);
  4008. return true;
  4009. }
  4010. }
  4011. }
  4012. }
  4013. else {
  4014. ball = xGame.common.getRandArrEle(this.lineBall);
  4015. }
  4016. }
  4017. else {
  4018. for (let i = 0; i < this.scoreBall.length; i++) {
  4019. if (i < this.scoreBall.length - 1) {
  4020. let rand = 70 + this.aiLv * 10 + i * 10;
  4021. if (xGame.tools.random(0, 100) < rand) {
  4022. ball = this.scoreBall[i];
  4023. break;
  4024. }
  4025. }
  4026. else {
  4027. ball = this.scoreBall[i];
  4028. break;
  4029. }
  4030. }
  4031. score = true;
  4032. this.selectNum++;
  4033. }
  4034. if (!ball)
  4035. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4036. let dx = ball.gameObj.x;
  4037. let dy = ball.gameObj.y;
  4038. let kickAngle = 0;
  4039. if (score) {
  4040. dx = ball.kickPos.x;
  4041. dy = ball.kickPos.y;
  4042. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4043. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4044. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4045. if (adot > 1)
  4046. adot = 1;
  4047. kickAngle = Math.acos(adot) * 57.3;
  4048. if (kickAngle > 45) {
  4049. let kdx = ball.kickPos.x - ball.gameObj.x;
  4050. let kdy = ball.kickPos.y - ball.gameObj.y;
  4051. dx = ball.kickPos.x - kdx * mis * 0.3;
  4052. dy = ball.kickPos.y - kdy * mis * 0.3;
  4053. }
  4054. else
  4055. this.destRot += mis;
  4056. }
  4057. else if (ball.poleAngle != 0) {
  4058. this.destRot += ball.poleAngle;
  4059. }
  4060. if (xGame.common.gameMode == 0) {
  4061. let af = kickAngle * 0.08;
  4062. this.forceMax = ball.hard * 0.1 + af * af;
  4063. }
  4064. this.setKick(dx, dy);
  4065. return ball;
  4066. }
  4067. initHoleBall(arr) {
  4068. this.kickBall = [];
  4069. this.lineBall = [];
  4070. this.scoreBall = [];
  4071. this.holeBall = [];
  4072. this.selectNum = 0;
  4073. this.forceNum = 0;
  4074. this.forceMax = 0;
  4075. this.turnNum = 0;
  4076. let list = arr;
  4077. let holes = xGame.common.gameMgr.holePosList;
  4078. let self = xGame.common.aiPlayer;
  4079. for (let i = 0; i < list.length; i++) {
  4080. let obj = list[i];
  4081. if (!obj)
  4082. continue;
  4083. obj.kickPos.x = 0;
  4084. obj.kickPos.y = 0;
  4085. obj.poleAngle = 0;
  4086. obj.hard = 0;
  4087. obj.borderDis = 0;
  4088. obj.kickAngle = 180;
  4089. let b = obj.gameObj;
  4090. let wbp = this.rootPos;
  4091. let bx = wbp.x - b.x;
  4092. let by = wbp.y - b.y;
  4093. obj.borderDis = xGame.tools.random(0, 100);
  4094. this.kickBall.push(obj);
  4095. if (!this.isLine(wbp, obj))
  4096. continue;
  4097. obj.kickAngle = xGame.tools.random(90, 180);
  4098. obj.kickPos.x = b.x;
  4099. obj.kickPos.y = b.y;
  4100. this.lineBall.push(obj);
  4101. let minDis = 999999;
  4102. let hole = false;
  4103. for (let j = 0; j < holes.length; j++) {
  4104. let hp = holes[j];
  4105. if (bx >= 0 && hp.x > b.x + 100)
  4106. continue;
  4107. if (bx <= 0 && hp.x < b.x - 100)
  4108. continue;
  4109. if (by < -10 && hp.y < wbp.y)
  4110. continue;
  4111. if (by > 10 && hp.y > wbp.y)
  4112. continue;
  4113. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4114. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4115. if (dis < minDis) {
  4116. let dx = b.x - this.tempDir1.x * this.ballSize;
  4117. let dy = b.y - this.tempDir1.y * this.ballSize;
  4118. this.tempDir3.x = this.tempDir1.x;
  4119. this.tempDir3.y = this.tempDir1.y;
  4120. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4121. obj.kickPos.x = dx;
  4122. obj.kickPos.y = dy;
  4123. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4124. if (num > 1)
  4125. num = 1;
  4126. obj.kickAngle = Math.acos(num) * 57.3;
  4127. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4128. dis = dis * 2;
  4129. if (Math.abs(hp.x - 600) < 100)
  4130. dis += 50;
  4131. obj.hard = dis + obj.kickAngle * 3;
  4132. hole = true;
  4133. }
  4134. }
  4135. }
  4136. }
  4137. if (hole) {
  4138. this.scoreBall.push(obj);
  4139. this.holeBall.push(obj);
  4140. }
  4141. }
  4142. this.scoreBall.sort(function (a, b) {
  4143. return a.hard - b.hard;
  4144. });
  4145. this.holeBall.sort(function (a, b) {
  4146. return a.kickAngle - b.kickAngle;
  4147. });
  4148. this.kickBall.sort(function (a, b) {
  4149. return a.borderDis - b.borderDis;
  4150. });
  4151. }
  4152. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4153. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4154. let balls = xGame.common.d2World.ballArr;
  4155. let max = xGame.tools.getDis(hx, hy, bx, by);
  4156. for (let index = 0; index < balls.length; index++) {
  4157. let obj = balls[index];
  4158. if (obj.number == 0)
  4159. continue;
  4160. if (obj.number == bn || obj.number == dn)
  4161. continue;
  4162. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4163. if (dis * dis > max)
  4164. continue;
  4165. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4166. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4167. if (num > 1)
  4168. num = 1;
  4169. if (num < 0)
  4170. continue;
  4171. let gap = Math.sin(Math.acos(num)) * dis;
  4172. if (gap < this.ballSize)
  4173. return true;
  4174. }
  4175. return false;
  4176. }
  4177. isLine(xy, ball) {
  4178. let bx = xy.x;
  4179. let by = xy.y;
  4180. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4181. let dis = ball.getDestDis(xy);
  4182. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4183. let sin = Math.sin(angle);
  4184. let cos = Math.cos(angle);
  4185. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4186. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4187. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4188. let dx = bx + this.tempDir2.x * dis;
  4189. let dy = by + this.tempDir2.y * dis;
  4190. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4191. sin = Math.sin(-angle);
  4192. cos = Math.cos(-angle);
  4193. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4194. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4195. dx = bx + this.tempDir2.x * dis;
  4196. dy = by + this.tempDir2.y * dis;
  4197. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4198. if (isr && isl)
  4199. return false;
  4200. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4201. }
  4202. return true;
  4203. }
  4204. setKick(dx, dy) {
  4205. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4206. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4207. this.tempDir1.x = 0;
  4208. this.tempDir1.y = 1;
  4209. this.tempDir2.y = -this.tempDir2.y;
  4210. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4211. if (num > 1)
  4212. num = 1;
  4213. let rot = Math.acos(num) * 57.3;
  4214. if (this.tempDir2.x < 0)
  4215. rot = 360 - rot;
  4216. this.destRot += rot;
  4217. }
  4218. }
  4219. class ui_UIGame extends fgui.GComponent {
  4220. static createInstance() {
  4221. return (fgui.UIPackage.createObject("game", "UIGame"));
  4222. }
  4223. onConstruct() {
  4224. this.c1 = this.getController("c1");
  4225. this.d3Root = (this.getChild("d3Root"));
  4226. this.clickNode = (this.getChild("clickNode"));
  4227. this.d2Root = (this.getChild("d2Root"));
  4228. this.topNode = (this.getChild("topNode"));
  4229. this.n72 = (this.getChild("n72"));
  4230. this.n40 = (this.getChild("n40"));
  4231. this.rulerNode = (this.getChild("rulerNode"));
  4232. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4233. this.n50 = (this.getChild("n50"));
  4234. this.keduNode = (this.getChild("keduNode"));
  4235. this.powerTxt = (this.getChild("powerTxt"));
  4236. this.powerNode = (this.getChild("powerNode"));
  4237. this.colorNode = (this.getChild("colorNode"));
  4238. this.powerEft = (this.getChild("powerEft"));
  4239. this.myPowerNode = (this.getChild("myPowerNode"));
  4240. this.ganNode = (this.getChild("ganNode"));
  4241. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4242. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4243. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4244. this.skillRod = (this.getChild("skillRod"));
  4245. this.border = (this.getChild("border"));
  4246. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4247. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4248. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4249. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4250. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4251. this.guanyuNode = (this.getChild("guanyuNode"));
  4252. this.helpBtn = (this.getChild("helpBtn"));
  4253. this.wordsBtn = (this.getChild("wordsBtn"));
  4254. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4255. this.returnBtn = (this.getChild("returnBtn"));
  4256. this.ballNode = (this.getChild("ballNode"));
  4257. this.whiteAni = (this.getChild("whiteAni"));
  4258. this.blackAni = (this.getChild("blackAni"));
  4259. this.selfTurn = (this.getChild("selfTurn"));
  4260. this.aiTurn = (this.getChild("aiTurn"));
  4261. this.deskNode = (this.getChild("deskNode"));
  4262. this.moveNode = (this.getChild("moveNode"));
  4263. this.selfTalk = (this.getChild("selfTalk"));
  4264. this.aiTalk = (this.getChild("aiTalk"));
  4265. this.d2Node = (this.getChild("d2Node"));
  4266. this.snowNode = (this.getChild("snowNode"));
  4267. this.guide2 = (this.getChild("guide2"));
  4268. this.guide1 = (this.getChild("guide1"));
  4269. this.guide3 = (this.getChild("guide3"));
  4270. this.guideNode = (this.getChild("guideNode"));
  4271. }
  4272. }
  4273. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4274. class ui_UIGameEnd extends fgui.GComponent {
  4275. static createInstance() {
  4276. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4277. }
  4278. onConstruct() {
  4279. this.c1 = this.getController("c1");
  4280. this.n22 = (this.getChild("n22"));
  4281. this.n2 = (this.getChild("n2"));
  4282. this.n52 = (this.getChild("n52"));
  4283. this.n53 = (this.getChild("n53"));
  4284. this.coinNode = (this.getChild("coinNode"));
  4285. this.closeNode = (this.getChild("closeNode"));
  4286. this.moneyNode = (this.getChild("moneyNode"));
  4287. this.secretary = (this.getChild("secretary"));
  4288. this.n27 = (this.getChild("n27"));
  4289. this.n29 = (this.getChild("n29"));
  4290. this.talkNode = (this.getChild("talkNode"));
  4291. this.n38 = (this.getChild("n38"));
  4292. this.n39 = (this.getChild("n39"));
  4293. this.n40 = (this.getChild("n40"));
  4294. this.awardNode = (this.getChild("awardNode"));
  4295. this.starNumNode = (this.getChild("starNumNode"));
  4296. this.n47 = (this.getChild("n47"));
  4297. this.conditionNode = (this.getChild("conditionNode"));
  4298. this.isGetAward = (this.getChild("isGetAward"));
  4299. this.leftBtn = (this.getChild("leftBtn"));
  4300. this.rightBtn = (this.getChild("rightBtn"));
  4301. this.btnNode = (this.getChild("btnNode"));
  4302. }
  4303. }
  4304. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4305. class ui_UIAddCoin extends fgui.GComponent {
  4306. static createInstance() {
  4307. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4308. }
  4309. onConstruct() {
  4310. this.n11 = (this.getChild("n11"));
  4311. this.myNode = (this.getChild("myNode"));
  4312. this.t0 = this.getTransition("t0");
  4313. }
  4314. }
  4315. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4316. class UIAddCoin extends UIBase {
  4317. constructor() {
  4318. super();
  4319. this.coinNum = 2000;
  4320. }
  4321. onConstructor() {
  4322. this.ui = ui_UIAddCoin.createInstance();
  4323. this.contentPane = this.ui;
  4324. this.isEject = false;
  4325. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4326. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4327. }
  4328. show() {
  4329. super.show();
  4330. this.ui.t0.play();
  4331. }
  4332. videoAddCoin() {
  4333. console.log('zh:qjff_AD_for_UIAddCoin');
  4334. if (Laya.Browser.onAndroid) {
  4335. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4336. if (!boo) {
  4337. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4338. return;
  4339. }
  4340. }
  4341. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4342. }
  4343. else {
  4344. console.log('zh:AD 失败,直接发放奖励');
  4345. this.qjff_AD_for_UIAddCoin();
  4346. }
  4347. }
  4348. qjff_AD_for_UIAddCoin() {
  4349. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4350. this.hide();
  4351. }
  4352. }
  4353. UIAddCoin.uiName = "UIAddCoin";
  4354. class ui_UIInvitation extends fgui.GComponent {
  4355. static createInstance() {
  4356. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4357. }
  4358. onConstruct() {
  4359. this.n14 = (this.getChild("n14"));
  4360. this.myNode = (this.getChild("myNode"));
  4361. this.t0 = this.getTransition("t0");
  4362. }
  4363. }
  4364. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4365. class UIInvitation extends UIBase {
  4366. constructor() {
  4367. super();
  4368. }
  4369. onConstructor() {
  4370. this.ui = ui_UIInvitation.createInstance();
  4371. this.contentPane = this.ui;
  4372. this.isEject = false;
  4373. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4374. }
  4375. show() {
  4376. super.show();
  4377. }
  4378. enterGame() {
  4379. xGame.common.gameMode = GameMode.classic;
  4380. DataMgr.setChallengeTimes(1);
  4381. xGame.common.passAwardCoin = 2000;
  4382. let need = xGame.common.classicNiceNeddCoin;
  4383. if (DataMgr.coinEnough(need)) {
  4384. DataMgr.setCoin(-need);
  4385. xGame.eventMgr.event(RESTART_GAME, true);
  4386. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4387. }
  4388. else {
  4389. xGame.eventMgr.event(RESTART_GAME, true);
  4390. }
  4391. this.hide();
  4392. }
  4393. hide() {
  4394. super.hide();
  4395. }
  4396. }
  4397. UIInvitation.uiName = "UIInvitation";
  4398. class ui_UIMain extends fgui.GComponent {
  4399. static createInstance() {
  4400. return (fgui.UIPackage.createObject("game", "UIMain"));
  4401. }
  4402. onConstruct() {
  4403. this.n47 = (this.getChild("n47"));
  4404. this.n10 = (this.getChild("n10"));
  4405. this.secretary = (this.getChild("secretary"));
  4406. this.shopBtn = (this.getChild("shopBtn"));
  4407. this.moneyNode = (this.getChild("moneyNode"));
  4408. this.headNode = (this.getChild("headNode"));
  4409. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4410. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4411. this.classicBtn = (this.getChild("classicBtn"));
  4412. this.globalBtn = (this.getChild("globalBtn"));
  4413. this.n44 = (this.getChild("n44"));
  4414. this.signBtn = (this.getChild("signBtn"));
  4415. this.drawBtn = (this.getChild("drawBtn"));
  4416. this.settingNode = (this.getChild("settingNode"));
  4417. this.n_fuli = (this.getChild("n_fuli"));
  4418. this.n45 = (this.getChild("n45"));
  4419. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4420. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4421. this.rankBtn = (this.getChild("rankBtn"));
  4422. this.n46 = (this.getChild("n46"));
  4423. this.liucheng1 = (this.getChild("liucheng1"));
  4424. this.rightBtn = (this.getChild("rightBtn"));
  4425. this.n75 = (this.getChild("n75"));
  4426. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4427. this.liucheng2 = (this.getChild("liucheng2"));
  4428. this.guideBtn = (this.getChild("guideBtn"));
  4429. this.n73 = (this.getChild("n73"));
  4430. this.wordsNode = (this.getChild("wordsNode"));
  4431. this.enterGuide = (this.getChild("enterGuide"));
  4432. this.talkNode = (this.getChild("talkNode"));
  4433. this.n83 = (this.getChild("n83"));
  4434. this.n84 = (this.getChild("n84"));
  4435. this.n_Logout = (this.getChild("n_Logout"));
  4436. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4437. this.n_dengLu = (this.getChild("n_dengLu"));
  4438. }
  4439. }
  4440. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4441. class ui_UIMoyu extends fgui.GComponent {
  4442. static createInstance() {
  4443. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4444. }
  4445. onConstruct() {
  4446. this.ageTip = (this.getChild("ageTip"));
  4447. this.mainBg = (this.getChild("mainBg"));
  4448. this.xyNode = (this.getChild("xyNode"));
  4449. this.rnNode = (this.getChild("rnNode"));
  4450. this.fcmNode = (this.getChild("fcmNode"));
  4451. this.ageNode = (this.getChild("ageNode"));
  4452. this.tipNode = (this.getChild("tipNode"));
  4453. this.msgNode = (this.getChild("msgNode"));
  4454. }
  4455. }
  4456. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4457. class MoyuMgr {
  4458. static initMoyu() {
  4459. this.moyuView = new MoyuView();
  4460. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4461. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4462. this.moyuView.ui.displayObject.zOrder = 1000;
  4463. this.moyuView.init();
  4464. this.moyuView.showTip(true);
  4465. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4466. window['XApk'] = this;
  4467. }
  4468. static showAge(show) {
  4469. if (this.moyuView)
  4470. this.moyuView.showAge(show);
  4471. }
  4472. static onPlatMsg(idx) {
  4473. if (!MoyuMgr.moyuView)
  4474. return;
  4475. if (idx == '0') {
  4476. MoyuMgr.moyuView.showTip(false);
  4477. }
  4478. }
  4479. static showAgree(call) {
  4480. if (this.moyuView)
  4481. this.moyuView.showAgree(call);
  4482. else
  4483. call && call();
  4484. }
  4485. static showXy(type = 1) {
  4486. if (this.moyuView)
  4487. this.moyuView.showXy(type);
  4488. }
  4489. }
  4490. MoyuMgr.isAdvise = false;
  4491. class MoyuView {
  4492. constructor() {
  4493. this.ysxyNum = 1;
  4494. this.ysJson = null;
  4495. this.ui = ui_UIMoyu.createInstance();
  4496. }
  4497. init() {
  4498. this.ui.mainBg.visible = false;
  4499. this.ui.xyNode.visible = false;
  4500. this.ui.ageNode.visible = false;
  4501. this.ui.tipNode.visible = false;
  4502. this.ui.rnNode.visible = false;
  4503. this.ui.fcmNode.visible = false;
  4504. this.ui.ageTip.visible = false;
  4505. this.ui.msgNode.visible = false;
  4506. this.ui.visible = false;
  4507. this.ui.xyNode.xyList.setVirtual();
  4508. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4509. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4510. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4511. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4512. this.ui.xyNode.btnKnown.visible = false;
  4513. this.ui.xyNode.xy1.visible = false;
  4514. this.ui.xyNode.xy2.visible = false;
  4515. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4516. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4517. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4518. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4519. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4520. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4521. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4522. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4523. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4524. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4525. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4526. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4527. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4528. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4529. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4530. this.ysxyNum = 2;
  4531. }
  4532. }
  4533. onClick(obj) {
  4534. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4535. switch (obj) {
  4536. case this.ui.ageTip:
  4537. if (Moyu.isTTApk) {
  4538. this.ui.ageNode.visible = true;
  4539. this.ui.mainBg.visible = true;
  4540. }
  4541. break;
  4542. case this.ui.tipNode:
  4543. this.showTip(false);
  4544. break;
  4545. case this.ui.ageNode.btnAge:
  4546. this.ui.ageNode.visible = false;
  4547. this.ui.mainBg.visible = false;
  4548. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4549. this.ui.visible = false;
  4550. break;
  4551. case this.ui.xyNode.btnXy3:
  4552. case this.ui.xyNode.btnXy1:
  4553. this.loadXy(1);
  4554. break;
  4555. case this.ui.xyNode.btnXy2:
  4556. this.loadXy(2);
  4557. break;
  4558. case this.ui.xyNode.btnBack:
  4559. this.ui.xyNode.xy1.visible = true;
  4560. this.ui.xyNode.xy2.visible = false;
  4561. break;
  4562. case this.ui.xyNode.btnKnown:
  4563. this.ui.xyNode.visible = false;
  4564. this.ui.mainBg.visible = false;
  4565. this.ui.visible = false;
  4566. break;
  4567. case this.ui.rnNode.btnCheck:
  4568. this.check();
  4569. break;
  4570. case this.ui.rnNode.btnExit:
  4571. case this.ui.xyNode.btnNo:
  4572. this.ysxyNum--;
  4573. if (this.ysxyNum > 0)
  4574. this.showMsg("Refuse to quit the game once again");
  4575. else {
  4576. Moyu.userAgree(false);
  4577. Moyu.exit();
  4578. }
  4579. break;
  4580. case this.ui.xyNode.btnSure:
  4581. case this.ui.xyNode.btnYes:
  4582. DataMgr.userData.isAgree = true;
  4583. DataMgr.saveUserData();
  4584. this.onAgree();
  4585. break;
  4586. case this.ui.rnNode.btnDone:
  4587. this.ui.rnNode.visible = false;
  4588. this.ui.visible = false;
  4589. break;
  4590. case this.ui.fcmNode.btnRn:
  4591. this.showRn();
  4592. break;
  4593. }
  4594. }
  4595. showTip(show) {
  4596. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4597. return;
  4598. if (show) {
  4599. MoyuMgr.isAdvise = true;
  4600. this.ui.visible = true;
  4601. this.ui.tipNode.visible = true;
  4602. this.ui.tipNode.alpha = 1;
  4603. Laya.timer.once(1000, this, this.showTip, [false]);
  4604. }
  4605. else {
  4606. this.ui.tipNode.alpha = 1;
  4607. this.ui.tipNode.visible = true;
  4608. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4609. this.ui.tipNode.visible = false;
  4610. MoyuMgr.isAdvise = false;
  4611. }), 1000);
  4612. }
  4613. }
  4614. showAge(show, px = 0, py = 0) {
  4615. if (Moyu.platType > 10 && !Moyu.isIos) {
  4616. this.ui.ageTip.x = px;
  4617. this.ui.ageTip.y = py;
  4618. this.ui.ageTip.visible = show;
  4619. if (show)
  4620. this.ui.visible = true;
  4621. }
  4622. }
  4623. showAgree(call) {
  4624. this.agreeCall = call;
  4625. this.onAgree();
  4626. return;
  4627. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4628. this.showXy(0);
  4629. }
  4630. else
  4631. this.onAgree();
  4632. }
  4633. onAgree() {
  4634. if (!this.ui.ageNode.visible)
  4635. this.ui.visible = false;
  4636. this.ui.xyNode.visible = false;
  4637. Moyu.userAgree(true);
  4638. this.showAge(false);
  4639. this.agreeCall && this.agreeCall();
  4640. this.showRn();
  4641. }
  4642. showMsg(txt) {
  4643. this.ui.msgNode.txtMsg.text = txt;
  4644. this.ui.msgNode.visible = true;
  4645. this.ui.msgNode.alpha = 1;
  4646. this.ui.visible = true;
  4647. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4648. this.ui.msgNode.visible = false;
  4649. }), 2500, true);
  4650. }
  4651. showRn() {
  4652. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4653. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4654. this.ui.rnNode.rn1.visible = true;
  4655. this.ui.rnNode.rn2.visible = false;
  4656. this.ui.rnNode.rn3.visible = false;
  4657. this.ui.rnNode.rn4.visible = false;
  4658. this.ui.rnNode.visible = true;
  4659. this.ui.mainBg.visible = true;
  4660. this.ui.rnNode.btnDone.visible = false;
  4661. this.ui.rnNode.btnExit.visible = true;
  4662. this.ui.rnNode.btnCheck.visible = true;
  4663. this.ui.fcmNode.visible = false;
  4664. this.ui.visible = true;
  4665. return;
  4666. }
  4667. }
  4668. this.showFcm();
  4669. }
  4670. showFcm() {
  4671. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4672. Moyu.initFCM(true);
  4673. if (Moyu.gameTime < 1)
  4674. this.fcmLoop();
  4675. else if (Moyu.gameTime < 999)
  4676. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4677. }
  4678. }
  4679. fcmLoop() {
  4680. if (Moyu.gameTime < 1) {
  4681. this.ui.rnNode.visible = false;
  4682. this.ui.fcmNode.visible = true;
  4683. this.ui.mainBg.visible = true;
  4684. this.ui.visible = true;
  4685. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4686. Laya.timer.clear(this.ui, this.fcmLoop);
  4687. }
  4688. }
  4689. check() {
  4690. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4691. this.ui.rnNode.rn1.visible = false;
  4692. this.ui.rnNode.rn2.visible = false;
  4693. this.ui.rnNode.rn4.visible = true;
  4694. }
  4695. else if (this.ui.rnNode.rn4.visible) {
  4696. let name = this.ui.rnNode.inputName.text;
  4697. let code = this.ui.rnNode.inputCode.text;
  4698. if (code && code.length == 18) {
  4699. this.ui.rnNode.rn1.visible = false;
  4700. this.ui.rnNode.rn4.visible = false;
  4701. Moyu.authenticate(name, code, (res) => {
  4702. this.ui.rnNode.rn2.visible = !res;
  4703. this.ui.rnNode.rn3.visible = res;
  4704. this.ui.rnNode.btnDone.visible = res;
  4705. this.ui.rnNode.btnExit.visible = !res;
  4706. this.ui.rnNode.btnCheck.visible = !res;
  4707. if (res)
  4708. this.showFcm();
  4709. });
  4710. }
  4711. else
  4712. this.showMsg("信息填写不完整");
  4713. }
  4714. }
  4715. loadXy(type = 0) {
  4716. this.ui.xyNode.xy1.visible = false;
  4717. this.ui.xyNode.xy2.visible = true;
  4718. this.ui.xyNode.xyList.scrollToView(0);
  4719. if (type == 1) {
  4720. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4721. }
  4722. else if (type == 2) {
  4723. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4724. }
  4725. }
  4726. showXy(type = 0) {
  4727. this.xyBtn();
  4728. if (type == 0) {
  4729. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4730. this.ui.xyNode.btnSure.visible = true;
  4731. }
  4732. else {
  4733. this.ui.xyNode.btnYes.visible = true;
  4734. this.ui.xyNode.btnNo.visible = true;
  4735. }
  4736. }
  4737. else {
  4738. this.ui.xyNode.btnKnown.visible = true;
  4739. this.ui.mainBg.visible = true;
  4740. }
  4741. this.ui.xyNode.xy1.visible = true;
  4742. this.ui.xyNode.xy2.visible = false;
  4743. this.ui.xyNode.visible = true;
  4744. this.ui.visible = true;
  4745. }
  4746. xyBtn() {
  4747. this.ui.xyNode.btnSure.visible = false;
  4748. this.ui.xyNode.btnYes.visible = false;
  4749. this.ui.xyNode.btnNo.visible = false;
  4750. this.ui.xyNode.btnKnown.visible = false;
  4751. {
  4752. this.ui.xyNode.btnXy3.visible = false;
  4753. this.ui.xyNode.btnXy2.visible = true;
  4754. this.ui.xyNode.btnXy1.visible = true;
  4755. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4756. }
  4757. }
  4758. createXY(json) {
  4759. this.ysJson = json.content;
  4760. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4761. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4762. this.ui.xyNode.xy2.visible = true;
  4763. }
  4764. renderListItem(idx, cell) {
  4765. let xy = this.ysJson[idx];
  4766. cell.height = xy.line * 30;
  4767. cell.xyItem.text = xy.text;
  4768. }
  4769. onDestroy() {
  4770. this.agreeCall = null;
  4771. }
  4772. }
  4773. class SettingNode {
  4774. constructor(ui) {
  4775. this.showSetting = false;
  4776. this.openSound = true;
  4777. this.openShake = true;
  4778. this.ui = ui;
  4779. this.ui.soundBtn.onClick(this, this.switchSound);
  4780. this.ui.shakeBtn.onClick(this, this.switchShake);
  4781. this.ui.xyBtn.onClick(this, this.onXy);
  4782. this.ui.clickNode.onClick(this, this.changeSetting);
  4783. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4784. this.ui.xyBtn.visible = false;
  4785. this.ui.shakeBtn.visible = false;
  4786. }
  4787. changeSetting() {
  4788. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4789. this.showSetting = !this.showSetting;
  4790. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4791. }
  4792. switchSound() {
  4793. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4794. this.openSound = !this.openSound;
  4795. Moyu.onSetting(this.openSound, this.openShake);
  4796. xGame.soundMgr.onSetting(this.openSound);
  4797. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4798. }
  4799. switchShake() {
  4800. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4801. this.openShake = !this.openShake;
  4802. Moyu.onSetting(this.openSound, this.openShake);
  4803. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4804. }
  4805. onXy() {
  4806. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4807. MoyuMgr.showXy(1);
  4808. }
  4809. }
  4810. class ui_UILevelDisplay extends fgui.GComponent {
  4811. static createInstance() {
  4812. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4813. }
  4814. onConstruct() {
  4815. this.n9 = (this.getChild("n9"));
  4816. this.myNode = (this.getChild("myNode"));
  4817. this.closeNode = (this.getChild("closeNode"));
  4818. }
  4819. }
  4820. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4821. class ui_UILevelProp extends fgui.GComponent {
  4822. static createInstance() {
  4823. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4824. }
  4825. onConstruct() {
  4826. this.n16 = (this.getChild("n16"));
  4827. this.myNode = (this.getChild("myNode"));
  4828. this.closeBtn = (this.getChild("closeBtn"));
  4829. this.moneyNode = (this.getChild("moneyNode"));
  4830. this.t1 = this.getTransition("t1");
  4831. }
  4832. }
  4833. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4834. class ui_ShowItem extends fgui.GComponent {
  4835. static createInstance() {
  4836. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4837. }
  4838. onConstruct() {
  4839. this.myImg = (this.getChild("myImg"));
  4840. }
  4841. }
  4842. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4843. class ShowItem {
  4844. constructor() {
  4845. this.ui = ui_ShowItem.createInstance();
  4846. }
  4847. destroySelf() {
  4848. if (!this.ui.isDisposed) {
  4849. this.ui.removeFromParent();
  4850. this.ui.dispose();
  4851. }
  4852. }
  4853. setParent(parent) {
  4854. parent.addChild(this.ui);
  4855. }
  4856. setPos(x, y) {
  4857. this.ui.x = x;
  4858. this.ui.y = y;
  4859. }
  4860. setUrl(index) {
  4861. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4862. }
  4863. }
  4864. class ui_UIPower extends fgui.GComponent {
  4865. static createInstance() {
  4866. return (fgui.UIPackage.createObject("game", "UIPower"));
  4867. }
  4868. onConstruct() {
  4869. this.n11 = (this.getChild("n11"));
  4870. this.myNode = (this.getChild("myNode"));
  4871. this.t0 = this.getTransition("t0");
  4872. }
  4873. }
  4874. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4875. class UIPower extends UIBase {
  4876. constructor() {
  4877. super();
  4878. }
  4879. onConstructor() {
  4880. this.ui = ui_UIPower.createInstance();
  4881. this.contentPane = this.ui;
  4882. this.isEject = false;
  4883. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4884. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4885. }
  4886. show() {
  4887. super.show();
  4888. this.ui.t0.play();
  4889. }
  4890. videoGetPower() {
  4891. console.log('zh:qjff_AD_for_uipower');
  4892. if (Laya.Browser.onAndroid) {
  4893. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4894. if (!boo) {
  4895. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4896. return;
  4897. }
  4898. }
  4899. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4900. }
  4901. else {
  4902. console.log('zh:AD 失败,直接发放奖励');
  4903. this.qjff_AD_for_uipower();
  4904. }
  4905. }
  4906. qjff_AD_for_uipower() {
  4907. DataMgr.setPower(xGame.common.videoPower, true);
  4908. xGame.eventMgr.event(POWER_TIME);
  4909. this.hide();
  4910. }
  4911. }
  4912. UIPower.uiName = "UIPower";
  4913. class LocalStorageManager {
  4914. test1() {
  4915. LocalStorageManager.setItem("playerName", "Tom");
  4916. LocalStorageManager.setItem("playerLevel", 5);
  4917. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4918. const name = LocalStorageManager.getItem("playerName");
  4919. const level = LocalStorageManager.getItem("playerLevel");
  4920. const data = LocalStorageManager.getItem("playerData");
  4921. console.log(name);
  4922. console.log(level);
  4923. console.log(data);
  4924. LocalStorageManager.removeItem("playerLevel");
  4925. }
  4926. static setItem(key, value) {
  4927. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4928. }
  4929. static getItem(key) {
  4930. const data = Laya.LocalStorage.getItem(key);
  4931. if (data === null)
  4932. return null;
  4933. try {
  4934. return JSON.parse(data);
  4935. }
  4936. catch (e) {
  4937. return data;
  4938. }
  4939. }
  4940. static removeItem(key) {
  4941. Laya.LocalStorage.removeItem(key);
  4942. }
  4943. static clear() {
  4944. Laya.LocalStorage.clear();
  4945. }
  4946. static hasJosnKey(key) {
  4947. var value = Laya.LocalStorage.getJSON(key);
  4948. if (value != null) {
  4949. return true;
  4950. }
  4951. else {
  4952. return false;
  4953. }
  4954. }
  4955. static hasKey(key) {
  4956. return Laya.LocalStorage.getItem(key) !== null;
  4957. }
  4958. }
  4959. class UILevelProp extends UIBase {
  4960. constructor() {
  4961. super();
  4962. this.firstPos = 385;
  4963. this.secondPos = 467;
  4964. this.showItemArr = [];
  4965. }
  4966. onFontLoaded() {
  4967. try {
  4968. this.ui.myNode.conditionTxt.font = "arial";
  4969. console.log("zh: onFontLoaded 设置arial字体成功");
  4970. }
  4971. catch (error) {
  4972. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4973. }
  4974. }
  4975. onConstructor() {
  4976. this.ui = ui_UILevelProp.createInstance();
  4977. this.contentPane = this.ui;
  4978. this.isEject = false;
  4979. this.addUIClick(this.ui.closeBtn, this.hide);
  4980. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4981. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4982. }
  4983. show(level) {
  4984. super.show();
  4985. this.ui.t1.play();
  4986. this.level = level;
  4987. this.data = cfgTable.placeballData[this.level];
  4988. this.updateSelf();
  4989. this.showPreView();
  4990. this.moneyNode.ui.c1.selectedIndex = 2;
  4991. this.moneyNode.checkPowerTime();
  4992. this.moneyNode.powerChange();
  4993. }
  4994. showPreView() {
  4995. let item;
  4996. let data;
  4997. for (let index = 0; index < this.showItemArr.length; index++) {
  4998. item = this.showItemArr[index];
  4999. item.destroySelf();
  5000. }
  5001. this.showItemArr = [];
  5002. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5003. for (const key in cfgData) {
  5004. data = cfgData[key];
  5005. item = new ShowItem();
  5006. item.setParent(this.ui.myNode.displayRoot);
  5007. item.setPos(data.x, data.y);
  5008. item.setUrl(data.value);
  5009. this.showItemArr.push(item);
  5010. }
  5011. }
  5012. updateSelf() {
  5013. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5014. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5015. if (this.data.ball == -1) {
  5016. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5017. }
  5018. else {
  5019. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5020. }
  5021. let localData = DataMgr.getPlaceBallLevel(this.level);
  5022. let getAward = localData.getAward;
  5023. let cfg = cfgTable.placeballData[this.level];
  5024. let coin = this.data.award[0];
  5025. let diamond = this.data.award[1];
  5026. if (cfg.type == PlaceBallType.challenge) {
  5027. diamond = 0;
  5028. coin = 100;
  5029. }
  5030. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5031. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5032. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5033. if (cfg.type == PlaceBallType.challenge) {
  5034. this.ui.myNode.coinNode.numTxt.text = "";
  5035. }
  5036. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5037. if (coin > 0 && diamond > 0) {
  5038. this.ui.myNode.diamondNode.x = 385;
  5039. this.ui.myNode.coinNode.x = 467;
  5040. }
  5041. else {
  5042. this.ui.myNode.diamondNode.x = 385;
  5043. this.ui.myNode.coinNode.x = 385;
  5044. }
  5045. if (!getAward) {
  5046. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5047. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5048. }
  5049. else {
  5050. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5051. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5052. }
  5053. }
  5054. startGame() {
  5055. if (DataMgr.powerEnough()) {
  5056. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5057. this.ui.myNode.startBtn.touchable = false;
  5058. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5059. console.log('zh:startGame ');
  5060. this.ui.myNode.startBtn.touchable = true;
  5061. DataMgr.setPower(-1);
  5062. xGame.eventMgr.event(POWER_TIME);
  5063. xGame.common.gameMode = GameMode.placeBall;
  5064. xGame.common.placeBallCurLevel = this.level;
  5065. xGame.uiMgr.Show(UIGame);
  5066. this.logEventForChallenge_level_start(this.level);
  5067. xGame.uiMgr.Hide(UILevelDisplay);
  5068. xGame.uiMgr.Hide(UIMain);
  5069. this.hide();
  5070. }));
  5071. }
  5072. else {
  5073. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5074. xGame.uiMgr.Show(UIPower);
  5075. }
  5076. }
  5077. logEventForChallenge_level_start(level) {
  5078. let keyStr = 'sjmd_challenge_level_start';
  5079. let jsonStr = {
  5080. "count": 1,
  5081. "gold_balance ": DataMgr.getCoin(),
  5082. "level": level,
  5083. "diamond_balance ": DataMgr.getDiamond()
  5084. };
  5085. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5086. const d = LocalStorageManager.getItem(keyStr);
  5087. if (level > d.level) {
  5088. jsonStr.count = d.count + 1;
  5089. LocalStorageManager.setItem(keyStr, jsonStr);
  5090. }
  5091. else {
  5092. }
  5093. }
  5094. else {
  5095. LocalStorageManager.setItem(keyStr, jsonStr);
  5096. }
  5097. const reqStr = JSON.stringify(jsonStr);
  5098. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5099. }
  5100. hide() {
  5101. super.hide();
  5102. }
  5103. }
  5104. UILevelProp.uiName = "UILevelProp";
  5105. class PutBallLevelDisplay {
  5106. constructor(ui, index) {
  5107. this.index = 0;
  5108. this.ui = ui;
  5109. this.index = index;
  5110. this.ui.onClick(this, this.clickSelf);
  5111. this.updateSelf();
  5112. this.ui.levelTxt.text = (this.index + 1) + "";
  5113. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5114. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5115. }
  5116. updateSelf() {
  5117. let level = this.index + 1;
  5118. this.data = DataMgr.getPlaceBallLevel(level);
  5119. this.ui.starNode.c1.selectedIndex = this.data.star;
  5120. let isChallenge = cfgTable.placeballData[level].type;
  5121. if (this.data.isCur) {
  5122. if (isChallenge) {
  5123. this.ui.c1.selectedIndex = 5;
  5124. }
  5125. else {
  5126. this.ui.c1.selectedIndex = 2;
  5127. }
  5128. }
  5129. else {
  5130. if (this.data.play) {
  5131. if (this.data.star == 3) {
  5132. this.ui.c1.selectedIndex = 0;
  5133. }
  5134. else {
  5135. this.ui.c1.selectedIndex = 1;
  5136. }
  5137. }
  5138. else {
  5139. if (isChallenge) {
  5140. this.ui.c1.selectedIndex = 4;
  5141. }
  5142. else {
  5143. this.ui.c1.selectedIndex = 3;
  5144. }
  5145. }
  5146. }
  5147. }
  5148. clickSelf() {
  5149. if (!this.data.play)
  5150. return;
  5151. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5152. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5153. }
  5154. }
  5155. class UILevelDisplay extends UIBase {
  5156. constructor() {
  5157. super();
  5158. }
  5159. onConstructor() {
  5160. this.ui = ui_UILevelDisplay.createInstance();
  5161. this.contentPane = this.ui;
  5162. this.isEject = false;
  5163. this.myList = this.ui.myNode.myList;
  5164. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5165. this.levelItemArr = [];
  5166. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5167. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5168. this.myList.numItems = levelNum;
  5169. if (Moyu.isKs)
  5170. this.ui.closeNode.closeBtn.x += 100;
  5171. }
  5172. levelItemRender(index, target) {
  5173. let item = new PutBallLevelDisplay(target, index);
  5174. this.levelItemArr.push(item);
  5175. }
  5176. show() {
  5177. super.show();
  5178. this.updateLevel();
  5179. this.scrollToPlace();
  5180. }
  5181. updateLevel() {
  5182. let temp;
  5183. for (let index = 0; index < this.levelItemArr.length; index++) {
  5184. temp = this.levelItemArr[index];
  5185. temp.updateSelf();
  5186. }
  5187. }
  5188. scrollToPlace() {
  5189. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5190. let passArr = DataMgr.getPlaceBallLevelList();
  5191. let offest = passArr.length;
  5192. if (offest >= maxNum - 1)
  5193. offest = maxNum - 1;
  5194. this.myList.scrollToView(offest, true, true);
  5195. }
  5196. hide() {
  5197. super.hide();
  5198. }
  5199. }
  5200. UILevelDisplay.uiName = "UILevelDisplay";
  5201. class ui_UIMatching extends fgui.GComponent {
  5202. static createInstance() {
  5203. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5204. }
  5205. onConstruct() {
  5206. this.n5 = (this.getChild("n5"));
  5207. this.n49 = (this.getChild("n49"));
  5208. this.n51 = (this.getChild("n51"));
  5209. this.n64 = (this.getChild("n64"));
  5210. this.n2 = (this.getChild("n2"));
  5211. this.n53 = (this.getChild("n53"));
  5212. this.n54 = (this.getChild("n54"));
  5213. this.n56 = (this.getChild("n56"));
  5214. this.n58 = (this.getChild("n58"));
  5215. this.n59 = (this.getChild("n59"));
  5216. this.n57 = (this.getChild("n57"));
  5217. this.n60 = (this.getChild("n60"));
  5218. this.n62 = (this.getChild("n62"));
  5219. this.awardTxt = (this.getChild("awardTxt"));
  5220. this.n61 = (this.getChild("n61"));
  5221. this.selfHead = (this.getChild("selfHead"));
  5222. this.aiHead = (this.getChild("aiHead"));
  5223. this.n82 = (this.getChild("n82"));
  5224. this.n84 = (this.getChild("n84"));
  5225. this.n83 = (this.getChild("n83"));
  5226. this.t1 = this.getTransition("t1");
  5227. this.t2 = this.getTransition("t2");
  5228. this.t3 = this.getTransition("t3");
  5229. this.t4 = this.getTransition("t4");
  5230. }
  5231. }
  5232. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5233. class UIMatching extends UIBase {
  5234. constructor() {
  5235. super();
  5236. }
  5237. onConstructor() {
  5238. this.ui = ui_UIMatching.createInstance();
  5239. this.contentPane = this.ui;
  5240. this.isEject = false;
  5241. }
  5242. show(callback) {
  5243. super.show();
  5244. PlatMgr.showBanner(true);
  5245. this.callback = callback;
  5246. let user = Moyu.getUserInfo();
  5247. if (!this.selfPot) {
  5248. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5249. }
  5250. if (!this.aiPot) {
  5251. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5252. }
  5253. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5254. this.ui.selfHead.nameTxt.text = user.nickName;
  5255. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5256. this.ui.aiHead.nameTxt.text = "???";
  5257. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5258. this.ui.selfHead.c1.selectedIndex = 0;
  5259. this.ui.aiHead.c1.selectedIndex = 0;
  5260. this.ui.selfHead.x = this.selfPot.x;
  5261. this.ui.selfHead.y = this.selfPot.y;
  5262. this.ui.aiHead.x = this.aiPot.x;
  5263. this.ui.aiHead.y = this.aiPot.y;
  5264. switch (xGame.common.gameMode) {
  5265. case GameMode.classic:
  5266. break;
  5267. case GameMode.bigMove:
  5268. this.initSkillData();
  5269. break;
  5270. default:
  5271. break;
  5272. }
  5273. this.ui.t1.play(Laya.Handler.create(this, () => {
  5274. this.ui.t2.play(Laya.Handler.create(this, () => {
  5275. switch (xGame.common.gameMode) {
  5276. case GameMode.classic:
  5277. this.waitingPeople();
  5278. break;
  5279. case GameMode.bigMove:
  5280. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5281. break;
  5282. default:
  5283. break;
  5284. }
  5285. }));
  5286. }));
  5287. }
  5288. initSkillData() {
  5289. this.skillSelectData = [];
  5290. let skillUrl = xGame.common.skillIconList;
  5291. let skillName = xGame.common.skillNameList;
  5292. let skillLevel = DataMgr.getBigSkillList();
  5293. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5294. for (let index = 0; index < 5; index++) {
  5295. let obj = {};
  5296. obj.skillImg = skillUrl[index];
  5297. obj.skillName = skillName[index];
  5298. obj.skillType = skillType[index];
  5299. obj.skillLevel = skillLevel[index];
  5300. this.skillSelectData.push(obj);
  5301. }
  5302. }
  5303. getAISkillLevel(myLevel) {
  5304. let video = xGame.common.upSkillLevel;
  5305. let aiLevel;
  5306. let temp;
  5307. if (video) {
  5308. temp = xGame.common.randomNum(-2, -1);
  5309. }
  5310. else {
  5311. if (myLevel <= 5) {
  5312. temp = xGame.common.randomNum(1, 3);
  5313. }
  5314. else if (myLevel <= 9) {
  5315. temp = xGame.common.randomNum(-2, 1);
  5316. }
  5317. else {
  5318. temp = xGame.common.randomNum(-4, 0);
  5319. }
  5320. }
  5321. aiLevel = temp + myLevel;
  5322. if (aiLevel <= 1)
  5323. aiLevel = 1;
  5324. if (aiLevel >= 10)
  5325. aiLevel = 10;
  5326. return aiLevel;
  5327. }
  5328. getAISkillType() {
  5329. return xGame.common.randomNum(1, 4);
  5330. let successTimes = DataMgr.getSkillSuccessTimes();
  5331. let info = cfgTable.aiskillData[successTimes];
  5332. if (!info) {
  5333. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5334. info = cfgTable.aiskillData[max];
  5335. }
  5336. let dataArr = info.skillselect;
  5337. let myCfg = {};
  5338. for (let index = 0; index < dataArr.length; index++) {
  5339. let temp = dataArr[index].split('-');
  5340. myCfg[temp[0]] = {};
  5341. myCfg[temp[0]].id = parseInt(temp[0]);
  5342. myCfg[temp[0]].weight = parseInt(temp[1]);
  5343. }
  5344. let aiCfg = xGame.common.initWeight(myCfg);
  5345. let curData = xGame.common.getRandomWeightData(aiCfg);
  5346. return parseInt(curData.id);
  5347. }
  5348. getAISkillData(index) {
  5349. let myLevel = this.skillSelectData[index].skillLevel;
  5350. let aiLevel = this.getAISkillLevel(myLevel);
  5351. let aiType = this.getAISkillType() - 1;
  5352. return { aiLevel, aiType } = { aiLevel, aiType };
  5353. }
  5354. skillSelectFinish(index) {
  5355. let aiInfo = this.getAISkillData(index);
  5356. xGame.common.gameMgr.selfCurSkill = index;
  5357. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5358. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5359. this.ui.selfHead.c1.selectedIndex = 1;
  5360. this.ui.aiHead.c1.selectedIndex = 1;
  5361. let myData = this.skillSelectData[index];
  5362. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5363. let guide = DataMgr.getSkillGuide();
  5364. if (guide == 0) {
  5365. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5366. }
  5367. else {
  5368. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5369. }
  5370. let aiData = this.skillSelectData[aiInfo.aiType];
  5371. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5372. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5373. this.waitingPeople();
  5374. }
  5375. waitingPeople() {
  5376. let time = xGame.common.randomNum(1000, 3000);
  5377. time += 1000;
  5378. Laya.timer.once(time, this, () => {
  5379. this.matchingSuccess();
  5380. });
  5381. }
  5382. matchingSuccess() {
  5383. let gameUI = xGame.common.gameUI;
  5384. let name = gameUI.ui.topNode.aiNameTxt.text;
  5385. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5386. this.ui.aiHead.nameTxt.text = name;
  5387. this.ui.aiHead.headImg.url = url;
  5388. name = gameUI.ui.topNode.selfNameTxt.text;
  5389. url = gameUI.ui.topNode.selfHeadLoader.url;
  5390. this.ui.selfHead.nameTxt.text = name;
  5391. this.ui.selfHead.headImg.url = url;
  5392. this.ui.t3.play(Laya.Handler.create(this, () => {
  5393. this.callback && this.callback();
  5394. this.ui.t4.play(Laya.Handler.create(this, () => {
  5395. this.destroySelf();
  5396. }));
  5397. }));
  5398. }
  5399. destroySelf() {
  5400. this.callback = null;
  5401. this.skillSelectData = null;
  5402. this.selfPot = null;
  5403. this.aiPot = null;
  5404. if (!this.ui.isDisposed) {
  5405. this.ui.removeFromParent();
  5406. this.ui.dispose();
  5407. }
  5408. xGame.uiMgr.destroyUI(this);
  5409. }
  5410. }
  5411. UIMatching.uiName = "UIMatching";
  5412. class ui_UIRanking extends fgui.GComponent {
  5413. static createInstance() {
  5414. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5415. }
  5416. onConstruct() {
  5417. this.n26 = (this.getChild("n26"));
  5418. this.myNode = (this.getChild("myNode"));
  5419. }
  5420. }
  5421. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5422. class UIRanking extends UIBase {
  5423. constructor() {
  5424. super();
  5425. this.showSelf = true;
  5426. this.rankType = 1;
  5427. this.rankList = [];
  5428. this.topX = 10;
  5429. this.myIndex = this.topX + 1;
  5430. this.myStar = 0;
  5431. }
  5432. onConstructor() {
  5433. this.ui = ui_UIRanking.createInstance();
  5434. this.contentPane = this.ui;
  5435. this.isEject = false;
  5436. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5437. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5438. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5439. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5440. this.ui.myNode.myList.setVirtual();
  5441. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5442. }
  5443. show() {
  5444. super.show();
  5445. this.getPaiHangBangDataFormJosnFile();
  5446. this.updateSelf();
  5447. let self = Moyu.getUserInfo();
  5448. if (!self.isAuth) {
  5449. Moyu.initUser(this, () => {
  5450. DataMgr.upRankData();
  5451. });
  5452. }
  5453. }
  5454. getPaiHangBangDataFormJosnFile() {
  5455. const rankingList = cfgTable.paiHangBangData.list;
  5456. this.updateItemData(rankingList);
  5457. }
  5458. updateSelfItem() {
  5459. console.log('zh:Moyu.platType =' + Moyu.platType);
  5460. let self = Moyu.getUserInfo();
  5461. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5462. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5463. if (this.myIndex > this.topX) {
  5464. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5465. }
  5466. else {
  5467. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5468. }
  5469. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5470. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5471. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5472. }
  5473. updateItemData(data) {
  5474. this.myStar = xGame.common.getAllStarNum();
  5475. if (this.rankList.length < 2) {
  5476. this.rankList = data;
  5477. let self = Moyu.getUserInfo();
  5478. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5479. self.headIcon = self.headIcon;
  5480. for (let i = 0; i < data.length; i++) {
  5481. let data = this.rankList[i];
  5482. if (data.userId == self.userId) {
  5483. this.rankList.splice(i, 1);
  5484. break;
  5485. }
  5486. }
  5487. for (let i = 0; i < data.length; i++) {
  5488. let data = this.rankList[i];
  5489. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5490. this.myIndex = i + 1;
  5491. let user = { headIcon: self.headIcon, nickName: "myself" };
  5492. let ud = { user: user, data: {} };
  5493. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5494. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5495. if (Moyu.platType < 11) {
  5496. user.headIcon = self.headIcon;
  5497. user.nickName = self.nickName;
  5498. }
  5499. this.rankList.splice(i, 0, md);
  5500. break;
  5501. }
  5502. }
  5503. }
  5504. this.updateSelfItem();
  5505. this.ui.myNode.myList.numItems = this.rankList.length;
  5506. }
  5507. updateItemUI(index, obj) {
  5508. let data = this.rankList[index];
  5509. let userData = JSON.parse(data.userData).user;
  5510. obj.nameTxt.text = userData.nickName.toString();
  5511. obj.valueTxt.text = data.rankScore;
  5512. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5513. obj.rankTxt.text = index + 1;
  5514. switch (index) {
  5515. case 0:
  5516. this.setImg(obj, 1, 0, 0);
  5517. obj.rankTxt.color = "#FFC047";
  5518. break;
  5519. case 1:
  5520. this.setImg(obj, 0, 1, 0);
  5521. obj.rankTxt.color = "#ACACAC";
  5522. break;
  5523. case 2:
  5524. this.setImg(obj, 0, 0, 1);
  5525. obj.rankTxt.color = "#D09672";
  5526. break;
  5527. default:
  5528. this.setImg(obj, 0, 0, 0);
  5529. obj.rankTxt.color = "#496FAB";
  5530. break;
  5531. }
  5532. }
  5533. setImg(obj, a, b, c) {
  5534. obj.img1.visible = a ? true : false;
  5535. obj.img2.visible = b ? true : false;
  5536. obj.img3.visible = c ? true : false;
  5537. }
  5538. changeList(type) {
  5539. this.rankType = type;
  5540. this.updateSelf();
  5541. }
  5542. changeSelfNode() {
  5543. this.showSelf = !this.showSelf;
  5544. this.updateSelf();
  5545. }
  5546. updateSelf() {
  5547. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5548. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5549. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5550. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5551. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5552. }
  5553. }
  5554. UIRanking.uiName = "UIRanking";
  5555. class ui_UISecretary extends fgui.GComponent {
  5556. static createInstance() {
  5557. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5558. }
  5559. onConstruct() {
  5560. this.n0 = (this.getChild("n0"));
  5561. this.myNode = (this.getChild("myNode"));
  5562. this.closeBtn = (this.getChild("closeBtn"));
  5563. this.t0 = this.getTransition("t0");
  5564. }
  5565. }
  5566. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5567. class UISecretary extends UIBase {
  5568. constructor() {
  5569. super();
  5570. this.curIndex = 1;
  5571. }
  5572. onConstructor() {
  5573. this.ui = ui_UISecretary.createInstance();
  5574. this.contentPane = this.ui;
  5575. this.isEject = false;
  5576. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5577. this.nodeObj = { left: null, right: null, cur: null };
  5578. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5579. }
  5580. show() {
  5581. super.show();
  5582. this.ui.t0.play();
  5583. this.updateData();
  5584. }
  5585. addSecretarySpine(node, spineName) {
  5586. if (spineName == "mishu") {
  5587. if (this.secretarySpine1) {
  5588. node.displayObject.destroyChildren();
  5589. this.playWoman(this.secretarySpine1, node.displayObject);
  5590. }
  5591. else {
  5592. let spine1 = new SpineMgr("mishu", () => {
  5593. this.secretarySpine1 = spine1;
  5594. this.playWoman(this.secretarySpine1, node.displayObject);
  5595. });
  5596. }
  5597. }
  5598. else {
  5599. if (this.secretarySpine2) {
  5600. node.displayObject.destroyChildren();
  5601. this.playWoman(this.secretarySpine2, node.displayObject);
  5602. }
  5603. else {
  5604. let spine2 = new SpineMgr("xiaomishu2", () => {
  5605. this.secretarySpine2 = spine2;
  5606. this.playWoman(this.secretarySpine2, node.displayObject);
  5607. });
  5608. }
  5609. }
  5610. }
  5611. playWoman(node, parent) {
  5612. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5613. let yy = this.ui.myNode.gameNode3.secretary.height;
  5614. let scale = 1.5;
  5615. if (node == this.secretarySpine2) {
  5616. scale = 1.2;
  5617. }
  5618. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5619. node.play(data, 0, true, parent);
  5620. }
  5621. turnLeft() {
  5622. this.curIndex--;
  5623. if (this.curIndex < 1) {
  5624. this.curIndex = 2;
  5625. }
  5626. let left = this.nodeObj.left;
  5627. let right = this.nodeObj.right;
  5628. let cur = this.nodeObj.cur;
  5629. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5630. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5631. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5632. this.updateData();
  5633. }));
  5634. this.ui.myNode.setChildIndex(right, 2);
  5635. this.nodeObj.left = cur;
  5636. this.nodeObj.right = left;
  5637. this.nodeObj.cur = right;
  5638. }
  5639. turnRight() {
  5640. this.curIndex++;
  5641. if (this.curIndex > 2) {
  5642. this.curIndex = 1;
  5643. }
  5644. let left = this.nodeObj.left;
  5645. let right = this.nodeObj.right;
  5646. let cur = this.nodeObj.cur;
  5647. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5648. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5649. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5650. this.updateData();
  5651. }));
  5652. this.ui.myNode.setChildIndex(left, 2);
  5653. this.nodeObj.left = right;
  5654. this.nodeObj.right = cur;
  5655. this.nodeObj.cur = left;
  5656. }
  5657. updateData() {
  5658. console.log('zh: updateData FFFFFFFFFF');
  5659. let data = cfgTable.secretaryshopData;
  5660. let children = this.ui.myNode._children;
  5661. let temp;
  5662. let curData;
  5663. for (let index = 0; index < children.length; index++) {
  5664. temp = children[index];
  5665. curData = data[1];
  5666. temp.heightTxt.text = curData.height;
  5667. temp.foodTxt.text = curData.food;
  5668. temp.historyTxt.text = curData.history;
  5669. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5670. this.addSecretarySpine(temp.secretary, curData.spine);
  5671. let womanIndex = curData.id - 1;
  5672. let getWoman = DataMgr.getSecretary(womanIndex);
  5673. let curUse = DataMgr.getCurSecretary();
  5674. if (getWoman) {
  5675. if (curUse == womanIndex) {
  5676. temp.purchaseBtn.c1.selectedIndex = 1;
  5677. }
  5678. else {
  5679. temp.purchaseBtn.c1.selectedIndex = 2;
  5680. }
  5681. }
  5682. else {
  5683. temp.purchaseBtn.c1.selectedIndex = 0;
  5684. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5685. }
  5686. temp.purchaseBtn.visible = false;
  5687. }
  5688. }
  5689. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5690. console.log('zh: 点击了clickSecretary ');
  5691. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5692. if (getWoman) {
  5693. if (curUse != womanIndex) {
  5694. console.log();
  5695. DataMgr.setCurSecretary(womanIndex);
  5696. this.updateData();
  5697. }
  5698. }
  5699. else {
  5700. console.log('zh:点击购买了');
  5701. let need = needDiamond;
  5702. if (DataMgr.diamondEnough(need)) {
  5703. DataMgr.setDiamond(-need);
  5704. DataMgr.setSecretary(womanIndex, 1);
  5705. DataMgr.setCurSecretary(womanIndex);
  5706. this.updateData();
  5707. }
  5708. else {
  5709. xGame.uiMgr.Show(UIAddProp, 1);
  5710. }
  5711. }
  5712. }
  5713. closeSelf() {
  5714. this.hide();
  5715. }
  5716. }
  5717. UISecretary.uiName = "UISecretary";
  5718. class ui_UIShop extends fgui.GComponent {
  5719. static createInstance() {
  5720. return (fgui.UIPackage.createObject("game", "UIShop"));
  5721. }
  5722. onConstruct() {
  5723. this.n48 = (this.getChild("n48"));
  5724. this.n0 = (this.getChild("n0"));
  5725. this.secretary = (this.getChild("secretary"));
  5726. this.talkNode = (this.getChild("talkNode"));
  5727. this.closeNode = (this.getChild("closeNode"));
  5728. this.moneyNode = (this.getChild("moneyNode"));
  5729. this.myNode = (this.getChild("myNode"));
  5730. }
  5731. }
  5732. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5733. class ui_UIMsg extends fgui.GComponent {
  5734. static createInstance() {
  5735. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5736. }
  5737. onConstruct() {
  5738. this.tipsNode = (this.getChild("tipsNode"));
  5739. }
  5740. }
  5741. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5742. class UIMsg extends UIBase {
  5743. constructor() {
  5744. super();
  5745. }
  5746. onConstructor() {
  5747. this.ui = ui_UIMsg.createInstance();
  5748. this.contentPane = this.ui;
  5749. this.isEject = false;
  5750. this.isMuti = true;
  5751. }
  5752. show(msg, callback) {
  5753. super.show();
  5754. this.ui.tipsNode.msgTxt.text = msg;
  5755. this.ui.alpha = 1;
  5756. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5757. this.hide();
  5758. callback && callback();
  5759. }), 1000);
  5760. }
  5761. }
  5762. UIMsg.uiName = "UIMsg";
  5763. class BallRodDisplay {
  5764. constructor(ui, index) {
  5765. this.index = 0;
  5766. this.uiIndex = 0;
  5767. this.ui = ui;
  5768. this.index = index;
  5769. this.initData();
  5770. }
  5771. initData() {
  5772. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5773. let data = cfgTable.ballrodData[this.index + 1];
  5774. this.ui.nameTxt.text = data.name;
  5775. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5776. this.ui.levelNode.c1.selectedIndex = data.quality;
  5777. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5778. if (data.spine) {
  5779. this.mySpine = new SpineMgr(data.spine, () => {
  5780. let xx = 150;
  5781. let yy = 70;
  5782. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5783. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5784. });
  5785. }
  5786. }
  5787. updateSelf() {
  5788. console.log('zh:updateSelf -------------- ');
  5789. let get = DataMgr.getBallRod(this.index);
  5790. if (get == null)
  5791. get = 1;
  5792. let curUse = DataMgr.getCurBallRod();
  5793. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5794. if (get) {
  5795. if (curUse == this.index) {
  5796. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5797. }
  5798. else {
  5799. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5800. }
  5801. }
  5802. else {
  5803. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5804. }
  5805. }
  5806. buyBallRod() {
  5807. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5808. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5809. switch (selectedIndex) {
  5810. case 0:
  5811. break;
  5812. case 1:
  5813. console.log('zh:点击了 USE THIS');
  5814. DataMgr.setCurBallRod(this.index);
  5815. let curUse = DataMgr.getCurBallRod();
  5816. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5817. let ui = xGame.uiMgr.getUI(UIShop);
  5818. ui.updateBallRod();
  5819. break;
  5820. case 2:
  5821. let data = cfgTable.ballrodData[this.index + 1];
  5822. let need = data.price;
  5823. if (DataMgr.diamondEnough(need)) {
  5824. this.buyQiuGan(data);
  5825. DataMgr.setDiamond(-need);
  5826. DataMgr.setBallRod(this.index, 1);
  5827. DataMgr.setCurBallRod(this.index);
  5828. let ui = xGame.uiMgr.getUI(UIShop);
  5829. ui.updateBallRod();
  5830. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5831. }
  5832. else {
  5833. xGame.uiMgr.Show(UIAddProp, 1);
  5834. }
  5835. break;
  5836. default:
  5837. break;
  5838. }
  5839. }
  5840. buyQiuGan(qgItem) {
  5841. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5842. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5843. if (userInfo == null) {
  5844. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5845. return;
  5846. }
  5847. let reqData = xGame.httpMgr.getReqData();
  5848. let pd = JSON.parse(reqData);
  5849. pd.qiuGanData = qgItem;
  5850. reqData = JSON.stringify(pd);
  5851. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5852. try {
  5853. console.log('zh:buySp res = ' + JSON.stringify(res));
  5854. let code = res.code;
  5855. let msg = res.msg;
  5856. if (code == 401) {
  5857. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5858. alert(TIP_MSG_key.loginTimeOut);
  5859. xGame.uiMgr.Show(UIMsg, msg);
  5860. return;
  5861. }
  5862. if (code == 200) {
  5863. xGame.uiMgr.Show(UIMsg, msg);
  5864. DataMgr.getUserZiChanInfo();
  5865. }
  5866. else {
  5867. xGame.uiMgr.Show(UIMsg, msg);
  5868. }
  5869. }
  5870. catch (error) {
  5871. console.log('error=' + error);
  5872. alert(error);
  5873. }
  5874. finally {
  5875. }
  5876. });
  5877. }
  5878. logEventForGouMaiGan(qiuGanName) {
  5879. const ev = {
  5880. value: qiuGanName
  5881. };
  5882. const jsonStr = JSON.stringify(ev);
  5883. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5884. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5885. }
  5886. }
  5887. class DaoJuDisplay {
  5888. constructor(ui, index) {
  5889. this.index = 0;
  5890. this.uiIndex = 0;
  5891. this.ui = ui;
  5892. this.index = index;
  5893. this.initData();
  5894. }
  5895. initData() {
  5896. this.ui.btn_buy.onClick(this, this.buySp);
  5897. this.ui.btn_buy.onClick(this, this.buyDj);
  5898. let data = cfgTable.daoJuData[this.index + 1];
  5899. console.log('zh:' + JSON.stringify(data));
  5900. this.ui.nameTxt.text = data.spbt;
  5901. this.ui.n_jiaGe.text = data.spjg + "";
  5902. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5903. let baseUrl = "asset/sound/ogg/";
  5904. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5905. }
  5906. buyDj() {
  5907. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5908. }
  5909. buySp() {
  5910. let djItem = cfgTable.daoJuData[this.index + 1];
  5911. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  5912. let userInfo = LocalStorageManager.getItem('userInfo');
  5913. if (userInfo == null) {
  5914. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5915. return;
  5916. }
  5917. let reqData = xGame.httpMgr.getReqData();
  5918. let pd = JSON.parse(reqData);
  5919. pd.spItem = djItem;
  5920. reqData = JSON.stringify(pd);
  5921. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  5922. try {
  5923. console.log('zh:buySp res = ' + JSON.stringify(res));
  5924. let code = res.code;
  5925. let msg = res.msg;
  5926. if (code == 401) {
  5927. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5928. alert(TIP_MSG_key.pleaseLoginIn);
  5929. return;
  5930. }
  5931. if (code == 200) {
  5932. xGame.uiMgr.Show(UIMsg, msg);
  5933. DataMgr.getUserZiChanInfo();
  5934. }
  5935. else {
  5936. xGame.uiMgr.Show(UIMsg, msg);
  5937. }
  5938. }
  5939. catch (error) {
  5940. console.log('error=' + error);
  5941. alert(error);
  5942. }
  5943. finally {
  5944. }
  5945. });
  5946. }
  5947. }
  5948. class UIShop extends UIBase {
  5949. constructor() {
  5950. super();
  5951. this.itemNums = 0;
  5952. this.itemNumsForDj = 0;
  5953. this.curType = "";
  5954. }
  5955. onConstructor() {
  5956. this.ui = ui_UIShop.createInstance();
  5957. this.contentPane = this.ui;
  5958. this.isEject = false;
  5959. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5960. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5961. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  5962. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  5963. this.addUIClick(this.ui, this.interuptSecretary);
  5964. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5965. this.ballRodArr = [];
  5966. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5967. this.ui.myNode.myList.numItems = this.itemNums;
  5968. this.loadDjdata_old();
  5969. }
  5970. loadDjdata_old() {
  5971. let fff = cfgTable.daoJuData;
  5972. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  5973. this.daoJuArr = [];
  5974. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  5975. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  5976. }
  5977. getProductList() {
  5978. let reqData = xGame.httpMgr.getReqData();
  5979. let pd = JSON.parse(reqData);
  5980. pd.splx = "Consumable";
  5981. reqData = JSON.stringify(pd);
  5982. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  5983. try {
  5984. let code = res.code;
  5985. let msg = res.msg;
  5986. if (code == 401) {
  5987. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5988. alert(TIP_MSG_key.pleaseLoginIn);
  5989. return;
  5990. }
  5991. if (code == 200) {
  5992. let data = res.data;
  5993. for (let index = 0; index < data.length; index++) {
  5994. let element = data[index];
  5995. cfgTable.daoJuData[element.spid] = element;
  5996. }
  5997. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  5998. }
  5999. else {
  6000. xGame.uiMgr.Show(UIMsg, msg);
  6001. }
  6002. }
  6003. catch (error) {
  6004. console.log('error=' + error);
  6005. alert(error);
  6006. }
  6007. finally {
  6008. }
  6009. });
  6010. }
  6011. show(type) {
  6012. super.show();
  6013. this.curType = type == 0 ? "qiugan" : "daoju";
  6014. this.switchBtn("qiugan");
  6015. this.playSecretaryIdle();
  6016. this.updateBallRod();
  6017. }
  6018. test123() {
  6019. console.log('zh:test123 ');
  6020. }
  6021. switchBtn(type) {
  6022. console.log('zh:1111切換 sel type=' + type);
  6023. if (type == "") {
  6024. type = this.curType;
  6025. }
  6026. else {
  6027. if (this.curType == type) {
  6028. return;
  6029. }
  6030. else {
  6031. this.curType = type;
  6032. }
  6033. }
  6034. if (type == "qiugan") {
  6035. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6036. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6037. this.ui.myNode.c1.selectedIndex = 0;
  6038. this.ui.myNode.myList.visible = true;
  6039. this.ui.myNode.djList.visible = false;
  6040. }
  6041. else {
  6042. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6043. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6044. this.ui.myNode.c1.selectedIndex = 1;
  6045. this.ui.myNode.myList.visible = false;
  6046. this.ui.myNode.djList.visible = true;
  6047. }
  6048. }
  6049. updateBallRod() {
  6050. for (let index = 0; index < this.ballRodArr.length; index++) {
  6051. this.ballRodArr[index].updateSelf();
  6052. }
  6053. }
  6054. renderBallRod(sort, obj) {
  6055. let index = this.getIndexBySort(sort + 1) - 1;
  6056. let ballRod = new BallRodDisplay(obj, index);
  6057. this.ballRodArr.push(ballRod);
  6058. }
  6059. renderDaoJu(idx, obj) {
  6060. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6061. let b = new DaoJuDisplay(obj, index);
  6062. this.daoJuArr.push(b);
  6063. }
  6064. getIndexBySort(sort) {
  6065. let object = cfgTable.ballrodData;
  6066. for (const key in object) {
  6067. if (object[key].sort == sort) {
  6068. return parseInt(key);
  6069. }
  6070. }
  6071. }
  6072. getIndexBySortForDj(idx) {
  6073. let object = cfgTable.daoJuData;
  6074. for (const key in object) {
  6075. if (object[key].idx == idx) {
  6076. return parseInt(key);
  6077. }
  6078. }
  6079. }
  6080. playSecretaryIdle() {
  6081. let parent = this.ui.secretary.displayObject;
  6082. parent.destroyChildren();
  6083. let xx = this.ui.secretary.width / 2;
  6084. let yy = this.ui.secretary.height;
  6085. let scale = xGame.common.getSecretaryScale();
  6086. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6087. xGame.common.secretary.play(data, 0, true, parent);
  6088. }
  6089. interuptSecretary() {
  6090. Laya.timer.clearAll(this);
  6091. this.playSecretaryRandomSound();
  6092. }
  6093. playSecretaryRandomSound() {
  6094. if (this.isHide)
  6095. return;
  6096. let time = xGame.common.randomNum(45000, 60000);
  6097. Laya.timer.once(time, this, () => {
  6098. if (this.isHide)
  6099. return;
  6100. let index = xGame.common.randomNum(4, 7);
  6101. xGame.soundMgr.playSound("s_main0" + index);
  6102. let words = 1;
  6103. switch (index) {
  6104. case 4:
  6105. words = 5;
  6106. break;
  6107. case 5:
  6108. words = 3;
  6109. break;
  6110. case 6:
  6111. words = 6;
  6112. break;
  6113. case 7:
  6114. words = 7;
  6115. break;
  6116. default:
  6117. break;
  6118. }
  6119. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6120. this.playSecretaryRandomSound();
  6121. });
  6122. }
  6123. closeSelf() {
  6124. this.hide();
  6125. }
  6126. }
  6127. UIShop.uiName = "UIShop";
  6128. class ui_UISign extends fgui.GComponent {
  6129. static createInstance() {
  6130. return (fgui.UIPackage.createObject("game", "UISign"));
  6131. }
  6132. onConstruct() {
  6133. this.n6 = (this.getChild("n6"));
  6134. this.closeNode = (this.getChild("closeNode"));
  6135. this.myNode = (this.getChild("myNode"));
  6136. this.moneyNode = (this.getChild("moneyNode"));
  6137. this.secretary = (this.getChild("secretary"));
  6138. this.talkNode = (this.getChild("talkNode"));
  6139. this.tripleBtn = (this.getChild("tripleBtn"));
  6140. this.normalBtn = (this.getChild("normalBtn"));
  6141. this.tipsNode = (this.getChild("tipsNode"));
  6142. this.againBtn = (this.getChild("againBtn"));
  6143. this.t0 = this.getTransition("t0");
  6144. }
  6145. }
  6146. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6147. class SignMax {
  6148. constructor(ui) {
  6149. this.ui = ui;
  6150. }
  6151. updateSelf(index, sameDay, curDayIndex) {
  6152. let data = cfgTable.signData[index + 1];
  6153. this.ui.titleTxt.text = data.title;
  6154. let arr1 = data.award[0].split('-');
  6155. let arr2 = data.award[1].split('-');
  6156. let num1 = parseInt(arr1[1]);
  6157. let num2 = parseInt(arr2[1]);
  6158. this.ui.numTxt1.text = num1 + "";
  6159. this.ui.numTxt2.text = num2 + "";
  6160. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6161. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6162. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6163. this.ui.numTxt1.visible = false;
  6164. }
  6165. else {
  6166. this.ui.numTxt1.visible = true;
  6167. }
  6168. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6169. this.ui.numTxt2.visible = false;
  6170. }
  6171. else {
  6172. this.ui.numTxt2.visible = true;
  6173. }
  6174. if (index < curDayIndex) {
  6175. this.ui.c1.selectedIndex = 1;
  6176. }
  6177. else if (index == curDayIndex) {
  6178. if (sameDay) {
  6179. this.ui.c1.selectedIndex = 2;
  6180. }
  6181. else {
  6182. this.ui.c1.selectedIndex = 2;
  6183. }
  6184. }
  6185. else {
  6186. this.ui.c1.selectedIndex = 0;
  6187. }
  6188. }
  6189. }
  6190. class SignNormal {
  6191. constructor(ui) {
  6192. this.ui = ui;
  6193. }
  6194. updateSelf(index, sameDay, curDayIndex) {
  6195. let data = cfgTable.signData[index + 1];
  6196. this.ui.titleTxt.text = data.title;
  6197. let arr = data.award[0].split('-');
  6198. let type = parseInt(arr[0]);
  6199. let num = parseInt(arr[1]);
  6200. this.ui.numTxt.text = num + "";
  6201. if (type > 2) {
  6202. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6203. this.ui.myIcon.rotation = 0;
  6204. }
  6205. else {
  6206. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6207. this.ui.myIcon.rotation = 0;
  6208. }
  6209. if (xGame.common.signAwardContainsRod(data.award)) {
  6210. this.ui.numTxt.visible = false;
  6211. }
  6212. else {
  6213. this.ui.numTxt.visible = true;
  6214. }
  6215. if (index < curDayIndex) {
  6216. this.ui.c1.selectedIndex = 1;
  6217. }
  6218. else if (index == curDayIndex) {
  6219. if (sameDay) {
  6220. this.ui.c1.selectedIndex = 2;
  6221. }
  6222. else {
  6223. this.ui.c1.selectedIndex = 2;
  6224. }
  6225. }
  6226. else {
  6227. this.ui.c1.selectedIndex = 0;
  6228. }
  6229. }
  6230. }
  6231. class UISign extends UIBase {
  6232. constructor() {
  6233. super();
  6234. this.curDayIndex = 0;
  6235. this.starX = 0;
  6236. }
  6237. onConstructor() {
  6238. this.ui = ui_UISign.createInstance();
  6239. this.contentPane = this.ui;
  6240. this.isEject = false;
  6241. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6242. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6243. this.initSignItem();
  6244. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6245. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6246. }
  6247. show() {
  6248. super.show();
  6249. this.ui.t0.play();
  6250. this.playSecretaryIdle();
  6251. this.updateSign();
  6252. }
  6253. initSignItem() {
  6254. this.signArr = [];
  6255. for (let index = 0; index < 6; index++) {
  6256. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6257. this.signArr.push(temp);
  6258. }
  6259. this.signMax = new SignMax(this.ui.myNode.day7);
  6260. if (Moyu.isKs)
  6261. this.ui.closeNode.closeBtn.x += 100;
  6262. }
  6263. updateSign() {
  6264. let sameDay = xGame.common.judgeSameDay();
  6265. let max = 7;
  6266. this.curDayIndex = DataMgr.getSignData();
  6267. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6268. this.curDayIndex = 0;
  6269. if (!sameDay) {
  6270. this.ui.normalBtn.visible = true;
  6271. this.ui.tipsNode.visible = false;
  6272. this.ui.againBtn.visible = false;
  6273. }
  6274. else {
  6275. this.ui.normalBtn.visible = false;
  6276. let again = DataMgr.getExtraSign();
  6277. let isCurrency = false;
  6278. let index = this.curDayIndex;
  6279. if (index == 0)
  6280. index = 7;
  6281. let award = cfgTable.signData[index].award;
  6282. let num = award[0].split("-")[0];
  6283. if (num == "1" || num == "2")
  6284. isCurrency = true;
  6285. let showAgain = again == 0 && isCurrency;
  6286. this.ui.againBtn.visible = showAgain;
  6287. this.ui.tipsNode.visible = !showAgain;
  6288. }
  6289. for (let index = 0; index < this.signArr.length; index++) {
  6290. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6291. }
  6292. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6293. }
  6294. playSecretaryIdle() {
  6295. let parent = this.ui.secretary.displayObject;
  6296. parent.destroyChildren();
  6297. let xx = this.ui.secretary.width / 2;
  6298. let yy = this.ui.secretary.height;
  6299. let scale = xGame.common.getSecretaryScale();
  6300. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6301. xGame.common.secretary.play(data, 0, true, parent);
  6302. }
  6303. closeSelf() {
  6304. this.hide();
  6305. }
  6306. normalGetAward() {
  6307. let sameDay = xGame.common.judgeSameDay();
  6308. if (!sameDay) {
  6309. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6310. let temp;
  6311. let type;
  6312. let num;
  6313. let arr = [];
  6314. for (let index = 0; index < award.length; index++) {
  6315. temp = award[index].split("-");
  6316. type = parseInt(temp[0]);
  6317. num = parseInt(temp[1]);
  6318. let awardType = new AwardType();
  6319. awardType.num = num;
  6320. awardType.type = type;
  6321. arr.push(awardType);
  6322. }
  6323. xGame.common.getAward(arr, (watchVideo) => {
  6324. this.curDayIndex++;
  6325. if (this.curDayIndex > 7)
  6326. this.curDayIndex = 0;
  6327. DataMgr.setSignData(this.curDayIndex);
  6328. DataMgr.setSignTime(new Date().getTime());
  6329. if (watchVideo) {
  6330. DataMgr.setExtraSign(1);
  6331. Moyu.sendDataEvent("signIn1");
  6332. }
  6333. this.updateSign();
  6334. });
  6335. }
  6336. }
  6337. againGetAward() {
  6338. Moyu.sendDataEvent("signIn2");
  6339. console.log('zh:qjff_AD_for_uisign');
  6340. if (Laya.Browser.onAndroid) {
  6341. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6342. if (!boo) {
  6343. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6344. return;
  6345. }
  6346. }
  6347. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6348. }
  6349. else {
  6350. console.log('zh:AD 失败,直接发放奖励');
  6351. this.qjff_AD_for_uisign();
  6352. }
  6353. }
  6354. qjff_AD_for_uisign() {
  6355. let index = this.curDayIndex;
  6356. if (index == 0)
  6357. index = 7;
  6358. let award = cfgTable.signData[index].award;
  6359. let temp;
  6360. let type;
  6361. let num;
  6362. for (let index = 0; index < award.length; index++) {
  6363. temp = award[index].split("-");
  6364. type = parseInt(temp[0]);
  6365. num = parseInt(temp[1]) * 3;
  6366. xGame.common.playObjFlyAnim(num, type);
  6367. }
  6368. DataMgr.setExtraSign(1);
  6369. this.updateSign();
  6370. }
  6371. }
  6372. UISign.uiName = "UISign";
  6373. class ui_UISkill extends fgui.GComponent {
  6374. static createInstance() {
  6375. return (fgui.UIPackage.createObject("game", "UISkill"));
  6376. }
  6377. onConstruct() {
  6378. this.n48 = (this.getChild("n48"));
  6379. this.n0 = (this.getChild("n0"));
  6380. this.secretary = (this.getChild("secretary"));
  6381. this.talkNode = (this.getChild("talkNode"));
  6382. this.closeNode = (this.getChild("closeNode"));
  6383. this.moneyNode = (this.getChild("moneyNode"));
  6384. this.skillNode = (this.getChild("skillNode"));
  6385. this.guideNode = (this.getChild("guideNode"));
  6386. }
  6387. }
  6388. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6389. class SkillDisplay {
  6390. constructor(ui, data, uiIndex) {
  6391. this.starX = 0;
  6392. this.starY = 0;
  6393. this.index = 0;
  6394. this.ui = ui;
  6395. this.data = data;
  6396. this.index = uiIndex;
  6397. this.initSelf();
  6398. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6399. }
  6400. initSelf() {
  6401. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6402. this.ui.nameTxt.text = this.data.name;
  6403. this.ui.describeTxt.text = this.data.describe;
  6404. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6405. this.ui.startBtn.onClick(this, this.startGame);
  6406. this.updateSelf();
  6407. }
  6408. updateSelf() {
  6409. this.checkTry();
  6410. let level = DataMgr.getBigSkillByIndex(this.index);
  6411. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6412. }
  6413. checkTry() {
  6414. let index = this.index;
  6415. let level = DataMgr.getBigSkillByIndex(index);
  6416. if (level == null) {
  6417. DataMgr.setBigSkill(index, 1, false);
  6418. level = 1;
  6419. }
  6420. this.ui.levelTxt.text = "LV." + level;
  6421. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6422. this.ui.tryNode.visible = true;
  6423. else
  6424. this.ui.tryNode.visible = false;
  6425. }
  6426. clickAddLevel() {
  6427. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6428. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6429. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6430. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6431. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6432. }
  6433. else {
  6434. console.log('zh:AD 失败,直接发放奖励');
  6435. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6436. }
  6437. }
  6438. qjff_AD_for_skilldisplay_clickAddLevel() {
  6439. DataMgr.setBigSkill(this.data.index, 1);
  6440. this.updateSelf();
  6441. xGame.common.upSkillLevel = true;
  6442. }
  6443. startGame() {
  6444. console.log('zh:rod skill startgame');
  6445. if (this.data.index == 3) {
  6446. alert('Coming soon!');
  6447. return;
  6448. }
  6449. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6450. let needCoin = xGame.common.bigMoveNeedCoin;
  6451. xGame.common.passAwardCoin = 2000;
  6452. let guide = DataMgr.getSkillGuide();
  6453. console.log('zh:startGame guide=' + guide);
  6454. xGame.common.temSelfLevel = 0;
  6455. if (guide == 0) {
  6456. needCoin = 0;
  6457. xGame.common.temSelfLevel = 100;
  6458. }
  6459. if (DataMgr.coinEnough(needCoin)) {
  6460. DataMgr.setCoin(-needCoin);
  6461. xGame.common.curPlayerSkillType = this.index;
  6462. if (guide == 0)
  6463. xGame.common.curPlayerSkillType = 0;
  6464. console.log('zh: skilldisplay 1');
  6465. xGame.uiMgr.Show(UIGame);
  6466. xGame.uiMgr.Hide(UIMain);
  6467. xGame.uiMgr.Show(UIMatching, () => {
  6468. xGame.common.gameUI.ui.alpha = 1;
  6469. xGame.common.gameUI.startGame();
  6470. xGame.uiMgr.Hide(UISkill);
  6471. });
  6472. this.logEventForRod_start();
  6473. }
  6474. else {
  6475. console.log('zh: skilldisplay 2');
  6476. xGame.uiMgr.Show(UIAddProp, 0);
  6477. Moyu.sendDataEvent("AddCoinVideo");
  6478. }
  6479. }
  6480. logEventForRod_start() {
  6481. let gfmsIdx = xGame.common.curPlayerSkillType;
  6482. console.log('zh:选择的技能=' + gfmsIdx);
  6483. let gfmc = 'Skyfall Shot';
  6484. if (gfmsIdx == 0) {
  6485. gfmc = 'Skyfall Shot';
  6486. }
  6487. if (gfmsIdx == 1) {
  6488. gfmc = 'Surging break';
  6489. }
  6490. if (gfmsIdx == 2) {
  6491. gfmc = 'Frost Lock';
  6492. }
  6493. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6494. let jsonStr = {
  6495. "count": 0,
  6496. "name": gfmc
  6497. };
  6498. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6499. const d = LocalStorageManager.getItem(keyStr);
  6500. jsonStr.count = d.count + 1;
  6501. LocalStorageManager.setItem(keyStr, jsonStr);
  6502. }
  6503. else {
  6504. LocalStorageManager.setItem(keyStr, jsonStr);
  6505. }
  6506. const reqStr = JSON.stringify(jsonStr);
  6507. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6508. }
  6509. }
  6510. class UISkill extends UIBase {
  6511. constructor() {
  6512. super();
  6513. this.skillData = [];
  6514. }
  6515. onConstructor() {
  6516. this.ui = ui_UISkill.createInstance();
  6517. this.contentPane = this.ui;
  6518. this.isEject = false;
  6519. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6520. this.initSkillData();
  6521. console.log('zh:aaaaaa1111111111');
  6522. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6523. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6524. console.log('zh:aaaaaa22222222');
  6525. this.displayList = [];
  6526. this.ui.skillNode.skillList.numItems = 3;
  6527. this.addUIClick(this.ui, this.interuptSecretary);
  6528. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6529. this.ui.talkNode.visible = false;
  6530. if (Moyu.isKs)
  6531. this.ui.closeNode.closeBtn.x += 100;
  6532. }
  6533. show() {
  6534. super.show();
  6535. this.playSecretaryIdle();
  6536. this.moneyNode.ui.c1.selectedIndex = 1;
  6537. Laya.timer.clearAll(this);
  6538. xGame.soundMgr.playSound("s_start");
  6539. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6540. let guide = DataMgr.getSkillGuide();
  6541. this.ui.guideNode.visible = guide == 0;
  6542. let item = this.getSkillItemByUIIndex(0);
  6543. if (guide == 0) {
  6544. item.ui.c1.selectedIndex = 1;
  6545. }
  6546. else {
  6547. item.ui.c1.selectedIndex = 0;
  6548. }
  6549. this.ui.guideNode.guideBtn.visible = guide == 0;
  6550. for (let index = 0; index < this.displayList.length; index++) {
  6551. this.displayList[index].checkTry();
  6552. }
  6553. }
  6554. getSkillItemByUIIndex(cur) {
  6555. for (let index = 0; index < this.displayList.length; index++) {
  6556. if (this.displayList[index].index == cur) {
  6557. return this.displayList[index];
  6558. }
  6559. }
  6560. }
  6561. enterGuideLevel() {
  6562. let item = this.getSkillItemByUIIndex(0);
  6563. item.startGame();
  6564. if (DataMgr.getNewUser())
  6565. Moyu.sendDataEvent("gameStart1");
  6566. }
  6567. initSkillData() {
  6568. this.skillData = [];
  6569. let nameList = xGame.common.skillNameList;
  6570. let iconList = xGame.common.skillIconList;
  6571. let describeList = [
  6572. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6573. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6574. "The power of frost descends—freezing the flow and taking full control of the game!"
  6575. ];
  6576. console.log('zh:initSkillData 111111111');
  6577. let data;
  6578. for (let index = 0; index < nameList.length; index++) {
  6579. data = {};
  6580. data.name = nameList[index];
  6581. data.icon = iconList[index];
  6582. data.describe = describeList[index];
  6583. data.index = index;
  6584. this.skillData.push(data);
  6585. }
  6586. }
  6587. updateSkillItem(index, target) {
  6588. if (this.displayList[index] == null) {
  6589. let uiIndex;
  6590. switch (index) {
  6591. case 0:
  6592. uiIndex = 1;
  6593. break;
  6594. case 1:
  6595. uiIndex = 0;
  6596. break;
  6597. case 2:
  6598. uiIndex = 2;
  6599. break;
  6600. case 3:
  6601. uiIndex = 3;
  6602. break;
  6603. default:
  6604. break;
  6605. }
  6606. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6607. this.displayList.push(temp);
  6608. }
  6609. }
  6610. playSecretaryIdle() {
  6611. let parent = this.ui.secretary.displayObject;
  6612. parent.destroyChildren();
  6613. let xx = this.ui.secretary.width / 2;
  6614. let yy = this.ui.secretary.height;
  6615. let scale = xGame.common.getSecretaryScale();
  6616. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6617. xGame.common.secretary.play(data, 0, true, parent);
  6618. }
  6619. returnUIMain() {
  6620. this.hide();
  6621. xGame.common.stopGirlPop(this.ui.talkNode);
  6622. xGame.uiMgr.Show(UIMain);
  6623. }
  6624. interuptSecretary() {
  6625. Laya.timer.clearAll(this);
  6626. this.playSecretaryRandomSound();
  6627. }
  6628. playSecretaryRandomSound() {
  6629. if (this.isHide)
  6630. return;
  6631. let time = xGame.common.randomNum(45000, 60000);
  6632. Laya.timer.once(time, this, () => {
  6633. if (this.isHide)
  6634. return;
  6635. let index = xGame.common.randomNum(4, 7);
  6636. xGame.soundMgr.playSound("s_main0" + index);
  6637. let words = 1;
  6638. switch (index) {
  6639. case 4:
  6640. words = 5;
  6641. break;
  6642. case 5:
  6643. words = 3;
  6644. break;
  6645. case 6:
  6646. words = 6;
  6647. break;
  6648. case 7:
  6649. words = 7;
  6650. break;
  6651. default:
  6652. break;
  6653. }
  6654. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6655. this.playSecretaryRandomSound();
  6656. });
  6657. }
  6658. }
  6659. UISkill.uiName = "UISkill";
  6660. class ui_UIModeSelection extends fgui.GComponent {
  6661. static createInstance() {
  6662. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6663. }
  6664. onConstruct() {
  6665. this.n19 = (this.getChild("n19"));
  6666. this.closeBtn = (this.getChild("closeBtn"));
  6667. this.myNode = (this.getChild("myNode"));
  6668. this.t0 = this.getTransition("t0");
  6669. }
  6670. }
  6671. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6672. class UIModeSelection extends UIBase {
  6673. constructor() {
  6674. super();
  6675. }
  6676. onConstructor() {
  6677. this.ui = ui_UIModeSelection.createInstance();
  6678. this.contentPane = this.ui;
  6679. this.isEject = false;
  6680. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6681. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6682. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6683. this.addUIClick(this.ui.closeBtn, this.hide);
  6684. this.peopleArr = [65, 990, 580];
  6685. this.peopleOffest = [5, 10, 10];
  6686. }
  6687. show(callback) {
  6688. this.updateSelf();
  6689. super.show();
  6690. this.ui.t0.play();
  6691. this.callback = callback;
  6692. }
  6693. updateSelf() {
  6694. let cfg = cfgTable.modeselectData;
  6695. for (let index = 1; index <= 3; index++) {
  6696. let node = this.ui.myNode["type" + index];
  6697. node.need.text = cfg[index].need;
  6698. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6699. node.peopleTxt.text = this.getRandPeople(index - 1);
  6700. }
  6701. }
  6702. enterGame(type) {
  6703. console.log('zh: 进入经典模式 type: ' + type);
  6704. xGame.common.classicRoomType = type;
  6705. let cfg = cfgTable.modeselectData[type];
  6706. let need = cfg.need;
  6707. xGame.common.passAwardCoin = cfg.award;
  6708. if (DataMgr.coinEnough(need)) {
  6709. DataMgr.setCoin(-need);
  6710. this.ui.myNode["type" + type].t0.play();
  6711. Laya.timer.once(200, this, () => {
  6712. this.callback && this.callback();
  6713. });
  6714. this.logEventForClassic_start();
  6715. }
  6716. else {
  6717. Moyu.sendDataEvent("AddCoinVideo");
  6718. xGame.uiMgr.Show(UIAddProp, 0);
  6719. }
  6720. }
  6721. getRandPeople(index) {
  6722. let rand = this.peopleOffest[index];
  6723. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6724. }
  6725. logEventForClassic_start() {
  6726. let rtype = xGame.common.classicRoomType;
  6727. let msmc = '';
  6728. if (rtype == 1) {
  6729. msmc = 'beginner';
  6730. }
  6731. if (rtype == 2) {
  6732. msmc = 'expert';
  6733. }
  6734. if (rtype == 3) {
  6735. msmc = 'master';
  6736. }
  6737. let keyStr = 'sjmd_classic_start_' + rtype;
  6738. let jsonStr = {
  6739. "difficulty": msmc,
  6740. "classic_count": 1,
  6741. "difficulty_count": 1
  6742. };
  6743. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6744. const d = LocalStorageManager.getItem(keyStr);
  6745. jsonStr.classic_count = d.classic_count + 1;
  6746. jsonStr.difficulty_count = d.difficulty_count + 1;
  6747. LocalStorageManager.setItem(keyStr, jsonStr);
  6748. }
  6749. else {
  6750. LocalStorageManager.setItem(keyStr, jsonStr);
  6751. }
  6752. const reqStr = JSON.stringify(jsonStr);
  6753. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6754. }
  6755. }
  6756. UIModeSelection.uiName = "UIModeSelection";
  6757. class ui_UIReg extends fgui.GComponent {
  6758. static createInstance() {
  6759. return (fgui.UIPackage.createObject("game", "UIReg"));
  6760. }
  6761. onConstruct() {
  6762. this.n38 = (this.getChild("n38"));
  6763. this.n9 = (this.getChild("n9"));
  6764. this.n14 = (this.getChild("n14"));
  6765. this.n15 = (this.getChild("n15"));
  6766. this.n34 = (this.getChild("n34"));
  6767. this.closeBtn = (this.getChild("closeBtn"));
  6768. this.lab_tip = (this.getChild("lab_tip"));
  6769. this.n43 = (this.getChild("n43"));
  6770. this.txt_ua = (this.getChild("txt_ua"));
  6771. this.n44 = (this.getChild("n44"));
  6772. this.txt_up1 = (this.getChild("txt_up1"));
  6773. this.n45 = (this.getChild("n45"));
  6774. this.txt_up2 = (this.getChild("txt_up2"));
  6775. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6776. this.btn_reg = (this.getChild("btn_reg"));
  6777. this.n50 = (this.getChild("n50"));
  6778. }
  6779. }
  6780. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6781. class ui_UILogin extends fgui.GComponent {
  6782. static createInstance() {
  6783. return (fgui.UIPackage.createObject("game", "UILogin"));
  6784. }
  6785. onConstruct() {
  6786. this.c1 = this.getController("c1");
  6787. this.n18 = (this.getChild("n18"));
  6788. this.n7 = (this.getChild("n7"));
  6789. this.n5 = (this.getChild("n5"));
  6790. this.n6 = (this.getChild("n6"));
  6791. this.closeBtn = (this.getChild("closeBtn"));
  6792. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6793. this.btn_login = (this.getChild("btn_login"));
  6794. this.n30 = (this.getChild("n30"));
  6795. this.n31 = (this.getChild("n31"));
  6796. this.txt_up = (this.getChild("txt_up"));
  6797. this.n32 = (this.getChild("n32"));
  6798. this.txt_ua = (this.getChild("txt_ua"));
  6799. }
  6800. }
  6801. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6802. class UILogin extends UIBase {
  6803. constructor() {
  6804. super();
  6805. }
  6806. onConstructor() {
  6807. this.ui = ui_UILogin.createInstance();
  6808. this.contentPane = this.ui;
  6809. this.isEject = false;
  6810. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6811. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6812. this.addUIClick(this.ui.btn_login, this.userLogin);
  6813. }
  6814. show() {
  6815. super.show();
  6816. this.x = (Laya.stage.width - this.width) / 2;
  6817. this.y = (Laya.stage.height - this.height) / 2;
  6818. }
  6819. closeSelf() {
  6820. this.hide();
  6821. }
  6822. userLogin() {
  6823. let ua = this.ui.txt_ua.text;
  6824. let up = this.ui.txt_up.text;
  6825. if (ua && up) {
  6826. let reqData = JSON.stringify({
  6827. username: ua.trim(),
  6828. password: up.trim(),
  6829. fromMark: 'app_game'
  6830. });
  6831. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6832. try {
  6833. console.log('zh:res = ' + JSON.stringify(res));
  6834. let code = res.code;
  6835. let msg = res.msg;
  6836. if (code == 200) {
  6837. let keyStr = 'userInfo';
  6838. let jsonStr = {
  6839. "username": res.username,
  6840. "token": res.token
  6841. };
  6842. LocalStorageManager.setItem(keyStr, jsonStr);
  6843. xGame.uiMgr.Show(UIMsg, msg);
  6844. DataMgr.getUserZiChanInfo();
  6845. this.closeSelf();
  6846. }
  6847. else {
  6848. xGame.uiMgr.Show(UIMsg, msg);
  6849. }
  6850. }
  6851. catch (error) {
  6852. console.log('error=' + error);
  6853. alert(error);
  6854. }
  6855. finally {
  6856. }
  6857. });
  6858. }
  6859. else {
  6860. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6861. }
  6862. }
  6863. gotoRegPage() {
  6864. this.closeSelf();
  6865. xGame.uiMgr.Show(UIReg);
  6866. }
  6867. }
  6868. UILogin.uiName = "UILogin";
  6869. class UIReg extends UIBase {
  6870. constructor() {
  6871. super();
  6872. }
  6873. onConstructor() {
  6874. this.ui = ui_UIReg.createInstance();
  6875. this.contentPane = this.ui;
  6876. this.isEject = false;
  6877. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6878. this.addUIClick(this.ui.btn_reg, this.regUser);
  6879. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6880. }
  6881. show() {
  6882. super.show();
  6883. this.x = (Laya.stage.width - this.width) / 2;
  6884. this.y = (Laya.stage.height - this.height) / 2;
  6885. }
  6886. closeSelf() {
  6887. this.hide();
  6888. }
  6889. regUser() {
  6890. this.ui.lab_tip.visible = false;
  6891. let ua = this.ui.txt_ua.text;
  6892. let up1 = this.ui.txt_up1.text;
  6893. let up2 = this.ui.txt_up2.text;
  6894. if (ua && up1 && up2 && up1 == up2) {
  6895. let reqData = JSON.stringify({
  6896. username: ua.trim(),
  6897. password: up1.trim(),
  6898. fromMark: 'app_game'
  6899. });
  6900. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6901. try {
  6902. console.log('zh:res = ' + JSON.stringify(res));
  6903. let code = res.code;
  6904. let msg = res.msg;
  6905. xGame.uiMgr.Show(UIMsg, msg);
  6906. if (code == 200) {
  6907. this.ui.lab_tip.color = "#FFFFFF";
  6908. xGame.uiMgr.Show(UIMsg, msg);
  6909. this.closeSelf();
  6910. }
  6911. else {
  6912. this.ui.lab_tip.color = "#FF0000";
  6913. xGame.uiMgr.Show(UIMsg, msg);
  6914. }
  6915. }
  6916. catch (error) {
  6917. console.log('error=' + error);
  6918. alert(error);
  6919. }
  6920. finally {
  6921. }
  6922. });
  6923. }
  6924. else {
  6925. if (up1 != up2) {
  6926. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6927. }
  6928. else {
  6929. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6930. }
  6931. }
  6932. }
  6933. gotoLogin() {
  6934. this.closeSelf();
  6935. xGame.uiMgr.Show(UILogin);
  6936. }
  6937. }
  6938. UIReg.uiName = "UIReg";
  6939. class ui_UIFuli1 extends fgui.GComponent {
  6940. static createInstance() {
  6941. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  6942. }
  6943. onConstruct() {
  6944. this.n1 = (this.getChild("n1"));
  6945. this.n2 = (this.getChild("n2"));
  6946. }
  6947. }
  6948. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  6949. class UIFuli1 extends UIBase {
  6950. constructor() {
  6951. super();
  6952. }
  6953. onConstructor() {
  6954. this.ui = ui_UIFuli1.createInstance();
  6955. this.contentPane = this.ui;
  6956. this.isEject = false;
  6957. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  6958. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  6959. }
  6960. show() {
  6961. super.show();
  6962. this.x = (Laya.stage.width - this.width) / 2;
  6963. this.y = (Laya.stage.height - this.height) / 2;
  6964. }
  6965. closeSelf() {
  6966. this.hide();
  6967. }
  6968. gotoBuy() {
  6969. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6970. if (userInfo == null) {
  6971. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6972. return;
  6973. }
  6974. let reqData = xGame.httpMgr.getReqData();
  6975. let pd = JSON.parse(reqData);
  6976. pd.productId = 1;
  6977. reqData = JSON.stringify(pd);
  6978. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  6979. try {
  6980. console.log('zh:buySp res = ' + JSON.stringify(res));
  6981. let code = res.code;
  6982. let msg = res.msg;
  6983. if (code == 401) {
  6984. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6985. alert(TIP_MSG_key.loginTimeOut);
  6986. xGame.uiMgr.Show(UIMsg, msg);
  6987. return;
  6988. }
  6989. if (code == 200) {
  6990. xGame.uiMgr.Show(UIMsg, msg);
  6991. DataMgr.getUserZiChanInfo();
  6992. this.closeSelf();
  6993. }
  6994. else {
  6995. xGame.uiMgr.Show(UIMsg, msg);
  6996. }
  6997. }
  6998. catch (error) {
  6999. console.log('error=' + error);
  7000. alert(error);
  7001. }
  7002. finally {
  7003. }
  7004. });
  7005. }
  7006. }
  7007. UIFuli1.uiName = "UIFuli1";
  7008. class ui_UIFuli2 extends fgui.GComponent {
  7009. static createInstance() {
  7010. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  7011. }
  7012. onConstruct() {
  7013. this.n1 = (this.getChild("n1"));
  7014. this.n0 = (this.getChild("n0"));
  7015. }
  7016. }
  7017. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  7018. class UIFuli2 extends UIBase {
  7019. constructor() {
  7020. super();
  7021. }
  7022. onConstructor() {
  7023. this.ui = ui_UIFuli2.createInstance();
  7024. this.contentPane = this.ui;
  7025. this.isEject = false;
  7026. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  7027. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  7028. }
  7029. show() {
  7030. super.show();
  7031. this.x = (Laya.stage.width - this.width) / 2;
  7032. this.y = (Laya.stage.height - this.height) / 2;
  7033. }
  7034. closeSelf() {
  7035. this.hide();
  7036. }
  7037. gotoBuy() {
  7038. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7039. if (userInfo == null) {
  7040. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7041. return;
  7042. }
  7043. let reqData = xGame.httpMgr.getReqData();
  7044. let pd = JSON.parse(reqData);
  7045. pd.productId = 2;
  7046. reqData = JSON.stringify(pd);
  7047. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7048. try {
  7049. console.log('zh:buySp res = ' + JSON.stringify(res));
  7050. let code = res.code;
  7051. let msg = res.msg;
  7052. if (code == 401) {
  7053. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7054. alert(TIP_MSG_key.loginTimeOut);
  7055. xGame.uiMgr.Show(UIMsg, msg);
  7056. return;
  7057. }
  7058. if (code == 200) {
  7059. xGame.uiMgr.Show(UIMsg, msg);
  7060. DataMgr.getUserZiChanInfo();
  7061. this.closeSelf();
  7062. }
  7063. else {
  7064. xGame.uiMgr.Show(UIMsg, msg);
  7065. }
  7066. }
  7067. catch (error) {
  7068. console.log('error=' + error);
  7069. alert(error);
  7070. }
  7071. finally {
  7072. }
  7073. });
  7074. }
  7075. }
  7076. UIFuli2.uiName = "UIFuli2";
  7077. class ui_UIGetAward extends fgui.GComponent {
  7078. static createInstance() {
  7079. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7080. }
  7081. onConstruct() {
  7082. this.n4 = (this.getChild("n4"));
  7083. this.n0 = (this.getChild("n0"));
  7084. this.myList = (this.getChild("myList"));
  7085. this.n1 = (this.getChild("n1"));
  7086. this.eftNode = (this.getChild("eftNode"));
  7087. this.btnNode = (this.getChild("btnNode"));
  7088. this.t0 = this.getTransition("t0");
  7089. }
  7090. }
  7091. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7092. class UIGetAward extends UIBase {
  7093. constructor() {
  7094. super();
  7095. this.showTriple = true;
  7096. }
  7097. onConstructor() {
  7098. this.ui = ui_UIGetAward.createInstance();
  7099. this.contentPane = this.ui;
  7100. this.isEject = false;
  7101. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7102. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7103. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7104. }
  7105. show(arr, showTriple, callback) {
  7106. super.show();
  7107. this.ui.t0.play();
  7108. this.ui.eftNode.visible = true;
  7109. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7110. this.ui.eftNode.visible = false;
  7111. }), 1, 0, 0, 0.9);
  7112. this.awardArr = arr;
  7113. this.showTriple = showTriple;
  7114. this.callback = callback;
  7115. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7116. this.ui.myList.numItems = arr.length;
  7117. xGame.soundMgr.playSound("getaward");
  7118. }
  7119. updateSelf(index, obj) {
  7120. let temp = this.awardArr[index];
  7121. let icon = this.getIcon(temp.type);
  7122. let str = icon;
  7123. if (temp.type > 2) {
  7124. str = "s" + icon;
  7125. }
  7126. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7127. obj.myIcon.rotation = 0;
  7128. obj.numTxt.text = temp.num + "";
  7129. obj.numTxt.visible = temp.type > 2 ? false : true;
  7130. obj.nameTxt.text = this.getNameStr(temp.type);
  7131. }
  7132. renderItem(index, obj) {
  7133. this.updateSelf(index, obj);
  7134. }
  7135. tripleGetAward() {
  7136. console.log('zh:qjff_AD_for_uigetAward');
  7137. if (Laya.Browser.onAndroid) {
  7138. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7139. if (!boo) {
  7140. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7141. return;
  7142. }
  7143. }
  7144. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7145. }
  7146. else {
  7147. console.log('zh:AD 失败,直接发放奖励');
  7148. this.qjff_AD_for_uigetAward();
  7149. }
  7150. }
  7151. qjff_AD_for_uigetAward() {
  7152. this.getAward(3);
  7153. }
  7154. normalGetAward() {
  7155. if (PlatMgr.isMisVideo())
  7156. this.tripleGetAward();
  7157. else
  7158. this.getAward();
  7159. }
  7160. getAward(times = 1) {
  7161. this.hide();
  7162. for (let index = 0; index < this.awardArr.length; index++) {
  7163. this.awardArr[index].num *= times;
  7164. }
  7165. this.callback && this.callback(times != 1);
  7166. }
  7167. getIcon(type) {
  7168. switch (type) {
  7169. case Prop.diamond:
  7170. return "ty_zs";
  7171. case Prop.coin:
  7172. return "ty_jb";
  7173. case Prop.gan1:
  7174. return "qg1";
  7175. case Prop.gan2:
  7176. return "qg2";
  7177. case Prop.gan3:
  7178. return "qg3";
  7179. case Prop.gan4:
  7180. return "qg4";
  7181. default:
  7182. break;
  7183. }
  7184. }
  7185. getNameStr(type) {
  7186. switch (type) {
  7187. case Prop.diamond:
  7188. return "Diamond";
  7189. case Prop.coin:
  7190. return "Coins";
  7191. case Prop.gan1:
  7192. case Prop.gan2:
  7193. case Prop.gan3:
  7194. case Prop.gan4:
  7195. return cfgTable.ballrodData[type - 1].name;
  7196. default:
  7197. break;
  7198. }
  7199. }
  7200. }
  7201. UIGetAward.uiName = "UIGetAward";
  7202. class ui_UIRepentProp extends fgui.GComponent {
  7203. static createInstance() {
  7204. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7205. }
  7206. onConstruct() {
  7207. this.c1 = this.getController("c1");
  7208. this.n11 = (this.getChild("n11"));
  7209. this.regretNode = (this.getChild("regretNode"));
  7210. this.helpLineNode = (this.getChild("helpLineNode"));
  7211. this.t0 = this.getTransition("t0");
  7212. }
  7213. }
  7214. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7215. class UIRepentProp extends UIBase {
  7216. constructor() {
  7217. super();
  7218. this.viewType = 0;
  7219. this.regretType = 0;
  7220. }
  7221. onConstructor() {
  7222. this.ui = ui_UIRepentProp.createInstance();
  7223. this.contentPane = this.ui;
  7224. this.isEject = false;
  7225. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7226. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7227. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7228. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7229. }
  7230. show(viewType, regretType, callback) {
  7231. PlatMgr.showInsert(true);
  7232. this.viewType = viewType;
  7233. this.regretType = regretType;
  7234. this.callback = callback;
  7235. super.show();
  7236. this.ui.t0.play();
  7237. this.ui.c1.selectedIndex = this.viewType;
  7238. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7239. if (this.viewType == 0) {
  7240. let guide = DataMgr.getGuideHelpLine();
  7241. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7242. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7243. }
  7244. xGame.common.gameMgr.gamePause = true;
  7245. }
  7246. hideSelf() {
  7247. xGame.common.gameMgr.gamePause = false;
  7248. this.callback && this.callback(false);
  7249. this.hide();
  7250. }
  7251. videoRegret() {
  7252. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7253. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7254. }
  7255. else {
  7256. console.log('zh:AD 失败,直接发放奖励');
  7257. this.qjff_AD_for_UIrepentProp_videoRegret();
  7258. }
  7259. }
  7260. qjff_AD_for_UIrepentProp_videoRegret() {
  7261. this.callback && this.callback(true);
  7262. this.hideSelf();
  7263. }
  7264. videoAddHelpLine() {
  7265. let guide = DataMgr.getGuideHelpLine();
  7266. if (guide == 0) {
  7267. this.callback && this.callback(true);
  7268. this.hideSelf();
  7269. DataMgr.setGuideHelpLine();
  7270. xGame.common.gameUI.ui.guideNode.visible = false;
  7271. }
  7272. else {
  7273. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7274. if (Laya.Browser.onAndroid) {
  7275. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7276. if (!boo) {
  7277. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7278. return;
  7279. }
  7280. }
  7281. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7282. }
  7283. else {
  7284. console.log('zh:AD 失败,直接发放奖励');
  7285. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7286. }
  7287. }
  7288. }
  7289. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7290. this.callback && this.callback(true);
  7291. this.hideSelf();
  7292. }
  7293. }
  7294. UIRepentProp.uiName = "UIRepentProp";
  7295. class UIMain extends UIBase {
  7296. constructor() {
  7297. super();
  7298. this.firstEnter = true;
  7299. }
  7300. nativeCallJs(msg) {
  7301. let t = msg;
  7302. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7303. switch (t) {
  7304. case 'qjff_chouJiang':
  7305. let dui = xGame.uiMgr.getUI(UIDraw);
  7306. dui.qjff_chouJiang();
  7307. break;
  7308. case 'qjff_AD_for_uisign':
  7309. let dui2 = xGame.uiMgr.getUI(UISign);
  7310. dui2.qjff_AD_for_uisign();
  7311. break;
  7312. case 'qjff_AD_for_uitry':
  7313. let dui3 = xGame.uiMgr.getUI(UITry);
  7314. dui3.qjff_AD_for_uitry();
  7315. break;
  7316. case 'qjff_AD_for_uipower':
  7317. let dui4 = xGame.uiMgr.getUI(UIPower);
  7318. dui4.qjff_AD_for_uipower();
  7319. break;
  7320. case 'qjff_AD_for_uigetAward':
  7321. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7322. dui5.qjff_AD_for_uigetAward();
  7323. break;
  7324. case 'qjff_AD_for_uiGameEnd':
  7325. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7326. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7327. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7328. break;
  7329. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7330. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7331. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7332. break;
  7333. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7334. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7335. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7336. break;
  7337. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7338. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7339. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7340. break;
  7341. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7342. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7343. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7344. break;
  7345. case 'qjff_AD_for_UIBOX_onOpenBox':
  7346. let dui11 = xGame.uiMgr.getUI(UIBox);
  7347. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7348. break;
  7349. case 'qjff_AD_for_UIAddCoin':
  7350. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7351. dui12.qjff_AD_for_UIAddCoin();
  7352. break;
  7353. case '111a':
  7354. let dui14 = xGame.uiMgr.getUI(UISign);
  7355. dui14.qjff_AD_for_uisign();
  7356. break;
  7357. case '222a':
  7358. let dui15 = xGame.uiMgr.getUI(UISign);
  7359. dui15.qjff_AD_for_uisign();
  7360. break;
  7361. case '333a':
  7362. let dui16 = xGame.uiMgr.getUI(UISign);
  7363. dui16.qjff_AD_for_uisign();
  7364. break;
  7365. default:
  7366. console.log('zh:未知的方法名字' + t);
  7367. break;
  7368. }
  7369. }
  7370. onConstructor() {
  7371. console.log('zh: UIMain onConstructor');
  7372. this.ui = ui_UIMain.createInstance();
  7373. this.contentPane = this.ui;
  7374. this.isEject = false;
  7375. this.addEvent();
  7376. this.addClickSpine();
  7377. this.settingNode = new SettingNode(this.ui.settingNode);
  7378. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7379. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7380. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7381. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7382. let curUse = DataMgr.getCurSecretary();
  7383. this.changeSecretary(curUse);
  7384. this.ui.talkNode.visible = false;
  7385. let guide = DataMgr.getSkillGuide();
  7386. if (xGame.common.isNewDay && guide == 1) {
  7387. xGame.common.isNewDay = false;
  7388. xGame.soundMgr.playSound("s_main01");
  7389. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7390. console.log("zh:播放小秘书每天语音");
  7391. }
  7392. this.onGetUserInfo();
  7393. DataMgr.getUserZiChanInfo();
  7394. this.ui.n83.visible = false;
  7395. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7396. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7397. let ua = d.username;
  7398. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7399. }
  7400. this.c_btn_for_user();
  7401. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7402. }
  7403. Logout() {
  7404. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7405. LocalStorageManager.removeItem(keyForLoginInfo);
  7406. this.freshUser();
  7407. }
  7408. JSBridgeUtils.instance.loginOutForApp();
  7409. }
  7410. gotoLogin() {
  7411. xGame.uiMgr.Show(UILogin);
  7412. }
  7413. gotoRegUser() {
  7414. xGame.uiMgr.Show(UIReg);
  7415. }
  7416. showFuLi() {
  7417. console.log('zh:福利2');
  7418. xGame.uiMgr.Show(UIFuli1);
  7419. xGame.uiMgr.Show(UIFuli2);
  7420. console.log('zh:福利2222');
  7421. }
  7422. c_btn_for_user() {
  7423. this.ui.n_Logout.visible = false;
  7424. this.ui.n_dengLu.visible = false;
  7425. this.ui.n_zhuCe.visible = false;
  7426. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7427. this.ui.n_Logout.visible = true;
  7428. }
  7429. else {
  7430. this.ui.n_dengLu.visible = true;
  7431. }
  7432. }
  7433. changeSecretary(curUse) {
  7434. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7435. xGame.common.secretary && xGame.common.secretary.dispose();
  7436. this.addSecretarySpine(name);
  7437. }
  7438. addSecretarySpine(name) {
  7439. let spine = new SpineMgr(name, () => {
  7440. this.playSecretaryIdle();
  7441. });
  7442. xGame.common.secretary = spine;
  7443. }
  7444. addClickSpine() {
  7445. let clickSpine = new SpineMgr("dianji", () => {
  7446. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7447. let parent = Laya.stage;
  7448. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7449. clickSpine.play(data, 0, false, parent, (spine) => {
  7450. spine.destroy(true);
  7451. });
  7452. });
  7453. });
  7454. }
  7455. addEvent() {
  7456. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7457. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7458. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7459. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7460. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7461. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7462. this.addUIClick(this.ui, this.interuptSecretary);
  7463. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7464. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7465. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7466. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7467. this.addUIClick(this.ui.signBtn, this.openSignView);
  7468. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7469. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7470. this.addUIClick(this.ui.n_Logout, this.Logout);
  7471. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7472. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7473. this.addUIClick(this.ui.n_fuli, this.showFuLi);
  7474. }
  7475. show(showFailWords) {
  7476. super.show();
  7477. this.moneyNode.ui.c1.selectedIndex = 1;
  7478. this.playSecretaryIdle();
  7479. xGame.soundMgr.playMusic("caromhall01", 0);
  7480. Laya.timer.clearAll(this);
  7481. this.playSecretaryRandomSound();
  7482. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7483. if (showFailWords) {
  7484. console.log('zh:uimain.ts ');
  7485. setTimeout(() => {
  7486. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7487. let words = -1;
  7488. if (str == "s_main02") {
  7489. words = 2;
  7490. }
  7491. else {
  7492. words = 3;
  7493. }
  7494. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7495. xGame.soundMgr.playSound(str);
  7496. }, 300);
  7497. }
  7498. this.showGuide();
  7499. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7500. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7501. let guide = DataMgr.getSkillGuide();
  7502. if (guide == 1) {
  7503. let randTime = xGame.common.randomNum(300, 800);
  7504. if (this.firstEnter) {
  7505. console.log("zh: firstEnter");
  7506. this.firstEnter = false;
  7507. randTime += 900;
  7508. }
  7509. else {
  7510. console.log("zh: no firstEnter");
  7511. }
  7512. Laya.timer.once(randTime, this, () => {
  7513. xGame.common.autoPopUIView();
  7514. });
  7515. }
  7516. }
  7517. checkActive(show) {
  7518. }
  7519. showGuide() {
  7520. let guide = DataMgr.getSkillGuide();
  7521. this.ui.guideBtn.visible = guide == 0;
  7522. this.ui.enterGuide.visible = false;
  7523. this.ui.secretaryGuide.visible = guide == 0;
  7524. if (guide == 0) {
  7525. console.log("zh:显示引导");
  7526. xGame.soundMgr.playSound("s_guide");
  7527. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7528. }
  7529. else {
  7530. console.log("zh:不需要显示引导");
  7531. }
  7532. }
  7533. ensureSecretary() {
  7534. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7535. this.ui.secretaryGuide.visible = false;
  7536. this.ui.enterGuide.visible = true;
  7537. this.ui.wordsNode.t0.play();
  7538. if (DataMgr.getNewUser())
  7539. Moyu.sendDataEvent("gameReady");
  7540. }
  7541. playSecretaryIdle() {
  7542. let parent = this.ui.secretary.displayObject;
  7543. parent.destroyChildren();
  7544. let xx = this.ui.secretary.width / 2;
  7545. let yy = this.ui.secretary.height;
  7546. let scale = xGame.common.getSecretaryScale();
  7547. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7548. xGame.common.secretary.play(data, 0, true, parent);
  7549. }
  7550. startGame(type) {
  7551. if (!this.isReadyForLoadNetSource()) {
  7552. return;
  7553. }
  7554. xGame.common.gameMode = type;
  7555. Moyu.sendDataEvent("PlayGame", { type: type });
  7556. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7557. switch (xGame.common.gameMode) {
  7558. case GameMode.classic:
  7559. console.log('zh:进入经典模式111111111');
  7560. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7561. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7562. console.log('zh:classic db_over_lev=', db_over_lev);
  7563. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7564. console.log('zh:判断是否可以玩该模式classic =NO');
  7565. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7566. xGame.uiMgr.Show(UIMsg, tipStr);
  7567. return;
  7568. }
  7569. else {
  7570. console.log('zh:可以玩该模式classic 66666666666666');
  7571. this.beginGame();
  7572. }
  7573. }
  7574. else {
  7575. console.log('zh:不需要判断是否可以玩该classic');
  7576. let challengeTimes = DataMgr.getChallengeTimes();
  7577. if (challengeTimes == 0) {
  7578. xGame.uiMgr.Show(UIInvitation);
  7579. }
  7580. else {
  7581. this.beginGame();
  7582. }
  7583. break;
  7584. }
  7585. case GameMode.bigMove:
  7586. console.error('zh:bigMove check');
  7587. let guide = DataMgr.getSkillGuide();
  7588. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7589. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7590. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7591. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7592. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7593. xGame.uiMgr.Show(UIMsg, tipStr);
  7594. return;
  7595. }
  7596. else {
  7597. console.log('zh:可以玩该模式 bigMove');
  7598. this.beginGame();
  7599. if (DataMgr.getNewUser())
  7600. Moyu.sendDataEvent("gameStart0");
  7601. }
  7602. }
  7603. else {
  7604. this.beginGame();
  7605. if (DataMgr.getNewUser())
  7606. Moyu.sendDataEvent("gameStart0");
  7607. }
  7608. break;
  7609. default:
  7610. console.error('zh:未知错误!!!!');
  7611. break;
  7612. }
  7613. }
  7614. beginGame(isNice = false) {
  7615. console.log('zh:beginGame ');
  7616. let guide = DataMgr.getSkillGuide();
  7617. if (guide == 1) {
  7618. console.log('zh:非新手引导,showInternAd ');
  7619. JSBridgeUtils.instance.showInternAd('beginGame');
  7620. }
  7621. else {
  7622. console.log('zh:新手引导,不显示AD ');
  7623. }
  7624. console.log('zh:beginGame 2 go');
  7625. if (xGame.common.gameMode == GameMode.classic) {
  7626. if (isNice) {
  7627. this.enterClassic();
  7628. }
  7629. else {
  7630. xGame.uiMgr.Show(UIModeSelection, () => {
  7631. console.log('zh:BBBBBBBBBBBBBBB');
  7632. this.enterClassic();
  7633. });
  7634. }
  7635. }
  7636. else if (xGame.common.gameMode == GameMode.bigMove) {
  7637. this.ui.enterGuide.visible = false;
  7638. xGame.uiMgr.Show(UISkill);
  7639. }
  7640. }
  7641. enterClassic() {
  7642. xGame.uiMgr.Show(UIGame);
  7643. xGame.uiMgr.Show(UIMatching, () => {
  7644. if (!this.isHide)
  7645. this.hide();
  7646. xGame.common.gameUI.ui.alpha = 1;
  7647. xGame.common.gameUI.startGame();
  7648. xGame.uiMgr.Hide(UIGameEnd);
  7649. });
  7650. }
  7651. startGlobal() {
  7652. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7653. let userInfo = LocalStorageManager.getItem('userInfo');
  7654. if (userInfo != null) {
  7655. let token = userInfo.token;
  7656. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7657. JSBridgeUtils.instance.testPay1(token, ggSpid);
  7658. return;
  7659. }
  7660. }
  7661. startWeekly() {
  7662. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7663. }
  7664. zhouSaiMonth() {
  7665. console.log('zh: zhouSaiMonth 被调用');
  7666. }
  7667. isReadyForLoadNetSource() {
  7668. let reqCount = xGame.cfgMgr.httpReqCount;
  7669. let ok = xGame.cfgMgr.httpReqOkCount;
  7670. if (reqCount > ok) {
  7671. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7672. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7673. Laya.timer.once(5000, this, () => {
  7674. let retryCount = 0;
  7675. const maxRetries = 3;
  7676. const tryFetchConfig = () => {
  7677. try {
  7678. xGame.cfgMgr.getConfigFromServer();
  7679. }
  7680. catch (error) {
  7681. if (retryCount < maxRetries) {
  7682. retryCount++;
  7683. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7684. Laya.timer.once(5000, this, tryFetchConfig);
  7685. }
  7686. else {
  7687. console.error("❌ 达到最大重试次数,配置获取失败");
  7688. }
  7689. }
  7690. };
  7691. tryFetchConfig();
  7692. });
  7693. return false;
  7694. }
  7695. return true;
  7696. }
  7697. startPlaceBall() {
  7698. if (!this.isReadyForLoadNetSource()) {
  7699. return;
  7700. }
  7701. xGame.uiMgr.Show(UILevelDisplay);
  7702. }
  7703. hide() {
  7704. console.log('zh:uimain hide ...');
  7705. super.hide();
  7706. xGame.common.stopGirlPop(this.ui.talkNode);
  7707. }
  7708. onGetUserInfo(force = false) {
  7709. if (Moyu.isWx) {
  7710. let info = Moyu.getSystemInfo();
  7711. if (info)
  7712. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7713. }
  7714. else {
  7715. Moyu.initUser(this, this.freshUser, force);
  7716. }
  7717. this.freshUser();
  7718. }
  7719. freshUser() {
  7720. let user = Moyu.getUserInfo();
  7721. if (!user.isAuth) {
  7722. user.headIcon = 'res/ty_touxiang.png';
  7723. }
  7724. else {
  7725. DataMgr.upRankData();
  7726. }
  7727. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7728. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7729. let keyStr = keyForLoginInfo;
  7730. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7731. const d = LocalStorageManager.getItem(keyStr);
  7732. let ua = d.username;
  7733. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7734. }
  7735. else {
  7736. }
  7737. this.c_btn_for_user();
  7738. }
  7739. interuptSecretary() {
  7740. Laya.timer.clearAll(this);
  7741. this.playSecretaryRandomSound();
  7742. }
  7743. playSecretaryRandomSound() {
  7744. if (this.isHide)
  7745. return;
  7746. let time = xGame.common.randomNum(45000, 60000);
  7747. Laya.timer.once(time, this, () => {
  7748. if (this.isHide)
  7749. return;
  7750. let index = xGame.common.randomNum(4, 7);
  7751. xGame.soundMgr.playSound("s_main0" + index);
  7752. let words = 1;
  7753. switch (index) {
  7754. case 4:
  7755. words = 5;
  7756. break;
  7757. case 5:
  7758. words = 3;
  7759. break;
  7760. case 6:
  7761. words = 6;
  7762. break;
  7763. case 7:
  7764. words = 7;
  7765. break;
  7766. default:
  7767. break;
  7768. }
  7769. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7770. this.playSecretaryRandomSound();
  7771. });
  7772. }
  7773. openSecretaryView() {
  7774. xGame.uiMgr.Show(UISecretary);
  7775. Moyu.sendDataEvent("secretary");
  7776. }
  7777. openShopView() {
  7778. xGame.uiMgr.Show(UIShop, 0);
  7779. }
  7780. openSignView() {
  7781. xGame.uiMgr.Show(UISign);
  7782. }
  7783. openDrawView() {
  7784. xGame.uiMgr.Show(UIDraw);
  7785. }
  7786. openRanking() {
  7787. console.log('zh:phb openRanking');
  7788. xGame.uiMgr.Show(UIRanking);
  7789. Moyu.sendDataEvent("rankingList");
  7790. }
  7791. }
  7792. UIMain.uiName = "UIMain";
  7793. class UIGameEnd extends UIBase {
  7794. constructor() {
  7795. super();
  7796. this.success = false;
  7797. this.awardCoinNum = 1000;
  7798. this.awardDiamondNum = 10;
  7799. }
  7800. onConstructor() {
  7801. this.ui = ui_UIGameEnd.createInstance();
  7802. this.contentPane = this.ui;
  7803. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7804. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7805. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7806. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7807. this.ui.talkNode.visible = false;
  7808. if (Moyu.isKs)
  7809. this.ui.closeNode.closeBtn.x += 100;
  7810. }
  7811. updateType() {
  7812. switch (xGame.common.gameMode) {
  7813. case GameMode.classic:
  7814. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7815. this.ui.coinNode.visible = this.success;
  7816. if (!this.success) {
  7817. Laya.timer.once(500, this, () => {
  7818. xGame.uiMgr.Show(UIAddCoin);
  7819. });
  7820. }
  7821. else {
  7822. this.logEventForClassic_win();
  7823. }
  7824. this.logEventForClassic_complete();
  7825. this.ui.isGetAward.visible = false;
  7826. this.ui.leftBtn.c1.selectedIndex = 3;
  7827. this.ui.rightBtn.c1.selectedIndex = 0;
  7828. this.moneyNode.ui.c1.selectedIndex = 1;
  7829. break;
  7830. case GameMode.bigMove:
  7831. console.log('zh:招法模式 aaaaaa bigMove');
  7832. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7833. this.ui.coinNode.visible = this.success;
  7834. if (xGame.common.gameMode == GameMode.bigMove) {
  7835. if (this.success) {
  7836. DataMgr.setSkillSuccessTimes(1, true);
  7837. DataMgr.setSkillAccTimes(1);
  7838. }
  7839. else {
  7840. DataMgr.setSkillSuccessTimes(0, false);
  7841. }
  7842. }
  7843. this.logEventForRod_complete_N();
  7844. if (!this.success) {
  7845. Laya.timer.once(500, this, () => {
  7846. xGame.uiMgr.Show(UIAddCoin);
  7847. });
  7848. }
  7849. else {
  7850. this.logEventForRod_win();
  7851. }
  7852. this.ui.isGetAward.visible = false;
  7853. this.ui.leftBtn.c1.selectedIndex = 3;
  7854. this.ui.rightBtn.c1.selectedIndex = 0;
  7855. this.moneyNode.ui.c1.selectedIndex = 1;
  7856. break;
  7857. case GameMode.placeBall:
  7858. this.ui.coinNode.visible = false;
  7859. if (this.success) {
  7860. if (xGame.common.placeBallStarNum == 3) {
  7861. this.ui.c1.selectedIndex = 2;
  7862. }
  7863. else {
  7864. this.ui.c1.selectedIndex = 3;
  7865. }
  7866. let level = xGame.common.placeBallCurLevel;
  7867. if (level > 59) {
  7868. this.logEventForChallenge_level_complete(level);
  7869. }
  7870. else {
  7871. this.logEventForChallenge_level_N(level);
  7872. }
  7873. }
  7874. else {
  7875. this.ui.c1.selectedIndex = 4;
  7876. }
  7877. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7878. if (cfg.type == PlaceBallType.challenge) {
  7879. this.ui.c1.selectedIndex = 2;
  7880. }
  7881. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7882. this.updatePlaceBallBtn();
  7883. this.updatePlaceBallStarNum();
  7884. this.updatePlaceBallAwardState();
  7885. this.moneyNode.ui.c1.selectedIndex = 2;
  7886. this.moneyNode.checkPowerTime();
  7887. this.moneyNode.powerChange();
  7888. DataMgr.upRankData();
  7889. break;
  7890. default:
  7891. break;
  7892. }
  7893. }
  7894. logEventForRod_complete_N() {
  7895. let gfmsIdx = xGame.common.curPlayerSkillType;
  7896. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7897. let gfmc = 'Skyfall Shot';
  7898. if (gfmsIdx == 0) {
  7899. gfmc = 'Skyfall Shot';
  7900. }
  7901. if (gfmsIdx == 1) {
  7902. gfmc = 'Surging break';
  7903. }
  7904. if (gfmsIdx == 2) {
  7905. gfmc = 'Frost Lock';
  7906. }
  7907. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7908. console.log('zh:logEventForRod_complete_N level = ' + level);
  7909. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7910. let jsonStr = {
  7911. "count": 0,
  7912. "name": gfmc
  7913. };
  7914. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7915. const d = LocalStorageManager.getItem(keyStr);
  7916. jsonStr.count = d.count + 1;
  7917. LocalStorageManager.setItem(keyStr, jsonStr);
  7918. }
  7919. else {
  7920. LocalStorageManager.setItem(keyStr, jsonStr);
  7921. }
  7922. const d2 = LocalStorageManager.getItem(keyStr);
  7923. let count = d2.count;
  7924. console.log('zh:logEventForRod_complete_N count = ' + count);
  7925. if (count % 5 == 0) {
  7926. const reqStr = JSON.stringify(jsonStr);
  7927. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7928. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7929. }
  7930. }
  7931. logEventForRod_win() {
  7932. console.log('zh:logEventForRod_win,胜利');
  7933. let gfmsIdx = xGame.common.curPlayerSkillType;
  7934. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7935. let gfmc = 'Skyfall Shot';
  7936. if (gfmsIdx == 0) {
  7937. gfmc = 'Skyfall Shot';
  7938. }
  7939. if (gfmsIdx == 1) {
  7940. gfmc = 'Surging break';
  7941. }
  7942. if (gfmsIdx == 2) {
  7943. gfmc = 'Frost Lock';
  7944. }
  7945. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7946. console.log('zh:logEventForRod_win level = ' + level);
  7947. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7948. let jsonStr = {
  7949. "count": 1,
  7950. "name": gfmc + ' Lev' + level
  7951. };
  7952. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7953. const d = LocalStorageManager.getItem(keyStr);
  7954. jsonStr.count = d.count + 1;
  7955. LocalStorageManager.setItem(keyStr, jsonStr);
  7956. }
  7957. else {
  7958. LocalStorageManager.setItem(keyStr, jsonStr);
  7959. }
  7960. const reqStr = JSON.stringify(jsonStr);
  7961. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7962. }
  7963. logEventForClassic_win() {
  7964. console.log('zh:logEventForClassic_win,胜利');
  7965. let rtype = xGame.common.classicRoomType;
  7966. let msmc = '';
  7967. if (rtype == 1) {
  7968. msmc = 'beginner';
  7969. }
  7970. if (rtype == 2) {
  7971. msmc = 'expert';
  7972. }
  7973. if (rtype == 3) {
  7974. msmc = 'master';
  7975. }
  7976. let keyStr = 'sjmd_classic_win_' + rtype;
  7977. let jsonStr = {
  7978. "difficulty": msmc,
  7979. "classic_count": 1,
  7980. "difficulty_count": 1
  7981. };
  7982. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7983. const d = LocalStorageManager.getItem(keyStr);
  7984. jsonStr.classic_count = d.classic_count + 1;
  7985. jsonStr.difficulty_count = d.difficulty_count + 1;
  7986. LocalStorageManager.setItem(keyStr, jsonStr);
  7987. }
  7988. else {
  7989. LocalStorageManager.setItem(keyStr, jsonStr);
  7990. }
  7991. const reqStr = JSON.stringify(jsonStr);
  7992. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7993. }
  7994. logEventForClassic_complete() {
  7995. console.log('zh:logEventForClassic_complete,胜利');
  7996. let rtype = xGame.common.classicRoomType;
  7997. let msmc = '';
  7998. if (rtype == 1) {
  7999. msmc = 'beginner';
  8000. }
  8001. if (rtype == 2) {
  8002. msmc = 'expert';
  8003. }
  8004. if (rtype == 3) {
  8005. msmc = 'master';
  8006. }
  8007. let keyStr = 'sjmd_classic_complete_' + rtype;
  8008. let jsonStr = {
  8009. "msmc": msmc,
  8010. "count": 0
  8011. };
  8012. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8013. const d = LocalStorageManager.getItem(keyStr);
  8014. jsonStr.count = d.count + 1;
  8015. LocalStorageManager.setItem(keyStr, jsonStr);
  8016. }
  8017. else {
  8018. LocalStorageManager.setItem(keyStr, jsonStr);
  8019. }
  8020. if (jsonStr.count % 5 == 0) {
  8021. const reqStr = JSON.stringify(jsonStr);
  8022. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8023. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8024. }
  8025. }
  8026. updatePlaceBallBtn() {
  8027. this.ui.leftBtn.c1.selectedIndex = 5;
  8028. if (this.success) {
  8029. this.ui.rightBtn.c1.selectedIndex = 14;
  8030. }
  8031. else {
  8032. if (xGame.common.placeBallStarNum == 3) {
  8033. this.ui.rightBtn.c1.selectedIndex = 14;
  8034. }
  8035. else {
  8036. this.ui.rightBtn.c1.selectedIndex = 1;
  8037. }
  8038. }
  8039. }
  8040. updatePlaceBallStarNum() {
  8041. let starNum = xGame.common.placeBallStarNum;
  8042. if (starNum == 0)
  8043. this.ui.starNumNode.c1.selectedIndex = 3;
  8044. else {
  8045. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8046. }
  8047. }
  8048. updatePlaceBallAwardState() {
  8049. let level = xGame.common.placeBallCurLevel;
  8050. let starNum = xGame.common.placeBallStarNum;
  8051. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8052. let data = cfgTable.placeballData[level].award;
  8053. let cfg = cfgTable.placeballData[level];
  8054. this.awardDiamondNum = data[1];
  8055. this.awardCoinNum = data[0];
  8056. if (cfg.type == PlaceBallType.challenge) {
  8057. this.awardDiamondNum = 0;
  8058. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8059. }
  8060. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8061. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8062. if (cfg.type == PlaceBallType.challenge) {
  8063. this.ui.awardNode.coinNode.visible = true;
  8064. }
  8065. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8066. this.ui.awardNode.diamondNode.x = 265;
  8067. this.ui.awardNode.coinNode.x = 354;
  8068. }
  8069. else {
  8070. this.ui.awardNode.diamondNode.x = 291;
  8071. this.ui.awardNode.coinNode.x = 291;
  8072. }
  8073. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8074. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8075. if (this.awardCoinNum == 0) {
  8076. this.ui.awardNode.coinNode.numTxt.text = "";
  8077. }
  8078. if (getAward) {
  8079. this.ui.isGetAward.visible = true;
  8080. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8081. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8082. }
  8083. else {
  8084. this.ui.isGetAward.visible = false;
  8085. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8086. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8087. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8088. }
  8089. else {
  8090. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8091. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8092. }
  8093. }
  8094. }
  8095. show(success) {
  8096. super.show();
  8097. xGame.eventMgr.event(RESET_GAME);
  8098. this.success = success;
  8099. Laya.timer.clearAll(this);
  8100. this.playSecretaryAni();
  8101. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8102. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8103. offsetTime = Math.floor(offsetTime / 1000);
  8104. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8105. this.updateType();
  8106. Laya.timer.once(200, this, () => {
  8107. this.addAward(() => {
  8108. this.updateType();
  8109. Laya.timer.once(500, this, () => {
  8110. this.showChallengeLevel();
  8111. });
  8112. });
  8113. });
  8114. if (this.success) {
  8115. JSBridgeUtils.instance.showInternAd('gameend_success');
  8116. console.log('zh:game end 成功');
  8117. xGame.soundMgr.playSound('slots_roll01');
  8118. xGame.soundMgr.playSound("s_win");
  8119. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8120. this.diyGameDataUtilForGameWin();
  8121. }
  8122. else {
  8123. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8124. console.log('zh:game end失败');
  8125. xGame.soundMgr.playSound('matchwin01');
  8126. xGame.soundMgr.playSound("s_lose");
  8127. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8128. }
  8129. let challengeNum = DataMgr.getChallengeTimes();
  8130. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8131. DataMgr.setChallengeTimes(1);
  8132. }
  8133. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8134. DataMgr.setClassicTimes();
  8135. }
  8136. }
  8137. diyGameDataUtilForGameWin() {
  8138. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8139. switch (xGame.common.gameMode) {
  8140. case GameMode.classic:
  8141. console.log('zh:DiyGameDataUtilForGameWin 111');
  8142. case GameMode.bigMove:
  8143. console.log('zh:DiyGameDataUtilForGameWin 222');
  8144. this.restartGame();
  8145. break;
  8146. case GameMode.placeBall:
  8147. console.log('zh:DiyGameDataUtilForGameWin 333');
  8148. var level = xGame.common.placeBallCurLevel;
  8149. console.log('zh:练习模式 联系了多少LEV=' + level);
  8150. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8151. if (level > db_over_lev) {
  8152. DataMgr.setChallengeMode_overLev(level);
  8153. }
  8154. break;
  8155. default:
  8156. console.log('zh:DiyGameDataUtilForGameWin 444');
  8157. break;
  8158. }
  8159. }
  8160. showChallengeLevel() {
  8161. if (DataMgr.getChallengeTimes() != 0)
  8162. return;
  8163. let skill = DataMgr.getSkillAccTimes();
  8164. let put = DataMgr.getPlaceBallLevelList().length;
  8165. if (skill >= 3 || put >= 5) {
  8166. xGame.uiMgr.Show(UIInvitation);
  8167. this.hide();
  8168. }
  8169. }
  8170. addAward(callback) {
  8171. if (!this.success) {
  8172. callback && callback();
  8173. return;
  8174. }
  8175. switch (xGame.common.gameMode) {
  8176. case GameMode.classic:
  8177. this.awardCoinNum = xGame.common.passAwardCoin;
  8178. this.awardDiamondNum = 0;
  8179. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8180. break;
  8181. case GameMode.bigMove:
  8182. this.awardCoinNum = xGame.common.passAwardCoin;
  8183. this.awardDiamondNum = 0;
  8184. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8185. callback && callback();
  8186. break;
  8187. case GameMode.placeBall:
  8188. let level = xGame.common.placeBallCurLevel;
  8189. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8190. if (xGame.common.placeBallStarNum != 3) {
  8191. callback && callback();
  8192. return;
  8193. }
  8194. else {
  8195. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8196. if (getAward) {
  8197. callback && callback();
  8198. return;
  8199. }
  8200. }
  8201. let cfg = cfgTable.placeballData[level];
  8202. let data = cfgTable.placeballData[level].award;
  8203. this.awardCoinNum = data[0];
  8204. this.awardDiamondNum = data[1];
  8205. if (cfg.type == PlaceBallType.challenge) {
  8206. this.awardDiamondNum = 0;
  8207. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8208. }
  8209. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8210. let diamondAward;
  8211. if (this.awardDiamondNum > 0) {
  8212. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8213. xGame.common.getAward([diamondAward, coinAward], callback);
  8214. }
  8215. else {
  8216. xGame.common.getAward([coinAward], callback);
  8217. }
  8218. if (cfg.type == PlaceBallType.normal) {
  8219. DataMgr.setPlaceBallAward(level);
  8220. }
  8221. break;
  8222. default:
  8223. break;
  8224. }
  8225. }
  8226. playSecretaryAni_old() {
  8227. let parent = this.ui.secretary.displayObject;
  8228. parent.destroyChildren();
  8229. let xx = this.ui.secretary.width / 2;
  8230. let yy = this.ui.secretary.height;
  8231. let scale = xGame.common.getSecretaryScale();
  8232. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8233. if (this.success) {
  8234. let rand = Math.random() <= 0.5 ? 2 : 3;
  8235. xGame.common.secretary.play(data, rand, false, parent, () => {
  8236. xGame.common.secretary.play(data, 1, true, parent);
  8237. });
  8238. }
  8239. else {
  8240. xGame.common.secretary.play(data, 0, true, parent);
  8241. }
  8242. }
  8243. playSecretaryAni() {
  8244. let parent = this.ui.secretary.displayObject;
  8245. parent.destroyChildren();
  8246. let xx = this.ui.secretary.width / 2;
  8247. let yy = this.ui.secretary.height;
  8248. let scale = xGame.common.getSecretaryScale();
  8249. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8250. if (this.success) {
  8251. let rand = 0;
  8252. xGame.common.secretary.play(data, 0, true, parent);
  8253. }
  8254. else {
  8255. xGame.common.secretary.play(data, 0, true, parent);
  8256. }
  8257. }
  8258. restartGame() {
  8259. switch (xGame.common.gameMode) {
  8260. case GameMode.classic:
  8261. xGame.eventMgr.event(RESTART_GAME);
  8262. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8263. break;
  8264. case GameMode.bigMove:
  8265. this.hide();
  8266. xGame.eventMgr.event(RESTART_GAME);
  8267. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8268. break;
  8269. default:
  8270. break;
  8271. }
  8272. }
  8273. hide() {
  8274. super.hide();
  8275. xGame.common.stopGirlPop(this.ui.talkNode);
  8276. PlatMgr.showBanner(false);
  8277. }
  8278. returnHome() {
  8279. this.hide();
  8280. let showFailWords = !this.success;
  8281. xGame.uiMgr.Show(UIMain, showFailWords);
  8282. }
  8283. clickLeftBtn() {
  8284. switch (xGame.common.gameMode) {
  8285. case GameMode.classic:
  8286. case GameMode.bigMove:
  8287. this.returnHome();
  8288. break;
  8289. case GameMode.placeBall:
  8290. let level = xGame.common.placeBallCurLevel;
  8291. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8292. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8293. break;
  8294. default:
  8295. break;
  8296. }
  8297. }
  8298. powerStartPlaceBallLevel(level, btn) {
  8299. if (DataMgr.powerEnough()) {
  8300. btn.touchable = false;
  8301. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8302. btn.touchable = true;
  8303. DataMgr.setPower(-1);
  8304. xGame.eventMgr.event(POWER_TIME);
  8305. this.startPlaceBallLevel(level);
  8306. this.logEventForChallenge_level_start(level);
  8307. }));
  8308. }
  8309. else {
  8310. xGame.uiMgr.Show(UIPower, 0);
  8311. }
  8312. }
  8313. clickRightBtn() {
  8314. switch (xGame.common.gameMode) {
  8315. case GameMode.classic:
  8316. console.log('zh:clickRightBtn 111');
  8317. case GameMode.bigMove:
  8318. console.log('zh:clickRightBtn 222');
  8319. this.restartGame();
  8320. break;
  8321. case GameMode.placeBall:
  8322. console.log('zh:clickRightBtn 333');
  8323. let level = xGame.common.placeBallCurLevel;
  8324. let data = DataMgr.getPlaceBallLevel(level);
  8325. let curPss = data.play && !data.isCur;
  8326. if (curPss) {
  8327. console.log('zh:clickRightBtn 333-111');
  8328. console.log('zh:当前LV=' + level);
  8329. if (level == 60) {
  8330. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8331. Laya.timer.once(3000, this, () => {
  8332. this.returnHome();
  8333. });
  8334. }
  8335. else {
  8336. let lev = level + 1;
  8337. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8338. }
  8339. }
  8340. else {
  8341. console.log('zh:clickRightBtn 333-000');
  8342. Moyu.sendDataEvent("placeBallNextLevel");
  8343. console.log('zh:qjff_AD_for_uiGameEnd');
  8344. if (Laya.Browser.onAndroid) {
  8345. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8346. if (!boo) {
  8347. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8348. return;
  8349. }
  8350. }
  8351. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8352. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8353. }
  8354. else {
  8355. console.log('zh:AD 失败,直接发放奖励');
  8356. this.qjff_AD_for_uiGameEnd(level);
  8357. }
  8358. }
  8359. break;
  8360. default:
  8361. console.log('zh:clickRightBtn 444');
  8362. break;
  8363. }
  8364. }
  8365. logEventForChallenge_level_start(level) {
  8366. let keyStr = 'sjmd_challenge_level_start';
  8367. let jsonStr = {
  8368. "count": 0,
  8369. "gold_balance ": DataMgr.getCoin(),
  8370. "level": level,
  8371. "diamond_balance ": DataMgr.getDiamond()
  8372. };
  8373. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8374. const d = LocalStorageManager.getItem(keyStr);
  8375. if (level > d.level) {
  8376. jsonStr.count = d.count + 1;
  8377. LocalStorageManager.setItem(keyStr, jsonStr);
  8378. }
  8379. else {
  8380. }
  8381. }
  8382. else {
  8383. LocalStorageManager.setItem(keyStr, jsonStr);
  8384. }
  8385. const reqStr = JSON.stringify(jsonStr);
  8386. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8387. }
  8388. qjff_AD_for_uiGameEnd(level) {
  8389. DataMgr.setPlaceBallLevel(level, 1);
  8390. this.startPlaceBallLevel(level + 1);
  8391. }
  8392. startPlaceBallLevel(level) {
  8393. xGame.common.gameMode = GameMode.placeBall;
  8394. xGame.common.placeBallCurLevel = level;
  8395. xGame.uiMgr.Show(UIGame);
  8396. this.hide();
  8397. }
  8398. logEventForChallenge_level_complete(level) {
  8399. let keyStr = 'sjmd_challenge_level_complete';
  8400. let jsonStr = {
  8401. "count": 1,
  8402. "gold_balance ": DataMgr.getCoin(),
  8403. "level": level,
  8404. "diamond_balance ": DataMgr.getDiamond()
  8405. };
  8406. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8407. const d = LocalStorageManager.getItem(keyStr);
  8408. jsonStr.count = d.count + 1;
  8409. LocalStorageManager.setItem(keyStr, jsonStr);
  8410. }
  8411. else {
  8412. LocalStorageManager.setItem(keyStr, jsonStr);
  8413. }
  8414. const reqStr = JSON.stringify(jsonStr);
  8415. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8416. }
  8417. logEventForChallenge_level_N(level) {
  8418. console.log('zh:logEventForChallenge_level_N ' + level);
  8419. let keyStr = 'sjmd_challenge_level_N';
  8420. if (LocalStorageManager.hasKey(keyStr)) {
  8421. let lev = LocalStorageManager.getItem(keyStr);
  8422. if (level > lev) {
  8423. LocalStorageManager.setItem(keyStr, level);
  8424. }
  8425. if ((level) % 5 == 0) {
  8426. console.log('zh:每5关上报1次');
  8427. let sjmc = 'challenge_level_' + level;
  8428. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8429. let sjmcForFirebase = 'challenge_level_' + level;
  8430. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8431. }
  8432. else {
  8433. console.log('zh:5 no 上报');
  8434. }
  8435. }
  8436. else {
  8437. LocalStorageManager.setItem(keyStr, level);
  8438. }
  8439. }
  8440. }
  8441. UIGameEnd.uiName = "UIGameEnd";
  8442. class ui_UIVideoShare extends fgui.GComponent {
  8443. static createInstance() {
  8444. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8445. }
  8446. onConstruct() {
  8447. this.n10 = (this.getChild("n10"));
  8448. this.myNode = (this.getChild("myNode"));
  8449. this.t0 = this.getTransition("t0");
  8450. }
  8451. }
  8452. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8453. class UIVideoShare extends UIBase {
  8454. constructor() {
  8455. super();
  8456. this.success = false;
  8457. this.awardNum = 0;
  8458. this.isShared = true;
  8459. }
  8460. onConstructor() {
  8461. this.ui = ui_UIVideoShare.createInstance();
  8462. this.contentPane = this.ui;
  8463. this.isEject = false;
  8464. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8465. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8466. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8467. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8468. }
  8469. show(success) {
  8470. super.show();
  8471. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8472. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8473. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8474. this.success = success;
  8475. let time = xGame.common.randomNum(600, 1500);
  8476. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8477. if (success)
  8478. xGame.soundMgr.playSound("applause");
  8479. this.ui.t0.play();
  8480. this.checkShareState();
  8481. let times = DataMgr.getDailyVideoShareTimes();
  8482. this.awardNum = times == 0 ? 2000 : 200;
  8483. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8484. }
  8485. checkShareState() {
  8486. if (PlatMgr.forceShare == 0) {
  8487. this.ui.myNode.closeBtn.visible = true;
  8488. this.ui.myNode.tipsNode.visible = false;
  8489. this.ui.myNode.closeBtn.x = 90;
  8490. this.ui.myNode.shareBtn.x = 342;
  8491. }
  8492. else if (PlatMgr.forceShare == 1) {
  8493. this.ui.myNode.closeBtn.visible = false;
  8494. this.ui.myNode.tipsNode.visible = true;
  8495. this.ui.myNode.shareBtn.x = 218;
  8496. this.isShared = true;
  8497. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8498. }
  8499. }
  8500. checkForceShare() {
  8501. this.isShared = !this.isShared;
  8502. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8503. }
  8504. videoShare() {
  8505. if (PlatMgr.forceShare == 1) {
  8506. if (this.isShared) {
  8507. this.shareGame();
  8508. }
  8509. else {
  8510. this.hideSelf();
  8511. }
  8512. }
  8513. else {
  8514. this.shareGame();
  8515. }
  8516. }
  8517. shareGame() {
  8518. Moyu.sendDataEvent("VideoShare");
  8519. if (Moyu.canShare() > 100) {
  8520. Moyu.shareGame((success) => {
  8521. if (success) {
  8522. DataMgr.setDailyVideoShareTimes(1);
  8523. DataMgr.setCoin(this.awardNum);
  8524. }
  8525. this.hideSelf();
  8526. }, this);
  8527. }
  8528. else {
  8529. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8530. this.hideSelf();
  8531. }
  8532. }
  8533. hideSelf() {
  8534. this.hide();
  8535. xGame.uiMgr.Show(UIGameEnd, this.success);
  8536. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8537. xGame.common.screenImg.destroy();
  8538. xGame.common.screenImg = null;
  8539. }
  8540. }
  8541. }
  8542. UIVideoShare.uiName = "UIVideoShare";
  8543. class ui_UITips extends fgui.GComponent {
  8544. static createInstance() {
  8545. return (fgui.UIPackage.createObject("game", "UITips"));
  8546. }
  8547. onConstruct() {
  8548. this.n0 = (this.getChild("n0"));
  8549. this.myNode = (this.getChild("myNode"));
  8550. this.t0 = this.getTransition("t0");
  8551. }
  8552. }
  8553. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8554. class UITips extends UIBase {
  8555. constructor() {
  8556. super();
  8557. this.type = 0;
  8558. }
  8559. onConstructor() {
  8560. this.ui = ui_UITips.createInstance();
  8561. this.contentPane = this.ui;
  8562. this.isEject = false;
  8563. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8564. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8565. }
  8566. show(tipsTxt, womanTxt, type) {
  8567. super.show();
  8568. this.ui.t0.play();
  8569. this.ui.myNode.tipsTxt.text = tipsTxt;
  8570. this.ui.myNode.womanTxt.text = womanTxt;
  8571. PlatMgr.showInsert(true);
  8572. this.ui.myNode.c1.selectedIndex = type;
  8573. this.type = type;
  8574. switch (this.type) {
  8575. case TipsType.exitGame:
  8576. xGame.common.gameMgr.gamePause = true;
  8577. break;
  8578. case TipsType.foul:
  8579. Laya.timer.once(200, this, () => {
  8580. xGame.common.gameMgr.gamePause = true;
  8581. });
  8582. break;
  8583. default:
  8584. break;
  8585. }
  8586. }
  8587. clickLeftBtn() {
  8588. this.hide();
  8589. xGame.common.gameMgr.gamePause = false;
  8590. switch (this.type) {
  8591. case TipsType.exitGame:
  8592. break;
  8593. case TipsType.foul:
  8594. break;
  8595. default:
  8596. break;
  8597. }
  8598. }
  8599. clickRightBtn() {
  8600. this.hide();
  8601. switch (this.type) {
  8602. case TipsType.exitGame:
  8603. xGame.eventMgr.event(RESET_GAME);
  8604. xGame.uiMgr.Show(UIMain);
  8605. Moyu.recordEnd(this, null);
  8606. xGame.common.longHelpLine = false;
  8607. break;
  8608. case TipsType.foul:
  8609. xGame.common.gameMgr.gamePause = false;
  8610. Laya.timer.clearAll(this);
  8611. break;
  8612. default:
  8613. break;
  8614. }
  8615. }
  8616. }
  8617. UITips.uiName = "UITips";
  8618. class GameMgr {
  8619. constructor() {
  8620. this.selfCamp = "";
  8621. this.selfFoulNum = 0;
  8622. this.selfBallArr = [];
  8623. this.selfTimer = 0;
  8624. this.selfScore = 0;
  8625. this.aiCamp = "";
  8626. this.aiFoulNum = 0;
  8627. this.aiBallArr = [];
  8628. this.aiTimer = 0;
  8629. this.aiScore = 0;
  8630. this.aiSkillLevelNum = 1;
  8631. this.targertScore = 0;
  8632. this.setTime = 30;
  8633. this.selfTurnRate = 0.5;
  8634. this.accTime = 0;
  8635. this.curFoul = "";
  8636. this.maxFoulTimes = 3;
  8637. this.isFirstInGame = true;
  8638. this.firstColliObj = null;
  8639. this.inHoleBalls = [];
  8640. this.blackNum = 8;
  8641. this.success = false;
  8642. this.holePosList = [];
  8643. this.posObj = {};
  8644. this._selfTurn = false;
  8645. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8646. this.ensureBallType = false;
  8647. this.isOpenBall = true;
  8648. this.finishOneShoot = true;
  8649. this.isEnd = false;
  8650. this.isChangeTurn = false;
  8651. this.isInterrupt = false;
  8652. this.aiPlayedBreakArmy = false;
  8653. this.isTouchedBall = false;
  8654. this.finishBalls = 0;
  8655. this.needBalls = 0;
  8656. this.allBallNum = 0;
  8657. this.placeBallPosData = {};
  8658. this.curHP = 0;
  8659. this.showLongView = false;
  8660. this.firstShoot = true;
  8661. this._gamePause = false;
  8662. this.trunCount = 0;
  8663. this.isBlackInHole = false;
  8664. this.isEnter = true;
  8665. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8666. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8667. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8668. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8669. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8670. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8671. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8672. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8673. }
  8674. get gamePause() {
  8675. return this._gamePause;
  8676. }
  8677. set gamePause(v) {
  8678. if (v) {
  8679. Laya.physicsTimer.pause();
  8680. }
  8681. else {
  8682. Laya.physicsTimer.resume();
  8683. }
  8684. this._gamePause = v;
  8685. }
  8686. get selfTurn() {
  8687. return this._selfTurn;
  8688. }
  8689. set selfTurn(val) {
  8690. this.trunCount++;
  8691. this._selfTurn = val;
  8692. if (val) {
  8693. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8694. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8695. }
  8696. else {
  8697. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8698. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8699. if (this.trunCount > 1)
  8700. PlatMgr.openBox();
  8701. }
  8702. }
  8703. resetGame() {
  8704. this.inHoleBalls = [];
  8705. this.isFirstInGame = true;
  8706. this.firstColliObj = null;
  8707. this.aiCamp = "";
  8708. this.selfCamp = "";
  8709. this.aiFoulNum = 0;
  8710. this.selfFoulNum = 0;
  8711. this.selfBallArr = [];
  8712. this.aiBallArr = [];
  8713. this.gamePause = false;
  8714. this.ensureBallType = false;
  8715. this.isInterrupt = false;
  8716. this.updateLeftBall();
  8717. this.clearTime();
  8718. this.aiPlayedBreakArmy = false;
  8719. this.isBlackInHole = false;
  8720. this.placeBallPosData = {};
  8721. if (xGame.common.d3World.knifeRoot) {
  8722. xGame.common.d3World.knifeRoot.destroyChildren();
  8723. }
  8724. }
  8725. gameReady() {
  8726. this.trunCount = 0;
  8727. this.firstColliObj = null;
  8728. this.isFirstInGame = true;
  8729. this.selfTurn = Math.random() <= this.selfTurnRate;
  8730. let challengeNum = DataMgr.getChallengeTimes();
  8731. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8732. this.selfTurn = true;
  8733. }
  8734. if (xGame.common.gameMode == GameMode.placeBall)
  8735. this.selfTurn = true;
  8736. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8737. this.selfTurn = true;
  8738. }
  8739. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8740. this.checkGuide();
  8741. if (xGame.common.uiRodMethod)
  8742. xGame.common.uiRodMethod.resetRod();
  8743. xGame.common.d2World.getHelpLine();
  8744. this.isOpenBall = true;
  8745. this.isTouchedBall = false;
  8746. xGame.common.aiPlayer.stopRun();
  8747. this.setTime = 30;
  8748. let ui = xGame.common.gameUI.ui;
  8749. switch (xGame.common.gameMode) {
  8750. case GameMode.classic:
  8751. xGame.common.aiPlayer.init();
  8752. this.blackNum = 8;
  8753. this.placeRootBall();
  8754. this.peoplePlay(9, 10);
  8755. ui.wordsBtn.visible = true;
  8756. ui.aiWordsBtn.visible = true;
  8757. xGame.common.talkMgr.changeAIState(true);
  8758. DataMgr.gameData.gameCount++;
  8759. DataMgr.saveGameData();
  8760. break;
  8761. case GameMode.bigMove:
  8762. this.blackNum = -1;
  8763. this.selfScore = 0;
  8764. this.aiScore = 0;
  8765. xGame.common.aiPlayer.init();
  8766. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8767. this.updateSelfScore();
  8768. this.updateAIScore();
  8769. this.updateTargetSroce();
  8770. this.placeRootBall();
  8771. this.peoplePlay(9, 10);
  8772. ui.wordsBtn.visible = true;
  8773. ui.aiWordsBtn.visible = true;
  8774. xGame.common.talkMgr.changeAIState(true);
  8775. if (DataMgr.getSkillGuide() < 1)
  8776. DataMgr.gameData.gameCount = 0;
  8777. else {
  8778. DataMgr.gameData.gameCount++;
  8779. DataMgr.saveGameData();
  8780. PlatMgr.openTry();
  8781. }
  8782. if (xGame.common.d3World.knifeRoot) {
  8783. xGame.common.d3World.knifeRoot.destroyChildren();
  8784. }
  8785. break;
  8786. case GameMode.placeBall:
  8787. this.blackNum = -1;
  8788. this.selfTurn = true;
  8789. this.setTime = 10000;
  8790. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8791. this.curHP = this.placeBallData.hp;
  8792. if (this.placeBallData.ball == -1)
  8793. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8794. else
  8795. this.needBalls = this.placeBallData.ball;
  8796. console.log("需要的进球数目", this.needBalls);
  8797. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8798. this.finishBalls = 0;
  8799. this.placeBallPosData = {};
  8800. this.updatePlaceBallPos();
  8801. this.updatePlaceBallState();
  8802. this.finishOneShoot = true;
  8803. xGame.common.gameUI.ui.moveNode.visible = false;
  8804. this.isOpenBall = false;
  8805. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8806. ui.wordsBtn.visible = false;
  8807. ui.aiWordsBtn.visible = false;
  8808. xGame.common.talkMgr.changeAIState(false);
  8809. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8810. PlatMgr.openBox();
  8811. });
  8812. break;
  8813. default:
  8814. break;
  8815. }
  8816. this.showLongView = false;
  8817. xGame.common.wordsMgr.comboTimes = 1;
  8818. let guide = DataMgr.getSkillGuide();
  8819. if (guide)
  8820. xGame.eventMgr.event(WAIT_SHOOT);
  8821. xGame.common.upSkillLevel = false;
  8822. xGame.common.gameStartTime = new Date().getTime();
  8823. this.firstShoot = true;
  8824. }
  8825. checkGuide() {
  8826. let guide = DataMgr.getSkillGuide();
  8827. let gameUI = xGame.common.gameUI.ui;
  8828. gameUI.guide1.visible = false;
  8829. gameUI.guide2.visible = false;
  8830. gameUI.guide3.visible = false;
  8831. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8832. this.selfTurn = true;
  8833. }
  8834. else {
  8835. return;
  8836. }
  8837. let oneBall = this.getOneBall();
  8838. gameUI.guide1.visible = true;
  8839. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8840. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8841. }
  8842. getOneBall() {
  8843. let arr = xGame.common.d2World.ballArr;
  8844. for (let index = 0; index < arr.length; index++) {
  8845. if (arr[index].number == 0)
  8846. continue;
  8847. return arr[index];
  8848. }
  8849. }
  8850. updateSelfScore() {
  8851. let ui = xGame.common.gameUI.ui.topNode;
  8852. ui.selfScoreTxt.text = this.selfScore + "";
  8853. }
  8854. updateAIScore() {
  8855. let ui = xGame.common.gameUI.ui.topNode;
  8856. ui.aiScoreTxt.text = this.aiScore + "";
  8857. }
  8858. updateTargetSroce() {
  8859. let ui = xGame.common.gameUI.ui.topNode;
  8860. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8861. }
  8862. updateLeftBall() {
  8863. let topUI = xGame.common.gameUI.ui.topNode;
  8864. topUI.selfBallList.numItems = this.selfBallArr.length;
  8865. topUI.aiBallList.numItems = this.aiBallArr.length;
  8866. }
  8867. ballShoot() {
  8868. this.clearTime();
  8869. this.finishOneShoot = false;
  8870. xGame.common.gameUI.ui.moveNode.visible = false;
  8871. if (xGame.common.gameUI.ui.guideNode.visible) {
  8872. xGame.common.gameUI.ui.guideNode.visible = false;
  8873. }
  8874. if (this.firstShoot) {
  8875. this.firstShoot = false;
  8876. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8877. }
  8878. }
  8879. ensureCamp(number) {
  8880. this.ensureBallType = true;
  8881. this.isOpenBall = false;
  8882. if (xGame.common.gameMode != GameMode.classic)
  8883. return;
  8884. let full = [1, 2, 3, 4, 5, 6, 7];
  8885. let flower = [9, 10, 11, 12, 13, 14, 15];
  8886. let sayWords = "";
  8887. if (this.selfTurn) {
  8888. if (number <= 7) {
  8889. this.selfCamp = ballCamp.full;
  8890. this.selfBallArr = full;
  8891. this.aiCamp = ballCamp.flower;
  8892. this.aiBallArr = flower;
  8893. sayWords = cfgTable.wordsData[3].msg;
  8894. }
  8895. else {
  8896. this.selfCamp = ballCamp.flower;
  8897. this.selfBallArr = flower;
  8898. this.aiCamp = ballCamp.full;
  8899. this.aiBallArr = full;
  8900. sayWords = cfgTable.wordsData[4].msg;
  8901. }
  8902. }
  8903. else {
  8904. if (number <= 7) {
  8905. this.selfCamp = ballCamp.flower;
  8906. this.selfBallArr = flower;
  8907. this.aiCamp = ballCamp.full;
  8908. this.aiBallArr = full;
  8909. sayWords = cfgTable.wordsData[2].msg;
  8910. }
  8911. else {
  8912. this.selfCamp = ballCamp.full;
  8913. this.selfBallArr = full;
  8914. this.aiCamp = ballCamp.flower;
  8915. this.aiBallArr = flower;
  8916. sayWords = cfgTable.wordsData[1].msg;
  8917. }
  8918. }
  8919. this.updateLeftBall();
  8920. xGame.uiMgr.Show(UIMsg, sayWords);
  8921. }
  8922. updatePlaceBallState() {
  8923. let ui = xGame.common.gameUI.ui;
  8924. switch (this.placeBallData.type) {
  8925. case PlaceBallType.normal:
  8926. let normal = ui.placeNormalNode;
  8927. normal.hpTxt.text = this.curHP + "";
  8928. this.updatePlaceBallStar(normal);
  8929. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8930. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8931. break;
  8932. case PlaceBallType.challenge:
  8933. let challenge = ui.placeChallengeNode;
  8934. challenge.hpTxt.text = "Shots:" + this.curHP;
  8935. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8936. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8937. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8938. break;
  8939. default:
  8940. break;
  8941. }
  8942. }
  8943. playSubHpAni() {
  8944. let ui = xGame.common.gameUI.ui;
  8945. switch (this.placeBallData.type) {
  8946. case PlaceBallType.normal:
  8947. let normal = ui.placeNormalNode;
  8948. normal.hpTxt.visible = false;
  8949. normal.starAni.c1.selectedIndex = 1;
  8950. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8951. normal.hpTxt.visible = true;
  8952. normal.starAni.c1.selectedIndex = 0;
  8953. }));
  8954. break;
  8955. default:
  8956. break;
  8957. }
  8958. }
  8959. getEndStarNum() {
  8960. let num;
  8961. let level = xGame.common.placeBallCurLevel;
  8962. if (this.curHP == this.placeBallData.hp) {
  8963. num = 3;
  8964. }
  8965. else if (this.curHP <= 1) {
  8966. num = 1;
  8967. }
  8968. else {
  8969. num = 2;
  8970. }
  8971. if (!this.success) {
  8972. num = 0;
  8973. }
  8974. else {
  8975. DataMgr.setPlaceBallLevel(level, num);
  8976. }
  8977. let myType = cfgTable.placeballData[level].type;
  8978. if (this.success && myType == 1) {
  8979. num = 3;
  8980. }
  8981. xGame.common.placeBallStarNum = num;
  8982. }
  8983. updatePlaceBallStar(node) {
  8984. let star = 0;
  8985. if (this.curHP == this.placeBallData.hp) {
  8986. star = 3;
  8987. }
  8988. else if (this.curHP >= 2) {
  8989. star = 2;
  8990. }
  8991. else if (this.curHP == 1) {
  8992. star = 1;
  8993. }
  8994. else {
  8995. star = 0;
  8996. }
  8997. let temp;
  8998. for (let index = 1; index <= 3; index++) {
  8999. temp = node["star" + index];
  9000. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9001. }
  9002. node.myProgress.value = (star / 3) * 100;
  9003. }
  9004. openRegretView(isFoul, GoalNum, challenge = false) {
  9005. let regretType = -1;
  9006. if (isFoul) {
  9007. regretType = 1;
  9008. }
  9009. else {
  9010. if (GoalNum <= 0) {
  9011. regretType = 0;
  9012. }
  9013. }
  9014. if (challenge) {
  9015. regretType = 1;
  9016. }
  9017. if (regretType != -1) {
  9018. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9019. if (success) {
  9020. this.curHP++;
  9021. this.updatePlaceBallState();
  9022. this.setPlaceBallAllPos();
  9023. xGame.common.gameUI.ui.moveNode.visible = false;
  9024. }
  9025. else {
  9026. if (this.curHP <= 0) {
  9027. this.success = false;
  9028. this.gameEnd();
  9029. }
  9030. this.playSubHpAni();
  9031. }
  9032. this.updatePlaceBallState();
  9033. this.updatePlaceBallPos();
  9034. });
  9035. }
  9036. }
  9037. setPlaceBallAllPos() {
  9038. let allBall = xGame.common.d2World.ballArr;
  9039. let cfgArr = this.placeBallPosData;
  9040. let temp;
  9041. let obj;
  9042. for (let index = 0; index < allBall.length; index++) {
  9043. temp = allBall[index];
  9044. if (temp.destroyed)
  9045. continue;
  9046. obj = cfgArr[temp.myUNID];
  9047. if (obj && obj.src && !obj.src.destroyed) {
  9048. temp.gameObj.x = obj.posX;
  9049. temp.gameObj.y = obj.posY;
  9050. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9051. }
  9052. }
  9053. xGame.common.d2World.getHelpLine();
  9054. }
  9055. updatePlaceBallPos() {
  9056. let arr = xGame.common.d2World.ballArr;
  9057. let temp;
  9058. for (let index = 0; index < arr.length; index++) {
  9059. temp = arr[index];
  9060. if (!this.placeBallPosData[temp.myUNID]) {
  9061. this.placeBallPosData[temp.myUNID] = {
  9062. src: temp,
  9063. posX: temp.gameObj.x,
  9064. posY: temp.gameObj.y
  9065. };
  9066. }
  9067. else {
  9068. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9069. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9070. }
  9071. }
  9072. let check;
  9073. for (const key in this.placeBallPosData) {
  9074. check = this.placeBallPosData[key];
  9075. if (check.src.destroyed) {
  9076. delete this.placeBallPosData[key];
  9077. }
  9078. }
  9079. }
  9080. gameRun(type) {
  9081. if (this.gamePause)
  9082. return;
  9083. this.curFoul = this.getFoulType();
  9084. if (type) {
  9085. xGame.common.d2World.d2Gan.shoot();
  9086. xGame.common.gameUI.forceCancel();
  9087. this.curFoul = type;
  9088. }
  9089. this.isEnd = false;
  9090. this.isChangeTurn = true;
  9091. if (xGame.common.gameMode == GameMode.classic) {
  9092. this.judgeClassic(this.curFoul);
  9093. this.checkClassicWords(() => {
  9094. xGame.common.destroyClassicEmotion();
  9095. if (this.isEnd) {
  9096. if (this.isBlackInHole) {
  9097. xGame.common.gameUI.ui.blackAni.visible = true;
  9098. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9099. xGame.common.gameUI.ui.blackAni.visible = false;
  9100. this.gameEnd();
  9101. }));
  9102. }
  9103. else {
  9104. this.gameEnd();
  9105. }
  9106. }
  9107. else {
  9108. this.waitShoot();
  9109. xGame.eventMgr.event(WAIT_SHOOT);
  9110. }
  9111. });
  9112. }
  9113. else if (xGame.common.gameMode == GameMode.bigMove) {
  9114. xGame.common.aiPlayer.stopRun();
  9115. let scoreArr = this.getScore(this.curFoul);
  9116. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9117. this.isEnd = true;
  9118. }
  9119. this.checkBigSkillWords(() => {
  9120. if (this.isEnd) {
  9121. this.gameEnd();
  9122. }
  9123. else {
  9124. this.waitShoot();
  9125. xGame.eventMgr.event(WAIT_SHOOT);
  9126. }
  9127. });
  9128. }
  9129. else if (xGame.common.gameMode == GameMode.placeBall) {
  9130. xGame.common.destroyAwardSpine();
  9131. let isFoul = this.curFoul == FoulType.rootHole;
  9132. let GoalNum = this.inHoleBalls.length;
  9133. if (this.inHoleBalls.indexOf(0) > -1)
  9134. GoalNum -= 1;
  9135. if (isFoul) {
  9136. this.placeRootBall();
  9137. }
  9138. console.log("neeballs", this.needBalls);
  9139. console.log("当前完成的goalNum", GoalNum);
  9140. this.finishBalls += GoalNum;
  9141. console.log("当前完成的finishballs", this.finishBalls);
  9142. let need = this.needBalls;
  9143. if (this.placeBallData.type == PlaceBallType.challenge) {
  9144. need += 100;
  9145. }
  9146. if (this.finishBalls >= need) {
  9147. this.success = true;
  9148. this.gameEnd();
  9149. }
  9150. else {
  9151. switch (this.placeBallData.type) {
  9152. case PlaceBallType.normal:
  9153. if (!isFoul && GoalNum > 0) {
  9154. this.updatePlaceBallPos();
  9155. this.updatePlaceBallState();
  9156. }
  9157. else {
  9158. this.curHP--;
  9159. this.openRegretView(isFoul, GoalNum);
  9160. }
  9161. this.waitShoot();
  9162. xGame.eventMgr.event(WAIT_SHOOT);
  9163. break;
  9164. case PlaceBallType.challenge:
  9165. this.curHP--;
  9166. this.updatePlaceBallState();
  9167. if (isFoul) {
  9168. this.openRegretView(isFoul, GoalNum, true);
  9169. }
  9170. else {
  9171. this.updatePlaceBallPos();
  9172. if (this.curHP <= 0) {
  9173. this.success = true;
  9174. this.gameEnd();
  9175. }
  9176. }
  9177. this.waitShoot();
  9178. xGame.eventMgr.event(WAIT_SHOOT);
  9179. break;
  9180. default:
  9181. break;
  9182. }
  9183. }
  9184. }
  9185. }
  9186. checkClassicWords(callback) {
  9187. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9188. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9189. let type = this.getClassicWordsType();
  9190. if (condition && type != -1) {
  9191. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9192. xGame.soundMgr.playSound(str);
  9193. xGame.common.wordsMgr.playClassicWords(type, callback);
  9194. }
  9195. else {
  9196. Laya.timer.once(300, this, () => {
  9197. callback && callback();
  9198. });
  9199. }
  9200. }
  9201. getClassicWordsType() {
  9202. let d2world = xGame.common.d2World;
  9203. let type = -1;
  9204. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9205. type = ClassicWordsType.perfectShow;
  9206. return type;
  9207. }
  9208. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9209. type = ClassicWordsType.directShoot;
  9210. return type;
  9211. }
  9212. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9213. type = ClassicWordsType.anotherShoot;
  9214. return type;
  9215. }
  9216. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9217. type = ClassicWordsType.bigPower;
  9218. return type;
  9219. }
  9220. let minSpeed = 1;
  9221. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9222. type = ClassicWordsType.hardShoot;
  9223. return type;
  9224. }
  9225. if (this.inHoleBalls.length > 0) {
  9226. type = ClassicWordsType.directShoot;
  9227. return type;
  9228. }
  9229. return type;
  9230. }
  9231. checkBigSkillWords(callback) {
  9232. if (this.curFoul == FoulType.timeOut) {
  9233. callback && callback();
  9234. }
  9235. else {
  9236. let playSkill = false;
  9237. if (this.selfTurn) {
  9238. playSkill = true;
  9239. }
  9240. else {
  9241. if (!this.aiPlayedBreakArmy) {
  9242. this.aiPlayedBreakArmy = true;
  9243. playSkill = true;
  9244. }
  9245. if (this.aiCurSkill != SkillType.breakArmy) {
  9246. playSkill = true;
  9247. }
  9248. }
  9249. if (xGame.common.skillMgr.playedLastSkill) {
  9250. xGame.common.skillMgr.playedLastSkill = false;
  9251. playSkill = false;
  9252. }
  9253. if (playSkill) {
  9254. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9255. let selfExtra = 0;
  9256. let aiExtra = 0;
  9257. if (this.selfTurn)
  9258. selfExtra += extraScore;
  9259. else
  9260. aiExtra += extraScore;
  9261. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9262. this.isEnd = true;
  9263. }
  9264. this.playBigSkillTimes(callback);
  9265. });
  9266. }
  9267. else {
  9268. this.playBigSkillTimes(callback);
  9269. }
  9270. }
  9271. }
  9272. playBigSkillTimes(callback) {
  9273. let length = this.inHoleBalls.length;
  9274. if (this.inHoleBalls.indexOf(0) > -1) {
  9275. length = this.inHoleBalls.length - 1;
  9276. }
  9277. if (length <= 0) {
  9278. callback && callback();
  9279. return;
  9280. }
  9281. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9282. callback && callback();
  9283. });
  9284. }
  9285. playSkillTips() {
  9286. let levelNum = 0;
  9287. let curType;
  9288. if (this.selfTurn) {
  9289. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9290. curType = this.selfCurSkill;
  9291. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9292. levelNum += 5;
  9293. }
  9294. }
  9295. else {
  9296. levelNum = this.aiSkillLevelNum;
  9297. curType = this.aiCurSkill;
  9298. }
  9299. let str = ``;
  9300. switch (curType) {
  9301. case SkillType.highSpace:
  9302. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9303. break;
  9304. case SkillType.breakArmy:
  9305. str = `You pocketed ${levelNum} extra balls`;
  9306. break;
  9307. case SkillType.ice:
  9308. str = `${levelNum * 2} extra balls were frozen`;
  9309. break;
  9310. case SkillType.fireworks:
  9311. str = `${levelNum} extra balls exploded `;
  9312. break;
  9313. case SkillType.GuanYu:
  9314. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9315. break;
  9316. default:
  9317. break;
  9318. }
  9319. xGame.uiMgr.Show(UIMsg, str);
  9320. }
  9321. getFoulType() {
  9322. let foulType = "";
  9323. if (this.firstColliObj == null) {
  9324. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9325. return FoulType.rootHole;
  9326. }
  9327. return FoulType.notTouch;
  9328. }
  9329. else {
  9330. if (this.selfTurn) {
  9331. if (this.selfBallArr.length > 0) {
  9332. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9333. foulType = FoulType.wrongTouch;
  9334. }
  9335. }
  9336. else {
  9337. if (this.ensureBallType) {
  9338. }
  9339. else {
  9340. if (this.firstColliObj == this.blackNum) {
  9341. foulType = FoulType.wrongTouch;
  9342. }
  9343. }
  9344. }
  9345. }
  9346. else {
  9347. if (this.aiBallArr.length > 0) {
  9348. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9349. foulType = FoulType.wrongTouch;
  9350. }
  9351. }
  9352. else {
  9353. if (this.ensureBallType) {
  9354. }
  9355. else {
  9356. if (this.firstColliObj == this.blackNum) {
  9357. foulType = FoulType.wrongTouch;
  9358. }
  9359. }
  9360. }
  9361. }
  9362. if (this.inHoleBalls.length <= 0) {
  9363. return foulType;
  9364. }
  9365. let temp;
  9366. if (this.inHoleBalls.indexOf(0) > -1) {
  9367. foulType = FoulType.rootHole;
  9368. }
  9369. else {
  9370. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9371. temp = this.inHoleBalls[index];
  9372. if (this.selfTurn) {
  9373. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9374. foulType = FoulType.wrongHole;
  9375. break;
  9376. }
  9377. }
  9378. else {
  9379. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9380. foulType = FoulType.wrongHole;
  9381. break;
  9382. }
  9383. }
  9384. }
  9385. }
  9386. let foo;
  9387. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9388. temp = this.inHoleBalls[index];
  9389. foo = this.selfBallArr.indexOf(temp);
  9390. if (foo > -1) {
  9391. this.selfBallArr.splice(foo, 1);
  9392. }
  9393. foo = this.aiBallArr.indexOf(temp);
  9394. if (foo > -1) {
  9395. this.aiBallArr.splice(foo, 1);
  9396. }
  9397. }
  9398. this.updateLeftBall();
  9399. }
  9400. return foulType;
  9401. }
  9402. judgeGameEndByBlack(arr) {
  9403. if (this.selfTurn) {
  9404. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9405. this.selfFoulNum = this.maxFoulTimes;
  9406. return true;
  9407. }
  9408. }
  9409. else {
  9410. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9411. this.aiFoulNum = this.maxFoulTimes;
  9412. return true;
  9413. }
  9414. }
  9415. }
  9416. judgeClassic(type) {
  9417. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9418. xGame.common.aiPlayer.stopRun();
  9419. if (this.judgeNormalSuccess()) {
  9420. this.isEnd = true;
  9421. return;
  9422. }
  9423. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9424. if (this.selfTurn) {
  9425. if (isFoul) {
  9426. this.selfFoulNum++;
  9427. }
  9428. if (this.selfFoulNum >= this.maxFoulTimes) {
  9429. this.success = false;
  9430. this.isEnd = true;
  9431. return;
  9432. }
  9433. }
  9434. else {
  9435. if (isFoul)
  9436. this.aiFoulNum++;
  9437. if (this.aiFoulNum >= this.maxFoulTimes) {
  9438. this.success = true;
  9439. this.isEnd = true;
  9440. return;
  9441. }
  9442. }
  9443. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9444. this.isChangeTurn = false;
  9445. }
  9446. else {
  9447. this.isInterrupt = true;
  9448. }
  9449. }
  9450. waitShoot() {
  9451. if (xGame.common.gameMode == GameMode.classic) {
  9452. switch (this.curFoul) {
  9453. case FoulType.timeOut:
  9454. case FoulType.rootHole:
  9455. this.selfTurn = !this.selfTurn;
  9456. this.peoplePlay(5, 6, true);
  9457. break;
  9458. case FoulType.notTouch:
  9459. this.selfTurn = !this.selfTurn;
  9460. this.peoplePlay(7, 7);
  9461. break;
  9462. case FoulType.wrongHole:
  9463. this.selfTurn = !this.selfTurn;
  9464. this.peoplePlay(11, 11);
  9465. break;
  9466. default:
  9467. if (this.inHoleBalls.length > 0) {
  9468. this.peoplePlay(0, 0, false, false);
  9469. }
  9470. else {
  9471. this.selfTurn = !this.selfTurn;
  9472. this.peoplePlay(7, 7);
  9473. }
  9474. break;
  9475. }
  9476. }
  9477. else if (xGame.common.gameMode == GameMode.bigMove) {
  9478. if (this.curFoul == FoulType.timeOut) {
  9479. this.selfTurn = !this.selfTurn;
  9480. this.peoplePlay(14, 15);
  9481. this.placeRootBall();
  9482. }
  9483. else {
  9484. this.selfTurn = !this.selfTurn;
  9485. if (this.curFoul == FoulType.rootHole) {
  9486. this.peoplePlay(12, 13);
  9487. this.placeRootBall();
  9488. }
  9489. else {
  9490. this.peoplePlay(0, 0, false, false);
  9491. }
  9492. }
  9493. }
  9494. else if (xGame.common.gameMode == GameMode.placeBall) {
  9495. this.finishOneShoot = true;
  9496. }
  9497. this.gameResult();
  9498. }
  9499. gameResult() {
  9500. this.firstColliObj = null;
  9501. this.inHoleBalls = [];
  9502. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9503. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9504. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9505. if (xGame.common.uiRodMethod)
  9506. xGame.common.uiRodMethod.resetRod();
  9507. xGame.common.d2World.rootBall.showSelf();
  9508. this.clearIceSkill();
  9509. if (this.selfTurn) {
  9510. PlatMgr.gameInsert();
  9511. }
  9512. xGame.common.d3World.knifeRoot.destroyChildren();
  9513. if (this.selfTurn) {
  9514. xGame.common.gameUI.showHelpLineGuide();
  9515. xGame.common.gameUI.setTurnAlpha(true);
  9516. }
  9517. else {
  9518. xGame.common.gameUI.setTurnAlpha(false);
  9519. }
  9520. }
  9521. getScore(type) {
  9522. let selfAdd = 0;
  9523. let aiAdd = 0;
  9524. if (type == FoulType.timeOut) {
  9525. if (this.selfTurn)
  9526. aiAdd += 3;
  9527. else
  9528. selfAdd += 3;
  9529. }
  9530. else {
  9531. if (this.inHoleBalls.length > 0) {
  9532. if (this.selfTurn) {
  9533. if (type == FoulType.rootHole) {
  9534. aiAdd += 3;
  9535. if (this.inHoleBalls.length - 1 > 0) {
  9536. selfAdd += this.inHoleBalls.length - 1;
  9537. }
  9538. }
  9539. else {
  9540. selfAdd += this.inHoleBalls.length;
  9541. }
  9542. }
  9543. else {
  9544. if (type == FoulType.rootHole) {
  9545. selfAdd += 3;
  9546. if (this.inHoleBalls.length - 1 > 0) {
  9547. aiAdd += this.inHoleBalls.length - 1;
  9548. }
  9549. }
  9550. else {
  9551. aiAdd += this.inHoleBalls.length;
  9552. }
  9553. }
  9554. }
  9555. }
  9556. return [selfAdd, aiAdd];
  9557. }
  9558. judgeScoreEnd(selfAdd, aiAdd) {
  9559. this.selfScore += selfAdd;
  9560. this.aiScore += aiAdd;
  9561. this.updateAIScore();
  9562. this.updateSelfScore();
  9563. if (this.selfScore >= this.targertScore) {
  9564. this.success = true;
  9565. return true;
  9566. }
  9567. if (this.aiScore >= this.targertScore) {
  9568. this.success = false;
  9569. return true;
  9570. }
  9571. let ballArr = xGame.common.d2World.ballArr;
  9572. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9573. if (this.selfScore > this.aiScore) {
  9574. this.success = true;
  9575. return true;
  9576. }
  9577. else if (this.selfScore < this.aiScore) {
  9578. this.success = false;
  9579. return true;
  9580. }
  9581. else {
  9582. if (this.selfTurn) {
  9583. this.success = false;
  9584. }
  9585. else {
  9586. this.success = true;
  9587. }
  9588. return true;
  9589. }
  9590. }
  9591. }
  9592. clearIceSkill() {
  9593. let arr = xGame.common.d2World.ballArr;
  9594. let temp;
  9595. if (this.selfTurn) {
  9596. if (this.selfCurSkill == SkillType.ice) {
  9597. for (let index = 0; index < arr.length; index++) {
  9598. temp = arr[index];
  9599. if (temp.ballFunc == "ice") {
  9600. temp.setBallFunc("normal", "self");
  9601. }
  9602. }
  9603. }
  9604. }
  9605. else {
  9606. if (this.aiCurSkill == SkillType.ice) {
  9607. for (let index = 0; index < arr.length; index++) {
  9608. temp = arr[index];
  9609. if (temp.ballFunc == "ice") {
  9610. temp.setBallFunc("normal", "ai");
  9611. }
  9612. }
  9613. }
  9614. }
  9615. }
  9616. judgeNormalSuccess() {
  9617. if (this.selfTurn) {
  9618. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9619. this.success = true;
  9620. return true;
  9621. }
  9622. }
  9623. else {
  9624. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9625. this.success = false;
  9626. return true;
  9627. }
  9628. }
  9629. }
  9630. gameEnd() {
  9631. if (Moyu.isTT) {
  9632. xGame.common.screenImg = getScreenImg();
  9633. }
  9634. console.log("游戏结束", this.success);
  9635. xGame.common.aiPlayer.stopRun();
  9636. if (xGame.common.gameMode == GameMode.placeBall) {
  9637. this.getEndStarNum();
  9638. this.updatePlaceBallState();
  9639. }
  9640. this.isEnter = false;
  9641. Moyu.recordEnd(this, () => {
  9642. if (this.isEnter)
  9643. return;
  9644. this.isEnter = true;
  9645. console.log("进入录结束回调");
  9646. this.enterNext();
  9647. });
  9648. Laya.timer.once(1000, this, () => {
  9649. if (this.isEnter)
  9650. return;
  9651. this.isEnter = true;
  9652. this.enterNext();
  9653. });
  9654. xGame.common.longHelpLine = false;
  9655. }
  9656. enterNext() {
  9657. Laya.timer.clearAll(this);
  9658. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9659. xGame.uiMgr.Show(UIVideoShare, this.success);
  9660. }
  9661. else {
  9662. xGame.uiMgr.Show(UIGameEnd, this.success);
  9663. }
  9664. }
  9665. aiLeave() {
  9666. let ui = xGame.common.gameUI.ui;
  9667. ui.topNode.aiNameTxt.text = "offline";
  9668. }
  9669. aiGameEnd(suc) {
  9670. this.success = suc;
  9671. xGame.common.aiPlayer.stopRun();
  9672. if (this.success) {
  9673. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9674. Laya.timer.once(1000, this, () => {
  9675. this.clearTime();
  9676. this.gameEnd();
  9677. });
  9678. }
  9679. }
  9680. openTimer() {
  9681. let src = xGame.common.gameUI;
  9682. if (this.selfTurn) {
  9683. src.ui.topNode.selfProgress.visible = true;
  9684. src.ui.topNode.aiProgress.visible = false;
  9685. this.curTimer = src.ui.topNode.selfProgress;
  9686. }
  9687. else {
  9688. src.ui.topNode.selfProgress.visible = false;
  9689. src.ui.topNode.aiProgress.visible = true;
  9690. this.curTimer = src.ui.topNode.aiProgress;
  9691. }
  9692. this.accTime = 0;
  9693. Laya.timer.clearAll(this);
  9694. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9695. this.curTimer.value = 100;
  9696. }
  9697. updateTime(dt) {
  9698. if (this.gamePause)
  9699. return;
  9700. this.accTime += dt;
  9701. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9702. if (this.accTime >= this.setTime) {
  9703. this.clearTime();
  9704. console.log("时钟进入了gameRun");
  9705. this.gameRun(FoulType.timeOut);
  9706. }
  9707. }
  9708. clearTime() {
  9709. let src = xGame.common.gameUI;
  9710. src.ui.topNode.selfProgress.visible = false;
  9711. src.ui.topNode.aiProgress.visible = false;
  9712. Laya.timer.clearAll(this);
  9713. }
  9714. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9715. let ui = xGame.common.gameUI.ui;
  9716. let selfMsg, aiMsg;
  9717. if (sayWords) {
  9718. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9719. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9720. if (Foul) {
  9721. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9722. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9723. this.placeRootBall();
  9724. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9725. if (this.curFoul == FoulType.rootHole) {
  9726. if (!DataMgr.getRootBallFoul()) {
  9727. DataMgr.setRootBallFoul();
  9728. aiMsg = "";
  9729. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9730. let woman = "Boss, pay attention next time~";
  9731. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9732. }
  9733. }
  9734. else if (this.curFoul == FoulType.timeOut) {
  9735. if (!DataMgr.getTimeoutFoul()) {
  9736. DataMgr.setTimeoutFoul();
  9737. aiMsg = "";
  9738. let tips = "Game timeout, 3 fouls, this game failed.";
  9739. let woman = "Boss, pay attention to the timeline~";
  9740. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9741. }
  9742. }
  9743. }
  9744. }
  9745. }
  9746. if (this.selfTurn) {
  9747. if (sayWords) {
  9748. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9749. ui.selfTurn.visible = true;
  9750. ui.aiTurn.visible = false;
  9751. ui.selfTurn.t0.play();
  9752. Moyu.vibration();
  9753. });
  9754. }
  9755. }
  9756. else {
  9757. let aiNum = xGame.tools.random(1, 11);
  9758. let challengeNum = DataMgr.getChallengeTimes();
  9759. let delay = false;
  9760. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9761. aiNum = 9;
  9762. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9763. aiNum = 3;
  9764. if (challengeNum == 3) {
  9765. if (!this.showLongView) {
  9766. this.showLongView = true;
  9767. delay = true;
  9768. }
  9769. }
  9770. }
  9771. }
  9772. if (delay) {
  9773. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9774. if (success) {
  9775. xGame.common.longHelpLine = true;
  9776. xGame.common.d2World.getHelpLine();
  9777. }
  9778. else {
  9779. aiNum = 10;
  9780. }
  9781. xGame.common.aiPlayer.setAiLevel(aiNum);
  9782. if (sayWords) {
  9783. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9784. xGame.common.aiPlayer.runAI();
  9785. ui.selfTurn.visible = false;
  9786. ui.aiTurn.visible = true;
  9787. ui.aiTurn.t0.play();
  9788. });
  9789. }
  9790. else {
  9791. xGame.common.aiPlayer.runAI();
  9792. }
  9793. this.openTimer();
  9794. this.finishOneShoot = true;
  9795. if (this.selfTurn) {
  9796. ui.topNode.selfKuang.visible = true;
  9797. ui.topNode.aiKuang.visible = false;
  9798. ui.topNode.selfTips.visible = true;
  9799. ui.topNode.aiTips.visible = false;
  9800. }
  9801. else {
  9802. ui.topNode.selfKuang.visible = false;
  9803. ui.topNode.aiKuang.visible = true;
  9804. ui.topNode.selfTips.visible = false;
  9805. ui.topNode.aiTips.visible = true;
  9806. }
  9807. });
  9808. return;
  9809. }
  9810. if (xGame.common.gameMode == GameMode.classic) {
  9811. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9812. if (cfg) {
  9813. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9814. aiNum = aiLevel;
  9815. }
  9816. }
  9817. xGame.common.aiPlayer.setAiLevel(aiNum);
  9818. if (sayWords) {
  9819. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9820. xGame.common.aiPlayer.runAI();
  9821. ui.selfTurn.visible = false;
  9822. ui.aiTurn.visible = true;
  9823. ui.aiTurn.t0.play();
  9824. });
  9825. }
  9826. else {
  9827. xGame.common.aiPlayer.runAI();
  9828. }
  9829. }
  9830. this.openTimer();
  9831. this.finishOneShoot = true;
  9832. if (this.selfTurn) {
  9833. ui.topNode.selfKuang.visible = true;
  9834. ui.topNode.aiKuang.visible = false;
  9835. ui.topNode.selfTips.visible = true;
  9836. ui.topNode.aiTips.visible = false;
  9837. }
  9838. else {
  9839. ui.topNode.selfKuang.visible = false;
  9840. ui.topNode.aiKuang.visible = true;
  9841. ui.topNode.selfTips.visible = false;
  9842. ui.topNode.aiTips.visible = true;
  9843. }
  9844. }
  9845. placeRootBall() {
  9846. let rootBall = xGame.common.d2World.rootBall;
  9847. if (!rootBall)
  9848. return;
  9849. rootBall.gameObj.x = this.lastRootBallPos.x;
  9850. rootBall.gameObj.y = this.lastRootBallPos.y;
  9851. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9852. let moveNode = xGame.common.gameUI.ui.moveNode;
  9853. moveNode.visible = true;
  9854. moveNode.x = this.lastRootBallPos.x;
  9855. moveNode.y = this.lastRootBallPos.y;
  9856. if (!this.selfTurn) {
  9857. xGame.common.aiPlayer.resetRoot();
  9858. }
  9859. }
  9860. }
  9861. class ui_guanyuAni extends fgui.GComponent {
  9862. static createInstance() {
  9863. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9864. }
  9865. onConstruct() {
  9866. this.n0 = (this.getChild("n0"));
  9867. }
  9868. }
  9869. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9870. class UIFireworks extends UIBase {
  9871. constructor() {
  9872. super();
  9873. }
  9874. onConstructor() {
  9875. this.isEject = false;
  9876. }
  9877. show(callback) {
  9878. super.show();
  9879. }
  9880. }
  9881. UIFireworks.uiName = "UIFireworks";
  9882. class ui_UIGuanYu extends fgui.GComponent {
  9883. static createInstance() {
  9884. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9885. }
  9886. onConstruct() {
  9887. this.n2 = (this.getChild("n2"));
  9888. this.n1 = (this.getChild("n1"));
  9889. this.n3 = (this.getChild("n3"));
  9890. this.n4 = (this.getChild("n4"));
  9891. this.n5 = (this.getChild("n5"));
  9892. this.n6 = (this.getChild("n6"));
  9893. this.n8 = (this.getChild("n8"));
  9894. this.n7 = (this.getChild("n7"));
  9895. this.t0 = this.getTransition("t0");
  9896. }
  9897. }
  9898. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9899. class UIGuanYu extends UIBase {
  9900. constructor() {
  9901. super();
  9902. }
  9903. onConstructor() {
  9904. this.ui = ui_UIGuanYu.createInstance();
  9905. this.contentPane = this.ui;
  9906. this.isEject = false;
  9907. }
  9908. show(callback) {
  9909. super.show();
  9910. this.ui.t0.play(Laya.Handler.create(this, () => {
  9911. callback && callback();
  9912. this.hide();
  9913. }));
  9914. }
  9915. }
  9916. UIGuanYu.uiName = "UIGuanYu";
  9917. class SkillMgr {
  9918. constructor() {
  9919. this.leveNum = 0;
  9920. this.extraScore = 0;
  9921. this.selfTurn = false;
  9922. this.playedLastSkill = false;
  9923. this.tweenArr = [];
  9924. this._finishNum = 0;
  9925. this._curFinish = 0;
  9926. this._rootX = 0;
  9927. this._rootY = 0;
  9928. this.knifeTimes = 0;
  9929. this.knifeV2 = new Laya.Vector2();
  9930. this.knifeV3 = new Laya.Vector3();
  9931. this.rtStarX = 0;
  9932. this.rtStarY = 0;
  9933. this.addBigSkillSpine();
  9934. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9935. }
  9936. addBigSkillSpine() {
  9937. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9938. console.log("extra2 success");
  9939. });
  9940. }
  9941. runBigSkill(callback) {
  9942. this.tweenArr = [];
  9943. this.callback = callback;
  9944. this.judgeSkill();
  9945. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9946. let guide = DataMgr.getSkillGuide();
  9947. if (!xGame.common.gameMgr.selfTurn) {
  9948. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9949. }
  9950. else {
  9951. if (xGame.common.temSelfLevel != 0) {
  9952. this.leveNum = xGame.common.temSelfLevel;
  9953. }
  9954. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9955. this.leveNum += 5;
  9956. }
  9957. }
  9958. if (guide == 0) {
  9959. DataMgr.setSkillGuide(1);
  9960. if (DataMgr.getNewUser()) {
  9961. Moyu.sendDataEvent("gameFirstPlay");
  9962. DataMgr.setNewUser();
  9963. }
  9964. }
  9965. this.playSpineAni(() => {
  9966. switch (this.curSkill) {
  9967. case SkillType.highSpace:
  9968. this.runHighSpace();
  9969. break;
  9970. case SkillType.breakArmy:
  9971. this.runBreakArmy();
  9972. break;
  9973. case SkillType.ice:
  9974. this.runIce();
  9975. break;
  9976. case SkillType.fireworks:
  9977. this.runFireworks();
  9978. break;
  9979. case SkillType.GuanYu:
  9980. this.runGuanYu();
  9981. break;
  9982. default:
  9983. break;
  9984. }
  9985. });
  9986. }
  9987. judgeSkill() {
  9988. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9989. let gameMgr = xGame.common.gameMgr;
  9990. let type;
  9991. for (let index = 0; index < typeArr.length; index++) {
  9992. type = typeArr[index];
  9993. if (gameMgr.selfTurn) {
  9994. if (gameMgr.selfCurSkill == type) {
  9995. this.selfTurn = true;
  9996. this.curSkill = type;
  9997. return;
  9998. }
  9999. }
  10000. else {
  10001. if (gameMgr.aiCurSkill == type) {
  10002. this.selfTurn = false;
  10003. this.curSkill = type;
  10004. return;
  10005. }
  10006. }
  10007. }
  10008. }
  10009. playSpineAni(callback) {
  10010. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10011. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10012. parent.destroyChildren();
  10013. let aniIndex = 0;
  10014. let skillSpine;
  10015. switch (this.curSkill) {
  10016. case SkillType.highSpace:
  10017. aniIndex = 1;
  10018. xGame.soundMgr.playSound("skill01");
  10019. skillSpine = this.skillSpine2;
  10020. data.scaleX = 0.5;
  10021. data.scaleY = 0.5;
  10022. skillSpine.play(data, 1, false, parent, () => {
  10023. callback && callback();
  10024. });
  10025. break;
  10026. case SkillType.breakArmy:
  10027. aniIndex = 2;
  10028. xGame.soundMgr.playSound("skill02");
  10029. skillSpine = this.skillSpine2;
  10030. data.scaleX = 0.5;
  10031. data.scaleY = 0.5;
  10032. skillSpine.play(data, 2, false, parent, () => {
  10033. callback && callback();
  10034. });
  10035. break;
  10036. case SkillType.ice:
  10037. aniIndex = 0;
  10038. xGame.soundMgr.playSound("skill03");
  10039. skillSpine = this.skillSpine2;
  10040. data.scaleX = 0.5;
  10041. data.scaleY = 0.5;
  10042. skillSpine.play(data, 0, false, parent, () => {
  10043. callback && callback();
  10044. });
  10045. break;
  10046. case SkillType.fireworks:
  10047. xGame.soundMgr.playSound("skill_04_01");
  10048. xGame.soundMgr.playSound("skill04");
  10049. xGame.uiMgr.Show(UIFireworks, callback);
  10050. break;
  10051. case SkillType.GuanYu:
  10052. xGame.soundMgr.playSound("skill05_1");
  10053. xGame.soundMgr.playSound("skill05");
  10054. xGame.uiMgr.Show(UIGuanYu, callback);
  10055. break;
  10056. default:
  10057. break;
  10058. }
  10059. }
  10060. getAllBallArr() {
  10061. let arr = xGame.common.d2World.ballArr;
  10062. let outArr = [];
  10063. for (let index = 0; index < arr.length; index++) {
  10064. if (arr[index] instanceof D2RootBallSrc)
  10065. continue;
  10066. if (arr[index].ballFunc == "ice")
  10067. continue;
  10068. if (arr[index].destroyed)
  10069. continue;
  10070. outArr.push(arr[index]);
  10071. }
  10072. return outArr;
  10073. }
  10074. getOneArr(deletObj) {
  10075. let allArr = this.getAllBallArr();
  10076. let temp;
  10077. for (let index = 0; index < allArr.length; index++) {
  10078. temp = allArr[index];
  10079. if (temp.id == deletObj.id) {
  10080. allArr.splice(index, 1);
  10081. break;
  10082. }
  10083. }
  10084. return allArr;
  10085. }
  10086. getNearBallBag(ball) {
  10087. let ui = xGame.common.gameUI.ui;
  10088. let circleArr = [];
  10089. for (let index = 1; index <= 6; index++) {
  10090. circleArr.push(ui.border["circle" + index]);
  10091. }
  10092. let outIndex = 0;
  10093. let temp;
  10094. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10095. ;
  10096. let dis = 0;
  10097. for (let index = 1; index < circleArr.length; index++) {
  10098. temp = circleArr[index];
  10099. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10100. if (dis < min) {
  10101. min = dis;
  10102. outIndex = index;
  10103. }
  10104. }
  10105. return [circleArr[outIndex], outIndex];
  10106. }
  10107. ballFlyToBag(ballArr, time = 300) {
  10108. let temp;
  10109. let hole;
  10110. this._finishNum = ballArr.length;
  10111. this._curFinish = 0;
  10112. let holeObj = {};
  10113. let holeCfg = {
  10114. "1": 0,
  10115. "2": 0,
  10116. "3": 0,
  10117. "4": 0,
  10118. "5": 0,
  10119. "6": 0
  10120. };
  10121. for (let index = 0; index < ballArr.length; index++) {
  10122. temp = ballArr[index];
  10123. temp.outColli.isSensor = true;
  10124. temp.innerColli.isSensor = true;
  10125. temp.isRunSkillAni = true;
  10126. let holeArr = this.getNearBallBag(temp);
  10127. hole = holeArr[0];
  10128. holeObj[index] = holeArr[1];
  10129. temp.d3BallSrc.scaleXYZ = 0.5;
  10130. this.tweenArr.push(temp.d3BallSrc, temp);
  10131. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10132. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10133. }));
  10134. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10135. let mIndex = holeObj[this._curFinish];
  10136. let isDone = holeCfg[mIndex];
  10137. if (isDone) {
  10138. ballArr[this._curFinish].checkWrongBall(false);
  10139. }
  10140. else {
  10141. holeCfg[mIndex] = 1;
  10142. ballArr[this._curFinish].checkWrongBall();
  10143. }
  10144. this._curFinish++;
  10145. if (this._curFinish >= this._finishNum) {
  10146. if (this.curSkill == SkillType.highSpace) {
  10147. }
  10148. else if (this.curSkill == SkillType.breakArmy) {
  10149. let rootBall = xGame.common.d2World.rootBall;
  10150. rootBall.gameObj.x = this._rootX;
  10151. rootBall.gameObj.y = this._rootY;
  10152. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10153. xGame.common.d2World.d2Gan.ui.visible = true;
  10154. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10155. xGame.common.d2World.getHelpLine();
  10156. this.callback && this.callback(this.extraScore);
  10157. }
  10158. }
  10159. }));
  10160. }
  10161. }
  10162. runHighSpace() {
  10163. let rootBall = xGame.common.d2World.rootBall;
  10164. rootBall.showSelf();
  10165. let d3Src = rootBall.d3BallSrc;
  10166. let allArr = this.getAllBallArr();
  10167. if (allArr.length <= 0) {
  10168. this.callback && this.callback(0);
  10169. return;
  10170. }
  10171. let selectBall = xGame.common.d2World.targetBall;
  10172. let wrong = selectBall && selectBall.destroyed;
  10173. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10174. selectBall = xGame.common.getRandArrEle(allArr);
  10175. }
  10176. let targetD3Src = selectBall.d3BallSrc;
  10177. xGame.common.d2World.d2Gan.ui.visible = false;
  10178. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10179. d3Src.scaleXYZ = 0.5;
  10180. this.tweenArr.push(d3Src);
  10181. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10182. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10183. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10184. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10185. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10186. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10187. let outArr = [selectBall];
  10188. let other = this.leveNum - 1;
  10189. if (other > 0) {
  10190. let nearArr = this.getOneArr(selectBall);
  10191. if (nearArr.length > 0) {
  10192. xGame.common.botherArr(nearArr);
  10193. if (other >= nearArr.length)
  10194. other = nearArr.length;
  10195. for (let index = 0; index < other; index++) {
  10196. outArr.push(nearArr[index]);
  10197. }
  10198. }
  10199. }
  10200. xGame.common.extraMoveNum = other + 1;
  10201. this.extraScore = other + 1;
  10202. this._rootX = selectBall.gameObj.x;
  10203. this._rootY = selectBall.gameObj.y;
  10204. rootBall.gameObj.x = this._rootX;
  10205. rootBall.gameObj.y = this._rootY;
  10206. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10207. Laya.Tween.clearAll(d3Src);
  10208. this.addRandomForce(outArr);
  10209. }));
  10210. }));
  10211. }
  10212. addRandomForce(outArr) {
  10213. if (outArr.length > 0) {
  10214. xGame.common.d2World.openCheckStill = true;
  10215. this.playedLastSkill = true;
  10216. }
  10217. let temp;
  10218. for (let index = 0; index < outArr.length; index++) {
  10219. let angle = xGame.common.randomNum(0, 360);
  10220. let linearPercent = xGame.common.randomNum(65, 100);
  10221. temp = outArr[index];
  10222. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10223. }
  10224. }
  10225. setLinearSpeed(angle, rigy, linearPercent) {
  10226. let sin = Math.sin(angle * Math.PI / 180);
  10227. let cos = Math.cos(angle * Math.PI / 180);
  10228. let maxSpeed = 4;
  10229. let speed = new Laya.Vector2();
  10230. speed.x = maxSpeed * linearPercent * sin;
  10231. speed.y = -maxSpeed * linearPercent * cos;
  10232. rigy.applyLinearImpulseToCenter(speed);
  10233. }
  10234. runBreakArmy() {
  10235. xGame.common.d2World.d2Gan.ui.visible = false;
  10236. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10237. let gameUI = xGame.common.gameUI.ui;
  10238. gameUI.skillRod.visible = true;
  10239. gameUI.skillRod.rotation = 110;
  10240. let outArr = this.getAllBallArr();
  10241. if (outArr.length <= 0) {
  10242. gameUI.skillRod.visible = false;
  10243. this.callback && this.callback(0);
  10244. return;
  10245. }
  10246. xGame.common.botherArr(outArr);
  10247. if (this.leveNum >= outArr.length)
  10248. this.leveNum = outArr.length;
  10249. let deleteNum = outArr.length - this.leveNum;
  10250. outArr.splice(0, deleteNum);
  10251. this.extraScore = this.leveNum;
  10252. let potX = gameUI.skillRod.x;
  10253. let potY = gameUI.skillRod.y;
  10254. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10255. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10256. let disArr = [];
  10257. for (let index = 0; index < outArr.length; index++) {
  10258. let obj = outArr[index];
  10259. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10260. dis = Math.pow(dis, 0.5);
  10261. disArr.push(dis);
  10262. }
  10263. this.tweenArr.push(gameUI.skillRod);
  10264. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10265. })).update = Laya.Handler.create(this, (e, t, c) => {
  10266. let angle = gameUI.skillRod.rotation;
  10267. let xx;
  10268. let yy;
  10269. let temp;
  10270. for (let index = 0; index < outArr.length; index++) {
  10271. temp = outArr[index];
  10272. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10273. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10274. yy -= 20;
  10275. temp.gameObj.x = xx;
  10276. temp.gameObj.y = yy;
  10277. temp.d3BallSrc.setTransPos(xx, yy);
  10278. }
  10279. if (angle <= 60) {
  10280. Laya.Tween.clearAll(gameUI.skillRod);
  10281. this.ballFlyToBag(outArr, 150);
  10282. gameUI.skillRod.visible = false;
  10283. }
  10284. }, null, false);
  10285. }
  10286. runIce() {
  10287. let ballArr = xGame.common.d2World.ballArr;
  10288. this.leveNum *= 2;
  10289. if (this.leveNum >= ballArr.length - 1)
  10290. this.leveNum = ballArr.length - 1;
  10291. let tempArr = [];
  10292. let outArr = [];
  10293. for (let index = 0; index < ballArr.length; index++) {
  10294. if (ballArr[index] instanceof D2RootBallSrc)
  10295. continue;
  10296. tempArr.push(ballArr[index]);
  10297. }
  10298. if (tempArr.length <= 0) {
  10299. this.callback && this.callback(0);
  10300. return;
  10301. }
  10302. xGame.common.botherArr(tempArr);
  10303. for (let index = 0; index < this.leveNum; index++) {
  10304. outArr.push(tempArr[index]);
  10305. }
  10306. this.extraScore = this.leveNum;
  10307. let temp;
  10308. for (let index = 0; index < outArr.length; index++) {
  10309. temp = outArr[index];
  10310. temp.d3BallSrc.playIceEft();
  10311. }
  10312. Laya.timer.once(2000, this, () => {
  10313. for (let index = 0; index < outArr.length; index++) {
  10314. temp = outArr[index];
  10315. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10316. temp.setBallFunc("ice", str);
  10317. }
  10318. this.callback && this.callback(0);
  10319. });
  10320. }
  10321. runFireworks() {
  10322. let allArr = this.getAllBallArr();
  10323. if (allArr.length <= 0) {
  10324. this.callback && this.callback(0);
  10325. return;
  10326. }
  10327. xGame.common.d2World.d2Gan.ui.visible = false;
  10328. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10329. let outArr = [];
  10330. let other = this.leveNum;
  10331. if (other > 0) {
  10332. if (allArr.length > 0) {
  10333. xGame.common.botherArr(allArr);
  10334. if (other >= allArr.length)
  10335. other = allArr.length;
  10336. for (let index = 0; index < other; index++) {
  10337. outArr.push(allArr[index]);
  10338. }
  10339. }
  10340. }
  10341. xGame.common.extraMoveNum = other;
  10342. this.extraScore = other;
  10343. this.addRandmomFireworks(outArr);
  10344. }
  10345. addRandmomFireworks(outArr) {
  10346. Laya.timer.once(1100, this, () => {
  10347. if (outArr.length > 0) {
  10348. xGame.common.d2World.openCheckStill = true;
  10349. this.playedLastSkill = true;
  10350. }
  10351. });
  10352. xGame.soundMgr.playSound("skill_04_02");
  10353. let temp;
  10354. let delay = -200;
  10355. for (let index = 0; index < outArr.length; index++) {
  10356. temp = outArr[index];
  10357. delay += 200;
  10358. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10359. let angle = xGame.common.randomNum(0, 360);
  10360. angle = this.getFireworksAngle(obj);
  10361. let linearPercent = xGame.common.randomNum(45, 80);
  10362. if (!obj.destroyed)
  10363. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10364. });
  10365. }
  10366. }
  10367. getFireworksAngle(obj) {
  10368. let rootBall = xGame.common.d2World.rootBall;
  10369. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10370. }
  10371. resetGame() {
  10372. Laya.timer.clearAll(this);
  10373. if (this.tweenArr) {
  10374. for (let index = 0; index < this.tweenArr.length; index++) {
  10375. Laya.Tween.clearAll(this.tweenArr[index]);
  10376. }
  10377. }
  10378. this.tweenArr = null;
  10379. }
  10380. runGuanYu() {
  10381. xGame.common.d2World.d2Gan.ui.visible = false;
  10382. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10383. let rootBall = xGame.common.d2World.rootBall;
  10384. if (rootBall.isInHole) {
  10385. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10386. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10387. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10388. rootBall.showSelf();
  10389. }
  10390. this.rtStarX = rootBall.gameObj.x;
  10391. this.rtStarY = rootBall.gameObj.y;
  10392. this.knifeTimes = 0;
  10393. this.playedLastSkill = true;
  10394. rootBall.forceRun = true;
  10395. rootBall.rigy.type = "static";
  10396. xGame.common.d2World.openCheckStill = true;
  10397. this.guanyuRandomKnife();
  10398. }
  10399. guanyuRandomKnife() {
  10400. let rootBall = xGame.common.d2World.rootBall;
  10401. let dir = this.getRandDir();
  10402. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10403. console.log("当前angle", angle);
  10404. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10405. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10406. let dis = 324;
  10407. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10408. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10409. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10410. this.rtStarX = rootBall.gameObj.x;
  10411. this.rtStarY = rootBall.gameObj.y;
  10412. this.knifeTimes++;
  10413. let skillLevel;
  10414. if (xGame.common.gameMgr.selfTurn) {
  10415. skillLevel = DataMgr.getBigSkillByIndex(4);
  10416. }
  10417. else {
  10418. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10419. }
  10420. if (!skillLevel)
  10421. skillLevel = 1;
  10422. skillLevel += 2;
  10423. if (this.knifeTimes < skillLevel) {
  10424. Laya.timer.once(400, this, () => {
  10425. this.guanyuRandomKnife();
  10426. });
  10427. }
  10428. else {
  10429. rootBall.forceRun = false;
  10430. rootBall.rigy.type = "dynamic";
  10431. xGame.common.extraMoveNum = skillLevel;
  10432. }
  10433. }));
  10434. }
  10435. getRandDir() {
  10436. let rootBall = xGame.common.d2World.rootBall;
  10437. let allBall = this.getAllBallArr();
  10438. let target = xGame.common.getRandArrEle(allBall);
  10439. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10440. return this.knifeV2;
  10441. }
  10442. cloneKnife(x, y, rotation) {
  10443. let parent = xGame.common.d3World.knifeRoot;
  10444. let prefab = xGame.common.d3World.knife;
  10445. let clone = prefab.clone();
  10446. parent.addChild(clone);
  10447. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10448. clone.transform.localPositionX = this.knifeV3.x;
  10449. clone.transform.localPositionY = 0;
  10450. clone.transform.localPositionZ = this.knifeV3.z;
  10451. clone.transform.localRotationEulerX = 0;
  10452. clone.transform.localRotationEulerY = rotation;
  10453. clone.transform.localRotationEulerZ = 0;
  10454. clone.active = true;
  10455. return clone;
  10456. }
  10457. cloneGuanYuEft(x, y, angle) {
  10458. return;
  10459. let parent = xGame.common.gameUI.ui.guanyuNode;
  10460. let eft = new ui_guanyuAni();
  10461. eft.parent = parent;
  10462. eft.x = x;
  10463. eft.y = y;
  10464. eft.rotation = angle;
  10465. }
  10466. }
  10467. class ui_UIWordsList extends fgui.GComponent {
  10468. static createInstance() {
  10469. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10470. }
  10471. onConstruct() {
  10472. this.c1 = this.getController("c1");
  10473. this.n74 = (this.getChild("n74"));
  10474. this.clickNode = (this.getChild("clickNode"));
  10475. this.myNode = (this.getChild("myNode"));
  10476. this.n68 = (this.getChild("n68"));
  10477. this.n66 = (this.getChild("n66"));
  10478. this.n55 = (this.getChild("n55"));
  10479. this.wordsBtn = (this.getChild("wordsBtn"));
  10480. this.emotionBtn = (this.getChild("emotionBtn"));
  10481. this.mybggg = (this.getChild("mybggg"));
  10482. this.wordsList = (this.getChild("wordsList"));
  10483. this.emotionList = (this.getChild("emotionList"));
  10484. this.myRoot = (this.getChild("myRoot"));
  10485. }
  10486. }
  10487. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10488. class EmotionDisplay {
  10489. constructor(index, ui) {
  10490. this.ui = ui;
  10491. this.index = index;
  10492. this.ui.onClick(this, this.clickSelf);
  10493. this.updateSelf();
  10494. }
  10495. updateSelf() {
  10496. let data = cfgTable.emotionData[this.index + 1];
  10497. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10498. }
  10499. clickSelf() {
  10500. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10501. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10502. xGame.common.talkMgr.closeTalkView();
  10503. }
  10504. }
  10505. class WordsDisplay {
  10506. constructor(index, ui) {
  10507. this.ui = ui;
  10508. this.index = index;
  10509. this.ui.onClick(this, this.clickSelf);
  10510. this.updateSelf();
  10511. }
  10512. updateSelf() {
  10513. let data = cfgTable.talkwordsData[this.index + 1];
  10514. this.ui.txt.text = data.msg;
  10515. }
  10516. clickSelf() {
  10517. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10518. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10519. xGame.common.talkMgr.closeTalkView();
  10520. }
  10521. }
  10522. class UIWordsList extends UIBase {
  10523. constructor() {
  10524. super();
  10525. }
  10526. onConstructor() {
  10527. this.ui = ui_UIWordsList.createInstance();
  10528. this.contentPane = this.ui;
  10529. this.isEject = false;
  10530. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10531. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10532. this.addUIClick(this.ui.clickNode, this.hide);
  10533. this.initTalkList();
  10534. this.initEmotionList();
  10535. }
  10536. show() {
  10537. super.show();
  10538. }
  10539. initTalkList() {
  10540. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10541. let data = cfgTable.talkwordsData;
  10542. let length = Object.keys(data).length;
  10543. this.ui.wordsList.numItems = length;
  10544. }
  10545. initEmotionList() {
  10546. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10547. let data = cfgTable.emotionData;
  10548. let length = Object.keys(data).length;
  10549. this.ui.emotionList.numItems = length;
  10550. }
  10551. renderTalkItem(index, obj) {
  10552. let temp = new WordsDisplay(index, obj);
  10553. }
  10554. renderEmotionItem(index, obj) {
  10555. let temp = new EmotionDisplay(index, obj);
  10556. }
  10557. openTalkList() {
  10558. this.ui.c1.selectedIndex = 0;
  10559. }
  10560. openEmotionList() {
  10561. this.ui.c1.selectedIndex = 1;
  10562. }
  10563. }
  10564. UIWordsList.uiName = "UIWordsList";
  10565. class TalkMgr {
  10566. constructor() {
  10567. this.aiSpeak = true;
  10568. this.emotionList = [];
  10569. this.talkList = [];
  10570. this.addEvent();
  10571. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10572. this.emotionList = [];
  10573. this.talkList = [];
  10574. for (let k in cfgTable.emotionData) {
  10575. this.emotionList.push(cfgTable.emotionData[k].id);
  10576. }
  10577. for (let k in cfgTable.talkwordsData) {
  10578. this.talkList.push(cfgTable.talkwordsData[k].id);
  10579. }
  10580. }
  10581. addEvent() {
  10582. let ui = xGame.common.gameUI.ui;
  10583. ui.wordsBtn.visible = true;
  10584. ui.wordsBtn.onClick(this, this.openTalkView);
  10585. ui.aiWordsBtn.visible = true;
  10586. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10587. }
  10588. openTalkView() {
  10589. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10590. xGame.uiMgr.Show(UIWordsList);
  10591. }
  10592. closeTalkView() {
  10593. xGame.uiMgr.Hide(UIWordsList);
  10594. }
  10595. clickAIState() {
  10596. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10597. this.aiSpeak = !this.aiSpeak;
  10598. this.changeAIState(this.aiSpeak);
  10599. }
  10600. changeAIState(speak) {
  10601. this.aiSpeak = speak;
  10602. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10603. if (speak) {
  10604. btn.c1.selectedIndex = 0;
  10605. }
  10606. else {
  10607. btn.c1.selectedIndex = 1;
  10608. }
  10609. }
  10610. showSelfTalk(wordsId) {
  10611. let ui = xGame.common.gameUI.ui;
  10612. ui.selfTalk.visible = true;
  10613. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10614. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10615. ui.selfTalk.t0.play();
  10616. }
  10617. showSelfEmotion(emotionId) {
  10618. let ui = xGame.common.gameUI.ui;
  10619. ui.selfTalk.visible = true;
  10620. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10621. this.selfSpine && this.selfSpine.dispose();
  10622. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10623. let spineData = cfgTable.emotionData[emotionId].spine;
  10624. this.selfSpine = new SpineMgr(spineData, () => {
  10625. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10626. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10627. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10628. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10629. });
  10630. ui.selfTalk.t0.play();
  10631. }
  10632. showAITalk(wordsId) {
  10633. if (!this.aiSpeak)
  10634. return;
  10635. if (DataMgr.gameData.gameCount < 2)
  10636. return;
  10637. if (wordsId < 1)
  10638. wordsId = this.getRandTalk();
  10639. let ui = xGame.common.gameUI.ui;
  10640. ui.aiTalk.visible = true;
  10641. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10642. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10643. ui.aiTalk.t0.play();
  10644. }
  10645. getRandTalk() {
  10646. let rand = xGame.tools.random(0, this.talkList.length);
  10647. return this.emotionList[rand];
  10648. }
  10649. getRandEmotion() {
  10650. let rand = xGame.tools.random(0, this.emotionList.length);
  10651. return this.emotionList[rand];
  10652. }
  10653. showAIEmotion(emotionId) {
  10654. if (!this.aiSpeak)
  10655. return;
  10656. if (DataMgr.gameData.gameCount < 2)
  10657. return;
  10658. if (emotionId < 1)
  10659. emotionId = this.getRandEmotion();
  10660. let ui = xGame.common.gameUI.ui;
  10661. ui.aiTalk.visible = true;
  10662. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10663. this.aiSpine && this.aiSpine.dispose();
  10664. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10665. let spineData = cfgTable.emotionData[emotionId].spine;
  10666. this.aiSpine = new SpineMgr(spineData, () => {
  10667. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10668. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10669. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10670. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10671. });
  10672. ui.aiTalk.t0.play();
  10673. }
  10674. resetGame() {
  10675. let ui = xGame.common.gameUI.ui;
  10676. ui.aiTalk.visible = false;
  10677. ui.selfTalk.visible = false;
  10678. this.aiSpine && this.aiSpine.dispose();
  10679. this.selfSpine && this.selfSpine.dispose();
  10680. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10681. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10682. this.closeTalkView();
  10683. }
  10684. }
  10685. class WordsMgr {
  10686. constructor() {
  10687. this.comboTimes = 1;
  10688. this.skillTimes = 0;
  10689. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10690. this.comboSpine = new SpineMgr("yxz_liangan");
  10691. this.skillSpine = new SpineMgr("yiganxqiu");
  10692. this.scoreSpine = new SpineMgr("defen");
  10693. }
  10694. setClassicCombo(isInterrupt) {
  10695. if (isInterrupt) {
  10696. this.comboTimes = 0;
  10697. }
  10698. }
  10699. playClassicWords(type, callback) {
  10700. this.callback = callback;
  10701. let aniIndex = type;
  10702. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10703. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10704. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10705. mySpine.destroy(true);
  10706. this.playClassicTimes();
  10707. });
  10708. }
  10709. playClassicTimes() {
  10710. this.comboTimes++;
  10711. if (this.comboTimes <= 1) {
  10712. this.callback && this.callback();
  10713. }
  10714. else {
  10715. let aniIndex = this.comboTimes - 1;
  10716. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10717. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10718. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10719. mySpine.destroy(true);
  10720. this.callback && this.callback();
  10721. });
  10722. }
  10723. }
  10724. playBigSkillTimes(times, callback) {
  10725. if (times <= 0) {
  10726. callback && callback();
  10727. return;
  10728. }
  10729. this.callback = callback;
  10730. let pre = "sz_0";
  10731. let aniIndex = 0;
  10732. this.getWordsImg(times, pre, () => {
  10733. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10734. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10735. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10736. let r1 = ``;
  10737. let r2 = ``;
  10738. if (times <= 9) {
  10739. r1 = `res/d2Res/${pre}${times}.png`;
  10740. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10741. aniIndex = 0;
  10742. }
  10743. else {
  10744. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10745. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10746. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10747. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10748. aniIndex = 1;
  10749. }
  10750. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10751. mySpine.destroy(true);
  10752. xGame.common.gameMgr.playSkillTips();
  10753. this.playScore(times);
  10754. xGame.common.playRandomMutiBallBigSkillSound();
  10755. }, mySpine);
  10756. });
  10757. }
  10758. playScore(score) {
  10759. let pre = "sz_";
  10760. let aniIndex = 0;
  10761. this.getWordsImg(score, pre, () => {
  10762. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10763. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10764. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10765. let r1 = ``;
  10766. let r2 = ``;
  10767. if (score <= 9) {
  10768. r1 = `res/d2Res/${pre}${score}.png`;
  10769. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10770. aniIndex = 0;
  10771. }
  10772. else {
  10773. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10774. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10775. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10776. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10777. aniIndex = 1;
  10778. }
  10779. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10780. mySpine.destroy(true);
  10781. this.callback && this.callback();
  10782. }, mySpine);
  10783. });
  10784. }
  10785. getWordsImg(number, pre = "", callback) {
  10786. let arr = [];
  10787. if (number <= 9) {
  10788. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10789. }
  10790. else {
  10791. 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 });
  10792. }
  10793. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10794. callback && callback();
  10795. }));
  10796. }
  10797. }
  10798. class ui_UIRodMethod extends fgui.GComponent {
  10799. static createInstance() {
  10800. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10801. }
  10802. onConstruct() {
  10803. this.n24 = (this.getChild("n24"));
  10804. this.white = (this.getChild("white"));
  10805. this.dot = (this.getChild("dot"));
  10806. this.sureBtn = (this.getChild("sureBtn"));
  10807. this.n20 = (this.getChild("n20"));
  10808. this.n21 = (this.getChild("n21"));
  10809. this.n22 = (this.getChild("n22"));
  10810. this.n23 = (this.getChild("n23"));
  10811. this.n5 = (this.getChild("n5"));
  10812. this.n14 = (this.getChild("n14"));
  10813. this.t0 = this.getTransition("t0");
  10814. }
  10815. }
  10816. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10817. class UIRodMethod extends UIBase {
  10818. constructor() {
  10819. super();
  10820. this.isPressd = false;
  10821. }
  10822. onConstructor() {
  10823. this.ui = ui_UIRodMethod.createInstance();
  10824. this.contentPane = this.ui;
  10825. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10826. this.moveDir = new Laya.Vector2();
  10827. this.moveDest = new Laya.Vector2();
  10828. this.centerPos = new Laya.Vector2();
  10829. xGame.common.uiRodMethod = this;
  10830. }
  10831. show() {
  10832. super.show();
  10833. xGame.common.gameMgr.gamePause = true;
  10834. this.openPressDotEvent();
  10835. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10836. this.centerPos.x = this.ui.white.x;
  10837. this.centerPos.y = this.ui.white.y;
  10838. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10839. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10840. this.setDot();
  10841. }
  10842. setDot() {
  10843. this.ui.dot.x = this.moveDest.x;
  10844. this.ui.dot.y = this.moveDest.y;
  10845. }
  10846. closeSelf() {
  10847. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10848. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10849. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10850. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10851. xGame.common.gameMgr.gamePause = false;
  10852. this.hide();
  10853. }
  10854. openPressDotEvent() {
  10855. this.closePressDotEvent();
  10856. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10857. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10858. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10859. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10860. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10861. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10862. }
  10863. closePressDotEvent() {
  10864. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10865. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10866. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10867. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10868. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10869. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10870. }
  10871. onDown(e) {
  10872. if (e.type == Laya.Event.MOUSE_DOWN)
  10873. this.isPressd = true;
  10874. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10875. this.isPressd = false;
  10876. if (!this.isPressd)
  10877. return;
  10878. this.moveDest.x = e.stageX;
  10879. this.moveDest.y = e.stageY;
  10880. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10881. if (dis > 6724) {
  10882. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10883. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10884. }
  10885. this.setDot();
  10886. }
  10887. resetRod() {
  10888. this.ui.dot.x = this.ui.white.x;
  10889. this.ui.dot.y = this.ui.white.y;
  10890. this.gameRod.dot.x = this.gameRod.bg.x;
  10891. this.gameRod.dot.y = this.gameRod.bg.y;
  10892. xGame.common.rodOffest.x = 0;
  10893. xGame.common.rodOffest.y = 0;
  10894. }
  10895. }
  10896. UIRodMethod.uiName = "UIRodMethod";
  10897. class UIGame extends UIBase {
  10898. constructor() {
  10899. super();
  10900. this.powerNum = 0;
  10901. this.isD3Inited = false;
  10902. this.isPrePlay = false;
  10903. this.isMoveRod = false;
  10904. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10905. this.rulerDis = 20;
  10906. this.rulerOffset = 0;
  10907. }
  10908. onConstructor() {
  10909. this.ui = ui_UIGame.createInstance();
  10910. this.contentPane = this.ui;
  10911. this.ui.x += xGame.common.sysOffestNum;
  10912. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10913. this.isEject = false;
  10914. xGame.common.gameUI = this;
  10915. this.initSelf();
  10916. }
  10917. isTurnSelf() {
  10918. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10919. return true;
  10920. }
  10921. }
  10922. initSelf() {
  10923. let topUI = this.ui.topNode;
  10924. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10925. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10926. this.barInfo = {};
  10927. this.barInfo.curY = 0;
  10928. this.barInfo.height = this.ui.powerNode.height;
  10929. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10930. this.barInfo.powerStartY = this.ui.powerNode.y;
  10931. xGame.common.aiPlayer = new AIPlayer();
  10932. xGame.common.gameMgr = new GameMgr();
  10933. xGame.common.skillMgr = new SkillMgr();
  10934. xGame.common.wordsMgr = new WordsMgr();
  10935. xGame.common.talkMgr = new TalkMgr();
  10936. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10937. console.log("加载经典模式表情文件chenggon !");
  10938. });
  10939. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10940. console.log("挑战模式奖励模式spine加载成功!");
  10941. });
  10942. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10943. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10944. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10945. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10946. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10947. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10948. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10949. }
  10950. getGanZiImg() {
  10951. let index = DataMgr.getCurBallRod();
  10952. let data = cfgTable.ballrodData[index + 1];
  10953. let gan_url = xGame.common.getGameIconUrl(data.img);
  10954. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10955. this.ui.powerNode.showImg.url = gan_url;
  10956. console.log('zh:修改杆子图标O K');
  10957. }
  10958. returnHome() {
  10959. let tips = "Are you sure to exit the game?";
  10960. let woman = "Boss, why don't you play for a while longer?";
  10961. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10962. }
  10963. addRodMethodClick() {
  10964. if (this.isTurnSelf()) {
  10965. xGame.uiMgr.Show(UIRodMethod);
  10966. }
  10967. }
  10968. clickHelpLineBtn(force = false) {
  10969. if (!this.isTurnSelf())
  10970. return;
  10971. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10972. if (success) {
  10973. xGame.common.longHelpLine = true;
  10974. xGame.common.d2World.getHelpLine();
  10975. Moyu.sendDataEvent("guideNum");
  10976. }
  10977. else {
  10978. }
  10979. });
  10980. }
  10981. renderSelfDisplayBalls(index, target) {
  10982. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10983. target.myImg.url = xGame.common.getGameIconUrl(str);
  10984. }
  10985. renderAIDisplayBalls(index, target) {
  10986. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10987. target.myImg.url = xGame.common.getGameIconUrl(str);
  10988. ;
  10989. }
  10990. updateMode() {
  10991. if (xGame.common.gameMode == GameMode.classic) {
  10992. this.ui.topNode.scoreNode.visible = false;
  10993. }
  10994. else if (xGame.common.gameMode == GameMode.bigMove) {
  10995. this.ui.topNode.scoreNode.visible = true;
  10996. }
  10997. }
  10998. show() {
  10999. super.show();
  11000. console.log("zh:uigame show AADD");
  11001. this.ui.alpha = 0;
  11002. this.updateSelf();
  11003. xGame.common.gameMgr.gamePause = false;
  11004. xGame.common.gameUI.ui.blackAni.visible = false;
  11005. xGame.common.gameUI.ui.whiteAni.visible = false;
  11006. this.ui.powerEft.visible = false;
  11007. this.ui.colorNode.visible = false;
  11008. this.updateHead();
  11009. let curUse = DataMgr.getCurBallRod();
  11010. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  11011. this.getGanZiImg();
  11012. }
  11013. updateSelf() {
  11014. if (xGame.common.gameMode == GameMode.classic) {
  11015. this.ui.c1.selectedIndex = 0;
  11016. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11017. this.ui.topNode.middleNode.visible = true;
  11018. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11019. }
  11020. else if (xGame.common.gameMode == GameMode.bigMove) {
  11021. this.ui.c1.selectedIndex = 0;
  11022. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11023. this.ui.topNode.middleNode.visible = false;
  11024. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11025. let rand = xGame.common.randomNum(1, max);
  11026. let guide = DataMgr.getSkillGuide();
  11027. if (guide == 0)
  11028. rand = 1;
  11029. xGame.common.bigMoveLevelIndex = rand;
  11030. }
  11031. else if (xGame.common.gameMode == GameMode.placeBall) {
  11032. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11033. this.ui.c1.selectedIndex = 1 + data.type;
  11034. this.ui.alpha = 1;
  11035. this.startGame();
  11036. }
  11037. this.updateMode();
  11038. this.initD3world();
  11039. this.initD2world();
  11040. }
  11041. startGame() {
  11042. this.ui.snowNode.visible = Math.random() <= 0.1;
  11043. this.ui.d2Node.visible = false;
  11044. xGame.common.d3World.d3Hand.gameObj.active = false;
  11045. xGame.common.d3World.tableSrc.init();
  11046. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11047. this.cameraViewChange(() => {
  11048. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11049. switch (xGame.common.gameMode) {
  11050. case GameMode.classic:
  11051. xGame.common.d3World.d3Hand.gameObj.active = true;
  11052. this.playPutBallD3Ani();
  11053. break;
  11054. case GameMode.bigMove:
  11055. this.enterGame();
  11056. Laya.timer.once(500, this, () => {
  11057. this.ui.topNode.middleNode.visible = true;
  11058. this.ui.topNode.middleNode.t0.play();
  11059. });
  11060. break;
  11061. case GameMode.placeBall:
  11062. this.enterGame();
  11063. break;
  11064. default:
  11065. break;
  11066. }
  11067. });
  11068. PlatMgr.showBanner(false);
  11069. }
  11070. enterGame() {
  11071. this.ui.d2Node.visible = true;
  11072. xGame.common.d3World.d3Hand.gameObj.active = false;
  11073. xGame.common.showOneCamera("mainCamera");
  11074. Moyu.recordGame(30, true);
  11075. if (!this.isPrePlay) {
  11076. this.isPrePlay = true;
  11077. xGame.common.d3World.prePlayEft();
  11078. }
  11079. xGame.common.gameMgr.gameReady();
  11080. this.openAllEvent();
  11081. this.ui.snowNode.visible = false;
  11082. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11083. this.ui.helpBtn.visible = condition;
  11084. }
  11085. showHelpLineGuide() {
  11086. let longGuide = DataMgr.getGuideHelpLine();
  11087. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11088. this.ui.helpBtn.visible = true;
  11089. this.ui.guideNode.visible = true;
  11090. }
  11091. }
  11092. setTurnAlpha(alpha) {
  11093. this.ui.keduNode.alpha = alpha;
  11094. this.ui.ganNode.alpha = alpha;
  11095. this.ui.rodMethodNode.alpha = alpha;
  11096. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11097. }
  11098. cameraViewChange(callback) {
  11099. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11100. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11101. xGame.common.showOneCamera("visitAngle");
  11102. cameraSrc.localRotationEulerY = 180;
  11103. cameraSrc.localRotationEulerZ = 0;
  11104. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11105. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11106. callback && callback();
  11107. }));
  11108. }));
  11109. }
  11110. playPutBallD3Ani() {
  11111. xGame.common.showOneCamera("mainCamera");
  11112. let handSrc = xGame.common.d3World.d3Hand;
  11113. handSrc.gameObj.active = true;
  11114. handSrc.transform.localPositionZ = 3;
  11115. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11116. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11117. handSrc.gameObj.active = false;
  11118. this.enterGame();
  11119. }), 400);
  11120. }));
  11121. }
  11122. updateHead() {
  11123. let user = Moyu.getUserInfo();
  11124. this.ui.topNode.selfNameTxt.text = user.nickName;
  11125. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11126. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11127. if (DataMgr.getSkillGuide() < 1) {
  11128. this.ui.topNode.aiNameTxt.text = 'billiards';
  11129. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11130. }
  11131. else {
  11132. this.ui.topNode.aiNameTxt.text = aiData.name;
  11133. let randNo = Math.floor(Math.random() * 10) + 1;
  11134. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11135. }
  11136. }
  11137. initD2world() {
  11138. let node = this.ui.d2Root.displayObject;
  11139. let src = node.getComponent(D2World);
  11140. if (!src) {
  11141. xGame.common.d2World = node.addComponent(D2World);
  11142. }
  11143. xGame.common.d2World.initSelf();
  11144. }
  11145. initD3world() {
  11146. if (this.isD3Inited)
  11147. return;
  11148. this.isD3Inited = true;
  11149. let scene3D = xGame.common.d3Scene;
  11150. this.ui.d3Root.displayObject.addChild(scene3D);
  11151. scene3D.active = true;
  11152. xGame.common.d3World.tableSrc.setBorderPos();
  11153. }
  11154. onRootMove(e) {
  11155. let rootBall = xGame.common.d2World.rootBall;
  11156. this.ui.moveNode.x = e.x;
  11157. this.ui.moveNode.y = e.y;
  11158. rootBall.gameObj.x = e.x;
  11159. rootBall.gameObj.y = e.y;
  11160. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11161. }
  11162. aiRootMove(move) {
  11163. if (move)
  11164. this.hideBallUI();
  11165. else {
  11166. this.showBallUI();
  11167. xGame.common.d2World.getHelpLine();
  11168. }
  11169. }
  11170. aiForce(type, force = 0) {
  11171. this.pressTarget = PressType.powerNode;
  11172. if (type == 1)
  11173. this.onEventUp({ force: true });
  11174. else if (type == 2)
  11175. this.onEventMove({ stageY: force, force: true });
  11176. }
  11177. onEventPress(e) {
  11178. if (e.stopPropagation)
  11179. e.stopPropagation();
  11180. if (!this.isTurnSelf())
  11181. return;
  11182. let target = e.target;
  11183. switch (target) {
  11184. case this.ui.myPowerNode.displayObject:
  11185. this.pressTarget = PressType.powerNode;
  11186. this.barInfo.curY = e.stageY;
  11187. this.updateBarInfo();
  11188. break;
  11189. case this.ui.moveNode.displayObject:
  11190. this.pressTarget = PressType.moveNode;
  11191. this.hideBallUI();
  11192. this.eventObj.curX = this.ui.moveNode.x;
  11193. this.eventObj.curY = this.ui.moveNode.y;
  11194. this.ui.moveNode.finger.visible = false;
  11195. this.eventObj.lastX = e.stageX;
  11196. this.eventObj.lastY = e.stageY;
  11197. break;
  11198. case this.ui.rulerClickNode.displayObject:
  11199. this.pressTarget = PressType.rulerNode;
  11200. this.eventObj.lastY = e.stageY;
  11201. break;
  11202. case this.ui.d2Root.displayObject:
  11203. this.pressTarget = PressType.d2Root;
  11204. this.eventObj.lastX = e.stageX;
  11205. this.eventObj.lastY = e.stageY;
  11206. this.eventObj.starX = e.stageX;
  11207. this.eventObj.starY = e.stageY;
  11208. this.eventObj.curX = 0;
  11209. this.eventObj.curY = 0;
  11210. xGame.common.d2World.d2Gan.setGanLastInfo();
  11211. this.rulerOffset = 0;
  11212. break;
  11213. default:
  11214. break;
  11215. }
  11216. }
  11217. onEventMove(e) {
  11218. if (e.stopPropagation)
  11219. e.stopPropagation();
  11220. if (e && e.force) {
  11221. }
  11222. else {
  11223. if (!this.isTurnSelf())
  11224. return;
  11225. }
  11226. switch (this.pressTarget) {
  11227. case PressType.powerNode:
  11228. this.barInfo.curY = e.stageY;
  11229. this.updateBarInfo();
  11230. this.isMoveRod = true;
  11231. break;
  11232. case PressType.moveNode:
  11233. let rootBall = xGame.common.d2World.rootBall;
  11234. let radius = rootBall.gameObj.width / 2;
  11235. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11236. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11237. let border = xGame.common.d2World.borderRect;
  11238. if (curX <= border.x + radius)
  11239. curX = border.x + radius;
  11240. else if (curX >= border.x + border.width - radius)
  11241. curX = border.x + border.width - radius;
  11242. if (curY <= border.y + radius)
  11243. curY = border.y + radius;
  11244. else if (curY >= border.y + border.height - radius)
  11245. curY = border.y + border.height - radius;
  11246. if (xGame.common.gameMgr.isOpenBall) {
  11247. if (curX >= border.x + border.openBallW - radius)
  11248. curX = border.x + border.openBallW - radius;
  11249. }
  11250. this.ui.moveNode.x = curX;
  11251. this.ui.moveNode.y = curY;
  11252. rootBall.gameObj.x = curX;
  11253. rootBall.gameObj.y = curY;
  11254. rootBall.d3BallSrc.setTransPos(curX, curY);
  11255. this.isMoveRod = true;
  11256. break;
  11257. case PressType.rulerNode:
  11258. let yy = e.stageY - this.eventObj.lastY;
  11259. this.eventObj.lastY = e.stageY;
  11260. let ruler1 = this.ui.rulerNode.img1;
  11261. let ruler2 = this.ui.rulerNode.img2;
  11262. ruler1.y += yy;
  11263. ruler2.y += yy;
  11264. this.rulerOffset += yy;
  11265. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11266. this.rulerOffset = 0;
  11267. xGame.soundMgr.playSound("inch", 1, 10);
  11268. }
  11269. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11270. let h = ruler1.height;
  11271. this.checkGuide();
  11272. this.isMoveRod = true;
  11273. if (ruler1.y >= h) {
  11274. ruler1.y = -h;
  11275. ruler2.y = 0;
  11276. return;
  11277. }
  11278. else if (ruler1.y <= -h) {
  11279. ruler1.y = h;
  11280. ruler2.y = 0;
  11281. return;
  11282. }
  11283. if (ruler2.y >= h) {
  11284. ruler2.y = -h;
  11285. ruler1.y = 0;
  11286. return;
  11287. }
  11288. else if (ruler2.y <= -h) {
  11289. ruler2.y = h;
  11290. ruler1.y = 0;
  11291. return;
  11292. }
  11293. break;
  11294. case PressType.d2Root:
  11295. this.eventObj.curX = e.stageX;
  11296. this.eventObj.curY = e.stageY;
  11297. let offset = this.checkRodMoveDir();
  11298. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11299. this.eventObj.lastX = e.stageX;
  11300. this.eventObj.lastY = e.stageY;
  11301. break;
  11302. default:
  11303. break;
  11304. }
  11305. }
  11306. onEventUp(e) {
  11307. if (e.stopPropagation)
  11308. e.stopPropagation();
  11309. if (e && e.force) {
  11310. }
  11311. else {
  11312. if (!this.isTurnSelf())
  11313. return;
  11314. }
  11315. switch (this.pressTarget) {
  11316. case PressType.powerNode:
  11317. this.ui.powerNode.value = 0;
  11318. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11319. this.ui.powerTxt.text = "";
  11320. if (this.powerNum > 0) {
  11321. xGame.eventMgr.event(BALL_SHOOT);
  11322. xGame.common.d2World.shoot(this.powerNum);
  11323. xGame.common.d2World.d2Gan.shoot();
  11324. xGame.common.d2World.d2HelpLine.shoot();
  11325. this.finishGuide();
  11326. this.ui.powerEft.visible = false;
  11327. this.ui.colorNode.visible = false;
  11328. let ganStr = "";
  11329. if (this.powerNum <= 30) {
  11330. ganStr = "gan_30";
  11331. }
  11332. else if (this.powerNum <= 60) {
  11333. ganStr = "gan_50";
  11334. }
  11335. else {
  11336. ganStr = "gan_80";
  11337. }
  11338. xGame.soundMgr.playSound(ganStr);
  11339. }
  11340. break;
  11341. case PressType.moveNode:
  11342. let rootBall = xGame.common.d2World.rootBall;
  11343. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11344. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11345. let isIntersect = this.judgeBallIntersect();
  11346. if (isIntersect) {
  11347. this.ui.moveNode.x = lastX;
  11348. this.ui.moveNode.y = lastY;
  11349. rootBall.gameObj.x = lastX;
  11350. rootBall.gameObj.y = lastY;
  11351. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11352. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11353. }
  11354. else {
  11355. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11356. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11357. }
  11358. this.showBallUI();
  11359. this.ui.moveNode.finger.visible = true;
  11360. xGame.common.d2World.getHelpLine();
  11361. break;
  11362. case PressType.rulerNode:
  11363. break;
  11364. case PressType.d2Root:
  11365. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11366. if (dis <= 25) {
  11367. this.moveToClickDot(e);
  11368. }
  11369. break;
  11370. default:
  11371. break;
  11372. }
  11373. this.pressTarget = -1;
  11374. }
  11375. checkGuide() {
  11376. let guide = DataMgr.getSkillGuide();
  11377. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11378. xGame.common.guideStep++;
  11379. xGame.common.gameUI.ui.guide2.visible = false;
  11380. xGame.common.gameUI.ui.guide3.visible = true;
  11381. }
  11382. }
  11383. finishGuide() {
  11384. let guide = DataMgr.getSkillGuide();
  11385. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11386. xGame.common.guideStep = 10;
  11387. this.closeAllGuide();
  11388. console.log('zh: 新手引导完毕');
  11389. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11390. }
  11391. }
  11392. closeAllGuide() {
  11393. xGame.common.gameUI.ui.guide1.visible = false;
  11394. xGame.common.gameUI.ui.guide2.visible = false;
  11395. xGame.common.gameUI.ui.guide3.visible = false;
  11396. }
  11397. updateBarInfo() {
  11398. let star = this.ui.powerNode.y;
  11399. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11400. if (rate >= 1)
  11401. rate = 1;
  11402. if (rate <= 0)
  11403. rate = 0;
  11404. this.powerNum = Math.ceil(rate * 100);
  11405. this.ui.powerNode.value = this.powerNum;
  11406. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11407. this.ui.colorNode.value = this.powerNum;
  11408. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11409. this.ui.powerEft.visible = this.powerNum != 0;
  11410. this.ui.colorNode.visible = this.powerNum != 0;
  11411. this.ui.powerTxt.text = this.powerNum + "";
  11412. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11413. }
  11414. forceCancel() {
  11415. this.ui.powerNode.value = 0;
  11416. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11417. this.ui.powerTxt.text = "";
  11418. }
  11419. checkRodMoveDir() {
  11420. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11421. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11422. if (tempX >= 0 && tempY <= 0) {
  11423. return this.checkDir();
  11424. }
  11425. else if (tempX < 0 && tempY < 0) {
  11426. return this.checkDir(1, -1);
  11427. }
  11428. else if (tempX < 0 && tempY > 0) {
  11429. return this.checkDir(-1, -1);
  11430. }
  11431. else {
  11432. return this.checkDir(-1, 1);
  11433. }
  11434. }
  11435. checkDir(flagX = 1, flagY = 1) {
  11436. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11437. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11438. if (offsetY == 0) {
  11439. return offsetX * flagX;
  11440. }
  11441. if (offsetX == 0) {
  11442. return offsetY * flagY;
  11443. }
  11444. let angle = offsetY / offsetX;
  11445. if (Math.abs(angle) >= 1) {
  11446. return offsetY * flagY;
  11447. }
  11448. else {
  11449. return offsetX * flagX;
  11450. }
  11451. }
  11452. judgeBallIntersect() {
  11453. let rootBall = xGame.common.d2World.rootBall;
  11454. let ballArr = xGame.common.d2World.ballArr;
  11455. let radius = rootBall.gameObj.width / 2;
  11456. let temp;
  11457. let isIntersect = false;
  11458. for (let index = 0; index < ballArr.length; index++) {
  11459. temp = ballArr[index];
  11460. if (temp.number == rootBall.number)
  11461. continue;
  11462. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11463. if (isIntersect) {
  11464. break;
  11465. }
  11466. }
  11467. return isIntersect;
  11468. }
  11469. hideBallUI() {
  11470. let d2Gan = xGame.common.d2World.d2Gan;
  11471. if (!d2Gan.ui.isDisposed)
  11472. d2Gan.ui.visible = false;
  11473. let d2Help = xGame.common.d2World.d2HelpLine;
  11474. if (!d2Help.ui.isDisposed)
  11475. d2Help.ui.visible = false;
  11476. let rootBall = xGame.common.d2World.rootBall;
  11477. if (!rootBall.destroyed) {
  11478. rootBall.gameObj.active = false;
  11479. }
  11480. }
  11481. showBallUI() {
  11482. let d2Gan = xGame.common.d2World.d2Gan;
  11483. if (!d2Gan.ui.isDisposed)
  11484. d2Gan.ui.visible = true;
  11485. let d2Help = xGame.common.d2World.d2HelpLine;
  11486. if (!d2Help.ui.isDisposed)
  11487. d2Help.ui.visible = true;
  11488. let rootBall = xGame.common.d2World.rootBall;
  11489. if (!rootBall.destroyed) {
  11490. rootBall.gameObj.active = true;
  11491. }
  11492. }
  11493. moveToClickDot(e) {
  11494. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11495. let root = xGame.common.d2World.rootBall.gameObj;
  11496. let xx = e.stageX - xGame.common.sysOffestNum;
  11497. let yy = e.stageY;
  11498. let x = xx - root.x;
  11499. let y = yy - root.y;
  11500. let angle = xGame.common.getfguiRotation(x, y);
  11501. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11502. xGame.common.d2World.getHelpLine();
  11503. }
  11504. this.isMoveRod = false;
  11505. xGame.common.clickedBall = false;
  11506. }
  11507. openAllEvent() {
  11508. this.closeAllEvent();
  11509. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11510. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11511. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11512. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11513. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11514. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11515. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11516. }
  11517. closeAllEvent() {
  11518. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11519. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11520. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11521. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11522. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11523. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11524. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11525. }
  11526. resetGame() {
  11527. this.closeAllEvent();
  11528. this.hideBallUI();
  11529. xGame.common.gameMgr.gamePause = true;
  11530. }
  11531. }
  11532. UIGame.uiName = "UIGame";
  11533. class UIAddProp extends UIBase {
  11534. constructor() {
  11535. super();
  11536. this.curType = "";
  11537. }
  11538. onConstructor() {
  11539. this.ui = ui_UIAddProp.createInstance();
  11540. this.contentPane = this.ui;
  11541. this.isEject = false;
  11542. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11543. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11544. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11545. this.updateUI();
  11546. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11547. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11548. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11549. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11550. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11551. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11552. }
  11553. show(type) {
  11554. super.show();
  11555. this.curType = type == 0 ? "coin" : "diamond";
  11556. this.switchBtn("");
  11557. this.ui.t0.play();
  11558. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11559. PlatMgr.showInsert(true);
  11560. }
  11561. closeSelf() {
  11562. this.hide();
  11563. }
  11564. updateUI() {
  11565. let data = cfgTable.moneyData;
  11566. let temp;
  11567. let obj;
  11568. for (const key in data) {
  11569. temp = data[key];
  11570. obj = this.ui.myNode["node" + key];
  11571. if (parseInt(key) <= 2) {
  11572. obj.diamondTxt.text = "+" + temp.num;
  11573. }
  11574. else {
  11575. obj.coinTxt.text = temp.num;
  11576. obj.diamondTxt.text = temp.get.split('_')[1];
  11577. }
  11578. }
  11579. this.updateDiamondShare();
  11580. }
  11581. updateDiamondShare() {
  11582. let data = DataMgr.getShareDiamondTimes();
  11583. if (data >= xGame.common.maxShareDiamondTimes) {
  11584. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11585. this.ui.myNode.node1.touchable = false;
  11586. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11587. }
  11588. else {
  11589. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11590. this.ui.myNode.node1.touchable = true;
  11591. }
  11592. }
  11593. switchBtn(type) {
  11594. if (type == "")
  11595. type = this.curType;
  11596. else {
  11597. if (this.curType == type) {
  11598. return;
  11599. }
  11600. else {
  11601. this.curType = type;
  11602. }
  11603. }
  11604. if (type == "coin") {
  11605. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11606. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11607. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11608. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11609. this.ui.myNode.c1.selectedIndex = 0;
  11610. }
  11611. else {
  11612. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11613. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11614. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11615. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11616. this.ui.myNode.c1.selectedIndex = 1;
  11617. }
  11618. }
  11619. convertCoin(index) {
  11620. let data = cfgTable.moneyData[index];
  11621. let coinNum = data.num;
  11622. let str = data.get.split('_')[1];
  11623. let needDiamond = parseInt(str);
  11624. if (DataMgr.diamondEnough(needDiamond)) {
  11625. DataMgr.setDiamond(-needDiamond);
  11626. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11627. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11628. }
  11629. else {
  11630. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11631. this.switchBtn("diamond");
  11632. }
  11633. }
  11634. videoGetDiamond() {
  11635. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11636. if (Laya.Browser.onAndroid) {
  11637. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11638. if (!boo) {
  11639. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11640. return;
  11641. }
  11642. }
  11643. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11644. }
  11645. else {
  11646. console.log('zh:AD 失败,直接发放奖励');
  11647. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11648. }
  11649. }
  11650. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11651. let num = cfgTable.moneyData[2].num;
  11652. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11653. this.closeSelf();
  11654. }
  11655. videoGetCoin() {
  11656. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11657. if (Laya.Browser.onAndroid) {
  11658. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11659. if (!boo) {
  11660. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11661. return;
  11662. }
  11663. }
  11664. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11665. }
  11666. else {
  11667. console.log('zh:AD 失败,直接发放奖励');
  11668. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11669. }
  11670. }
  11671. qjff_AD_for_uiAddProp_videoGetCoin() {
  11672. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11673. this.closeSelf();
  11674. }
  11675. shareGetDiamond() {
  11676. let times = DataMgr.getShareDiamondTimes();
  11677. if (times >= xGame.common.maxShareDiamondTimes) {
  11678. console.log('zh: 233333333333 maxShareDiamondTimes');
  11679. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11680. }
  11681. else {
  11682. console.log('zh:33333333333333ad');
  11683. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11684. if (Laya.Browser.onAndroid) {
  11685. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11686. if (!boo) {
  11687. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11688. return;
  11689. }
  11690. }
  11691. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11692. }
  11693. else {
  11694. console.log('zh:AD 失败,直接发放奖励');
  11695. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11696. }
  11697. }
  11698. }
  11699. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11700. let diamond = xGame.common.randomNum(50, 100);
  11701. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11702. DataMgr.setShareDiamondTimes(1);
  11703. this.updateDiamondShare();
  11704. }
  11705. openPutBallView() {
  11706. let end = xGame.uiMgr.getUI(UIGameEnd);
  11707. let skill = xGame.uiMgr.getUI(UISkill);
  11708. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11709. let uigame = xGame.uiMgr.getUI(UIGame);
  11710. if (end && !end.isHide) {
  11711. xGame.uiMgr.Hide(UIGameEnd);
  11712. xGame.uiMgr.Show(UIMain);
  11713. }
  11714. if (skill && !skill.isHide)
  11715. xGame.uiMgr.Hide(UISkill);
  11716. if (uigame && !uigame.isHide)
  11717. xGame.uiMgr.Hide(UIGame);
  11718. if (level && !level.isHide) {
  11719. }
  11720. else {
  11721. xGame.uiMgr.Show(UILevelDisplay);
  11722. }
  11723. this.closeSelf();
  11724. }
  11725. }
  11726. UIAddProp.uiName = "UIAddProp";
  11727. class MoneyNode {
  11728. constructor(ui) {
  11729. this.leftTime = 0;
  11730. this.ui = ui;
  11731. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11732. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11733. this.ui.addPowerBtn.onClick(this, this.addPower);
  11734. this.ui.c1.selectedIndex = 1;
  11735. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11736. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11737. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11738. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11739. this.coinChange();
  11740. this.diamondChange();
  11741. this.powerChange();
  11742. }
  11743. addPower() {
  11744. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11745. xGame.uiMgr.Show(UIPower);
  11746. }
  11747. powerChange() {
  11748. let powerNum = DataMgr.getPower();
  11749. this.ui.powerTxt.text = powerNum + "";
  11750. }
  11751. checkPowerTime() {
  11752. let cur = new Date().getTime();
  11753. let last = DataMgr.getPowerTime();
  11754. if (last == 0) {
  11755. last = cur;
  11756. DataMgr.setPowerTime(cur);
  11757. }
  11758. let power = DataMgr.getPower();
  11759. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11760. Laya.timer.clearAll(this);
  11761. if (power >= xGame.common.natureMaxPower) {
  11762. this.ui.powerTimeTxt.text = "";
  11763. DataMgr.setPowerTime(cur);
  11764. return;
  11765. }
  11766. if (power + offset >= xGame.common.natureMaxPower) {
  11767. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11768. this.ui.powerTimeTxt.text = "";
  11769. DataMgr.setPowerTime(cur);
  11770. }
  11771. else {
  11772. if (offset > 0) {
  11773. DataMgr.setPower(offset);
  11774. DataMgr.setPowerTime(cur);
  11775. }
  11776. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11777. this.leftTime = xGame.common.powerRecoverNum - time;
  11778. if (this.leftTime <= 0)
  11779. this.leftTime = 0;
  11780. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11781. Laya.timer.loop(1000, this, this.updatePowerTime);
  11782. }
  11783. }
  11784. updatePowerTime() {
  11785. this.leftTime -= 1;
  11786. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11787. if (this.leftTime <= 0) {
  11788. this.checkPowerTime();
  11789. }
  11790. }
  11791. coinChange() {
  11792. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11793. }
  11794. diamondChange() {
  11795. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11796. }
  11797. addCoin() {
  11798. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11799. Moyu.sendDataEvent("AddCoinBtn");
  11800. xGame.uiMgr.Show(UIAddProp, 0);
  11801. }
  11802. addDiamond() {
  11803. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11804. Moyu.sendDataEvent("AddDiamondBtn");
  11805. xGame.uiMgr.Show(UIAddProp, 1);
  11806. }
  11807. }
  11808. class UIDraw extends UIBase {
  11809. constructor() {
  11810. super();
  11811. this.curKey = 0;
  11812. }
  11813. onConstructor() {
  11814. this.ui = ui_UIDraw.createInstance();
  11815. this.contentPane = this.ui;
  11816. this.isEject = false;
  11817. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11818. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11819. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11820. this.initDraw();
  11821. this.initUI();
  11822. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11823. if (Moyu.isKs)
  11824. this.ui.closeNode.closeBtn.x += 100;
  11825. }
  11826. show() {
  11827. super.show();
  11828. this.ui.t0.play();
  11829. this.playSecretaryIdle();
  11830. this.updateDraw();
  11831. this.checkFree();
  11832. if (PlatMgr.bannerDelay > 0) {
  11833. this.ui.closeNode.closeBtn.visible = false;
  11834. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11835. this.ui.closeNode.closeBtn.visible = true;
  11836. });
  11837. }
  11838. PlatMgr.showRateBanner();
  11839. }
  11840. hide() {
  11841. Laya.timer.clearAll(this);
  11842. super.hide();
  11843. }
  11844. checkFree() {
  11845. let isFree = DataMgr.getDailyfreeDrawTimes();
  11846. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11847. }
  11848. initDraw() {
  11849. this.drawObj = [];
  11850. let data = cfgTable.drawData;
  11851. let temp;
  11852. let weight = 0;
  11853. for (const key in data) {
  11854. temp = data[key];
  11855. weight += temp.weight;
  11856. this.drawObj.push(weight);
  11857. }
  11858. this.allWeight = weight;
  11859. }
  11860. initUI() {
  11861. let data = cfgTable.drawData;
  11862. let temp;
  11863. let img;
  11864. let txt;
  11865. for (const key in data) {
  11866. temp = data[key];
  11867. img = this.ui.myNode.rotNode["img" + key];
  11868. txt = this.ui.myNode.rotNode["txt" + key];
  11869. img.url = xGame.common.getGameIconUrl(temp.icon);
  11870. txt.visible = true;
  11871. if (temp.award > 2) {
  11872. img.rotation = 0;
  11873. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11874. }
  11875. else {
  11876. img.rotation = temp.rotation;
  11877. txt.text = temp.num;
  11878. }
  11879. }
  11880. }
  11881. getCurkey() {
  11882. let rand = Math.random() * this.allWeight;
  11883. let temp;
  11884. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11885. temp = this.drawObj[index];
  11886. if (index == 0) {
  11887. if (rand < temp) {
  11888. return index + 1;
  11889. }
  11890. }
  11891. else {
  11892. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11893. return index + 1;
  11894. }
  11895. }
  11896. }
  11897. return 2;
  11898. }
  11899. startDraw() {
  11900. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11901. if (freeTimes > 0) {
  11902. this.beginDraw();
  11903. DataMgr.setDailyfreeDrawTimes(0);
  11904. this.checkFree();
  11905. }
  11906. else {
  11907. if (Laya.Browser.onAndroid) {
  11908. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11909. if (!boo) {
  11910. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11911. return;
  11912. }
  11913. }
  11914. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11915. }
  11916. else {
  11917. console.log('zh:AD 失败,直接发放奖励');
  11918. this.qjff_chouJiang();
  11919. }
  11920. }
  11921. }
  11922. qjff_chouJiang() {
  11923. this.beginDraw();
  11924. }
  11925. beginDraw() {
  11926. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11927. this.ui.drawBtn.touchable = false;
  11928. this.curKey = this.getCurkey();
  11929. console.log("当前key", this.curKey);
  11930. let cell = 60;
  11931. let lap = 3;
  11932. let angle = cell * (this.curKey - 1) + lap * 360;
  11933. let target = this.ui.myNode.rotNode;
  11934. target.rotation = 0;
  11935. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11936. console.log("旋转完成");
  11937. this.ui.drawBtn.touchable = true;
  11938. this.getAward();
  11939. }));
  11940. }
  11941. getAward() {
  11942. let data = cfgTable.drawData[this.curKey];
  11943. let temp = new AwardType();
  11944. temp.type = data.award;
  11945. temp.num = data.num;
  11946. xGame.common.getAward([temp], () => {
  11947. DataMgr.setDrawTimes(1);
  11948. this.updateDraw();
  11949. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11950. });
  11951. }
  11952. updateDraw() {
  11953. let drawTimes = DataMgr.getDrawTimes();
  11954. let awardTimes = DataMgr.getDrawAwardTimes();
  11955. if (Math.floor(drawTimes / 3) > awardTimes) {
  11956. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11957. this.ui.extraNode.boxBtn.touchable = true;
  11958. this.ui.extraNode.tipsTxt.text = "3/3";
  11959. this.ui.extraNode.barNode.width = 265;
  11960. this.getExtraAward();
  11961. }
  11962. else {
  11963. this.ui.extraNode.boxBtn.t0.stop();
  11964. this.ui.extraNode.boxBtn.touchable = false;
  11965. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11966. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11967. }
  11968. let data = cfgTable.drawData[1];
  11969. if (awardTimes == 0) {
  11970. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11971. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11972. this.ui.myNode.rotNode.img1.rotation = 0;
  11973. }
  11974. else {
  11975. let award = data.nextid;
  11976. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11977. this.ui.myNode.rotNode.txt1.text = award[1];
  11978. this.ui.myNode.rotNode.img1.rotation = 0;
  11979. }
  11980. }
  11981. getExtraAward() {
  11982. let drawTimes = DataMgr.getDrawTimes();
  11983. let awardTimes = DataMgr.getDrawAwardTimes();
  11984. let data = cfgTable.drawData[1];
  11985. let award = new AwardType();
  11986. if (awardTimes == 0) {
  11987. award.num = data.num;
  11988. award.type = data.award;
  11989. xGame.common.getAward([award], () => {
  11990. let all = Math.floor(drawTimes / 3);
  11991. DataMgr.setDrawAwardTimes(all);
  11992. this.updateDraw();
  11993. });
  11994. }
  11995. else {
  11996. award.num = parseInt(data.nextid[1]);
  11997. award.type = parseInt(data.nextid[0]);
  11998. xGame.common.getAward([award], () => {
  11999. let all = Math.floor(drawTimes / 3);
  12000. DataMgr.setDrawAwardTimes(all);
  12001. this.updateDraw();
  12002. });
  12003. }
  12004. }
  12005. closeSelf() {
  12006. this.hide();
  12007. }
  12008. playSecretaryIdle() {
  12009. let parent = this.ui.secretary.displayObject;
  12010. parent.destroyChildren();
  12011. let xx = this.ui.secretary.width / 2;
  12012. let yy = this.ui.secretary.height;
  12013. let scale = xGame.common.getSecretaryScale();
  12014. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12015. xGame.common.secretary.play(data, 0, true, parent);
  12016. }
  12017. }
  12018. UIDraw.uiName = "UIDraw";
  12019. class ui_UIFlyEft extends fgui.GComponent {
  12020. static createInstance() {
  12021. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12022. }
  12023. onConstruct() {
  12024. this.n0 = (this.getChild("n0"));
  12025. this.n1 = (this.getChild("n1"));
  12026. this.n2 = (this.getChild("n2"));
  12027. this.n3 = (this.getChild("n3"));
  12028. this.n4 = (this.getChild("n4"));
  12029. this.n5 = (this.getChild("n5"));
  12030. this.n6 = (this.getChild("n6"));
  12031. this.n7 = (this.getChild("n7"));
  12032. this.iconNode = (this.getChild("iconNode"));
  12033. this.txt = (this.getChild("txt"));
  12034. this.txtNode = (this.getChild("txtNode"));
  12035. }
  12036. }
  12037. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12038. class UIFlyEft extends UIBase {
  12039. constructor() {
  12040. super();
  12041. this.max = 8;
  12042. this.delay = 0;
  12043. }
  12044. onConstructor() {
  12045. this.ui = ui_UIFlyEft.createInstance();
  12046. this.contentPane = this.ui;
  12047. this.isEject = false;
  12048. this.isMuti = true;
  12049. this.ui.x += xGame.common.sysOffestNum;
  12050. }
  12051. getArrPos() {
  12052. if (this.iconPos && this.iconPos.length > 0)
  12053. return;
  12054. this.iconPos = [];
  12055. let temp;
  12056. for (let index = 0; index < this.max; index++) {
  12057. temp = this.ui["n" + index];
  12058. this.iconPos.push([temp.x, temp.y]);
  12059. }
  12060. }
  12061. show(stPos, edPos, num, type, callback) {
  12062. super.show();
  12063. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12064. this.getArrPos();
  12065. this.updateUI(type);
  12066. this.updatePos();
  12067. this.runFly(edPos, callback);
  12068. this.runWorlds(stPos, num);
  12069. }
  12070. updateUI(type) {
  12071. let temp;
  12072. let str;
  12073. for (let index = 0; index < this.max; index++) {
  12074. temp = this.ui["n" + index];
  12075. str = this.getIconStr(type);
  12076. temp.url = xGame.common.getGameIconUrl(str);
  12077. }
  12078. }
  12079. getIconStr(type) {
  12080. switch (type) {
  12081. case Prop.diamond:
  12082. return "ty_zs";
  12083. case Prop.coin:
  12084. return "ty_jb";
  12085. default:
  12086. break;
  12087. }
  12088. }
  12089. updatePos() {
  12090. let temp;
  12091. for (let index = 0; index < this.max; index++) {
  12092. temp = this.ui["n" + index];
  12093. temp.x = this.iconPos[index][0];
  12094. temp.y = this.iconPos[index][1];
  12095. }
  12096. }
  12097. runFly(endPos, callback) {
  12098. let all = 0;
  12099. let temp;
  12100. for (let index = 0; index < this.max; index++) {
  12101. temp = this.ui["n" + index];
  12102. temp.visible = true;
  12103. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12104. temp.visible = false;
  12105. all++;
  12106. if (all >= this.max) {
  12107. callback && callback();
  12108. }
  12109. }), 20 * index);
  12110. }
  12111. }
  12112. runWorlds(stPos, num) {
  12113. let str = "+" + num;
  12114. this.ui.txt.text = str;
  12115. let starX = stPos.x;
  12116. let starY = stPos.y + 50;
  12117. this.ui.txt.x = starX;
  12118. this.ui.txt.y = starY;
  12119. this.ui.txt.visible = true;
  12120. this.ui.txt.alpha = 1;
  12121. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12122. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12123. this.ui.txt.visible = false;
  12124. this.hide();
  12125. }));
  12126. }));
  12127. }
  12128. }
  12129. UIFlyEft.uiName = "UIFlyEft";
  12130. class Common {
  12131. constructor() {
  12132. this.convertNum = 0.025;
  12133. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12134. this.scaleV3One = new Laya.Vector3();
  12135. this.scaleV3Two = new Laya.Vector3();
  12136. this.posV4 = new Laya.Vector4();
  12137. this.showDebug = false;
  12138. this.openGuide = true;
  12139. this.rodOffest = new Laya.Vector2(0, 0);
  12140. this.rodAngle = 0;
  12141. this.gameMode = GameMode.classic;
  12142. this.bigMoveLevelIndex = 1;
  12143. this.bigMoveNeedCoin = 1000;
  12144. this.classicNiceNeddCoin = 1000;
  12145. this.passAwardCoin = 2000;
  12146. this.classicRoomType = 1;
  12147. this.maxPower = 20;
  12148. this.natureMaxPower = 5;
  12149. this.videoPower = 2;
  12150. this.powerRecoverNum = 900;
  12151. this.curPlayerSkillType = 0;
  12152. this.isNewDay = false;
  12153. this.clickedBall = false;
  12154. this.placeBallCurLevel = 0;
  12155. this.placeBallStarNum = 0;
  12156. this.longHelpLine = false;
  12157. this.maxShareDiamondTimes = 3;
  12158. this.guideStep = 0;
  12159. this.temSelfLevel = 0;
  12160. this.extraMoveNum = 0;
  12161. this.curRankID = 0;
  12162. this.rankID = {
  12163. normalStar: 12000,
  12164. wxStar: 12001
  12165. };
  12166. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  12167. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12168. this.btnClickStr = "buttonclick";
  12169. this.maxSkillLevel = 10;
  12170. this.upSkillLevel = false;
  12171. this.gameStartTime = 0;
  12172. this._sysOffestNum = 0;
  12173. this.angleV2 = new Laya.Vector2();
  12174. this.rootV = new Laya.Vector2(0, 1);
  12175. this.tempDir1 = new Laya.Vector2();
  12176. this.tempDir2 = new Laya.Vector2();
  12177. this.ballSize = 33;
  12178. this.stPos = new Laya.Point();
  12179. this.edPos = new Laya.Point();
  12180. Common._instance = this;
  12181. window["common"] = this;
  12182. }
  12183. static getInstance() {
  12184. if (!this._instance) {
  12185. this._instance = new Common();
  12186. }
  12187. return this._instance;
  12188. }
  12189. get sysOffestNum() {
  12190. if (this._sysOffestNum == 0) {
  12191. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12192. }
  12193. return this._sysOffestNum;
  12194. }
  12195. testShader() {
  12196. let test = new LightShader();
  12197. test.texture = "res/d3Res/ballTexture/ball1.png";
  12198. Laya.stage.addChild(test);
  12199. }
  12200. playScale(node) {
  12201. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12202. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12203. }));
  12204. }));
  12205. }
  12206. setGroup(colli, ...group) {
  12207. let out = 0;
  12208. for (let index = 0; index < group.length; index++) {
  12209. if (index == 0) {
  12210. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12211. }
  12212. else {
  12213. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12214. }
  12215. }
  12216. colli.collisionGroup = out;
  12217. }
  12218. setCanGroupWith(colli, ...group) {
  12219. let out = 0;
  12220. for (let index = 0; index < group.length; index++) {
  12221. if (index == 0) {
  12222. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12223. }
  12224. else {
  12225. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12226. }
  12227. }
  12228. colli.canCollideWith = out;
  12229. }
  12230. loadPrefab(name, callback) {
  12231. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12232. let prefab = new Laya.Prefab();
  12233. prefab.json = obj;
  12234. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12235. callback && callback(img);
  12236. }));
  12237. }
  12238. pos2to3Convert(x, y, d3Pos) {
  12239. x = x + this.sysOffestNum;
  12240. d3Pos.setValue(x, y, 0);
  12241. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12242. if (success) {
  12243. }
  12244. else {
  12245. console.error("转换出错了。。。。。。。。");
  12246. }
  12247. }
  12248. scale2to3Convert(num) {
  12249. this.scaleV3One.setValue(0, 0, 0);
  12250. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12251. this.scaleV3Two.setValue(0, num, 0);
  12252. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12253. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12254. return outNum;
  12255. }
  12256. pos3to2Convert(d3Pos) {
  12257. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12258. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12259. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12260. d3Pos.x -= this.sysOffestNum;
  12261. }
  12262. scale3to2Convert(num) {
  12263. let scale = this.scale2to3Convert(1);
  12264. let d2Out = num / scale;
  12265. return d2Out;
  12266. }
  12267. getCollider(type, restitution = 0.9, density = 10) {
  12268. let colli;
  12269. if (type == "box")
  12270. colli = new Laya.BoxCollider();
  12271. else
  12272. colli = new Laya.CircleCollider();
  12273. colli.friction = 0;
  12274. colli.restitution = restitution;
  12275. colli.density = density;
  12276. return colli;
  12277. }
  12278. getRigbody() {
  12279. let rigy = new Laya.RigidBody();
  12280. rigy.bullet = true;
  12281. rigy.allowRotation = false;
  12282. rigy.allowSleep = false;
  12283. rigy.gravityScale = 0;
  12284. return rigy;
  12285. }
  12286. getfguiRotation(x, y) {
  12287. this.angleV2.setValue(x, y);
  12288. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12289. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12290. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12291. angle = -angle;
  12292. }
  12293. return 180 + angle;
  12294. }
  12295. getAngle(x, y) {
  12296. this.angleV2.setValue(x, y);
  12297. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12298. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12299. return angle;
  12300. }
  12301. randomNum(a, b) {
  12302. return a + Math.floor((b - a + 1) * Math.random());
  12303. }
  12304. getRandArrEle(arr) {
  12305. return arr[Math.floor(arr.length * Math.random())];
  12306. }
  12307. getSign(val) {
  12308. return val >= 0 ? 1 : -1;
  12309. }
  12310. botherArr(arr) {
  12311. let times = arr.length + 2;
  12312. let length = arr.length;
  12313. let a;
  12314. let b;
  12315. let temp;
  12316. for (let index = 0; index < times; index++) {
  12317. a = Math.floor(Math.random() * length);
  12318. b = Math.floor(Math.random() * length);
  12319. temp = arr[a];
  12320. arr[a] = arr[b];
  12321. arr[b] = temp;
  12322. }
  12323. }
  12324. getGameIconUrl(id) {
  12325. return "ui://game/" + id;
  12326. }
  12327. getComponentUrl(id) {
  12328. return "ui://game/" + id;
  12329. }
  12330. getAnimation() {
  12331. }
  12332. judgeSkillType(type = SkillType.highSpace) {
  12333. if (this.gameMode == GameMode.classic)
  12334. return;
  12335. let gameMgr = this.gameMgr;
  12336. if (gameMgr.selfTurn) {
  12337. if (gameMgr.selfCurSkill == type) {
  12338. return true;
  12339. }
  12340. }
  12341. else {
  12342. if (gameMgr.aiCurSkill == type) {
  12343. return true;
  12344. }
  12345. }
  12346. }
  12347. ballColliHole(collider) {
  12348. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12349. xGame.common.gameMgr.isFirstInGame = false;
  12350. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12351. }
  12352. collider.owner.mySrc.checkWrongBall();
  12353. }
  12354. getArrMaxEle(arr) {
  12355. let max = -Infinity;
  12356. for (let index = 0; index < arr.length; index++) {
  12357. max = Math.max(arr[index], max);
  12358. }
  12359. return max;
  12360. }
  12361. getArrMinEle(arr) {
  12362. let min = Infinity;
  12363. for (let index = 0; index < arr.length; index++) {
  12364. min = Math.min(arr[index], min);
  12365. }
  12366. return min;
  12367. }
  12368. playRandomMutiBallBigSkillSound() {
  12369. if (Math.random() <= 0.5)
  12370. return;
  12371. let rand = this.randomNum(1, 6);
  12372. let str = "ganfa0" + rand;
  12373. xGame.soundMgr.playSound(str);
  12374. }
  12375. showOneCamera(type) {
  12376. let object = xGame.common.d3World.cameraObj;
  12377. for (const key in object) {
  12378. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12379. object[key].init();
  12380. object[key].owner.active = key == type;
  12381. }
  12382. }
  12383. }
  12384. checkBallOverBorder(x, y) {
  12385. let radius = 17;
  12386. let condition = this._checkBorder(x + radius, y) ||
  12387. this._checkBorder(x - radius, y) ||
  12388. this._checkBorder(x, y + radius) ||
  12389. this._checkBorder(x, y - radius);
  12390. if (condition) {
  12391. return true;
  12392. }
  12393. }
  12394. _checkBorder(x, y) {
  12395. let borderRect = this.d2World.borderRect;
  12396. let xOffest = 20;
  12397. let yOffest = 20;
  12398. if (y <= borderRect.y - yOffest) {
  12399. return true;
  12400. }
  12401. if (y >= borderRect.y + borderRect.height + yOffest) {
  12402. return true;
  12403. }
  12404. if (x <= borderRect.x - xOffest) {
  12405. return true;
  12406. }
  12407. if (x >= borderRect.x + borderRect.width + xOffest) {
  12408. return true;
  12409. }
  12410. }
  12411. initWeight(cfg) {
  12412. let allCfgData = { data: {}, allWeightNum: 0 };
  12413. let weightCfg = allCfgData.data;
  12414. let weight = 0;
  12415. for (const key in cfg) {
  12416. weightCfg[key] = {};
  12417. weightCfg[key].id = cfg[key].id;
  12418. weightCfg[key].minWeight = weight;
  12419. weight += cfg[key].weight;
  12420. weightCfg[key].maxWeight = weight;
  12421. }
  12422. allCfgData.allWeightNum = weight;
  12423. return allCfgData;
  12424. }
  12425. getRandomWeightData(cfg) {
  12426. let weightCfg = cfg.data;
  12427. let allWeightNum = cfg.allWeightNum;
  12428. let rand = Math.floor(Math.random() * allWeightNum);
  12429. for (const key in weightCfg) {
  12430. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12431. return weightCfg[key];
  12432. }
  12433. }
  12434. return weightCfg[1];
  12435. }
  12436. showGirlTalkPop(wordsIndex, node, msgNode) {
  12437. node.visible = true;
  12438. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12439. node.t0.play(Laya.Handler.create(this, () => {
  12440. node.visible = false;
  12441. }));
  12442. }
  12443. stopGirlPop(node) {
  12444. node.t0.stop();
  12445. node.visible = false;
  12446. }
  12447. createHead(loader, url, size = 107) {
  12448. if (Laya.Browser.name == "Browser") {
  12449. loader.url = url;
  12450. return;
  12451. }
  12452. else {
  12453. console.log('zh:url=', url);
  12454. loader.url = url;
  12455. }
  12456. }
  12457. addTestCoin(num) {
  12458. DataMgr.setCoin(num);
  12459. }
  12460. addTestDiamond(num) {
  12461. DataMgr.setDiamond(num);
  12462. }
  12463. addTestSkill() {
  12464. DataMgr.setBigSkill(0, 99);
  12465. DataMgr.setBigSkill(1, 99);
  12466. DataMgr.setBigSkill(2, 99);
  12467. }
  12468. playClassicEmotion(number, x, y) {
  12469. if (this.gameMode == GameMode.bigMove)
  12470. return;
  12471. let randIndex = this.randomNum(0, 2);
  12472. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12473. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12474. if (this.gameMgr.selfTurn) {
  12475. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12476. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12477. }
  12478. else {
  12479. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12480. }
  12481. else {
  12482. if (number == this.gameMgr.blackNum) {
  12483. if (this.gameMgr.selfBallArr.length == 0) {
  12484. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12485. }
  12486. else {
  12487. }
  12488. }
  12489. else {
  12490. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12491. }
  12492. }
  12493. }
  12494. }
  12495. else {
  12496. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12497. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12498. }
  12499. else {
  12500. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12501. }
  12502. else {
  12503. if (number == this.gameMgr.blackNum) {
  12504. if (this.gameMgr.aiBallArr.length == 0) {
  12505. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12506. }
  12507. else {
  12508. }
  12509. }
  12510. else {
  12511. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12512. }
  12513. }
  12514. }
  12515. }
  12516. }
  12517. playHappySound(number) {
  12518. if (this.gameMode != GameMode.classic)
  12519. return;
  12520. if (number == 8)
  12521. return;
  12522. let play = false;
  12523. if (this.gameMgr.selfTurn) {
  12524. if (this.gameMgr.ensureBallType) {
  12525. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12526. play = true;
  12527. }
  12528. }
  12529. else {
  12530. play = true;
  12531. }
  12532. }
  12533. else {
  12534. if (this.gameMgr.ensureBallType) {
  12535. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12536. play = true;
  12537. }
  12538. }
  12539. else {
  12540. play = true;
  12541. }
  12542. }
  12543. if (play)
  12544. xGame.soundMgr.playSound("applause");
  12545. }
  12546. destroyClassicEmotion() {
  12547. if (this.gameMode == GameMode.bigMove)
  12548. return;
  12549. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12550. parent.destroyChildren();
  12551. }
  12552. playAwardSpine(x, y) {
  12553. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12554. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12555. this.awardSpine.play(data, 0, false, parent);
  12556. }
  12557. destroyAwardSpine() {
  12558. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12559. parent.destroyChildren();
  12560. }
  12561. isBlock(bx, by, hx, hy, except = null) {
  12562. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12563. let balls = xGame.common.d2World.ballArr;
  12564. let outArr = [];
  12565. for (let index = 0; index < balls.length; index++) {
  12566. let obj = balls[index];
  12567. if (obj.number == 0)
  12568. continue;
  12569. if (obj == except)
  12570. continue;
  12571. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12572. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12573. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12574. if (num >= 1)
  12575. num = 1;
  12576. if (num < 0)
  12577. continue;
  12578. let gap = Math.sin(Math.acos(num)) * dis;
  12579. if (gap < this.ballSize) {
  12580. outArr.push({
  12581. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12582. disHon: Math.cos(Math.acos(num)) * dis,
  12583. disVer: Math.sin(Math.acos(num)) * dis,
  12584. src: balls[index],
  12585. dir: this.tempDir1
  12586. });
  12587. }
  12588. }
  12589. if (outArr.length > 0) {
  12590. outArr.sort((a, b) => { return a.dis - b.dis; });
  12591. return outArr[0];
  12592. }
  12593. }
  12594. AngleBetween(vector1, vector2) {
  12595. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12596. return rad * (180 / Math.PI);
  12597. }
  12598. getSecretaryScale() {
  12599. if (this.secretary.spineName == "mishu") {
  12600. return 1.28;
  12601. }
  12602. else {
  12603. return 1.024;
  12604. }
  12605. }
  12606. signAwardContainsRod(arr) {
  12607. let temp;
  12608. for (let index = 0; index < arr.length; index++) {
  12609. temp = arr[index].split('-')[0];
  12610. if (parseInt(temp) > 2) {
  12611. return true;
  12612. }
  12613. }
  12614. }
  12615. judgeSameDay() {
  12616. let lastTime = DataMgr.getSignTime();
  12617. let curTime = new Date().getTime();
  12618. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12619. return true;
  12620. }
  12621. return false;
  12622. }
  12623. getAward(arr, callback) {
  12624. let showTriple = arr[0].type <= 2;
  12625. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12626. let temp;
  12627. for (let index = 0; index < arr.length; index++) {
  12628. temp = arr[index];
  12629. switch (temp.type) {
  12630. case 1:
  12631. this.playObjFlyAnim(temp.num, temp.type);
  12632. break;
  12633. case 2:
  12634. this.playObjFlyAnim(temp.num, temp.type);
  12635. break;
  12636. case 3:
  12637. case 4:
  12638. case 5:
  12639. case 6:
  12640. DataMgr.setBallRod(temp.type - 2, 1);
  12641. DataMgr.setCurBallRod(temp.type - 2);
  12642. break;
  12643. default:
  12644. break;
  12645. }
  12646. }
  12647. callback && callback(watchVideo);
  12648. });
  12649. }
  12650. getMoneyNode() {
  12651. let moneyNode;
  12652. let sign = xGame.uiMgr.getUI(UISign);
  12653. let draw = xGame.uiMgr.getUI(UIDraw);
  12654. let end = xGame.uiMgr.getUI(UIGameEnd);
  12655. let skill = xGame.uiMgr.getUI(UISkill);
  12656. if (sign && !sign.isHide)
  12657. moneyNode = sign.ui.moneyNode;
  12658. if (draw && !draw.isHide)
  12659. moneyNode = draw.ui.moneyNode;
  12660. if (end && !end.isHide)
  12661. moneyNode = end.ui.moneyNode;
  12662. if (skill && !skill.isHide)
  12663. moneyNode = skill.ui.moneyNode;
  12664. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12665. let main = xGame.uiMgr.getUI(UIMain);
  12666. if (condition1 && main && !main.isHide) {
  12667. moneyNode = main.ui.moneyNode;
  12668. }
  12669. return moneyNode;
  12670. }
  12671. playObjFlyAnim(num, type, callback = null) {
  12672. this.stPos.x = Laya.stage.width / 2;
  12673. this.stPos.y = Laya.stage.height / 2;
  12674. let moneyNode = this.getMoneyNode();
  12675. switch (type) {
  12676. case Prop.diamond:
  12677. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12678. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12679. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12680. this.edPos.x /= 2;
  12681. this.edPos.y /= 2;
  12682. break;
  12683. case Prop.coin:
  12684. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12685. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12686. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12687. this.edPos.x /= 2;
  12688. this.edPos.y /= 2;
  12689. break;
  12690. default:
  12691. break;
  12692. }
  12693. xGame.soundMgr.playSound("coinbag");
  12694. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12695. switch (type) {
  12696. case Prop.diamond:
  12697. DataMgr.setDiamond(num);
  12698. break;
  12699. case Prop.coin:
  12700. DataMgr.setCoin(num);
  12701. break;
  12702. default:
  12703. break;
  12704. }
  12705. callback && callback();
  12706. });
  12707. }
  12708. autoPopUIView() {
  12709. let arr = [];
  12710. let sign = this.judgeSameDay() ? false : true;
  12711. if (sign)
  12712. arr.push("sign");
  12713. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12714. if (draw)
  12715. arr.push("draw");
  12716. if (arr.length <= 0)
  12717. return;
  12718. let str = this.getRandArrEle(arr);
  12719. switch (str) {
  12720. case "sign":
  12721. xGame.uiMgr.Show(UISign);
  12722. break;
  12723. case "draw":
  12724. xGame.uiMgr.Show(UIDraw);
  12725. break;
  12726. default:
  12727. break;
  12728. }
  12729. }
  12730. getMSTime(time) {
  12731. let min = Math.floor(time / 60);
  12732. let sec = Math.floor((time - min * 60));
  12733. if (sec < 10)
  12734. sec = "0" + sec;
  12735. if (min < 10)
  12736. min = "0" + min;
  12737. return `${min}:${sec}`;
  12738. }
  12739. testPower() {
  12740. DataMgr.setPower(0, false);
  12741. }
  12742. getAllStarNum() {
  12743. let data = DataMgr.getPlaceBallLevelList();
  12744. let out = 0;
  12745. for (let index = 0; index < data.length; index++) {
  12746. out += data[index].star;
  12747. }
  12748. return out;
  12749. }
  12750. recoverCameraView() {
  12751. Laya.timer.once(900, this, () => {
  12752. xGame.common.showOneCamera("mainCamera");
  12753. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12754. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12755. xGame.common.gameUI.ui.border.alpha = 0;
  12756. if (Laya.physicsTimer.scale < 1) {
  12757. Laya.physicsTimer.scale = 1;
  12758. }
  12759. }
  12760. });
  12761. }
  12762. getClassicLevel() {
  12763. let successTimes = DataMgr.getClassicTimes();
  12764. let needKey = "";
  12765. let lastKey = "";
  12766. let cfg = cfgTable.classictimesData;
  12767. let data;
  12768. for (const key in cfg) {
  12769. data = cfg[key];
  12770. if (successTimes <= data.times) {
  12771. needKey = key;
  12772. }
  12773. lastKey = key;
  12774. }
  12775. if (needKey == "")
  12776. needKey = lastKey;
  12777. return cfg[needKey];
  12778. }
  12779. }
  12780. Common._instance = null;
  12781. class ui_Component92 extends fgui.GComponent {
  12782. static createInstance() {
  12783. return (fgui.UIPackage.createObject("game", "Component92"));
  12784. }
  12785. onConstruct() {
  12786. this.n0 = (this.getChild("n0"));
  12787. }
  12788. }
  12789. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12790. class ui_Component129 extends fgui.GProgressBar {
  12791. static createInstance() {
  12792. return (fgui.UIPackage.createObject("game", "Component129"));
  12793. }
  12794. onConstruct() {
  12795. this.bar_v = (this.getChild("bar_v"));
  12796. this.n84 = (this.getChild("n84"));
  12797. }
  12798. }
  12799. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12800. class ui_Component130 extends fgui.GComponent {
  12801. static createInstance() {
  12802. return (fgui.UIPackage.createObject("game", "Component130"));
  12803. }
  12804. onConstruct() {
  12805. this.ani = (this.getChild("ani"));
  12806. this.t0 = this.getTransition("t0");
  12807. }
  12808. }
  12809. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12810. class ui_powerEft extends fgui.GComponent {
  12811. static createInstance() {
  12812. return (fgui.UIPackage.createObject("game", "powerEft"));
  12813. }
  12814. onConstruct() {
  12815. this.ani = (this.getChild("ani"));
  12816. this.n88 = (this.getChild("n88"));
  12817. this.n89 = (this.getChild("n89"));
  12818. }
  12819. }
  12820. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12821. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12822. static createInstance() {
  12823. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12824. }
  12825. onConstruct() {
  12826. this.c1 = this.getController("c1");
  12827. this.n2 = (this.getChild("n2"));
  12828. this.n22 = (this.getChild("n22"));
  12829. this.n23 = (this.getChild("n23"));
  12830. this.n15 = (this.getChild("n15"));
  12831. this.challenge = (this.getChild("challenge"));
  12832. this.n17 = (this.getChild("n17"));
  12833. this.n3 = (this.getChild("n3"));
  12834. this.starNode = (this.getChild("starNode"));
  12835. this.levelTxt = (this.getChild("levelTxt"));
  12836. this.n14 = (this.getChild("n14"));
  12837. this.n19 = (this.getChild("n19"));
  12838. this.n20 = (this.getChild("n20"));
  12839. this.n21 = (this.getChild("n21"));
  12840. this.special = (this.getChild("special"));
  12841. }
  12842. }
  12843. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12844. class ui_Component79 extends fgui.GComponent {
  12845. static createInstance() {
  12846. return (fgui.UIPackage.createObject("game", "Component79"));
  12847. }
  12848. onConstruct() {
  12849. this.c1 = this.getController("c1");
  12850. this.n7 = (this.getChild("n7"));
  12851. this.n8 = (this.getChild("n8"));
  12852. this.n9 = (this.getChild("n9"));
  12853. this.n10 = (this.getChild("n10"));
  12854. this.n11 = (this.getChild("n11"));
  12855. this.n12 = (this.getChild("n12"));
  12856. }
  12857. }
  12858. ui_Component79.URL = "ui://isxx5ak7avag477";
  12859. class ui_Component80 extends fgui.GComponent {
  12860. static createInstance() {
  12861. return (fgui.UIPackage.createObject("game", "Component80"));
  12862. }
  12863. onConstruct() {
  12864. this.n0 = (this.getChild("n0"));
  12865. this.n1 = (this.getChild("n1"));
  12866. this.myList = (this.getChild("myList"));
  12867. this.t0 = this.getTransition("t0");
  12868. }
  12869. }
  12870. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12871. class ui_SignNormal extends fgui.GComponent {
  12872. static createInstance() {
  12873. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12874. }
  12875. onConstruct() {
  12876. this.c1 = this.getController("c1");
  12877. this.n7 = (this.getChild("n7"));
  12878. this.n15 = (this.getChild("n15"));
  12879. this.titleTxt = (this.getChild("titleTxt"));
  12880. this.n8 = (this.getChild("n8"));
  12881. this.myIcon = (this.getChild("myIcon"));
  12882. this.numTxt = (this.getChild("numTxt"));
  12883. this.n12 = (this.getChild("n12"));
  12884. this.n13 = (this.getChild("n13"));
  12885. this.n17 = (this.getChild("n17"));
  12886. this.n14 = (this.getChild("n14"));
  12887. }
  12888. }
  12889. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12890. class ui_Button_reg extends fgui.GButton {
  12891. static createInstance() {
  12892. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12893. }
  12894. onConstruct() {
  12895. this.button = this.getController("button");
  12896. this.n6 = (this.getChild("n6"));
  12897. this.n4 = (this.getChild("n4"));
  12898. }
  12899. }
  12900. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12901. class ui_screenNode extends fgui.GComponent {
  12902. static createInstance() {
  12903. return (fgui.UIPackage.createObject("game", "screenNode"));
  12904. }
  12905. onConstruct() {
  12906. this.n9 = (this.getChild("n9"));
  12907. this.screenImg = (this.getChild("screenImg"));
  12908. }
  12909. }
  12910. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12911. class ui_GetAwrad_com1 extends fgui.GComponent {
  12912. static createInstance() {
  12913. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12914. }
  12915. onConstruct() {
  12916. this.n38 = (this.getChild("n38"));
  12917. this.n39 = (this.getChild("n39"));
  12918. this.n40 = (this.getChild("n40"));
  12919. this.t0 = this.getTransition("t0");
  12920. this.t1 = this.getTransition("t1");
  12921. }
  12922. }
  12923. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12924. class ui_GetAwrad_com2 extends fgui.GComponent {
  12925. static createInstance() {
  12926. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12927. }
  12928. onConstruct() {
  12929. this.n39 = (this.getChild("n39"));
  12930. this.n40 = (this.getChild("n40"));
  12931. this.t0 = this.getTransition("t0");
  12932. }
  12933. }
  12934. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12935. class ui_Component128 extends fgui.GComponent {
  12936. static createInstance() {
  12937. return (fgui.UIPackage.createObject("game", "Component128"));
  12938. }
  12939. onConstruct() {
  12940. this.n38 = (this.getChild("n38"));
  12941. this.n40 = (this.getChild("n40"));
  12942. }
  12943. }
  12944. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12945. class ui_Component100_1 extends fgui.GComponent {
  12946. static createInstance() {
  12947. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12948. }
  12949. onConstruct() {
  12950. this.myNode = (this.getChild("myNode"));
  12951. this.t0 = this.getTransition("t0");
  12952. }
  12953. }
  12954. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12955. class ui_Component142 extends fgui.GComponent {
  12956. static createInstance() {
  12957. return (fgui.UIPackage.createObject("game", "Component142"));
  12958. }
  12959. onConstruct() {
  12960. this.n41 = (this.getChild("n41"));
  12961. this.n42 = (this.getChild("n42"));
  12962. }
  12963. }
  12964. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12965. class ui_main_guang extends fgui.GComponent {
  12966. static createInstance() {
  12967. return (fgui.UIPackage.createObject("game", "main_guang"));
  12968. }
  12969. onConstruct() {
  12970. this.n1 = (this.getChild("n1"));
  12971. this.n2 = (this.getChild("n2"));
  12972. this.n3 = (this.getChild("n3"));
  12973. this.n4 = (this.getChild("n4"));
  12974. this.n5 = (this.getChild("n5"));
  12975. this.n6 = (this.getChild("n6"));
  12976. this.n8 = (this.getChild("n8"));
  12977. this.t0 = this.getTransition("t0");
  12978. }
  12979. }
  12980. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12981. class ui_try_com1 extends fgui.GComponent {
  12982. static createInstance() {
  12983. return (fgui.UIPackage.createObject("game", "try_com1"));
  12984. }
  12985. onConstruct() {
  12986. this.c1 = this.getController("c1");
  12987. this.n0 = (this.getChild("n0"));
  12988. this.n2 = (this.getChild("n2"));
  12989. this.cancelBtn = (this.getChild("cancelBtn"));
  12990. this.videoBtn = (this.getChild("videoBtn"));
  12991. this.n9 = (this.getChild("n9"));
  12992. this.n24 = (this.getChild("n24"));
  12993. this.titleTxt = (this.getChild("titleTxt"));
  12994. this.n32 = (this.getChild("n32"));
  12995. this.n29 = (this.getChild("n29"));
  12996. this.n36 = (this.getChild("n36"));
  12997. this.txtTime = (this.getChild("txtTime"));
  12998. this.t0 = this.getTransition("t0");
  12999. }
  13000. }
  13001. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13002. class ui_try_com2 extends fgui.GComponent {
  13003. static createInstance() {
  13004. return (fgui.UIPackage.createObject("game", "try_com2"));
  13005. }
  13006. onConstruct() {
  13007. this.skillicon = (this.getChild("skillicon"));
  13008. this.n35 = (this.getChild("n35"));
  13009. this.n31 = (this.getChild("n31"));
  13010. this.n32 = (this.getChild("n32"));
  13011. this.n33 = (this.getChild("n33"));
  13012. this.n34 = (this.getChild("n34"));
  13013. }
  13014. }
  13015. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13016. class ui_try_com3 extends fgui.GComponent {
  13017. static createInstance() {
  13018. return (fgui.UIPackage.createObject("game", "try_com3"));
  13019. }
  13020. onConstruct() {
  13021. this.n33 = (this.getChild("n33"));
  13022. this.n34 = (this.getChild("n34"));
  13023. this.n35 = (this.getChild("n35"));
  13024. this.t0 = this.getTransition("t0");
  13025. }
  13026. }
  13027. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13028. class ui_huihe1 extends fgui.GComponent {
  13029. static createInstance() {
  13030. return (fgui.UIPackage.createObject("game", "huihe1"));
  13031. }
  13032. onConstruct() {
  13033. this.n0 = (this.getChild("n0"));
  13034. this.n1 = (this.getChild("n1"));
  13035. this.t0 = this.getTransition("t0");
  13036. }
  13037. }
  13038. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13039. class ui_huihe2 extends fgui.GComponent {
  13040. static createInstance() {
  13041. return (fgui.UIPackage.createObject("game", "huihe2"));
  13042. }
  13043. onConstruct() {
  13044. this.n0 = (this.getChild("n0"));
  13045. this.n1 = (this.getChild("n1"));
  13046. this.t0 = this.getTransition("t0");
  13047. }
  13048. }
  13049. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13050. class ui_Component143 extends fgui.GComponent {
  13051. static createInstance() {
  13052. return (fgui.UIPackage.createObject("game", "Component143"));
  13053. }
  13054. onConstruct() {
  13055. this.n3 = (this.getChild("n3"));
  13056. this.n4 = (this.getChild("n4"));
  13057. this.n5 = (this.getChild("n5"));
  13058. this.n6 = (this.getChild("n6"));
  13059. this.n7 = (this.getChild("n7"));
  13060. this.n8 = (this.getChild("n8"));
  13061. this.n9 = (this.getChild("n9"));
  13062. this.n10 = (this.getChild("n10"));
  13063. this.t0 = this.getTransition("t0");
  13064. }
  13065. }
  13066. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13067. class ui_dh_jingbi2 extends fgui.GComponent {
  13068. static createInstance() {
  13069. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13070. }
  13071. onConstruct() {
  13072. this.n0 = (this.getChild("n0"));
  13073. this.n1 = (this.getChild("n1"));
  13074. this.n2 = (this.getChild("n2"));
  13075. this.n3 = (this.getChild("n3"));
  13076. this.n4 = (this.getChild("n4"));
  13077. this.n5 = (this.getChild("n5"));
  13078. this.n6 = (this.getChild("n6"));
  13079. this.n8 = (this.getChild("n8"));
  13080. this.n10 = (this.getChild("n10"));
  13081. this.t0 = this.getTransition("t0");
  13082. }
  13083. }
  13084. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13085. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13086. static createInstance() {
  13087. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13088. }
  13089. onConstruct() {
  13090. this.n1 = (this.getChild("n1"));
  13091. this.n4 = (this.getChild("n4"));
  13092. this.t0 = this.getTransition("t0");
  13093. }
  13094. }
  13095. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13096. class ui_dh_jingbi3 extends fgui.GComponent {
  13097. static createInstance() {
  13098. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13099. }
  13100. onConstruct() {
  13101. this.n0 = (this.getChild("n0"));
  13102. this.n1 = (this.getChild("n1"));
  13103. this.n2 = (this.getChild("n2"));
  13104. this.n3 = (this.getChild("n3"));
  13105. this.n4 = (this.getChild("n4"));
  13106. this.n5 = (this.getChild("n5"));
  13107. this.n6 = (this.getChild("n6"));
  13108. this.n8 = (this.getChild("n8"));
  13109. this.n10 = (this.getChild("n10"));
  13110. this.t0 = this.getTransition("t0");
  13111. }
  13112. }
  13113. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13114. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13115. static createInstance() {
  13116. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13117. }
  13118. onConstruct() {
  13119. this.n3 = (this.getChild("n3"));
  13120. this.n1 = (this.getChild("n1"));
  13121. this.t0 = this.getTransition("t0");
  13122. }
  13123. }
  13124. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13125. class ui_hb_jinbi1 extends fgui.GButton {
  13126. static createInstance() {
  13127. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13128. }
  13129. onConstruct() {
  13130. this.n20 = (this.getChild("n20"));
  13131. this.n25 = (this.getChild("n25"));
  13132. this.coinTxt = (this.getChild("coinTxt"));
  13133. this.n28 = (this.getChild("n28"));
  13134. this.n32 = (this.getChild("n32"));
  13135. this.n38 = (this.getChild("n38"));
  13136. this.n45 = (this.getChild("n45"));
  13137. this.getTips = (this.getChild("getTips"));
  13138. this.n39 = (this.getChild("n39"));
  13139. this.diamondTxt = (this.getChild("diamondTxt"));
  13140. this.n41 = (this.getChild("n41"));
  13141. this.n42 = (this.getChild("n42"));
  13142. this.n46 = (this.getChild("n46"));
  13143. this.n47 = (this.getChild("n47"));
  13144. this.n48 = (this.getChild("n48"));
  13145. this.t0 = this.getTransition("t0");
  13146. }
  13147. }
  13148. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13149. class ui_hb_jinbi2 extends fgui.GButton {
  13150. static createInstance() {
  13151. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13152. }
  13153. onConstruct() {
  13154. this.n20 = (this.getChild("n20"));
  13155. this.n25 = (this.getChild("n25"));
  13156. this.coinTxt = (this.getChild("coinTxt"));
  13157. this.n28 = (this.getChild("n28"));
  13158. this.n32 = (this.getChild("n32"));
  13159. this.n38 = (this.getChild("n38"));
  13160. this.n39 = (this.getChild("n39"));
  13161. this.diamondTxt = (this.getChild("diamondTxt"));
  13162. this.n41 = (this.getChild("n41"));
  13163. this.n42 = (this.getChild("n42"));
  13164. this.n43 = (this.getChild("n43"));
  13165. this.n44 = (this.getChild("n44"));
  13166. this.n45 = (this.getChild("n45"));
  13167. this.t0 = this.getTransition("t0");
  13168. }
  13169. }
  13170. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13171. class ui_hb_jinbi3 extends fgui.GButton {
  13172. static createInstance() {
  13173. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13174. }
  13175. onConstruct() {
  13176. this.n20 = (this.getChild("n20"));
  13177. this.n25 = (this.getChild("n25"));
  13178. this.coinTxt = (this.getChild("coinTxt"));
  13179. this.n28 = (this.getChild("n28"));
  13180. this.n32 = (this.getChild("n32"));
  13181. this.n38 = (this.getChild("n38"));
  13182. this.n39 = (this.getChild("n39"));
  13183. this.diamondTxt = (this.getChild("diamondTxt"));
  13184. this.n41 = (this.getChild("n41"));
  13185. this.n42 = (this.getChild("n42"));
  13186. this.n43 = (this.getChild("n43"));
  13187. this.n44 = (this.getChild("n44"));
  13188. this.n45 = (this.getChild("n45"));
  13189. this.t0 = this.getTransition("t0");
  13190. }
  13191. }
  13192. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13193. class ui_Component104 extends fgui.GComponent {
  13194. static createInstance() {
  13195. return (fgui.UIPackage.createObject("game", "Component104"));
  13196. }
  13197. onConstruct() {
  13198. this.c1 = this.getController("c1");
  13199. this.n12 = (this.getChild("n12"));
  13200. this.coinBtn = (this.getChild("coinBtn"));
  13201. this.diamondBtn = (this.getChild("diamondBtn"));
  13202. this.node3 = (this.getChild("node3"));
  13203. this.node4 = (this.getChild("node4"));
  13204. this.node5 = (this.getChild("node5"));
  13205. this.node1 = (this.getChild("node1"));
  13206. this.node2 = (this.getChild("node2"));
  13207. this.node6 = (this.getChild("node6"));
  13208. this.t0 = this.getTransition("t0");
  13209. }
  13210. }
  13211. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13212. class ui_Component105 extends fgui.GButton {
  13213. static createInstance() {
  13214. return (fgui.UIPackage.createObject("game", "Component105"));
  13215. }
  13216. onConstruct() {
  13217. this.c1 = this.getController("c1");
  13218. this.n49 = (this.getChild("n49"));
  13219. this.n18 = (this.getChild("n18"));
  13220. this.n46 = (this.getChild("n46"));
  13221. this.n48 = (this.getChild("n48"));
  13222. }
  13223. }
  13224. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13225. class ui_Component106 extends fgui.GButton {
  13226. static createInstance() {
  13227. return (fgui.UIPackage.createObject("game", "Component106"));
  13228. }
  13229. onConstruct() {
  13230. this.c1 = this.getController("c1");
  13231. this.n49 = (this.getChild("n49"));
  13232. this.n18 = (this.getChild("n18"));
  13233. this.n46 = (this.getChild("n46"));
  13234. this.n48 = (this.getChild("n48"));
  13235. }
  13236. }
  13237. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13238. class ui_hb_zs1 extends fgui.GButton {
  13239. static createInstance() {
  13240. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13241. }
  13242. onConstruct() {
  13243. this.c1 = this.getController("c1");
  13244. this.n20 = (this.getChild("n20"));
  13245. this.n21 = (this.getChild("n21"));
  13246. this.n26 = (this.getChild("n26"));
  13247. this.n27 = (this.getChild("n27"));
  13248. this.shareTxt = (this.getChild("shareTxt"));
  13249. this.n32 = (this.getChild("n32"));
  13250. this.n38 = (this.getChild("n38"));
  13251. this.n39 = (this.getChild("n39"));
  13252. this.n44 = (this.getChild("n44"));
  13253. this.diamondTxt = (this.getChild("diamondTxt"));
  13254. this.n41 = (this.getChild("n41"));
  13255. this.n45 = (this.getChild("n45"));
  13256. this.n47 = (this.getChild("n47"));
  13257. this.n48 = (this.getChild("n48"));
  13258. this.randTxt = (this.getChild("randTxt"));
  13259. this.n50 = (this.getChild("n50"));
  13260. this.t0 = this.getTransition("t0");
  13261. }
  13262. }
  13263. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13264. class ui_dh_zs1 extends fgui.GComponent {
  13265. static createInstance() {
  13266. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13267. }
  13268. onConstruct() {
  13269. this.n10 = (this.getChild("n10"));
  13270. this.n9 = (this.getChild("n9"));
  13271. this.n1 = (this.getChild("n1"));
  13272. this.n2 = (this.getChild("n2"));
  13273. this.n3 = (this.getChild("n3"));
  13274. this.n4 = (this.getChild("n4"));
  13275. this.n5 = (this.getChild("n5"));
  13276. this.n6 = (this.getChild("n6"));
  13277. this.n8 = (this.getChild("n8"));
  13278. this.n11 = (this.getChild("n11"));
  13279. this.t0 = this.getTransition("t0");
  13280. }
  13281. }
  13282. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13283. class ui_dh_zs1_1 extends fgui.GComponent {
  13284. static createInstance() {
  13285. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13286. }
  13287. onConstruct() {
  13288. this.n3 = (this.getChild("n3"));
  13289. this.n1 = (this.getChild("n1"));
  13290. this.t0 = this.getTransition("t0");
  13291. }
  13292. }
  13293. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13294. class ui_hb_zs2 extends fgui.GButton {
  13295. static createInstance() {
  13296. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13297. }
  13298. onConstruct() {
  13299. this.n20 = (this.getChild("n20"));
  13300. this.n21 = (this.getChild("n21"));
  13301. this.n26 = (this.getChild("n26"));
  13302. this.n27 = (this.getChild("n27"));
  13303. this.n32 = (this.getChild("n32"));
  13304. this.n38 = (this.getChild("n38"));
  13305. this.n39 = (this.getChild("n39"));
  13306. this.n44 = (this.getChild("n44"));
  13307. this.diamondTxt = (this.getChild("diamondTxt"));
  13308. this.n41 = (this.getChild("n41"));
  13309. this.n45 = (this.getChild("n45"));
  13310. this.t0 = this.getTransition("t0");
  13311. }
  13312. }
  13313. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13314. class ui_hb_zs3 extends fgui.GButton {
  13315. static createInstance() {
  13316. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13317. }
  13318. onConstruct() {
  13319. this.n20 = (this.getChild("n20"));
  13320. this.n21 = (this.getChild("n21"));
  13321. this.n26 = (this.getChild("n26"));
  13322. this.n27 = (this.getChild("n27"));
  13323. this.n32 = (this.getChild("n32"));
  13324. this.n38 = (this.getChild("n38"));
  13325. this.n47 = (this.getChild("n47"));
  13326. this.t0 = this.getTransition("t0");
  13327. }
  13328. }
  13329. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13330. class ui_dh_zs2 extends fgui.GComponent {
  13331. static createInstance() {
  13332. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13333. }
  13334. onConstruct() {
  13335. this.n10 = (this.getChild("n10"));
  13336. this.n9 = (this.getChild("n9"));
  13337. this.n1 = (this.getChild("n1"));
  13338. this.n2 = (this.getChild("n2"));
  13339. this.n3 = (this.getChild("n3"));
  13340. this.n4 = (this.getChild("n4"));
  13341. this.n5 = (this.getChild("n5"));
  13342. this.n6 = (this.getChild("n6"));
  13343. this.n8 = (this.getChild("n8"));
  13344. this.n11 = (this.getChild("n11"));
  13345. this.t0 = this.getTransition("t0");
  13346. }
  13347. }
  13348. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13349. class ui_dh_zs2_1 extends fgui.GComponent {
  13350. static createInstance() {
  13351. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13352. }
  13353. onConstruct() {
  13354. this.n3 = (this.getChild("n3"));
  13355. this.n1 = (this.getChild("n1"));
  13356. this.t0 = this.getTransition("t0");
  13357. }
  13358. }
  13359. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13360. class ui_dh_zs3 extends fgui.GComponent {
  13361. static createInstance() {
  13362. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13363. }
  13364. onConstruct() {
  13365. this.n10 = (this.getChild("n10"));
  13366. this.n9 = (this.getChild("n9"));
  13367. this.n1 = (this.getChild("n1"));
  13368. this.n2 = (this.getChild("n2"));
  13369. this.n3 = (this.getChild("n3"));
  13370. this.n4 = (this.getChild("n4"));
  13371. this.n5 = (this.getChild("n5"));
  13372. this.n6 = (this.getChild("n6"));
  13373. this.n8 = (this.getChild("n8"));
  13374. this.n11 = (this.getChild("n11"));
  13375. this.t0 = this.getTransition("t0");
  13376. }
  13377. }
  13378. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13379. class ui_dh_zs3_1 extends fgui.GComponent {
  13380. static createInstance() {
  13381. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13382. }
  13383. onConstruct() {
  13384. this.n3 = (this.getChild("n3"));
  13385. this.n1 = (this.getChild("n1"));
  13386. this.t0 = this.getTransition("t0");
  13387. }
  13388. }
  13389. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13390. class ui_Component107 extends fgui.GComponent {
  13391. static createInstance() {
  13392. return (fgui.UIPackage.createObject("game", "Component107"));
  13393. }
  13394. onConstruct() {
  13395. this.n18 = (this.getChild("n18"));
  13396. this.n19 = (this.getChild("n19"));
  13397. this.n20 = (this.getChild("n20"));
  13398. this.n21 = (this.getChild("n21"));
  13399. this.n22 = (this.getChild("n22"));
  13400. this.levelTxt = (this.getChild("levelTxt"));
  13401. this.t0 = this.getTransition("t0");
  13402. }
  13403. }
  13404. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13405. class ui_box_com1 extends fgui.GComponent {
  13406. static createInstance() {
  13407. return (fgui.UIPackage.createObject("game", "box_com1"));
  13408. }
  13409. onConstruct() {
  13410. this.n14 = (this.getChild("n14"));
  13411. this.n6 = (this.getChild("n6"));
  13412. this.t0 = this.getTransition("t0");
  13413. }
  13414. }
  13415. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13416. class ui_box_com2 extends fgui.GProgressBar {
  13417. static createInstance() {
  13418. return (fgui.UIPackage.createObject("game", "box_com2"));
  13419. }
  13420. onConstruct() {
  13421. this.bg0 = (this.getChild("bg0"));
  13422. this.bg = (this.getChild("bg"));
  13423. this.bar = (this.getChild("bar"));
  13424. this.n7 = (this.getChild("n7"));
  13425. this.n8 = (this.getChild("n8"));
  13426. this.n10 = (this.getChild("n10"));
  13427. this.n11 = (this.getChild("n11"));
  13428. this.n12 = (this.getChild("n12"));
  13429. }
  13430. }
  13431. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13432. class ui_box_com4 extends fgui.GComponent {
  13433. static createInstance() {
  13434. return (fgui.UIPackage.createObject("game", "box_com4"));
  13435. }
  13436. onConstruct() {
  13437. this.n8 = (this.getChild("n8"));
  13438. this.t0 = this.getTransition("t0");
  13439. }
  13440. }
  13441. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13442. class ui_box_com3 extends fgui.GComponent {
  13443. static createInstance() {
  13444. return (fgui.UIPackage.createObject("game", "box_com3"));
  13445. }
  13446. onConstruct() {
  13447. this.n2 = (this.getChild("n2"));
  13448. this.n3 = (this.getChild("n3"));
  13449. this.n4 = (this.getChild("n4"));
  13450. this.n5 = (this.getChild("n5"));
  13451. this.t0 = this.getTransition("t0");
  13452. this.t1 = this.getTransition("t1");
  13453. }
  13454. }
  13455. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13456. class ui_Component97 extends fgui.GComponent {
  13457. static createInstance() {
  13458. return (fgui.UIPackage.createObject("game", "Component97"));
  13459. }
  13460. onConstruct() {
  13461. this.c1 = this.getController("c1");
  13462. this.n46 = (this.getChild("n46"));
  13463. this.diamondNode = (this.getChild("diamondNode"));
  13464. this.coinNode = (this.getChild("coinNode"));
  13465. this.t0 = this.getTransition("t0");
  13466. }
  13467. }
  13468. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13469. class ui_Component98 extends fgui.GButton {
  13470. static createInstance() {
  13471. return (fgui.UIPackage.createObject("game", "Component98"));
  13472. }
  13473. onConstruct() {
  13474. this.n8 = (this.getChild("n8"));
  13475. this.n40 = (this.getChild("n40"));
  13476. }
  13477. }
  13478. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13479. class ui_Component28_11 extends fgui.GButton {
  13480. static createInstance() {
  13481. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13482. }
  13483. onConstruct() {
  13484. this.c1 = this.getController("c1");
  13485. this.n12 = (this.getChild("n12"));
  13486. this.n17 = (this.getChild("n17"));
  13487. this.n13 = (this.getChild("n13"));
  13488. this.diamondTxt = (this.getChild("diamondTxt"));
  13489. this.n15 = (this.getChild("n15"));
  13490. this.n16 = (this.getChild("n16"));
  13491. }
  13492. }
  13493. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13494. class ui_Component58_11 extends fgui.GComponent {
  13495. static createInstance() {
  13496. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13497. }
  13498. onConstruct() {
  13499. this.c1 = this.getController("c1");
  13500. this.n23 = (this.getChild("n23"));
  13501. this.n41 = (this.getChild("n41"));
  13502. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13503. this.n_daoju = (this.getChild("n_daoju"));
  13504. this.myList = (this.getChild("myList"));
  13505. this.djList = (this.getChild("djList"));
  13506. this.t0 = this.getTransition("t0");
  13507. }
  13508. }
  13509. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13510. class ui_Component100 extends fgui.GComponent {
  13511. static createInstance() {
  13512. return (fgui.UIPackage.createObject("game", "Component100"));
  13513. }
  13514. onConstruct() {
  13515. this.c1 = this.getController("c1");
  13516. this.n75 = (this.getChild("n75"));
  13517. this.n76 = (this.getChild("n76"));
  13518. this.n80 = (this.getChild("n80"));
  13519. this.txt = (this.getChild("txt"));
  13520. this.spineRoot = (this.getChild("spineRoot"));
  13521. }
  13522. }
  13523. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13524. class ui_Component101 extends fgui.GComponent {
  13525. static createInstance() {
  13526. return (fgui.UIPackage.createObject("game", "Component101"));
  13527. }
  13528. onConstruct() {
  13529. this.c1 = this.getController("c1");
  13530. this.n36 = (this.getChild("n36"));
  13531. this.n35 = (this.getChild("n35"));
  13532. this.n33 = (this.getChild("n33"));
  13533. this.n34 = (this.getChild("n34"));
  13534. }
  13535. }
  13536. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13537. class ui_Component53 extends fgui.GComponent {
  13538. static createInstance() {
  13539. return (fgui.UIPackage.createObject("game", "Component53"));
  13540. }
  13541. onConstruct() {
  13542. this.n0 = (this.getChild("n0"));
  13543. this.n1 = (this.getChild("n1"));
  13544. this.n2 = (this.getChild("n2"));
  13545. this.n3 = (this.getChild("n3"));
  13546. this.n4 = (this.getChild("n4"));
  13547. this.n5 = (this.getChild("n5"));
  13548. this.n6 = (this.getChild("n6"));
  13549. this.n7 = (this.getChild("n7"));
  13550. this.n8 = (this.getChild("n8"));
  13551. this.n9 = (this.getChild("n9"));
  13552. this.n10 = (this.getChild("n10"));
  13553. this.n11 = (this.getChild("n11"));
  13554. this.n12 = (this.getChild("n12"));
  13555. this.n13 = (this.getChild("n13"));
  13556. this.n14 = (this.getChild("n14"));
  13557. this.n15 = (this.getChild("n15"));
  13558. this.n16 = (this.getChild("n16"));
  13559. this.n19 = (this.getChild("n19"));
  13560. this.n20 = (this.getChild("n20"));
  13561. this.n21 = (this.getChild("n21"));
  13562. this.n22 = (this.getChild("n22"));
  13563. this.n23 = (this.getChild("n23"));
  13564. this.n24 = (this.getChild("n24"));
  13565. this.n25 = (this.getChild("n25"));
  13566. this.n26 = (this.getChild("n26"));
  13567. this.n27 = (this.getChild("n27"));
  13568. this.n28 = (this.getChild("n28"));
  13569. this.n29 = (this.getChild("n29"));
  13570. this.n30 = (this.getChild("n30"));
  13571. this.n31 = (this.getChild("n31"));
  13572. this.n32 = (this.getChild("n32"));
  13573. this.n33 = (this.getChild("n33"));
  13574. this.n34 = (this.getChild("n34"));
  13575. this.n35 = (this.getChild("n35"));
  13576. this.t0 = this.getTransition("t0");
  13577. }
  13578. }
  13579. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13580. class ui_Component58 extends fgui.GComponent {
  13581. static createInstance() {
  13582. return (fgui.UIPackage.createObject("game", "Component58"));
  13583. }
  13584. onConstruct() {
  13585. this.n23 = (this.getChild("n23"));
  13586. this.n41 = (this.getChild("n41"));
  13587. this.n8 = (this.getChild("n8"));
  13588. this.skillList = (this.getChild("skillList"));
  13589. this.t0 = this.getTransition("t0");
  13590. }
  13591. }
  13592. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13593. class ui_Component59 extends fgui.GComponent {
  13594. static createInstance() {
  13595. return (fgui.UIPackage.createObject("game", "Component59"));
  13596. }
  13597. onConstruct() {
  13598. this.n3 = (this.getChild("n3"));
  13599. this.msgTxt = (this.getChild("msgTxt"));
  13600. this.t0 = this.getTransition("t0");
  13601. }
  13602. }
  13603. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13604. class ui_RulerNode extends fgui.GComponent {
  13605. static createInstance() {
  13606. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13607. }
  13608. onConstruct() {
  13609. this.n6 = (this.getChild("n6"));
  13610. this.n4 = (this.getChild("n4"));
  13611. this.img1 = (this.getChild("img1"));
  13612. this.img2 = (this.getChild("img2"));
  13613. }
  13614. }
  13615. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13616. class ui_Component108 extends fgui.GComponent {
  13617. static createInstance() {
  13618. return (fgui.UIPackage.createObject("game", "Component108"));
  13619. }
  13620. onConstruct() {
  13621. this.n19 = (this.getChild("n19"));
  13622. this.t0 = this.getTransition("t0");
  13623. }
  13624. }
  13625. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13626. class ui_Component63 extends fgui.GComponent {
  13627. static createInstance() {
  13628. return (fgui.UIPackage.createObject("game", "Component63"));
  13629. }
  13630. onConstruct() {
  13631. this.n66 = (this.getChild("n66"));
  13632. this.n56 = (this.getChild("n56"));
  13633. this.n63 = (this.getChild("n63"));
  13634. this.n65 = (this.getChild("n65"));
  13635. this.t0 = this.getTransition("t0");
  13636. }
  13637. }
  13638. ui_Component63.URL = "ui://isxx5ak7h657452";
  13639. class ui_topNode extends fgui.GComponent {
  13640. static createInstance() {
  13641. return (fgui.UIPackage.createObject("game", "topNode"));
  13642. }
  13643. onConstruct() {
  13644. this.selfProgress = (this.getChild("selfProgress"));
  13645. this.aiProgress = (this.getChild("aiProgress"));
  13646. this.selfKuang = (this.getChild("selfKuang"));
  13647. this.aiKuang = (this.getChild("aiKuang"));
  13648. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13649. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13650. this.n33 = (this.getChild("n33"));
  13651. this.n34 = (this.getChild("n34"));
  13652. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13653. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13654. this.selfBallList = (this.getChild("selfBallList"));
  13655. this.aiBallList = (this.getChild("aiBallList"));
  13656. this.middleNode = (this.getChild("middleNode"));
  13657. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13658. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13659. this.scoreNode = (this.getChild("scoreNode"));
  13660. this.selfTips = (this.getChild("selfTips"));
  13661. this.aiTips = (this.getChild("aiTips"));
  13662. }
  13663. }
  13664. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13665. class ui_selfProgress extends fgui.GProgressBar {
  13666. static createInstance() {
  13667. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13668. }
  13669. onConstruct() {
  13670. this.n3 = (this.getChild("n3"));
  13671. this.bar = (this.getChild("bar"));
  13672. }
  13673. }
  13674. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13675. class ui_aiProgress extends fgui.GProgressBar {
  13676. static createInstance() {
  13677. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13678. }
  13679. onConstruct() {
  13680. this.n3 = (this.getChild("n3"));
  13681. this.bar = (this.getChild("bar"));
  13682. }
  13683. }
  13684. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13685. class ui_ballDisplay extends fgui.GComponent {
  13686. static createInstance() {
  13687. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13688. }
  13689. onConstruct() {
  13690. this.myImg = (this.getChild("myImg"));
  13691. }
  13692. }
  13693. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13694. class ui_moveNode extends fgui.GComponent {
  13695. static createInstance() {
  13696. return (fgui.UIPackage.createObject("game", "moveNode"));
  13697. }
  13698. onConstruct() {
  13699. this.n8 = (this.getChild("n8"));
  13700. this.finger = (this.getChild("finger"));
  13701. }
  13702. }
  13703. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13704. class ui_cancelBtn extends fgui.GButton {
  13705. static createInstance() {
  13706. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13707. }
  13708. onConstruct() {
  13709. this.c1 = this.getController("c1");
  13710. this.n0 = (this.getChild("n0"));
  13711. this.n1 = (this.getChild("n1"));
  13712. }
  13713. }
  13714. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13715. class ui_shareBtn extends fgui.GButton {
  13716. static createInstance() {
  13717. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13718. }
  13719. onConstruct() {
  13720. this.c1 = this.getController("c1");
  13721. this.n2 = (this.getChild("n2"));
  13722. this.n1 = (this.getChild("n1"));
  13723. this.n3 = (this.getChild("n3"));
  13724. this.n4 = (this.getChild("n4"));
  13725. this.n5 = (this.getChild("n5"));
  13726. this.n6 = (this.getChild("n6"));
  13727. }
  13728. }
  13729. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13730. class ui_share2Btn extends fgui.GButton {
  13731. static createInstance() {
  13732. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13733. }
  13734. onConstruct() {
  13735. this.n3 = (this.getChild("n3"));
  13736. }
  13737. }
  13738. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13739. class ui_rodMethodNode extends fgui.GComponent {
  13740. static createInstance() {
  13741. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13742. }
  13743. onConstruct() {
  13744. this.bg = (this.getChild("bg"));
  13745. this.dot = (this.getChild("dot"));
  13746. }
  13747. }
  13748. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13749. class ui_sureBtn extends fgui.GButton {
  13750. static createInstance() {
  13751. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13752. }
  13753. onConstruct() {
  13754. this.n2 = (this.getChild("n2"));
  13755. this.n1 = (this.getChild("n1"));
  13756. }
  13757. }
  13758. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13759. class ui_Component18 extends fgui.GComponent {
  13760. static createInstance() {
  13761. return (fgui.UIPackage.createObject("game", "Component18"));
  13762. }
  13763. onConstruct() {
  13764. this.c1 = this.getController("c1");
  13765. this.nameTxt = (this.getChild("nameTxt"));
  13766. this.headImg = (this.getChild("headImg"));
  13767. this.n24 = (this.getChild("n24"));
  13768. this.skillImg = (this.getChild("skillImg"));
  13769. this.skillTxt = (this.getChild("skillTxt"));
  13770. }
  13771. }
  13772. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13773. class ui_Component45 extends fgui.GComponent {
  13774. static createInstance() {
  13775. return (fgui.UIPackage.createObject("game", "Component45"));
  13776. }
  13777. onConstruct() {
  13778. this.c1 = this.getController("c1");
  13779. this.n40 = (this.getChild("n40"));
  13780. this.n41 = (this.getChild("n41"));
  13781. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13782. this.n42 = (this.getChild("n42"));
  13783. this.awardTxt = (this.getChild("awardTxt"));
  13784. this.n44 = (this.getChild("n44"));
  13785. this.t0 = this.getTransition("t0");
  13786. }
  13787. }
  13788. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13789. class ui_emotionDisplay extends fgui.GButton {
  13790. static createInstance() {
  13791. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13792. }
  13793. onConstruct() {
  13794. this.myIcon = (this.getChild("myIcon"));
  13795. }
  13796. }
  13797. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13798. class ui_Component49 extends fgui.GButton {
  13799. static createInstance() {
  13800. return (fgui.UIPackage.createObject("game", "Component49"));
  13801. }
  13802. onConstruct() {
  13803. this.n69 = (this.getChild("n69"));
  13804. this.n56 = (this.getChild("n56"));
  13805. }
  13806. }
  13807. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13808. class ui_Component50 extends fgui.GButton {
  13809. static createInstance() {
  13810. return (fgui.UIPackage.createObject("game", "Component50"));
  13811. }
  13812. onConstruct() {
  13813. this.n54 = (this.getChild("n54"));
  13814. this.n65 = (this.getChild("n65"));
  13815. }
  13816. }
  13817. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13818. class ui_Component51 extends fgui.GButton {
  13819. static createInstance() {
  13820. return (fgui.UIPackage.createObject("game", "Component51"));
  13821. }
  13822. onConstruct() {
  13823. this.c1 = this.getController("c1");
  13824. this.n51 = (this.getChild("n51"));
  13825. this.n54 = (this.getChild("n54"));
  13826. }
  13827. }
  13828. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13829. class ui_Button5 extends fgui.GButton {
  13830. static createInstance() {
  13831. return (fgui.UIPackage.createObject("game", "Button5"));
  13832. }
  13833. onConstruct() {
  13834. this.c1 = this.getController("c1");
  13835. this.n0 = (this.getChild("n0"));
  13836. this.n2 = (this.getChild("n2"));
  13837. }
  13838. }
  13839. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13840. class ui_Component124 extends fgui.GComponent {
  13841. static createInstance() {
  13842. return (fgui.UIPackage.createObject("game", "Component124"));
  13843. }
  13844. onConstruct() {
  13845. this.n22 = (this.getChild("n22"));
  13846. this.shareNode = (this.getChild("shareNode"));
  13847. }
  13848. }
  13849. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13850. class ui_Component125 extends fgui.GComponent {
  13851. static createInstance() {
  13852. return (fgui.UIPackage.createObject("game", "Component125"));
  13853. }
  13854. onConstruct() {
  13855. this.n29 = (this.getChild("n29"));
  13856. this.coinTxt = (this.getChild("coinTxt"));
  13857. }
  13858. }
  13859. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13860. class ui_Component52 extends fgui.GButton {
  13861. static createInstance() {
  13862. return (fgui.UIPackage.createObject("game", "Component52"));
  13863. }
  13864. onConstruct() {
  13865. this.n35 = (this.getChild("n35"));
  13866. this.n36 = (this.getChild("n36"));
  13867. }
  13868. }
  13869. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13870. class ui_Component_fl_1 extends fgui.GComponent {
  13871. static createInstance() {
  13872. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  13873. }
  13874. onConstruct() {
  13875. this.n0 = (this.getChild("n0"));
  13876. this.n6 = (this.getChild("n6"));
  13877. this.n7 = (this.getChild("n7"));
  13878. this.n8 = (this.getChild("n8"));
  13879. this.n5 = (this.getChild("n5"));
  13880. this.n9 = (this.getChild("n9"));
  13881. this.n10 = (this.getChild("n10"));
  13882. this.txt_price = (this.getChild("txt_price"));
  13883. this.n_no = (this.getChild("n_no"));
  13884. this.n_buy = (this.getChild("n_buy"));
  13885. }
  13886. }
  13887. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  13888. class ui_Component_fl_2 extends fgui.GComponent {
  13889. static createInstance() {
  13890. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  13891. }
  13892. onConstruct() {
  13893. this.n0 = (this.getChild("n0"));
  13894. this.txt_price = (this.getChild("txt_price"));
  13895. this.n4 = (this.getChild("n4"));
  13896. this.n6 = (this.getChild("n6"));
  13897. this.n7 = (this.getChild("n7"));
  13898. this.n5 = (this.getChild("n5"));
  13899. this.n8 = (this.getChild("n8"));
  13900. this.n9 = (this.getChild("n9"));
  13901. this.n_no = (this.getChild("n_no"));
  13902. this.n_buy = (this.getChild("n_buy"));
  13903. }
  13904. }
  13905. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  13906. class ui_drawBtn extends fgui.GButton {
  13907. static createInstance() {
  13908. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13909. }
  13910. onConstruct() {
  13911. this.c1 = this.getController("c1");
  13912. this.n2 = (this.getChild("n2"));
  13913. this.n1 = (this.getChild("n1"));
  13914. this.n5 = (this.getChild("n5"));
  13915. }
  13916. }
  13917. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13918. class ui_Component43 extends fgui.GButton {
  13919. static createInstance() {
  13920. return (fgui.UIPackage.createObject("game", "Component43"));
  13921. }
  13922. onConstruct() {
  13923. this.n49 = (this.getChild("n49"));
  13924. }
  13925. }
  13926. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13927. class ui_wordsDisplay extends fgui.GComponent {
  13928. static createInstance() {
  13929. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13930. }
  13931. onConstruct() {
  13932. this.txt = (this.getChild("txt"));
  13933. this.n63 = (this.getChild("n63"));
  13934. }
  13935. }
  13936. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13937. class ui_Component_phb extends fgui.GComponent {
  13938. static createInstance() {
  13939. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13940. }
  13941. onConstruct() {
  13942. this.n3 = (this.getChild("n3"));
  13943. this.n4 = (this.getChild("n4"));
  13944. }
  13945. }
  13946. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13947. class ui_Component3 extends fgui.GComponent {
  13948. static createInstance() {
  13949. return (fgui.UIPackage.createObject("game", "Component3"));
  13950. }
  13951. onConstruct() {
  13952. this.n26 = (this.getChild("n26"));
  13953. this.n24 = (this.getChild("n24"));
  13954. this.nameTxt = (this.getChild("nameTxt"));
  13955. this.headRoot = (this.getChild("headRoot"));
  13956. }
  13957. }
  13958. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13959. class ui_Component4 extends fgui.GComponent {
  13960. static createInstance() {
  13961. return (fgui.UIPackage.createObject("game", "Component4"));
  13962. }
  13963. onConstruct() {
  13964. this.headImg = (this.getChild("headImg"));
  13965. }
  13966. }
  13967. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13968. class ui_Component7 extends fgui.GButton {
  13969. static createInstance() {
  13970. return (fgui.UIPackage.createObject("game", "Component7"));
  13971. }
  13972. onConstruct() {
  13973. this.n17 = (this.getChild("n17"));
  13974. }
  13975. }
  13976. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13977. class ui_Component8 extends fgui.GButton {
  13978. static createInstance() {
  13979. return (fgui.UIPackage.createObject("game", "Component8"));
  13980. }
  13981. onConstruct() {
  13982. this.n19 = (this.getChild("n19"));
  13983. }
  13984. }
  13985. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13986. class ui_Component10 extends fgui.GButton {
  13987. static createInstance() {
  13988. return (fgui.UIPackage.createObject("game", "Component10"));
  13989. }
  13990. onConstruct() {
  13991. this.c1 = this.getController("c1");
  13992. this.n40 = (this.getChild("n40"));
  13993. }
  13994. }
  13995. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13996. class ui_Component11 extends fgui.GButton {
  13997. static createInstance() {
  13998. return (fgui.UIPackage.createObject("game", "Component11"));
  13999. }
  14000. onConstruct() {
  14001. this.n34 = (this.getChild("n34"));
  14002. }
  14003. }
  14004. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14005. class ui_Component12 extends fgui.GButton {
  14006. static createInstance() {
  14007. return (fgui.UIPackage.createObject("game", "Component12"));
  14008. }
  14009. onConstruct() {
  14010. this.n35 = (this.getChild("n35"));
  14011. }
  14012. }
  14013. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14014. class ui_Component13 extends fgui.GButton {
  14015. static createInstance() {
  14016. return (fgui.UIPackage.createObject("game", "Component13"));
  14017. }
  14018. onConstruct() {
  14019. this.n27 = (this.getChild("n27"));
  14020. this.n36 = (this.getChild("n36"));
  14021. }
  14022. }
  14023. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14024. class ui_dh_js_tuowei extends fgui.GComponent {
  14025. static createInstance() {
  14026. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14027. }
  14028. onConstruct() {
  14029. this.n19 = (this.getChild("n19"));
  14030. this.n18 = (this.getChild("n18"));
  14031. this.n0 = (this.getChild("n0"));
  14032. this.n3 = (this.getChild("n3"));
  14033. this.n4 = (this.getChild("n4"));
  14034. this.n5 = (this.getChild("n5"));
  14035. this.n6 = (this.getChild("n6"));
  14036. this.n8 = (this.getChild("n8"));
  14037. this.n9 = (this.getChild("n9"));
  14038. this.n10 = (this.getChild("n10"));
  14039. this.n11 = (this.getChild("n11"));
  14040. this.n12 = (this.getChild("n12"));
  14041. this.n13 = (this.getChild("n13"));
  14042. this.n14 = (this.getChild("n14"));
  14043. this.n15 = (this.getChild("n15"));
  14044. this.n20 = (this.getChild("n20"));
  14045. this.t0 = this.getTransition("t0");
  14046. this.t1 = this.getTransition("t1");
  14047. }
  14048. }
  14049. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14050. class ui_dh_js_tw_g extends fgui.GComponent {
  14051. static createInstance() {
  14052. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14053. }
  14054. onConstruct() {
  14055. this.n0 = (this.getChild("n0"));
  14056. this.n1 = (this.getChild("n1"));
  14057. this.t0 = this.getTransition("t0");
  14058. }
  14059. }
  14060. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14061. class ui_dh_js_xingxing extends fgui.GComponent {
  14062. static createInstance() {
  14063. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14064. }
  14065. onConstruct() {
  14066. this.n1 = (this.getChild("n1"));
  14067. this.n2 = (this.getChild("n2"));
  14068. this.n3 = (this.getChild("n3"));
  14069. this.n4 = (this.getChild("n4"));
  14070. this.n0 = (this.getChild("n0"));
  14071. this.t2 = this.getTransition("t2");
  14072. this.t1 = this.getTransition("t1");
  14073. }
  14074. }
  14075. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14076. class ui_dh_zy_jiazai extends fgui.GComponent {
  14077. static createInstance() {
  14078. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14079. }
  14080. onConstruct() {
  14081. this.c1 = this.getController("c1");
  14082. this.n0 = (this.getChild("n0"));
  14083. this.n1 = (this.getChild("n1"));
  14084. this.n2 = (this.getChild("n2"));
  14085. this.n4 = (this.getChild("n4"));
  14086. this.n5 = (this.getChild("n5"));
  14087. this.n6 = (this.getChild("n6"));
  14088. this.n8 = (this.getChild("n8"));
  14089. this.n7 = (this.getChild("n7"));
  14090. this.t0 = this.getTransition("t0");
  14091. }
  14092. }
  14093. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14094. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14095. static createInstance() {
  14096. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14097. }
  14098. onConstruct() {
  14099. this.c1 = this.getController("c1");
  14100. this.n3 = (this.getChild("n3"));
  14101. this.n5 = (this.getChild("n5"));
  14102. this.n4 = (this.getChild("n4"));
  14103. this.n0 = (this.getChild("n0"));
  14104. this.n1 = (this.getChild("n1"));
  14105. this.n2 = (this.getChild("n2"));
  14106. }
  14107. }
  14108. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14109. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14110. static createInstance() {
  14111. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14112. }
  14113. onConstruct() {
  14114. this.n19 = (this.getChild("n19"));
  14115. this.n21 = (this.getChild("n21"));
  14116. this.n0 = (this.getChild("n0"));
  14117. this.n3 = (this.getChild("n3"));
  14118. this.n4 = (this.getChild("n4"));
  14119. this.n5 = (this.getChild("n5"));
  14120. this.n6 = (this.getChild("n6"));
  14121. this.n8 = (this.getChild("n8"));
  14122. this.n9 = (this.getChild("n9"));
  14123. this.n10 = (this.getChild("n10"));
  14124. this.n11 = (this.getChild("n11"));
  14125. this.n12 = (this.getChild("n12"));
  14126. this.n13 = (this.getChild("n13"));
  14127. this.n14 = (this.getChild("n14"));
  14128. this.n15 = (this.getChild("n15"));
  14129. this.n23 = (this.getChild("n23"));
  14130. this.t0 = this.getTransition("t0");
  14131. this.t1 = this.getTransition("t1");
  14132. }
  14133. }
  14134. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14135. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14136. static createInstance() {
  14137. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14138. }
  14139. onConstruct() {
  14140. this.n1 = (this.getChild("n1"));
  14141. this.n2 = (this.getChild("n2"));
  14142. this.t0 = this.getTransition("t0");
  14143. }
  14144. }
  14145. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14146. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14147. static createInstance() {
  14148. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14149. }
  14150. onConstruct() {
  14151. this.n4 = (this.getChild("n4"));
  14152. this.n2 = (this.getChild("n2"));
  14153. this.n3 = (this.getChild("n3"));
  14154. this.idle = this.getTransition("idle");
  14155. this.attack = this.getTransition("attack");
  14156. }
  14157. }
  14158. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14159. class ui_special extends fgui.GComponent {
  14160. static createInstance() {
  14161. return (fgui.UIPackage.createObject("game", "special"));
  14162. }
  14163. onConstruct() {
  14164. this.n18 = (this.getChild("n18"));
  14165. this.n19 = (this.getChild("n19"));
  14166. this.n20 = (this.getChild("n20"));
  14167. this.n21 = (this.getChild("n21"));
  14168. this.n22 = (this.getChild("n22"));
  14169. this.levelTxt = (this.getChild("levelTxt"));
  14170. this.n24 = (this.getChild("n24"));
  14171. this.n25 = (this.getChild("n25"));
  14172. this.t0 = this.getTransition("t0");
  14173. }
  14174. }
  14175. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14176. class ui_Component145 extends fgui.GComponent {
  14177. static createInstance() {
  14178. return (fgui.UIPackage.createObject("game", "Component145"));
  14179. }
  14180. onConstruct() {
  14181. this.guanyuNode = (this.getChild("guanyuNode"));
  14182. }
  14183. }
  14184. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14185. class ui_longBtn extends fgui.GButton {
  14186. static createInstance() {
  14187. return (fgui.UIPackage.createObject("game", "longBtn"));
  14188. }
  14189. onConstruct() {
  14190. this.c1 = this.getController("c1");
  14191. this.n2 = (this.getChild("n2"));
  14192. this.n1 = (this.getChild("n1"));
  14193. this.n4 = (this.getChild("n4"));
  14194. }
  14195. }
  14196. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14197. class ui_Component146 extends fgui.GComponent {
  14198. static createInstance() {
  14199. return (fgui.UIPackage.createObject("game", "Component146"));
  14200. }
  14201. onConstruct() {
  14202. this.n89 = (this.getChild("n89"));
  14203. this.n90 = (this.getChild("n90"));
  14204. this.guideBtn = (this.getChild("guideBtn"));
  14205. }
  14206. }
  14207. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14208. class ui_Component146_11 extends fgui.GComponent {
  14209. static createInstance() {
  14210. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14211. }
  14212. onConstruct() {
  14213. this.n89 = (this.getChild("n89"));
  14214. this.n90 = (this.getChild("n90"));
  14215. this.guideBtn = (this.getChild("guideBtn"));
  14216. }
  14217. }
  14218. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14219. class ui_Component111_1 extends fgui.GComponent {
  14220. static createInstance() {
  14221. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14222. }
  14223. onConstruct() {
  14224. this.n68 = (this.getChild("n68"));
  14225. this.myMask = (this.getChild("myMask"));
  14226. }
  14227. }
  14228. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14229. class ui_Component64_1 extends fgui.GComponent {
  14230. static createInstance() {
  14231. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14232. }
  14233. onConstruct() {
  14234. this.n57 = (this.getChild("n57"));
  14235. this.n54 = (this.getChild("n54"));
  14236. this.n55 = (this.getChild("n55"));
  14237. this.n56 = (this.getChild("n56"));
  14238. this.t1 = this.getTransition("t1");
  14239. }
  14240. }
  14241. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14242. class ui_ModeSelection_com123 extends fgui.GComponent {
  14243. static createInstance() {
  14244. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14245. }
  14246. onConstruct() {
  14247. this.type1 = (this.getChild("type1"));
  14248. this.type2 = (this.getChild("type2"));
  14249. this.type3 = (this.getChild("type3"));
  14250. this.n38 = (this.getChild("n38"));
  14251. this.t0 = this.getTransition("t0");
  14252. }
  14253. }
  14254. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14255. class ui_Component132_2 extends fgui.GComponent {
  14256. static createInstance() {
  14257. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14258. }
  14259. onConstruct() {
  14260. this.n25 = (this.getChild("n25"));
  14261. this.n26 = (this.getChild("n26"));
  14262. this.n27 = (this.getChild("n27"));
  14263. this.t0 = this.getTransition("t0");
  14264. }
  14265. }
  14266. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14267. class ui_UIPower$1 extends fgui.GComponent {
  14268. static createInstance() {
  14269. return (fgui.UIPackage.createObject("game", "UIPower"));
  14270. }
  14271. onConstruct() {
  14272. this.n11 = (this.getChild("n11"));
  14273. this.myNode = (this.getChild("myNode"));
  14274. this.t0 = this.getTransition("t0");
  14275. }
  14276. }
  14277. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14278. class ui_Component133 extends fgui.GComponent {
  14279. static createInstance() {
  14280. return (fgui.UIPackage.createObject("game", "Component133"));
  14281. }
  14282. onConstruct() {
  14283. this.n29 = (this.getChild("n29"));
  14284. this.n30 = (this.getChild("n30"));
  14285. }
  14286. }
  14287. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14288. class ui_Component134 extends fgui.GComponent {
  14289. static createInstance() {
  14290. return (fgui.UIPackage.createObject("game", "Component134"));
  14291. }
  14292. onConstruct() {
  14293. this.n30 = (this.getChild("n30"));
  14294. this.n31 = (this.getChild("n31"));
  14295. this.t0 = this.getTransition("t0");
  14296. }
  14297. }
  14298. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14299. class ui_Component135 extends fgui.GComponent {
  14300. static createInstance() {
  14301. return (fgui.UIPackage.createObject("game", "Component135"));
  14302. }
  14303. onConstruct() {
  14304. this.n30 = (this.getChild("n30"));
  14305. this.t0 = this.getTransition("t0");
  14306. }
  14307. }
  14308. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14309. class ui_Component137 extends fgui.GComponent {
  14310. static createInstance() {
  14311. return (fgui.UIPackage.createObject("game", "Component137"));
  14312. }
  14313. onConstruct() {
  14314. this.n28 = (this.getChild("n28"));
  14315. this.n29 = (this.getChild("n29"));
  14316. this.n30 = (this.getChild("n30"));
  14317. this.n32 = (this.getChild("n32"));
  14318. }
  14319. }
  14320. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14321. class ui_dh_zuanshi extends fgui.GButton {
  14322. static createInstance() {
  14323. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14324. }
  14325. onConstruct() {
  14326. this.n1 = (this.getChild("n1"));
  14327. this.n2 = (this.getChild("n2"));
  14328. this.n0 = (this.getChild("n0"));
  14329. this.n3 = (this.getChild("n3"));
  14330. this.n4 = (this.getChild("n4"));
  14331. }
  14332. }
  14333. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14334. class ui_Component138 extends fgui.GComponent {
  14335. static createInstance() {
  14336. return (fgui.UIPackage.createObject("game", "Component138"));
  14337. }
  14338. onConstruct() {
  14339. this.n1 = (this.getChild("n1"));
  14340. this.n2 = (this.getChild("n2"));
  14341. this.t0 = this.getTransition("t0");
  14342. }
  14343. }
  14344. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14345. class ui_Component139 extends fgui.GComponent {
  14346. static createInstance() {
  14347. return (fgui.UIPackage.createObject("game", "Component139"));
  14348. }
  14349. onConstruct() {
  14350. this.n0 = (this.getChild("n0"));
  14351. this.t0 = this.getTransition("t0");
  14352. }
  14353. }
  14354. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14355. class ui_Component140 extends fgui.GComponent {
  14356. static createInstance() {
  14357. return (fgui.UIPackage.createObject("game", "Component140"));
  14358. }
  14359. onConstruct() {
  14360. this.n2 = (this.getChild("n2"));
  14361. this.n3 = (this.getChild("n3"));
  14362. this.t0 = this.getTransition("t0");
  14363. }
  14364. }
  14365. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14366. class ui_Component141 extends fgui.GComponent {
  14367. static createInstance() {
  14368. return (fgui.UIPackage.createObject("game", "Component141"));
  14369. }
  14370. onConstruct() {
  14371. this.n0 = (this.getChild("n0"));
  14372. this.t0 = this.getTransition("t0");
  14373. }
  14374. }
  14375. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14376. class ui_powerNode extends fgui.GProgressBar {
  14377. static createInstance() {
  14378. return (fgui.UIPackage.createObject("game", "powerNode"));
  14379. }
  14380. onConstruct() {
  14381. this.n2 = (this.getChild("n2"));
  14382. this.bar_v = (this.getChild("bar_v"));
  14383. this.showImg = (this.getChild("showImg"));
  14384. this.n12 = (this.getChild("n12"));
  14385. }
  14386. }
  14387. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14388. class ui_dh_jingbi1 extends fgui.GComponent {
  14389. static createInstance() {
  14390. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14391. }
  14392. onConstruct() {
  14393. this.n0 = (this.getChild("n0"));
  14394. this.n1 = (this.getChild("n1"));
  14395. this.n2 = (this.getChild("n2"));
  14396. this.n3 = (this.getChild("n3"));
  14397. this.n4 = (this.getChild("n4"));
  14398. this.n5 = (this.getChild("n5"));
  14399. this.n6 = (this.getChild("n6"));
  14400. this.n8 = (this.getChild("n8"));
  14401. this.t0 = this.getTransition("t0");
  14402. }
  14403. }
  14404. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14405. class ui_Component94 extends fgui.GButton {
  14406. static createInstance() {
  14407. return (fgui.UIPackage.createObject("game", "Component94"));
  14408. }
  14409. onConstruct() {
  14410. this.n77 = (this.getChild("n77"));
  14411. }
  14412. }
  14413. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14414. class ui_Component95 extends fgui.GButton {
  14415. static createInstance() {
  14416. return (fgui.UIPackage.createObject("game", "Component95"));
  14417. }
  14418. onConstruct() {
  14419. this.n77 = (this.getChild("n77"));
  14420. }
  14421. }
  14422. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14423. class ui_Component126 extends fgui.GComponent {
  14424. static createInstance() {
  14425. return (fgui.UIPackage.createObject("game", "Component126"));
  14426. }
  14427. onConstruct() {
  14428. this.c1 = this.getController("c1");
  14429. this.normalBtn = (this.getChild("normalBtn"));
  14430. this.tripleBtn = (this.getChild("tripleBtn"));
  14431. }
  14432. }
  14433. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14434. class ui_Component60 extends fgui.GComponent {
  14435. static createInstance() {
  14436. return (fgui.UIPackage.createObject("game", "Component60"));
  14437. }
  14438. onConstruct() {
  14439. this.c1 = this.getController("c1");
  14440. this.n48 = (this.getChild("n48"));
  14441. this.womanTxt = (this.getChild("womanTxt"));
  14442. this.t0 = this.getTransition("t0");
  14443. }
  14444. }
  14445. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14446. class ui_Component_fuli1 extends fgui.GComponent {
  14447. static createInstance() {
  14448. return (fgui.UIPackage.createObject("game", "Component_fuli1"));
  14449. }
  14450. onConstruct() {
  14451. this.n0 = (this.getChild("n0"));
  14452. }
  14453. }
  14454. ui_Component_fuli1.URL = "ui://isxx5ak7loypv59q";
  14455. class ui_Button_h extends fgui.GButton {
  14456. static createInstance() {
  14457. return (fgui.UIPackage.createObject("game", "Button_h"));
  14458. }
  14459. onConstruct() {
  14460. this.button = this.getController("button");
  14461. this.n0 = (this.getChild("n0"));
  14462. this.n1 = (this.getChild("n1"));
  14463. }
  14464. }
  14465. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14466. class ui_Button_lv extends fgui.GButton {
  14467. static createInstance() {
  14468. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14469. }
  14470. onConstruct() {
  14471. this.button = this.getController("button");
  14472. this.n0 = (this.getChild("n0"));
  14473. this.n1 = (this.getChild("n1"));
  14474. }
  14475. }
  14476. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14477. class ui_Component98_3 extends fgui.GButton {
  14478. static createInstance() {
  14479. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14480. }
  14481. onConstruct() {
  14482. this.c1 = this.getController("c1");
  14483. this.n8 = (this.getChild("n8"));
  14484. this.n41 = (this.getChild("n41"));
  14485. this.n40 = (this.getChild("n40"));
  14486. }
  14487. }
  14488. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14489. class ui_ModeSelection_com1 extends fgui.GButton {
  14490. static createInstance() {
  14491. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14492. }
  14493. onConstruct() {
  14494. this.n34 = (this.getChild("n34"));
  14495. this.n36 = (this.getChild("n36"));
  14496. this.n22 = (this.getChild("n22"));
  14497. this.n20 = (this.getChild("n20"));
  14498. this.n23 = (this.getChild("n23"));
  14499. this.n24 = (this.getChild("n24"));
  14500. this.n26 = (this.getChild("n26"));
  14501. this.n33 = (this.getChild("n33"));
  14502. this.coinImg = (this.getChild("coinImg"));
  14503. this.need = (this.getChild("need"));
  14504. this.n35 = (this.getChild("n35"));
  14505. this.n29 = (this.getChild("n29"));
  14506. this.tipsTxt = (this.getChild("tipsTxt"));
  14507. this.n30 = (this.getChild("n30"));
  14508. this.peopleTxt = (this.getChild("peopleTxt"));
  14509. this.t0 = this.getTransition("t0");
  14510. }
  14511. }
  14512. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14513. class ui_ModeSelection_com2 extends fgui.GButton {
  14514. static createInstance() {
  14515. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14516. }
  14517. onConstruct() {
  14518. this.n36 = (this.getChild("n36"));
  14519. this.n34 = (this.getChild("n34"));
  14520. this.n22 = (this.getChild("n22"));
  14521. this.n20 = (this.getChild("n20"));
  14522. this.n23 = (this.getChild("n23"));
  14523. this.n24 = (this.getChild("n24"));
  14524. this.n26 = (this.getChild("n26"));
  14525. this.n33 = (this.getChild("n33"));
  14526. this.coinImg = (this.getChild("coinImg"));
  14527. this.need = (this.getChild("need"));
  14528. this.n35 = (this.getChild("n35"));
  14529. this.n29 = (this.getChild("n29"));
  14530. this.tipsTxt = (this.getChild("tipsTxt"));
  14531. this.n30 = (this.getChild("n30"));
  14532. this.peopleTxt = (this.getChild("peopleTxt"));
  14533. this.t0 = this.getTransition("t0");
  14534. }
  14535. }
  14536. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14537. class ui_ModeSelection_com3 extends fgui.GButton {
  14538. static createInstance() {
  14539. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14540. }
  14541. onConstruct() {
  14542. this.n34 = (this.getChild("n34"));
  14543. this.n36 = (this.getChild("n36"));
  14544. this.n22 = (this.getChild("n22"));
  14545. this.n20 = (this.getChild("n20"));
  14546. this.n23 = (this.getChild("n23"));
  14547. this.n24 = (this.getChild("n24"));
  14548. this.n26 = (this.getChild("n26"));
  14549. this.n33 = (this.getChild("n33"));
  14550. this.coinImg = (this.getChild("coinImg"));
  14551. this.need = (this.getChild("need"));
  14552. this.n35 = (this.getChild("n35"));
  14553. this.n29 = (this.getChild("n29"));
  14554. this.tipsTxt = (this.getChild("tipsTxt"));
  14555. this.n30 = (this.getChild("n30"));
  14556. this.peopleTxt = (this.getChild("peopleTxt"));
  14557. this.t0 = this.getTransition("t0");
  14558. }
  14559. }
  14560. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14561. class ui_Invitation_com1 extends fgui.GComponent {
  14562. static createInstance() {
  14563. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14564. }
  14565. onConstruct() {
  14566. this.n14 = (this.getChild("n14"));
  14567. this.n13 = (this.getChild("n13"));
  14568. this.n3 = (this.getChild("n3"));
  14569. this.n1 = (this.getChild("n1"));
  14570. this.n6 = (this.getChild("n6"));
  14571. this.n7 = (this.getChild("n7"));
  14572. this.enterBtn = (this.getChild("enterBtn"));
  14573. this.n11 = (this.getChild("n11"));
  14574. this.n12 = (this.getChild("n12"));
  14575. this.n15 = (this.getChild("n15"));
  14576. this.t0 = this.getTransition("t0");
  14577. this.t1 = this.getTransition("t1");
  14578. }
  14579. }
  14580. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14581. class ui_Component87_1 extends fgui.GComponent {
  14582. static createInstance() {
  14583. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14584. }
  14585. onConstruct() {
  14586. this.n74 = (this.getChild("n74"));
  14587. this.n73 = (this.getChild("n73"));
  14588. this.ballTxt = (this.getChild("ballTxt"));
  14589. this.n76 = (this.getChild("n76"));
  14590. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14591. this.levelTxt = (this.getChild("levelTxt"));
  14592. this.n87 = (this.getChild("n87"));
  14593. this.n84 = (this.getChild("n84"));
  14594. this.hpTxt = (this.getChild("hpTxt"));
  14595. this.n89 = (this.getChild("n89"));
  14596. this.tipsTxt = (this.getChild("tipsTxt"));
  14597. }
  14598. }
  14599. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14600. class ui_sqg1 extends fgui.GComponent {
  14601. static createInstance() {
  14602. return (fgui.UIPackage.createObject("game", "sqg1"));
  14603. }
  14604. onConstruct() {
  14605. this.n1 = (this.getChild("n1"));
  14606. this.n0 = (this.getChild("n0"));
  14607. }
  14608. }
  14609. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14610. class ui_sqg2 extends fgui.GComponent {
  14611. static createInstance() {
  14612. return (fgui.UIPackage.createObject("game", "sqg2"));
  14613. }
  14614. onConstruct() {
  14615. this.n1 = (this.getChild("n1"));
  14616. this.n0 = (this.getChild("n0"));
  14617. }
  14618. }
  14619. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14620. class ui_sqg3 extends fgui.GComponent {
  14621. static createInstance() {
  14622. return (fgui.UIPackage.createObject("game", "sqg3"));
  14623. }
  14624. onConstruct() {
  14625. this.n1 = (this.getChild("n1"));
  14626. this.n0 = (this.getChild("n0"));
  14627. }
  14628. }
  14629. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14630. class ui_sqg4 extends fgui.GComponent {
  14631. static createInstance() {
  14632. return (fgui.UIPackage.createObject("game", "sqg4"));
  14633. }
  14634. onConstruct() {
  14635. this.n1 = (this.getChild("n1"));
  14636. this.n0 = (this.getChild("n0"));
  14637. }
  14638. }
  14639. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14640. class ui_Component36 extends fgui.GButton {
  14641. static createInstance() {
  14642. return (fgui.UIPackage.createObject("game", "Component36"));
  14643. }
  14644. onConstruct() {
  14645. this.c1 = this.getController("c1");
  14646. this.n53 = (this.getChild("n53"));
  14647. this.n56 = (this.getChild("n56"));
  14648. }
  14649. }
  14650. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14651. class ui_Component37 extends fgui.GButton {
  14652. static createInstance() {
  14653. return (fgui.UIPackage.createObject("game", "Component37"));
  14654. }
  14655. onConstruct() {
  14656. this.c1 = this.getController("c1");
  14657. this.n52 = (this.getChild("n52"));
  14658. this.n54 = (this.getChild("n54"));
  14659. }
  14660. }
  14661. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14662. class ui_UISetting extends fgui.GComponent {
  14663. static createInstance() {
  14664. return (fgui.UIPackage.createObject("game", "UISetting"));
  14665. }
  14666. onConstruct() {
  14667. this.c1 = this.getController("c1");
  14668. this.n4 = (this.getChild("n4"));
  14669. this.soundBtn = (this.getChild("soundBtn"));
  14670. this.shakeBtn = (this.getChild("shakeBtn"));
  14671. this.clickNode = (this.getChild("clickNode"));
  14672. this.xyBtn = (this.getChild("xyBtn"));
  14673. }
  14674. }
  14675. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14676. class ui_Component39 extends fgui.GComponent {
  14677. static createInstance() {
  14678. return (fgui.UIPackage.createObject("game", "Component39"));
  14679. }
  14680. onConstruct() {
  14681. this.n5 = (this.getChild("n5"));
  14682. this.n6 = (this.getChild("n6"));
  14683. this.n7 = (this.getChild("n7"));
  14684. this.t0 = this.getTransition("t0");
  14685. }
  14686. }
  14687. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14688. class ui_Component40 extends fgui.GButton {
  14689. static createInstance() {
  14690. return (fgui.UIPackage.createObject("game", "Component40"));
  14691. }
  14692. onConstruct() {
  14693. this.n46 = (this.getChild("n46"));
  14694. this.n47 = (this.getChild("n47"));
  14695. }
  14696. }
  14697. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14698. class ui_Component41 extends fgui.GComponent {
  14699. static createInstance() {
  14700. return (fgui.UIPackage.createObject("game", "Component41"));
  14701. }
  14702. onConstruct() {
  14703. this.c1 = this.getController("c1");
  14704. this.n0 = (this.getChild("n0"));
  14705. this.titleTxt = (this.getChild("titleTxt"));
  14706. this.n2 = (this.getChild("n2"));
  14707. this.msgTips = (this.getChild("msgTips"));
  14708. this.numTxt = (this.getChild("numTxt"));
  14709. this.n18 = (this.getChild("n18"));
  14710. this.cancelBtn = (this.getChild("cancelBtn"));
  14711. this.videoBtn = (this.getChild("videoBtn"));
  14712. this.n10 = (this.getChild("n10"));
  14713. }
  14714. }
  14715. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14716. class ui_Component42 extends fgui.GComponent {
  14717. static createInstance() {
  14718. return (fgui.UIPackage.createObject("game", "Component42"));
  14719. }
  14720. onConstruct() {
  14721. this.c1 = this.getController("c1");
  14722. this.n1 = (this.getChild("n1"));
  14723. this.n2 = (this.getChild("n2"));
  14724. this.n3 = (this.getChild("n3"));
  14725. this.tipsTxt = (this.getChild("tipsTxt"));
  14726. this.cancelBtn = (this.getChild("cancelBtn"));
  14727. this.sureBtn = (this.getChild("sureBtn"));
  14728. this.n11 = (this.getChild("n11"));
  14729. this.n13 = (this.getChild("n13"));
  14730. this.n14 = (this.getChild("n14"));
  14731. this.womanTxt = (this.getChild("womanTxt"));
  14732. this.t0 = this.getTransition("t0");
  14733. }
  14734. }
  14735. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14736. class ui_dh_js_shengli extends fgui.GComponent {
  14737. static createInstance() {
  14738. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14739. }
  14740. onConstruct() {
  14741. this.n3 = (this.getChild("n3"));
  14742. this.n4 = (this.getChild("n4"));
  14743. this.n1 = (this.getChild("n1"));
  14744. this.n2 = (this.getChild("n2"));
  14745. this.n5 = (this.getChild("n5"));
  14746. this.n6 = (this.getChild("n6"));
  14747. this.n7 = (this.getChild("n7"));
  14748. this.n8 = (this.getChild("n8"));
  14749. this.attack = this.getTransition("attack");
  14750. this.idle = this.getTransition("idle");
  14751. }
  14752. }
  14753. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14754. class ui_dh_js_shengli_g extends fgui.GComponent {
  14755. static createInstance() {
  14756. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14757. }
  14758. onConstruct() {
  14759. this.n3 = (this.getChild("n3"));
  14760. this.n1 = (this.getChild("n1"));
  14761. this.t0 = this.getTransition("t0");
  14762. }
  14763. }
  14764. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14765. class ui_dh_js_shibai extends fgui.GComponent {
  14766. static createInstance() {
  14767. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14768. }
  14769. onConstruct() {
  14770. this.n0 = (this.getChild("n0"));
  14771. this.n1 = (this.getChild("n1"));
  14772. this.n2 = (this.getChild("n2"));
  14773. this.n3 = (this.getChild("n3"));
  14774. this.idle = this.getTransition("idle");
  14775. this.attack = this.getTransition("attack");
  14776. }
  14777. }
  14778. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14779. class ui_dh_zy_ganfa extends fgui.GButton {
  14780. static createInstance() {
  14781. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14782. }
  14783. onConstruct() {
  14784. this.n0 = (this.getChild("n0"));
  14785. }
  14786. }
  14787. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14788. class ui_dh_zy_sc_guang extends fgui.GButton {
  14789. static createInstance() {
  14790. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14791. }
  14792. onConstruct() {
  14793. this.n0 = (this.getChild("n0"));
  14794. this.n2 = (this.getChild("n2"));
  14795. }
  14796. }
  14797. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14798. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14799. static createInstance() {
  14800. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14801. }
  14802. onConstruct() {
  14803. this.n0 = (this.getChild("n0"));
  14804. this.n3 = (this.getChild("n3"));
  14805. this.t0 = this.getTransition("t0");
  14806. }
  14807. }
  14808. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14809. class ui_dh_zy_wanfa extends fgui.GButton {
  14810. static createInstance() {
  14811. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14812. }
  14813. onConstruct() {
  14814. this.n0 = (this.getChild("n0"));
  14815. }
  14816. }
  14817. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14818. class ui_Button_login extends fgui.GButton {
  14819. static createInstance() {
  14820. return (fgui.UIPackage.createObject("game", "Button_login"));
  14821. }
  14822. onConstruct() {
  14823. this.button = this.getController("button");
  14824. this.n5 = (this.getChild("n5"));
  14825. this.n3 = (this.getChild("n3"));
  14826. }
  14827. }
  14828. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14829. class ui_Component53_1 extends fgui.GComponent {
  14830. static createInstance() {
  14831. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14832. }
  14833. onConstruct() {
  14834. this.n0 = (this.getChild("n0"));
  14835. this.n1 = (this.getChild("n1"));
  14836. this.n2 = (this.getChild("n2"));
  14837. this.n3 = (this.getChild("n3"));
  14838. this.n4 = (this.getChild("n4"));
  14839. this.n5 = (this.getChild("n5"));
  14840. this.n6 = (this.getChild("n6"));
  14841. this.n7 = (this.getChild("n7"));
  14842. this.n8 = (this.getChild("n8"));
  14843. this.n9 = (this.getChild("n9"));
  14844. this.n10 = (this.getChild("n10"));
  14845. this.n11 = (this.getChild("n11"));
  14846. this.n12 = (this.getChild("n12"));
  14847. this.n13 = (this.getChild("n13"));
  14848. this.n14 = (this.getChild("n14"));
  14849. this.n15 = (this.getChild("n15"));
  14850. this.n16 = (this.getChild("n16"));
  14851. this.n19 = (this.getChild("n19"));
  14852. this.n20 = (this.getChild("n20"));
  14853. this.n21 = (this.getChild("n21"));
  14854. this.n22 = (this.getChild("n22"));
  14855. this.n23 = (this.getChild("n23"));
  14856. this.n24 = (this.getChild("n24"));
  14857. this.n25 = (this.getChild("n25"));
  14858. this.n26 = (this.getChild("n26"));
  14859. this.n27 = (this.getChild("n27"));
  14860. this.n28 = (this.getChild("n28"));
  14861. this.n29 = (this.getChild("n29"));
  14862. this.n30 = (this.getChild("n30"));
  14863. this.n31 = (this.getChild("n31"));
  14864. this.n32 = (this.getChild("n32"));
  14865. this.n33 = (this.getChild("n33"));
  14866. this.n34 = (this.getChild("n34"));
  14867. this.n35 = (this.getChild("n35"));
  14868. this.t0 = this.getTransition("t0");
  14869. }
  14870. }
  14871. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14872. class ui_Component30 extends fgui.GComponent {
  14873. static createInstance() {
  14874. return (fgui.UIPackage.createObject("game", "Component30"));
  14875. }
  14876. onConstruct() {
  14877. this.c1 = this.getController("c1");
  14878. this.n46 = (this.getChild("n46"));
  14879. this.n47 = (this.getChild("n47"));
  14880. this.numTxt = (this.getChild("numTxt"));
  14881. this.n50 = (this.getChild("n50"));
  14882. this.n53 = (this.getChild("n53"));
  14883. this.n54 = (this.getChild("n54"));
  14884. this.n55 = (this.getChild("n55"));
  14885. this.n56 = (this.getChild("n56"));
  14886. }
  14887. }
  14888. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14889. class ui_Component30_1 extends fgui.GComponent {
  14890. static createInstance() {
  14891. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14892. }
  14893. onConstruct() {
  14894. this.c1 = this.getController("c1");
  14895. this.n46 = (this.getChild("n46"));
  14896. this.n47 = (this.getChild("n47"));
  14897. this.numTxt = (this.getChild("numTxt"));
  14898. this.n50 = (this.getChild("n50"));
  14899. this.n51 = (this.getChild("n51"));
  14900. this.n52 = (this.getChild("n52"));
  14901. this.n53 = (this.getChild("n53"));
  14902. this.n54 = (this.getChild("n54"));
  14903. }
  14904. }
  14905. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14906. class ui_Component31 extends fgui.GComponent {
  14907. static createInstance() {
  14908. return (fgui.UIPackage.createObject("game", "Component31"));
  14909. }
  14910. onConstruct() {
  14911. this.n55 = (this.getChild("n55"));
  14912. this.n54 = (this.getChild("n54"));
  14913. this.conditionTxt = (this.getChild("conditionTxt"));
  14914. this.n57 = (this.getChild("n57"));
  14915. this.t0 = this.getTransition("t0");
  14916. }
  14917. }
  14918. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14919. class ui_Component32 extends fgui.GComponent {
  14920. static createInstance() {
  14921. return (fgui.UIPackage.createObject("game", "Component32"));
  14922. }
  14923. onConstruct() {
  14924. this.n5 = (this.getChild("n5"));
  14925. this.n6 = (this.getChild("n6"));
  14926. this.n7 = (this.getChild("n7"));
  14927. this.t0 = this.getTransition("t0");
  14928. }
  14929. }
  14930. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14931. class ui_AwardItem extends fgui.GComponent {
  14932. static createInstance() {
  14933. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14934. }
  14935. onConstruct() {
  14936. this.n9 = (this.getChild("n9"));
  14937. this.myIcon = (this.getChild("myIcon"));
  14938. this.numTxt = (this.getChild("numTxt"));
  14939. this.nameTxt = (this.getChild("nameTxt"));
  14940. this.n16 = (this.getChild("n16"));
  14941. this.n17 = (this.getChild("n17"));
  14942. }
  14943. }
  14944. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14945. class ui_ranking_com1 extends fgui.GButton {
  14946. static createInstance() {
  14947. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14948. }
  14949. onConstruct() {
  14950. this.c1 = this.getController("c1");
  14951. this.n49 = (this.getChild("n49"));
  14952. this.n18 = (this.getChild("n18"));
  14953. this.n46 = (this.getChild("n46"));
  14954. this.n48 = (this.getChild("n48"));
  14955. this.n50 = (this.getChild("n50"));
  14956. }
  14957. }
  14958. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14959. class ui_ranking_com2 extends fgui.GButton {
  14960. static createInstance() {
  14961. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14962. }
  14963. onConstruct() {
  14964. this.c1 = this.getController("c1");
  14965. this.n49 = (this.getChild("n49"));
  14966. this.n18 = (this.getChild("n18"));
  14967. this.n46 = (this.getChild("n46"));
  14968. this.n48 = (this.getChild("n48"));
  14969. this.n50 = (this.getChild("n50"));
  14970. }
  14971. }
  14972. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14973. class ui_ranking_com3 extends fgui.GComponent {
  14974. static createInstance() {
  14975. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14976. }
  14977. onConstruct() {
  14978. this.n17 = (this.getChild("n17"));
  14979. this.myIcon = (this.getChild("myIcon"));
  14980. }
  14981. }
  14982. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14983. class ui_ranking_com4 extends fgui.GComponent {
  14984. static createInstance() {
  14985. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14986. }
  14987. onConstruct() {
  14988. this.n16 = (this.getChild("n16"));
  14989. this.head = (this.getChild("head"));
  14990. }
  14991. }
  14992. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14993. class ui_ranking_com5 extends fgui.GComponent {
  14994. static createInstance() {
  14995. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14996. }
  14997. onConstruct() {
  14998. this.c1 = this.getController("c1");
  14999. this.c2 = this.getController("c2");
  15000. this.n2 = (this.getChild("n2"));
  15001. this.n3 = (this.getChild("n3"));
  15002. this.levelBtn = (this.getChild("levelBtn"));
  15003. this.starBtn = (this.getChild("starBtn"));
  15004. this.n23 = (this.getChild("n23"));
  15005. this.n24 = (this.getChild("n24"));
  15006. this.n25 = (this.getChild("n25"));
  15007. this.myList = (this.getChild("myList"));
  15008. this.selfNode = (this.getChild("selfNode"));
  15009. this.n9 = (this.getChild("n9"));
  15010. this.n12 = (this.getChild("n12"));
  15011. this.n13 = (this.getChild("n13"));
  15012. this.n14 = (this.getChild("n14"));
  15013. this.n39 = (this.getChild("n39"));
  15014. this.n41 = (this.getChild("n41"));
  15015. this.n42 = (this.getChild("n42"));
  15016. this.n45 = (this.getChild("n45"));
  15017. this.changeBtn = (this.getChild("changeBtn"));
  15018. this.closeBtn = (this.getChild("closeBtn"));
  15019. this.t0 = this.getTransition("t0");
  15020. }
  15021. }
  15022. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15023. class ui_RankItem extends fgui.GComponent {
  15024. static createInstance() {
  15025. return (fgui.UIPackage.createObject("game", "RankItem"));
  15026. }
  15027. onConstruct() {
  15028. this.n10 = (this.getChild("n10"));
  15029. this.n11 = (this.getChild("n11"));
  15030. this.rankTxt = (this.getChild("rankTxt"));
  15031. this.headNode = (this.getChild("headNode"));
  15032. this.nameTxt = (this.getChild("nameTxt"));
  15033. this.n19 = (this.getChild("n19"));
  15034. this.valueTxt = (this.getChild("valueTxt"));
  15035. this.img1 = (this.getChild("img1"));
  15036. this.img2 = (this.getChild("img2"));
  15037. this.img3 = (this.getChild("img3"));
  15038. }
  15039. }
  15040. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15041. class ui_ranking_com9 extends fgui.GComponent {
  15042. static createInstance() {
  15043. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15044. }
  15045. onConstruct() {
  15046. this.c1 = this.getController("c1");
  15047. this.n27 = (this.getChild("n27"));
  15048. this.n28 = (this.getChild("n28"));
  15049. this.headNode = (this.getChild("headNode"));
  15050. this.rankTxt = (this.getChild("rankTxt"));
  15051. this.nameTxt = (this.getChild("nameTxt"));
  15052. this.n34 = (this.getChild("n34"));
  15053. this.valueTxt = (this.getChild("valueTxt"));
  15054. this.n36 = (this.getChild("n36"));
  15055. this.n37 = (this.getChild("n37"));
  15056. this.n38 = (this.getChild("n38"));
  15057. this.n39 = (this.getChild("n39"));
  15058. this.n40 = (this.getChild("n40"));
  15059. }
  15060. }
  15061. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15062. class ui_ranking_com10 extends fgui.GComponent {
  15063. static createInstance() {
  15064. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15065. }
  15066. onConstruct() {
  15067. this.n23 = (this.getChild("n23"));
  15068. this.n24 = (this.getChild("n24"));
  15069. }
  15070. }
  15071. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15072. class ui_ranking_com11 extends fgui.GComponent {
  15073. static createInstance() {
  15074. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15075. }
  15076. onConstruct() {
  15077. this.n24 = (this.getChild("n24"));
  15078. this.n25 = (this.getChild("n25"));
  15079. this.t0 = this.getTransition("t0");
  15080. }
  15081. }
  15082. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15083. class ui_ranking_com13 extends fgui.GButton {
  15084. static createInstance() {
  15085. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15086. }
  15087. onConstruct() {
  15088. this.c1 = this.getController("c1");
  15089. this.n44 = (this.getChild("n44"));
  15090. this.n45 = (this.getChild("n45"));
  15091. this.n46 = (this.getChild("n46"));
  15092. }
  15093. }
  15094. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15095. class ui_Component_dl_zc extends fgui.GButton {
  15096. static createInstance() {
  15097. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  15098. }
  15099. onConstruct() {
  15100. this.c1 = this.getController("c1");
  15101. this.n0 = (this.getChild("n0"));
  15102. }
  15103. }
  15104. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  15105. class ui_Component122 extends fgui.GComponent {
  15106. static createInstance() {
  15107. return (fgui.UIPackage.createObject("game", "Component122"));
  15108. }
  15109. onConstruct() {
  15110. this.gameNode3 = (this.getChild("gameNode3"));
  15111. }
  15112. }
  15113. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15114. class ui_skillItem extends fgui.GComponent {
  15115. static createInstance() {
  15116. return (fgui.UIPackage.createObject("game", "skillItem"));
  15117. }
  15118. onConstruct() {
  15119. this.c1 = this.getController("c1");
  15120. this.n31 = (this.getChild("n31"));
  15121. this.n6 = (this.getChild("n6"));
  15122. this.skillImg = (this.getChild("skillImg"));
  15123. this.nameTxt = (this.getChild("nameTxt"));
  15124. this.levelTxt = (this.getChild("levelTxt"));
  15125. this.n28 = (this.getChild("n28"));
  15126. this.describeTxt = (this.getChild("describeTxt"));
  15127. this.n32 = (this.getChild("n32"));
  15128. this.mutiBtn = (this.getChild("mutiBtn"));
  15129. this.tryNode = (this.getChild("tryNode"));
  15130. this.normalBtn = (this.getChild("normalBtn"));
  15131. this.startBtn = (this.getChild("startBtn"));
  15132. this.n42 = (this.getChild("n42"));
  15133. this.n43 = (this.getChild("n43"));
  15134. this.n44 = (this.getChild("n44"));
  15135. }
  15136. }
  15137. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15138. class ui_Component26 extends fgui.GButton {
  15139. static createInstance() {
  15140. return (fgui.UIPackage.createObject("game", "Component26"));
  15141. }
  15142. onConstruct() {
  15143. this.n11 = (this.getChild("n11"));
  15144. this.n30 = (this.getChild("n30"));
  15145. this.n34 = (this.getChild("n34"));
  15146. }
  15147. }
  15148. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15149. class ui_Component28 extends fgui.GButton {
  15150. static createInstance() {
  15151. return (fgui.UIPackage.createObject("game", "Component28"));
  15152. }
  15153. onConstruct() {
  15154. this.n12 = (this.getChild("n12"));
  15155. this.n31 = (this.getChild("n31"));
  15156. this.curTxt = (this.getChild("curTxt"));
  15157. this.n33 = (this.getChild("n33"));
  15158. }
  15159. }
  15160. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15161. class ui_Component1302 extends fgui.GComponent {
  15162. static createInstance() {
  15163. return (fgui.UIPackage.createObject("game", "Component1302"));
  15164. }
  15165. onConstruct() {
  15166. this.n2 = (this.getChild("n2"));
  15167. this.n3 = (this.getChild("n3"));
  15168. }
  15169. }
  15170. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15171. class ui_Component113 extends fgui.GComponent {
  15172. static createInstance() {
  15173. return (fgui.UIPackage.createObject("game", "Component113"));
  15174. }
  15175. onConstruct() {
  15176. this.n85 = (this.getChild("n85"));
  15177. this.n86 = (this.getChild("n86"));
  15178. this.n77 = (this.getChild("n77"));
  15179. this.n79 = (this.getChild("n79"));
  15180. this.n80 = (this.getChild("n80"));
  15181. this.n81 = (this.getChild("n81"));
  15182. this.n82 = (this.getChild("n82"));
  15183. this.n84 = (this.getChild("n84"));
  15184. this.n87 = (this.getChild("n87"));
  15185. this.t0 = this.getTransition("t0");
  15186. }
  15187. }
  15188. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15189. class ui_Component114 extends fgui.GComponent {
  15190. static createInstance() {
  15191. return (fgui.UIPackage.createObject("game", "Component114"));
  15192. }
  15193. onConstruct() {
  15194. this.n77 = (this.getChild("n77"));
  15195. this.t0 = this.getTransition("t0");
  15196. }
  15197. }
  15198. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15199. class ui_Component115 extends fgui.GComponent {
  15200. static createInstance() {
  15201. return (fgui.UIPackage.createObject("game", "Component115"));
  15202. }
  15203. onConstruct() {
  15204. this.n83 = (this.getChild("n83"));
  15205. this.fingerNode = (this.getChild("fingerNode"));
  15206. this.n84 = (this.getChild("n84"));
  15207. }
  15208. }
  15209. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15210. class ui_Component117 extends fgui.GComponent {
  15211. static createInstance() {
  15212. return (fgui.UIPackage.createObject("game", "Component117"));
  15213. }
  15214. onConstruct() {
  15215. this.n87 = (this.getChild("n87"));
  15216. this.n88 = (this.getChild("n88"));
  15217. this.n84 = (this.getChild("n84"));
  15218. this.n85 = (this.getChild("n85"));
  15219. this.n86 = (this.getChild("n86"));
  15220. this.t0 = this.getTransition("t0");
  15221. }
  15222. }
  15223. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15224. class ui_Component98_1 extends fgui.GButton {
  15225. static createInstance() {
  15226. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15227. }
  15228. onConstruct() {
  15229. this.c1 = this.getController("c1");
  15230. this.n8 = (this.getChild("n8"));
  15231. this.n41 = (this.getChild("n41"));
  15232. this.n40 = (this.getChild("n40"));
  15233. }
  15234. }
  15235. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15236. class ui_Component61 extends fgui.GComponent {
  15237. static createInstance() {
  15238. return (fgui.UIPackage.createObject("game", "Component61"));
  15239. }
  15240. onConstruct() {
  15241. this.n14 = (this.getChild("n14"));
  15242. this.n6 = (this.getChild("n6"));
  15243. this.t0 = this.getTransition("t0");
  15244. }
  15245. }
  15246. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15247. class ui_Component62 extends fgui.GComponent {
  15248. static createInstance() {
  15249. return (fgui.UIPackage.createObject("game", "Component62"));
  15250. }
  15251. onConstruct() {
  15252. this.n66 = (this.getChild("n66"));
  15253. this.n56 = (this.getChild("n56"));
  15254. this.n63 = (this.getChild("n63"));
  15255. this.n65 = (this.getChild("n65"));
  15256. this.t0 = this.getTransition("t0");
  15257. }
  15258. }
  15259. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15260. class ui_d3Root extends fgui.GComponent {
  15261. static createInstance() {
  15262. return (fgui.UIPackage.createObject("game", "d3Root"));
  15263. }
  15264. onConstruct() {
  15265. }
  15266. }
  15267. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15268. class ui_d2Root extends fgui.GComponent {
  15269. static createInstance() {
  15270. return (fgui.UIPackage.createObject("game", "d2Root"));
  15271. }
  15272. onConstruct() {
  15273. }
  15274. }
  15275. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15276. class ui_ballNode extends fgui.GComponent {
  15277. static createInstance() {
  15278. return (fgui.UIPackage.createObject("game", "ballNode"));
  15279. }
  15280. onConstruct() {
  15281. }
  15282. }
  15283. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15284. class ui_border extends fgui.GComponent {
  15285. static createInstance() {
  15286. return (fgui.UIPackage.createObject("game", "border"));
  15287. }
  15288. onConstruct() {
  15289. this.bar1 = (this.getChild("bar1"));
  15290. this.bar2 = (this.getChild("bar2"));
  15291. this.bar3 = (this.getChild("bar3"));
  15292. this.bar4 = (this.getChild("bar4"));
  15293. this.bar5 = (this.getChild("bar5"));
  15294. this.bar6 = (this.getChild("bar6"));
  15295. this.circle1 = (this.getChild("circle1"));
  15296. this.circle2 = (this.getChild("circle2"));
  15297. this.circle3 = (this.getChild("circle3"));
  15298. this.circle4 = (this.getChild("circle4"));
  15299. this.circle5 = (this.getChild("circle5"));
  15300. this.circle6 = (this.getChild("circle6"));
  15301. this.n28 = (this.getChild("n28"));
  15302. }
  15303. }
  15304. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15305. class ui_btn_buy extends fgui.GButton {
  15306. static createInstance() {
  15307. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15308. }
  15309. onConstruct() {
  15310. this.button = this.getController("button");
  15311. this.n0 = (this.getChild("n0"));
  15312. this.n1 = (this.getChild("n1"));
  15313. this.n2 = (this.getChild("n2"));
  15314. }
  15315. }
  15316. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15317. class ui_Component41_2 extends fgui.GComponent {
  15318. static createInstance() {
  15319. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15320. }
  15321. onConstruct() {
  15322. this.c1 = this.getController("c1");
  15323. this.n0 = (this.getChild("n0"));
  15324. this.n2 = (this.getChild("n2"));
  15325. this.n19 = (this.getChild("n19"));
  15326. this.cancelBtn = (this.getChild("cancelBtn"));
  15327. this.videoBtn = (this.getChild("videoBtn"));
  15328. this.n9 = (this.getChild("n9"));
  15329. this.n22 = (this.getChild("n22"));
  15330. this.tipsTxt = (this.getChild("tipsTxt"));
  15331. this.n23 = (this.getChild("n23"));
  15332. this.n24 = (this.getChild("n24"));
  15333. this.n26 = (this.getChild("n26"));
  15334. this.n27 = (this.getChild("n27"));
  15335. this.titleTxt = (this.getChild("titleTxt"));
  15336. }
  15337. }
  15338. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15339. class ui_Component41_1 extends fgui.GComponent {
  15340. static createInstance() {
  15341. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15342. }
  15343. onConstruct() {
  15344. this.c1 = this.getController("c1");
  15345. this.n0 = (this.getChild("n0"));
  15346. this.n2 = (this.getChild("n2"));
  15347. this.cancelBtn = (this.getChild("cancelBtn"));
  15348. this.videoBtn = (this.getChild("videoBtn"));
  15349. this.n27 = (this.getChild("n27"));
  15350. this.n30 = (this.getChild("n30"));
  15351. this.n31 = (this.getChild("n31"));
  15352. this.n32 = (this.getChild("n32"));
  15353. this.n33 = (this.getChild("n33"));
  15354. this.n34 = (this.getChild("n34"));
  15355. this.n35 = (this.getChild("n35"));
  15356. this.n36 = (this.getChild("n36"));
  15357. this.n1 = (this.getChild("n1"));
  15358. this.n37 = (this.getChild("n37"));
  15359. this.t0 = this.getTransition("t0");
  15360. this.t1 = this.getTransition("t1");
  15361. this.t2 = this.getTransition("t2");
  15362. this.t3 = this.getTransition("t3");
  15363. }
  15364. }
  15365. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15366. class ui_againBtn extends fgui.GButton {
  15367. static createInstance() {
  15368. return (fgui.UIPackage.createObject("game", "againBtn"));
  15369. }
  15370. onConstruct() {
  15371. this.n2 = (this.getChild("n2"));
  15372. this.n1 = (this.getChild("n1"));
  15373. this.n5 = (this.getChild("n5"));
  15374. }
  15375. }
  15376. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15377. class ui_Component118 extends fgui.GButton {
  15378. static createInstance() {
  15379. return (fgui.UIPackage.createObject("game", "Component118"));
  15380. }
  15381. onConstruct() {
  15382. this.c1 = this.getController("c1");
  15383. this.n14 = (this.getChild("n14"));
  15384. this.n9 = (this.getChild("n9"));
  15385. this.n10 = (this.getChild("n10"));
  15386. this.diamondTxt = (this.getChild("diamondTxt"));
  15387. this.n13 = (this.getChild("n13"));
  15388. this.n15 = (this.getChild("n15"));
  15389. }
  15390. }
  15391. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15392. class ui_Component119 extends fgui.GComponent {
  15393. static createInstance() {
  15394. return (fgui.UIPackage.createObject("game", "Component119"));
  15395. }
  15396. onConstruct() {
  15397. this.n1 = (this.getChild("n1"));
  15398. this.n2 = (this.getChild("n2"));
  15399. this.n13 = (this.getChild("n13"));
  15400. this.n6 = (this.getChild("n6"));
  15401. this.screenNode = (this.getChild("screenNode"));
  15402. this.n15 = (this.getChild("n15"));
  15403. this.closeBtn = (this.getChild("closeBtn"));
  15404. this.share2Btn = (this.getChild("share2Btn"));
  15405. this.shareBtn = (this.getChild("shareBtn"));
  15406. this.tipsNode = (this.getChild("tipsNode"));
  15407. this.awardNode = (this.getChild("awardNode"));
  15408. }
  15409. }
  15410. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15411. class ui_daoJuDisplay extends fgui.GComponent {
  15412. static createInstance() {
  15413. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15414. }
  15415. onConstruct() {
  15416. this.n6 = (this.getChild("n6"));
  15417. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15418. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15419. this.btn_buy = (this.getChild("btn_buy"));
  15420. this.nameTxt = (this.getChild("nameTxt"));
  15421. this.zsImg = (this.getChild("zsImg"));
  15422. }
  15423. }
  15424. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15425. class ui_Component132_1 extends fgui.GComponent {
  15426. static createInstance() {
  15427. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15428. }
  15429. onConstruct() {
  15430. this.n25 = (this.getChild("n25"));
  15431. this.n26 = (this.getChild("n26"));
  15432. this.n27 = (this.getChild("n27"));
  15433. this.t0 = this.getTransition("t0");
  15434. }
  15435. }
  15436. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15437. class ui_SecretaryDisplay extends fgui.GComponent {
  15438. static createInstance() {
  15439. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15440. }
  15441. onConstruct() {
  15442. this.n2 = (this.getChild("n2"));
  15443. this.levelTxt = (this.getChild("levelTxt"));
  15444. this.n4 = (this.getChild("n4"));
  15445. this.secretary = (this.getChild("secretary"));
  15446. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15447. this.n16 = (this.getChild("n16"));
  15448. this.n37 = (this.getChild("n37"));
  15449. this.n41 = (this.getChild("n41"));
  15450. this.n14 = (this.getChild("n14"));
  15451. this.n17 = (this.getChild("n17"));
  15452. this.heightTxt = (this.getChild("heightTxt"));
  15453. this.n46 = (this.getChild("n46"));
  15454. this.n36 = (this.getChild("n36"));
  15455. this.n38 = (this.getChild("n38"));
  15456. this.foodTxt = (this.getChild("foodTxt"));
  15457. this.n47 = (this.getChild("n47"));
  15458. this.n40 = (this.getChild("n40"));
  15459. this.n42 = (this.getChild("n42"));
  15460. this.historyTxt = (this.getChild("historyTxt"));
  15461. this.n48 = (this.getChild("n48"));
  15462. this.nameImg = (this.getChild("nameImg"));
  15463. this.n12 = (this.getChild("n12"));
  15464. this.n49 = (this.getChild("n49"));
  15465. this.t0 = this.getTransition("t0");
  15466. }
  15467. }
  15468. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15469. class ui_BallRodDisplay extends fgui.GComponent {
  15470. static createInstance() {
  15471. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15472. }
  15473. onConstruct() {
  15474. this.c1 = this.getController("c1");
  15475. this.n31 = (this.getChild("n31"));
  15476. this.n6 = (this.getChild("n6"));
  15477. this.nameTxt = (this.getChild("nameTxt"));
  15478. this.rodImg = (this.getChild("rodImg"));
  15479. this.eftRod = (this.getChild("eftRod"));
  15480. this.levelNode = (this.getChild("levelNode"));
  15481. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15482. }
  15483. }
  15484. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15485. class ui_Component111_11 extends fgui.GComponent {
  15486. static createInstance() {
  15487. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15488. }
  15489. onConstruct() {
  15490. this.n68 = (this.getChild("n68"));
  15491. this.n69 = (this.getChild("n69"));
  15492. }
  15493. }
  15494. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15495. class ui_Component112 extends fgui.GComponent {
  15496. static createInstance() {
  15497. return (fgui.UIPackage.createObject("game", "Component112"));
  15498. }
  15499. onConstruct() {
  15500. this.n68 = (this.getChild("n68"));
  15501. this.n70 = (this.getChild("n70"));
  15502. this.myMask = (this.getChild("myMask"));
  15503. }
  15504. }
  15505. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15506. class ui_Component111 extends fgui.GComponent {
  15507. static createInstance() {
  15508. return (fgui.UIPackage.createObject("game", "Component111"));
  15509. }
  15510. onConstruct() {
  15511. this.n68 = (this.getChild("n68"));
  15512. this.myMask = (this.getChild("myMask"));
  15513. }
  15514. }
  15515. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15516. class ui_Component144 extends fgui.GButton {
  15517. static createInstance() {
  15518. return (fgui.UIPackage.createObject("game", "Component144"));
  15519. }
  15520. onConstruct() {
  15521. this.n8 = (this.getChild("n8"));
  15522. }
  15523. }
  15524. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15525. class ui_Sign_com2 extends fgui.GComponent {
  15526. static createInstance() {
  15527. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15528. }
  15529. onConstruct() {
  15530. this.n0 = (this.getChild("n0"));
  15531. this.n1 = (this.getChild("n1"));
  15532. this.t0 = this.getTransition("t0");
  15533. }
  15534. }
  15535. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15536. class ui_Sign_guang extends fgui.GComponent {
  15537. static createInstance() {
  15538. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15539. }
  15540. onConstruct() {
  15541. this.n1 = (this.getChild("n1"));
  15542. this.n2 = (this.getChild("n2"));
  15543. this.n3 = (this.getChild("n3"));
  15544. this.n4 = (this.getChild("n4"));
  15545. this.n5 = (this.getChild("n5"));
  15546. this.n6 = (this.getChild("n6"));
  15547. this.n8 = (this.getChild("n8"));
  15548. }
  15549. }
  15550. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15551. class ui_SignMax extends fgui.GComponent {
  15552. static createInstance() {
  15553. return (fgui.UIPackage.createObject("game", "SignMax"));
  15554. }
  15555. onConstruct() {
  15556. this.c1 = this.getController("c1");
  15557. this.n7 = (this.getChild("n7"));
  15558. this.n15 = (this.getChild("n15"));
  15559. this.n8 = (this.getChild("n8"));
  15560. this.titleTxt = (this.getChild("titleTxt"));
  15561. this.myIcon1 = (this.getChild("myIcon1"));
  15562. this.numTxt1 = (this.getChild("numTxt1"));
  15563. this.myIcon2 = (this.getChild("myIcon2"));
  15564. this.n20 = (this.getChild("n20"));
  15565. this.n17 = (this.getChild("n17"));
  15566. this.numTxt2 = (this.getChild("numTxt2"));
  15567. this.n12 = (this.getChild("n12"));
  15568. this.n13 = (this.getChild("n13"));
  15569. this.n21 = (this.getChild("n21"));
  15570. this.n14 = (this.getChild("n14"));
  15571. }
  15572. }
  15573. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15574. class ui_Sign_com2_1 extends fgui.GComponent {
  15575. static createInstance() {
  15576. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15577. }
  15578. onConstruct() {
  15579. this.n0 = (this.getChild("n0"));
  15580. this.n1 = (this.getChild("n1"));
  15581. this.t0 = this.getTransition("t0");
  15582. }
  15583. }
  15584. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15585. class ui_Sign_com5 extends fgui.GComponent {
  15586. static createInstance() {
  15587. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15588. }
  15589. onConstruct() {
  15590. this.n3 = (this.getChild("n3"));
  15591. this.n29 = (this.getChild("n29"));
  15592. this.n4 = (this.getChild("n4"));
  15593. this.day1 = (this.getChild("day1"));
  15594. this.day2 = (this.getChild("day2"));
  15595. this.day3 = (this.getChild("day3"));
  15596. this.day4 = (this.getChild("day4"));
  15597. this.day5 = (this.getChild("day5"));
  15598. this.day6 = (this.getChild("day6"));
  15599. this.day7 = (this.getChild("day7"));
  15600. this.t0 = this.getTransition("t0");
  15601. }
  15602. }
  15603. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15604. class ui_Sign_com8 extends fgui.GComponent {
  15605. static createInstance() {
  15606. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15607. }
  15608. onConstruct() {
  15609. this.n48 = (this.getChild("n48"));
  15610. this.womanTxt = (this.getChild("womanTxt"));
  15611. this.t0 = this.getTransition("t0");
  15612. }
  15613. }
  15614. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15615. class ui_Sign_com6 extends fgui.GComponent {
  15616. static createInstance() {
  15617. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15618. }
  15619. onConstruct() {
  15620. this.n2 = (this.getChild("n2"));
  15621. this.n3 = (this.getChild("n3"));
  15622. this.t0 = this.getTransition("t0");
  15623. }
  15624. }
  15625. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15626. class ui_Sign_com7 extends fgui.GComponent {
  15627. static createInstance() {
  15628. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15629. }
  15630. onConstruct() {
  15631. this.n29 = (this.getChild("n29"));
  15632. this.n2 = (this.getChild("n2"));
  15633. }
  15634. }
  15635. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15636. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15637. static createInstance() {
  15638. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15639. }
  15640. onConstruct() {
  15641. this.n5 = (this.getChild("n5"));
  15642. this.n4 = (this.getChild("n4"));
  15643. this.t0 = this.getTransition("t0");
  15644. }
  15645. }
  15646. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15647. class ui_UITurntable_com2 extends fgui.GComponent {
  15648. static createInstance() {
  15649. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15650. }
  15651. onConstruct() {
  15652. this.c1 = this.getController("c1");
  15653. this.n4 = (this.getChild("n4"));
  15654. this.n6 = (this.getChild("n6"));
  15655. this.n10 = (this.getChild("n10"));
  15656. this.n11 = (this.getChild("n11"));
  15657. this.n12 = (this.getChild("n12"));
  15658. this.n13 = (this.getChild("n13"));
  15659. this.n14 = (this.getChild("n14"));
  15660. this.n15 = (this.getChild("n15"));
  15661. this.n16 = (this.getChild("n16"));
  15662. this.n17 = (this.getChild("n17"));
  15663. this.n18 = (this.getChild("n18"));
  15664. this.n19 = (this.getChild("n19"));
  15665. this.n20 = (this.getChild("n20"));
  15666. this.n21 = (this.getChild("n21"));
  15667. this.n22 = (this.getChild("n22"));
  15668. this.n23 = (this.getChild("n23"));
  15669. this.n24 = (this.getChild("n24"));
  15670. this.n25 = (this.getChild("n25"));
  15671. this.n26 = (this.getChild("n26"));
  15672. this.n27 = (this.getChild("n27"));
  15673. this.n28 = (this.getChild("n28"));
  15674. this.n29 = (this.getChild("n29"));
  15675. this.n30 = (this.getChild("n30"));
  15676. this.n31 = (this.getChild("n31"));
  15677. this.n32 = (this.getChild("n32"));
  15678. this.n33 = (this.getChild("n33"));
  15679. }
  15680. }
  15681. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15682. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15683. static createInstance() {
  15684. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15685. }
  15686. onConstruct() {
  15687. this.n5 = (this.getChild("n5"));
  15688. this.n4 = (this.getChild("n4"));
  15689. this.t0 = this.getTransition("t0");
  15690. }
  15691. }
  15692. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15693. class ui_UITurntable_com5 extends fgui.GComponent {
  15694. static createInstance() {
  15695. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15696. }
  15697. onConstruct() {
  15698. this.flashNode = (this.getChild("flashNode"));
  15699. this.rotNode = (this.getChild("rotNode"));
  15700. this.n3 = (this.getChild("n3"));
  15701. this.n21 = (this.getChild("n21"));
  15702. this.t0 = this.getTransition("t0");
  15703. }
  15704. }
  15705. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15706. class ui_UITurntable_com7 extends fgui.GComponent {
  15707. static createInstance() {
  15708. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15709. }
  15710. onConstruct() {
  15711. this.n2 = (this.getChild("n2"));
  15712. this.n35 = (this.getChild("n35"));
  15713. this.img1 = (this.getChild("img1"));
  15714. this.img2 = (this.getChild("img2"));
  15715. this.img3 = (this.getChild("img3"));
  15716. this.img4 = (this.getChild("img4"));
  15717. this.img6 = (this.getChild("img6"));
  15718. this.img5 = (this.getChild("img5"));
  15719. this.txt1 = (this.getChild("txt1"));
  15720. this.txt2 = (this.getChild("txt2"));
  15721. this.txt3 = (this.getChild("txt3"));
  15722. this.txt4 = (this.getChild("txt4"));
  15723. this.txt5 = (this.getChild("txt5"));
  15724. this.txt6 = (this.getChild("txt6"));
  15725. }
  15726. }
  15727. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15728. class ui_UITurntable_com9 extends fgui.GComponent {
  15729. static createInstance() {
  15730. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15731. }
  15732. onConstruct() {
  15733. this.n38 = (this.getChild("n38"));
  15734. this.n39 = (this.getChild("n39"));
  15735. }
  15736. }
  15737. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15738. class ui_UITurntable_com10 extends fgui.GComponent {
  15739. static createInstance() {
  15740. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15741. }
  15742. onConstruct() {
  15743. this.n39 = (this.getChild("n39"));
  15744. this.n40 = (this.getChild("n40"));
  15745. this.t0 = this.getTransition("t0");
  15746. }
  15747. }
  15748. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15749. class ui_UITurntable_com11 extends fgui.GComponent {
  15750. static createInstance() {
  15751. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15752. }
  15753. onConstruct() {
  15754. this.n38 = (this.getChild("n38"));
  15755. this.n39 = (this.getChild("n39"));
  15756. this.n40 = (this.getChild("n40"));
  15757. this.t0 = this.getTransition("t0");
  15758. }
  15759. }
  15760. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15761. class ui_UITurntable_com12 extends fgui.GComponent {
  15762. static createInstance() {
  15763. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15764. }
  15765. onConstruct() {
  15766. this.n43 = (this.getChild("n43"));
  15767. this.barNode = (this.getChild("barNode"));
  15768. this.tipsTxt = (this.getChild("tipsTxt"));
  15769. this.n45 = (this.getChild("n45"));
  15770. this.boxBtn = (this.getChild("boxBtn"));
  15771. }
  15772. }
  15773. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15774. class ui_UITurntable_com1 extends fgui.GButton {
  15775. static createInstance() {
  15776. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15777. }
  15778. onConstruct() {
  15779. this.n41 = (this.getChild("n41"));
  15780. this.n42 = (this.getChild("n42"));
  15781. this.t0 = this.getTransition("t0");
  15782. }
  15783. }
  15784. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15785. class ui_UITurntable_com3 extends fgui.GComponent {
  15786. static createInstance() {
  15787. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15788. }
  15789. onConstruct() {
  15790. this.n48 = (this.getChild("n48"));
  15791. this.womanTxt = (this.getChild("womanTxt"));
  15792. this.t0 = this.getTransition("t0");
  15793. }
  15794. }
  15795. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15796. class ui_cancelBtn2 extends fgui.GButton {
  15797. static createInstance() {
  15798. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15799. }
  15800. onConstruct() {
  15801. this.c1 = this.getController("c1");
  15802. this.n0 = (this.getChild("n0"));
  15803. this.n1 = (this.getChild("n1"));
  15804. this.n2 = (this.getChild("n2"));
  15805. this.n3 = (this.getChild("n3"));
  15806. this.n4 = (this.getChild("n4"));
  15807. this.n5 = (this.getChild("n5"));
  15808. this.n6 = (this.getChild("n6"));
  15809. this.n7 = (this.getChild("n7"));
  15810. this.n8 = (this.getChild("n8"));
  15811. this.powerEft = (this.getChild("powerEft"));
  15812. }
  15813. }
  15814. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15815. class ui_shareBtn2 extends fgui.GButton {
  15816. static createInstance() {
  15817. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15818. }
  15819. onConstruct() {
  15820. this.c1 = this.getController("c1");
  15821. this.n2 = (this.getChild("n2"));
  15822. this.n24 = (this.getChild("n24"));
  15823. this.n1 = (this.getChild("n1"));
  15824. this.n3 = (this.getChild("n3"));
  15825. this.n23 = (this.getChild("n23"));
  15826. this.n4 = (this.getChild("n4"));
  15827. this.n5 = (this.getChild("n5"));
  15828. this.n6 = (this.getChild("n6"));
  15829. this.n20 = (this.getChild("n20"));
  15830. this.n21 = (this.getChild("n21"));
  15831. this.n22 = (this.getChild("n22"));
  15832. this.powerEft = (this.getChild("powerEft"));
  15833. }
  15834. }
  15835. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15836. class ui_UIMoney extends fgui.GComponent {
  15837. static createInstance() {
  15838. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15839. }
  15840. onConstruct() {
  15841. this.c1 = this.getController("c1");
  15842. this.n4 = (this.getChild("n4"));
  15843. this.coinImg = (this.getChild("coinImg"));
  15844. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15845. this.coinTxt = (this.getChild("coinTxt"));
  15846. this.n7 = (this.getChild("n7"));
  15847. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15848. this.diamondTxt = (this.getChild("diamondTxt"));
  15849. this.diamondImg = (this.getChild("diamondImg"));
  15850. this.n12 = (this.getChild("n12"));
  15851. this.powerImg = (this.getChild("powerImg"));
  15852. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15853. this.powerTxt = (this.getChild("powerTxt"));
  15854. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15855. }
  15856. }
  15857. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15858. class ui_backBtn extends fgui.GButton {
  15859. static createInstance() {
  15860. return (fgui.UIPackage.createObject("game", "backBtn"));
  15861. }
  15862. onConstruct() {
  15863. this.n0 = (this.getChild("n0"));
  15864. this.t0 = this.getTransition("t0");
  15865. this.t1 = this.getTransition("t1");
  15866. }
  15867. }
  15868. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15869. class ui_MoneyBtn extends fgui.GButton {
  15870. static createInstance() {
  15871. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15872. }
  15873. onConstruct() {
  15874. this.button = this.getController("button");
  15875. this.n0 = (this.getChild("n0"));
  15876. }
  15877. }
  15878. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15879. class ui_UIMoneyBtn extends fgui.GComponent {
  15880. static createInstance() {
  15881. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15882. }
  15883. onConstruct() {
  15884. this.n1 = (this.getChild("n1"));
  15885. this.closeBtn = (this.getChild("closeBtn"));
  15886. }
  15887. }
  15888. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15889. class ui_Component64 extends fgui.GComponent {
  15890. static createInstance() {
  15891. return (fgui.UIPackage.createObject("game", "Component64"));
  15892. }
  15893. onConstruct() {
  15894. this.n57 = (this.getChild("n57"));
  15895. this.n54 = (this.getChild("n54"));
  15896. this.n55 = (this.getChild("n55"));
  15897. this.n56 = (this.getChild("n56"));
  15898. this.t1 = this.getTransition("t1");
  15899. }
  15900. }
  15901. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15902. class ui_Component41_3 extends fgui.GComponent {
  15903. static createInstance() {
  15904. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15905. }
  15906. onConstruct() {
  15907. this.c1 = this.getController("c1");
  15908. this.n0 = (this.getChild("n0"));
  15909. this.n2 = (this.getChild("n2"));
  15910. this.cancelBtn = (this.getChild("cancelBtn"));
  15911. this.videoBtn = (this.getChild("videoBtn"));
  15912. this.n9 = (this.getChild("n9"));
  15913. this.n24 = (this.getChild("n24"));
  15914. this.n27 = (this.getChild("n27"));
  15915. this.titleTxt = (this.getChild("titleTxt"));
  15916. this.n28 = (this.getChild("n28"));
  15917. this.t0 = this.getTransition("t0");
  15918. }
  15919. }
  15920. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15921. class ui_dh_zs_4 extends fgui.GComponent {
  15922. static createInstance() {
  15923. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15924. }
  15925. onConstruct() {
  15926. this.n1 = (this.getChild("n1"));
  15927. this.n2 = (this.getChild("n2"));
  15928. this.n3 = (this.getChild("n3"));
  15929. this.n4 = (this.getChild("n4"));
  15930. this.n5 = (this.getChild("n5"));
  15931. this.n6 = (this.getChild("n6"));
  15932. this.n8 = (this.getChild("n8"));
  15933. this.t0 = this.getTransition("t0");
  15934. }
  15935. }
  15936. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15937. class ui_Component71_1 extends fgui.GButton {
  15938. static createInstance() {
  15939. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15940. }
  15941. onConstruct() {
  15942. this.n17 = (this.getChild("n17"));
  15943. this.t0 = this.getTransition("t0");
  15944. }
  15945. }
  15946. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15947. class ui_Component83 extends fgui.GComponent {
  15948. static createInstance() {
  15949. return (fgui.UIPackage.createObject("game", "Component83"));
  15950. }
  15951. onConstruct() {
  15952. this.c1 = this.getController("c1");
  15953. this.n17 = (this.getChild("n17"));
  15954. this.n19 = (this.getChild("n19"));
  15955. this.n20 = (this.getChild("n20"));
  15956. }
  15957. }
  15958. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15959. class ui_Component84 extends fgui.GComponent {
  15960. static createInstance() {
  15961. return (fgui.UIPackage.createObject("game", "Component84"));
  15962. }
  15963. onConstruct() {
  15964. this.c1 = this.getController("c1");
  15965. this.n4 = (this.getChild("n4"));
  15966. this.n22 = (this.getChild("n22"));
  15967. this.n23 = (this.getChild("n23"));
  15968. this.numTxt = (this.getChild("numTxt"));
  15969. this.n25 = (this.getChild("n25"));
  15970. this.n26 = (this.getChild("n26"));
  15971. }
  15972. }
  15973. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15974. class ui_Component84_1 extends fgui.GComponent {
  15975. static createInstance() {
  15976. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15977. }
  15978. onConstruct() {
  15979. this.c1 = this.getController("c1");
  15980. this.n4 = (this.getChild("n4"));
  15981. this.n22 = (this.getChild("n22"));
  15982. this.n23 = (this.getChild("n23"));
  15983. this.numTxt = (this.getChild("numTxt"));
  15984. this.n25 = (this.getChild("n25"));
  15985. this.n26 = (this.getChild("n26"));
  15986. }
  15987. }
  15988. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15989. class ui_Component85 extends fgui.GComponent {
  15990. static createInstance() {
  15991. return (fgui.UIPackage.createObject("game", "Component85"));
  15992. }
  15993. onConstruct() {
  15994. this.n1 = (this.getChild("n1"));
  15995. this.n6 = (this.getChild("n6"));
  15996. this.n2 = (this.getChild("n2"));
  15997. this.n3 = (this.getChild("n3"));
  15998. this.levelTxt = (this.getChild("levelTxt"));
  15999. this.n10 = (this.getChild("n10"));
  16000. this.n11 = (this.getChild("n11"));
  16001. this.n12 = (this.getChild("n12"));
  16002. this.n13 = (this.getChild("n13"));
  16003. this.n14 = (this.getChild("n14"));
  16004. this.modeNode = (this.getChild("modeNode"));
  16005. this.n18 = (this.getChild("n18"));
  16006. this.conditionTxt = (this.getChild("conditionTxt"));
  16007. this.diamondNode = (this.getChild("diamondNode"));
  16008. this.coinNode = (this.getChild("coinNode"));
  16009. this.startBtn = (this.getChild("startBtn"));
  16010. this.n28 = (this.getChild("n28"));
  16011. this.displayRoot = (this.getChild("displayRoot"));
  16012. this.t0 = this.getTransition("t0");
  16013. }
  16014. }
  16015. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16016. class ui_Component86 extends fgui.GButton {
  16017. static createInstance() {
  16018. return (fgui.UIPackage.createObject("game", "Component86"));
  16019. }
  16020. onConstruct() {
  16021. this.n15 = (this.getChild("n15"));
  16022. this.t0 = this.getTransition("t0");
  16023. }
  16024. }
  16025. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16026. class ui_Component87 extends fgui.GComponent {
  16027. static createInstance() {
  16028. return (fgui.UIPackage.createObject("game", "Component87"));
  16029. }
  16030. onConstruct() {
  16031. this.n66 = (this.getChild("n66"));
  16032. this.myProgress = (this.getChild("myProgress"));
  16033. this.starAni = (this.getChild("starAni"));
  16034. this.hpTxt = (this.getChild("hpTxt"));
  16035. this.n74 = (this.getChild("n74"));
  16036. this.n73 = (this.getChild("n73"));
  16037. this.ballTxt = (this.getChild("ballTxt"));
  16038. this.n76 = (this.getChild("n76"));
  16039. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16040. this.levelTxt = (this.getChild("levelTxt"));
  16041. this.star1 = (this.getChild("star1"));
  16042. this.star2 = (this.getChild("star2"));
  16043. this.star3 = (this.getChild("star3"));
  16044. }
  16045. }
  16046. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16047. class ui_Component88 extends fgui.GProgressBar {
  16048. static createInstance() {
  16049. return (fgui.UIPackage.createObject("game", "Component88"));
  16050. }
  16051. onConstruct() {
  16052. this.n68 = (this.getChild("n68"));
  16053. this.bar = (this.getChild("bar"));
  16054. }
  16055. }
  16056. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16057. class ui_Component89 extends fgui.GComponent {
  16058. static createInstance() {
  16059. return (fgui.UIPackage.createObject("game", "Component89"));
  16060. }
  16061. onConstruct() {
  16062. this.c1 = this.getController("c1");
  16063. this.n71 = (this.getChild("n71"));
  16064. this.n72 = (this.getChild("n72"));
  16065. }
  16066. }
  16067. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16068. class ui_Component90 extends fgui.GComponent {
  16069. static createInstance() {
  16070. return (fgui.UIPackage.createObject("game", "Component90"));
  16071. }
  16072. onConstruct() {
  16073. this.c1 = this.getController("c1");
  16074. this.n64 = (this.getChild("n64"));
  16075. this.n65 = (this.getChild("n65"));
  16076. this.n66 = (this.getChild("n66"));
  16077. this.t0 = this.getTransition("t0");
  16078. }
  16079. }
  16080. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16081. class ui_Component127 extends fgui.GButton {
  16082. static createInstance() {
  16083. return (fgui.UIPackage.createObject("game", "Component127"));
  16084. }
  16085. onConstruct() {
  16086. this.n5 = (this.getChild("n5"));
  16087. }
  16088. }
  16089. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16090. class gameBinder {
  16091. static bindAll() {
  16092. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16093. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16094. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16095. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16096. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16097. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16098. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16099. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16100. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16101. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16102. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16103. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16104. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16105. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16106. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16107. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16108. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16109. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16110. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16111. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16112. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16113. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16114. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16115. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16116. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16117. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16118. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16119. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16120. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16121. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16122. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16123. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16124. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16125. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16126. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16127. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16128. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16129. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16130. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16131. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16132. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16133. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16134. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16135. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16136. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16137. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16138. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16139. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16140. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16141. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16142. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16143. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16144. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16145. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16146. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16147. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16148. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16149. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16150. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16151. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16152. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16153. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16154. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16155. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16156. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16157. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16158. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16159. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16160. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16161. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16162. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16163. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16164. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16165. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16166. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16167. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16168. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16169. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16170. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16171. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16172. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16173. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16174. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16175. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16176. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16177. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16178. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16179. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16180. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16181. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16182. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16183. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16184. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16185. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16186. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16187. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16188. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16189. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16190. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16191. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16192. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16193. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16194. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16195. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16196. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16197. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16198. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16199. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16200. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16201. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16202. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16203. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16204. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16205. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16206. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16207. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16208. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16209. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16210. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16211. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16212. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16213. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16214. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16215. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16216. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16217. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16218. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16219. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16220. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16221. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16222. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16223. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16224. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16225. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16226. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16227. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16228. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16229. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16230. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16231. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16232. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16233. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16234. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16235. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16236. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16237. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16238. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16239. fgui.UIObjectFactory.setExtension(ui_Component_fuli1.URL, ui_Component_fuli1);
  16240. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16241. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16242. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16243. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16244. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16245. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16246. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16247. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16248. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16249. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16250. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16251. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16252. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16253. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16254. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16255. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16256. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16257. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16258. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16259. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16260. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16261. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16262. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16263. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16264. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16265. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16266. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16267. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16268. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16269. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16270. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16271. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16272. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16273. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16274. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16275. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16276. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16277. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16278. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16279. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16280. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16281. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16282. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16283. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16284. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16285. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16286. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16287. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16288. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16289. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  16290. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16291. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16292. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16293. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16294. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16295. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16296. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16297. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16298. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16299. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16300. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16301. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16302. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16303. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16304. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16305. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16306. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16307. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16308. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16309. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16310. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16311. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16312. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16313. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16314. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16315. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16316. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16317. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16318. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16319. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16320. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16321. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16322. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16323. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16324. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16325. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16326. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16327. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16328. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16329. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16330. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16331. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16332. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16333. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16334. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16335. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16336. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16337. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16338. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16339. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16340. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16341. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16342. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16343. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16344. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16345. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16346. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16347. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16348. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16349. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16350. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16351. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16352. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16353. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16354. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16355. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16356. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16357. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16358. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16359. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16360. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16361. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16362. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16363. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16364. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16365. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16366. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16367. }
  16368. }
  16369. class ui_btn6 extends fgui.GButton {
  16370. static createInstance() {
  16371. return (fgui.UIPackage.createObject("loading", "btn6"));
  16372. }
  16373. onConstruct() {
  16374. this.n6 = (this.getChild("n6"));
  16375. this.n1 = (this.getChild("n1"));
  16376. }
  16377. }
  16378. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16379. class ui_xyItem extends fgui.GComponent {
  16380. static createInstance() {
  16381. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16382. }
  16383. onConstruct() {
  16384. this.xyItem = (this.getChild("xyItem"));
  16385. }
  16386. }
  16387. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16388. class ui_loadinfo extends fgui.GProgressBar {
  16389. static createInstance() {
  16390. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16391. }
  16392. onConstruct() {
  16393. this.bg = (this.getChild("bg"));
  16394. this.bar = (this.getChild("bar"));
  16395. this.title = (this.getChild("title"));
  16396. this.ani = (this.getChild("ani"));
  16397. }
  16398. }
  16399. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16400. class ui_xyNode extends fgui.GComponent {
  16401. static createInstance() {
  16402. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16403. }
  16404. onConstruct() {
  16405. this.n0 = (this.getChild("n0"));
  16406. this.btnYes = (this.getChild("btnYes"));
  16407. this.btnNo = (this.getChild("btnNo"));
  16408. this.btnKnown = (this.getChild("btnKnown"));
  16409. this.btnSure = (this.getChild("btnSure"));
  16410. this.txtWelcom = (this.getChild("txtWelcom"));
  16411. this.txtXy = (this.getChild("txtXy"));
  16412. this.n75 = (this.getChild("n75"));
  16413. this.btnXy1 = (this.getChild("btnXy1"));
  16414. this.btnXy3 = (this.getChild("btnXy3"));
  16415. this.btnXy2 = (this.getChild("btnXy2"));
  16416. this.n74 = (this.getChild("n74"));
  16417. this.xy1 = (this.getChild("xy1"));
  16418. this.txtTitle = (this.getChild("txtTitle"));
  16419. this.btnBack = (this.getChild("btnBack"));
  16420. this.xyList = (this.getChild("xyList"));
  16421. this.xy2 = (this.getChild("xy2"));
  16422. this.xyNode = (this.getChild("xyNode"));
  16423. }
  16424. }
  16425. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16426. class ui_ageNode extends fgui.GComponent {
  16427. static createInstance() {
  16428. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16429. }
  16430. onConstruct() {
  16431. this.n3 = (this.getChild("n3"));
  16432. this.n7 = (this.getChild("n7"));
  16433. this.n4 = (this.getChild("n4"));
  16434. this.btnAge = (this.getChild("btnAge"));
  16435. this.ageNode = (this.getChild("ageNode"));
  16436. }
  16437. }
  16438. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16439. class ui_rnNode extends fgui.GComponent {
  16440. static createInstance() {
  16441. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16442. }
  16443. onConstruct() {
  16444. this.n28 = (this.getChild("n28"));
  16445. this.n30 = (this.getChild("n30"));
  16446. this.n33 = (this.getChild("n33"));
  16447. this.rn1 = (this.getChild("rn1"));
  16448. this.n40 = (this.getChild("n40"));
  16449. this.n41 = (this.getChild("n41"));
  16450. this.rn3 = (this.getChild("rn3"));
  16451. this.n37 = (this.getChild("n37"));
  16452. this.n39 = (this.getChild("n39"));
  16453. this.rn2 = (this.getChild("rn2"));
  16454. this.n47 = (this.getChild("n47"));
  16455. this.n49 = (this.getChild("n49"));
  16456. this.n44 = (this.getChild("n44"));
  16457. this.inputCode = (this.getChild("inputCode"));
  16458. this.inputName = (this.getChild("inputName"));
  16459. this.n48 = (this.getChild("n48"));
  16460. this.n50 = (this.getChild("n50"));
  16461. this.rn4 = (this.getChild("rn4"));
  16462. this.btnCheck = (this.getChild("btnCheck"));
  16463. this.btnExit = (this.getChild("btnExit"));
  16464. this.btnDone = (this.getChild("btnDone"));
  16465. this.rnNode = (this.getChild("rnNode"));
  16466. }
  16467. }
  16468. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16469. class ui_tipNode extends fgui.GComponent {
  16470. static createInstance() {
  16471. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16472. }
  16473. onConstruct() {
  16474. this.bg = (this.getChild("bg"));
  16475. this.n55 = (this.getChild("n55"));
  16476. this.n56 = (this.getChild("n56"));
  16477. this.tipNode = (this.getChild("tipNode"));
  16478. }
  16479. }
  16480. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16481. class ui_fcmNode extends fgui.GComponent {
  16482. static createInstance() {
  16483. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16484. }
  16485. onConstruct() {
  16486. this.n63 = (this.getChild("n63"));
  16487. this.n62 = (this.getChild("n62"));
  16488. this.btnRn = (this.getChild("btnRn"));
  16489. this.n61 = (this.getChild("n61"));
  16490. this.n58 = (this.getChild("n58"));
  16491. this.fcmNode = (this.getChild("fcmNode"));
  16492. }
  16493. }
  16494. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16495. class ui_msgNode extends fgui.GComponent {
  16496. static createInstance() {
  16497. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16498. }
  16499. onConstruct() {
  16500. this.n69 = (this.getChild("n69"));
  16501. this.txtMsg = (this.getChild("txtMsg"));
  16502. this.msgNode = (this.getChild("msgNode"));
  16503. }
  16504. }
  16505. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16506. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16507. static createInstance() {
  16508. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16509. }
  16510. onConstruct() {
  16511. this.n1 = (this.getChild("n1"));
  16512. this.n13 = (this.getChild("n13"));
  16513. this.n14 = (this.getChild("n14"));
  16514. this.n15 = (this.getChild("n15"));
  16515. this.n3 = (this.getChild("n3"));
  16516. this.n4 = (this.getChild("n4"));
  16517. this.n5 = (this.getChild("n5"));
  16518. this.n6 = (this.getChild("n6"));
  16519. this.n7 = (this.getChild("n7"));
  16520. this.n8 = (this.getChild("n8"));
  16521. this.n9 = (this.getChild("n9"));
  16522. this.n10 = (this.getChild("n10"));
  16523. this.n12 = (this.getChild("n12"));
  16524. this.n11 = (this.getChild("n11"));
  16525. this.n16 = (this.getChild("n16"));
  16526. this.n17 = (this.getChild("n17"));
  16527. this.n18 = (this.getChild("n18"));
  16528. this.n20 = (this.getChild("n20"));
  16529. this.n21 = (this.getChild("n21"));
  16530. this.t0 = this.getTransition("t0");
  16531. }
  16532. }
  16533. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16534. class ui_btn5 extends fgui.GButton {
  16535. static createInstance() {
  16536. return (fgui.UIPackage.createObject("loading", "btn5"));
  16537. }
  16538. onConstruct() {
  16539. this.n9 = (this.getChild("n9"));
  16540. this.n1 = (this.getChild("n1"));
  16541. }
  16542. }
  16543. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16544. class ui_UILoading extends fgui.GComponent {
  16545. static createInstance() {
  16546. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16547. }
  16548. onConstruct() {
  16549. this.n12 = (this.getChild("n12"));
  16550. this.loadinfo = (this.getChild("loadinfo"));
  16551. this.n13 = (this.getChild("n13"));
  16552. this.txtLoad = (this.getChild("txtLoad"));
  16553. this.n18 = (this.getChild("n18"));
  16554. }
  16555. }
  16556. ui_UILoading.URL = "ui://37nctnhwphc33";
  16557. class ui_AgeItem extends fgui.GComponent {
  16558. static createInstance() {
  16559. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16560. }
  16561. onConstruct() {
  16562. this.txtAge = (this.getChild("txtAge"));
  16563. }
  16564. }
  16565. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16566. class ui_btn1 extends fgui.GButton {
  16567. static createInstance() {
  16568. return (fgui.UIPackage.createObject("loading", "btn1"));
  16569. }
  16570. onConstruct() {
  16571. this.n6 = (this.getChild("n6"));
  16572. this.n1 = (this.getChild("n1"));
  16573. }
  16574. }
  16575. ui_btn1.URL = "ui://37nctnhwxe622p";
  16576. class ui_btn3 extends fgui.GButton {
  16577. static createInstance() {
  16578. return (fgui.UIPackage.createObject("loading", "btn3"));
  16579. }
  16580. onConstruct() {
  16581. this.n9 = (this.getChild("n9"));
  16582. this.n1 = (this.getChild("n1"));
  16583. }
  16584. }
  16585. ui_btn3.URL = "ui://37nctnhwxe622s";
  16586. class ui_btn2 extends fgui.GButton {
  16587. static createInstance() {
  16588. return (fgui.UIPackage.createObject("loading", "btn2"));
  16589. }
  16590. onConstruct() {
  16591. this.n6 = (this.getChild("n6"));
  16592. this.n1 = (this.getChild("n1"));
  16593. }
  16594. }
  16595. ui_btn2.URL = "ui://37nctnhwxe622t";
  16596. class ui_btnBack extends fgui.GButton {
  16597. static createInstance() {
  16598. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16599. }
  16600. onConstruct() {
  16601. this.n6 = (this.getChild("n6"));
  16602. this.n7 = (this.getChild("n7"));
  16603. }
  16604. }
  16605. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16606. class ui_btnXy1 extends fgui.GButton {
  16607. static createInstance() {
  16608. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16609. }
  16610. onConstruct() {
  16611. this.n1 = (this.getChild("n1"));
  16612. }
  16613. }
  16614. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16615. class ui_btnXy2 extends fgui.GButton {
  16616. static createInstance() {
  16617. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16618. }
  16619. onConstruct() {
  16620. this.n1 = (this.getChild("n1"));
  16621. }
  16622. }
  16623. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16624. class ui_btnXy3 extends fgui.GButton {
  16625. static createInstance() {
  16626. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16627. }
  16628. onConstruct() {
  16629. this.n1 = (this.getChild("n1"));
  16630. }
  16631. }
  16632. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16633. class ui_btn4 extends fgui.GButton {
  16634. static createInstance() {
  16635. return (fgui.UIPackage.createObject("loading", "btn4"));
  16636. }
  16637. onConstruct() {
  16638. this.n9 = (this.getChild("n9"));
  16639. this.n1 = (this.getChild("n1"));
  16640. }
  16641. }
  16642. ui_btn4.URL = "ui://37nctnhwxe622z";
  16643. class loadingBinder {
  16644. static bindAll() {
  16645. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16646. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16647. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16648. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16649. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16650. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16651. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16652. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16653. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16654. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16655. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16656. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16657. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16658. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16659. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16660. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16661. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16662. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16663. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16664. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16665. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16666. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16667. }
  16668. }
  16669. class UIMgr {
  16670. constructor() {
  16671. this._stage = null;
  16672. this._uiList = [];
  16673. this._showList = [];
  16674. this._bindPkgList = [];
  16675. this.uiIndex = 0;
  16676. }
  16677. static get inst() {
  16678. if (UIMgr._inst == null) {
  16679. UIMgr._inst = new UIMgr();
  16680. }
  16681. return UIMgr._inst;
  16682. }
  16683. setStage(s) {
  16684. if (this._stage) {
  16685. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16686. return;
  16687. }
  16688. this._stage = s;
  16689. }
  16690. clearTempData() {
  16691. console.log('zh:clearTempData start');
  16692. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16693. console.log('zh:clearTempData end');
  16694. }
  16695. init() {
  16696. this.setStage(Laya.stage);
  16697. fairygui.UIConfig.defaultFont = "微软雅黑";
  16698. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16699. fairygui.UIConfig.packageFileExtension = "obj";
  16700. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16701. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16702. fairygui.GRoot.inst.width = Laya.stage.width;
  16703. fairygui.GRoot.inst.height = Laya.stage.height;
  16704. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16705. }
  16706. addAllUpdate() {
  16707. this.uiIndex = 0;
  16708. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16709. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16710. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16711. }
  16712. }
  16713. }
  16714. bindFUI(pkgname) {
  16715. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16716. return;
  16717. }
  16718. switch (pkgname) {
  16719. case fguiRes.loading:
  16720. fairygui.UIPackage.addPackage(pkgname);
  16721. loadingBinder.bindAll();
  16722. this._bindPkgList.push(pkgname);
  16723. break;
  16724. case fguiRes.game:
  16725. fairygui.UIPackage.addPackage(pkgname);
  16726. gameBinder.bindAll();
  16727. this._bindPkgList.push(pkgname);
  16728. break;
  16729. default:
  16730. break;
  16731. }
  16732. }
  16733. Show(cls, ...param) {
  16734. let nameStr = cls.uiName;
  16735. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16736. let temp = this._uiList[i];
  16737. let str = temp.className;
  16738. if (str == nameStr) {
  16739. if (temp.isMuti) {
  16740. if (temp.isHide) {
  16741. temp.show(...param);
  16742. this._uiList.splice(i, 1);
  16743. this._uiList.push(temp);
  16744. return temp;
  16745. }
  16746. }
  16747. else {
  16748. temp.show(...param);
  16749. this._uiList.splice(i, 1);
  16750. this._uiList.push(temp);
  16751. return temp;
  16752. }
  16753. }
  16754. }
  16755. let ui = new cls();
  16756. ui.className = nameStr;
  16757. this._showUI(ui, param);
  16758. return ui;
  16759. }
  16760. destroyUI(ui) {
  16761. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16762. let temp = this._uiList[i].className;
  16763. if (temp == ui.className) {
  16764. this._uiList.splice(i, 1);
  16765. break;
  16766. }
  16767. }
  16768. this.checkUIState();
  16769. }
  16770. _showUI(ui, param) {
  16771. this._uiList.push(ui);
  16772. ui.show(...param);
  16773. }
  16774. Hide(uiClass) {
  16775. let ui = this.getUI(uiClass);
  16776. if (ui && !ui.isHide) {
  16777. ui.hide();
  16778. }
  16779. }
  16780. getUI(ui) {
  16781. let nameStr = ui.uiName;
  16782. for (let index = 0; index < this._uiList.length; index++) {
  16783. let temp = this._uiList[index];
  16784. if (temp.className == nameStr) {
  16785. return temp;
  16786. }
  16787. }
  16788. return null;
  16789. }
  16790. isShow(cls) {
  16791. for (var i of this._uiList) {
  16792. if (i instanceof cls) {
  16793. return i.isShowing;
  16794. }
  16795. }
  16796. return false;
  16797. }
  16798. showUINum() {
  16799. let num = 0;
  16800. for (var i of this._uiList) {
  16801. if (i.isShowing) {
  16802. num++;
  16803. }
  16804. }
  16805. return num;
  16806. }
  16807. checkUIState() {
  16808. Laya.timer.clear(this, this._uiCheck);
  16809. Laya.timer.once(400, this, this._uiCheck);
  16810. }
  16811. _uiCheck() {
  16812. let showList = [];
  16813. for (var i of this._uiList) {
  16814. if (!i.isHide) {
  16815. showList.push(i);
  16816. }
  16817. }
  16818. for (let index = 0; index < showList.length; index++) {
  16819. if (index == showList.length - 1) {
  16820. showList[index].checkActive(true);
  16821. }
  16822. else {
  16823. showList[index].checkActive(false);
  16824. }
  16825. }
  16826. }
  16827. showTip(msg, time = 600, size = 30) {
  16828. }
  16829. }
  16830. class UIShowList {
  16831. }
  16832. class SoundMgr {
  16833. constructor() {
  16834. this.soundMax = 4;
  16835. this.isLoad = false;
  16836. this.soundMap = {};
  16837. this.isSound = true;
  16838. this.openShake = true;
  16839. SoundMgr._instance = this;
  16840. }
  16841. static getInstance() {
  16842. if (!this._instance) {
  16843. this._instance = new SoundMgr();
  16844. }
  16845. return this._instance;
  16846. }
  16847. init() {
  16848. console.log('zh:sm init 1');
  16849. Laya.SoundManager.autoReleaseSound = true;
  16850. Laya.SoundManager.autoStopMusic = true;
  16851. Laya.SoundManager.musicVolume = 0.3;
  16852. Laya.SoundManager.soundVolume = 0.5;
  16853. this.musicPlayed = false;
  16854. this.audioUrl = "asset/sound/ogg/";
  16855. console.log('zh:sm init 2');
  16856. console.log('zh:dev type ');
  16857. if (Laya.Browser.onAndroid) {
  16858. console.log('zh:dev type android');
  16859. this.audioUrl = "asset/sound/ogg/";
  16860. this.isLoad = true;
  16861. }
  16862. else {
  16863. console.log('zh:dev type not android');
  16864. this.audioUrl = "asset/sound/mp3/";
  16865. this.isLoad = true;
  16866. }
  16867. }
  16868. onSetting(isS) {
  16869. this.isSound = isS;
  16870. this.mute(!this.isSound);
  16871. }
  16872. clearCount() {
  16873. for (var key in this.soundMap) {
  16874. delete this.soundMap[key];
  16875. }
  16876. }
  16877. playMusic(path, loop = 0) {
  16878. console.log('zh:playMusic 1 PATH=' + path);
  16879. this.musicPath = path;
  16880. if (!this.isLoad) {
  16881. return;
  16882. }
  16883. if (!path || path == "") {
  16884. return;
  16885. }
  16886. if (!this.isSound) {
  16887. return;
  16888. }
  16889. this.musicPlayed = true;
  16890. let url = this.getUrl(path);
  16891. if (!Laya.Browser.onAndroid) {
  16892. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16893. this.play(url, loop);
  16894. }));
  16895. }
  16896. else {
  16897. this.play(url, loop);
  16898. }
  16899. }
  16900. play(url, loop) {
  16901. Laya.SoundManager.playMusic(url, loop);
  16902. }
  16903. getUrl(path) {
  16904. let url = this.audioUrl + path;
  16905. if (Laya.Browser.onAndroid) {
  16906. url += ".ogg";
  16907. }
  16908. else {
  16909. url += ".mp3";
  16910. }
  16911. return url;
  16912. }
  16913. pauseMusic(pause) {
  16914. if (pause) {
  16915. this.mute(true);
  16916. }
  16917. else if (this.isSound)
  16918. this.mute(false);
  16919. }
  16920. stopMusic() {
  16921. Laya.SoundManager.stopMusic();
  16922. if (Moyu.isNeedPlatAudio) {
  16923. Moyu.stopMusic();
  16924. }
  16925. }
  16926. mute(mute) {
  16927. if (Moyu.isNeedPlatAudio) {
  16928. Moyu.pauseMusic(mute);
  16929. }
  16930. else {
  16931. Laya.SoundManager.musicMuted = mute;
  16932. if (!mute && !this.musicPlayed && this.musicPath) {
  16933. this.playMusic(this.musicPath);
  16934. }
  16935. }
  16936. }
  16937. stopSound(path) {
  16938. let url = this.getUrl(path);
  16939. Laya.SoundManager.stopSound(url);
  16940. }
  16941. playSound(path, loop = 1, soundMax = this.soundMax) {
  16942. if (!this.isLoad)
  16943. return;
  16944. if (!this.isSound)
  16945. return;
  16946. if (!path || path == "")
  16947. return;
  16948. let url = this.getUrl(path);
  16949. if (Moyu.isNeedPlatAudio) {
  16950. Moyu.playSound(path, loop == 0);
  16951. }
  16952. else {
  16953. let count = 1;
  16954. if (this.soundMap[path])
  16955. count = this.soundMap[path] + 1;
  16956. if (count > soundMax)
  16957. return;
  16958. this.soundMap[path] = count;
  16959. Laya.SoundManager.playSound(url, loop);
  16960. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16961. }
  16962. }
  16963. removePath(path) {
  16964. if (this.soundMap[path]) {
  16965. let count = this.soundMap[path];
  16966. count--;
  16967. if (count < 1)
  16968. delete this.soundMap[path];
  16969. else
  16970. this.soundMap[path] = count;
  16971. }
  16972. }
  16973. playBtnSound() {
  16974. this.playSound("btn");
  16975. }
  16976. playGetSound() {
  16977. }
  16978. playCloseUISound() {
  16979. }
  16980. }
  16981. SoundMgr._instance = null;
  16982. var Handler$1 = Laya.Handler;
  16983. var EResType;
  16984. (function (EResType) {
  16985. EResType[EResType["none"] = 0] = "none";
  16986. EResType[EResType["nromal"] = 1] = "nromal";
  16987. EResType[EResType["td"] = 2] = "td";
  16988. EResType[EResType["sk"] = 3] = "sk";
  16989. })(EResType || (EResType = {}));
  16990. class CResLoader {
  16991. constructor(doneCall, proCall) {
  16992. this.completrCall = doneCall;
  16993. this.progressCall = proCall;
  16994. this.progressHander = new Handler$1(this, this.onProgress);
  16995. this.tdResMap = {};
  16996. }
  16997. load(resList) {
  16998. this.resCount = 0;
  16999. this.loadCount = 0;
  17000. for (let i = 0; i < resList.length; i++) {
  17001. let path = resList[i];
  17002. if (!path)
  17003. continue;
  17004. this.resCount++;
  17005. let type = this.getResType(path);
  17006. if (type == EResType.nromal)
  17007. this.loadNromal(path);
  17008. else if (type == EResType.td)
  17009. this.loadTd(path);
  17010. }
  17011. }
  17012. getRes(path) {
  17013. let type = this.getResType(path);
  17014. if (type == EResType.nromal)
  17015. return Laya.loader.getRes(path);
  17016. else if (type == EResType.td) {
  17017. let res = this.tdResMap[path];
  17018. if (res)
  17019. return res.clone();
  17020. return null;
  17021. }
  17022. }
  17023. destroy() {
  17024. this.progressHander.clear();
  17025. this.progressHander = null;
  17026. }
  17027. clearRes(path) {
  17028. let type = this.getResType(path);
  17029. if (type == EResType.nromal)
  17030. Laya.loader.clearRes(path);
  17031. else if (type == EResType.td) {
  17032. let obj = this.tdResMap[path];
  17033. if (obj)
  17034. obj.destroy();
  17035. delete this.tdResMap[path];
  17036. }
  17037. }
  17038. getResType(path) {
  17039. let exs = this.getExtension(path);
  17040. if (exs == "sk")
  17041. return EResType.sk;
  17042. if (exs == "ls" || exs == "lh" || exs == "lm")
  17043. return EResType.td;
  17044. else
  17045. return EResType.nromal;
  17046. }
  17047. getExtension(res) {
  17048. var index = res.lastIndexOf(".");
  17049. return res.substr(index + 1);
  17050. }
  17051. loadNromal(path) {
  17052. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17053. if (res) {
  17054. this.onLoad();
  17055. }
  17056. else
  17057. console.log("load res fail:" + path);
  17058. }), this.progressHander);
  17059. }
  17060. loadSk() {
  17061. }
  17062. loadTd(path) {
  17063. if (this.tdResMap[path]) {
  17064. this.onLoad();
  17065. return;
  17066. }
  17067. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17068. if (res) {
  17069. this.tdResMap[path] = res;
  17070. this.onLoad();
  17071. }
  17072. else
  17073. console.log("load res fail:" + path);
  17074. }));
  17075. }
  17076. onLoad() {
  17077. this.loadCount++;
  17078. this.onProgress(1);
  17079. if (this.loadCount >= this.resCount) {
  17080. this.completrCall.run();
  17081. }
  17082. }
  17083. onProgress(pro) {
  17084. let progress = (this.loadCount + pro) / this.resCount;
  17085. this.progressCall.runWith(progress);
  17086. }
  17087. }
  17088. var Handler$2 = Laya.Handler;
  17089. class ResInfo {
  17090. constructor() {
  17091. this.index = 0;
  17092. }
  17093. }
  17094. class ResMgr {
  17095. constructor() {
  17096. this.resList = [];
  17097. this.doneList = [];
  17098. this.resMap = {};
  17099. this.currentLoad = null;
  17100. this.completeHandler = new Handler$2(this, this.onComplete);
  17101. this.progressHandler = new Handler$2(this, this.onProgress);
  17102. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17103. }
  17104. static getInstance() {
  17105. if (ResMgr._instance == null) {
  17106. ResMgr._instance = new ResMgr();
  17107. }
  17108. return ResMgr._instance;
  17109. }
  17110. loadList(list, completeHandler, progressHandler) {
  17111. if (list.length < 1) {
  17112. completeHandler.run();
  17113. return;
  17114. }
  17115. let info = this.getResInfo();
  17116. info.resList = list;
  17117. info.completeHandler = completeHandler;
  17118. info.progressHandler = progressHandler;
  17119. this.resList.push(info);
  17120. this.startLoad();
  17121. }
  17122. loadFguiRes(list, completeHandler, progressHandler) {
  17123. Laya.loader.load(list, completeHandler, progressHandler);
  17124. }
  17125. loadAny(list, completeHandler, progressHandler) {
  17126. Laya.loader.load(list, completeHandler, progressHandler);
  17127. }
  17128. load(path, completeHandler, progressHandler) {
  17129. let count = this.resMap[path];
  17130. if (count && count > 0) {
  17131. if (completeHandler)
  17132. completeHandler.run();
  17133. }
  17134. else
  17135. this.loadList([path], completeHandler, progressHandler);
  17136. }
  17137. getRes(path) {
  17138. let res = this.resMap[path];
  17139. if (!res)
  17140. this.showLog("资源不存在:" + path);
  17141. else
  17142. return this.loader.getRes(path);
  17143. }
  17144. clearList(list, force = false) {
  17145. if (!list || list.length < 1)
  17146. return;
  17147. let cr = () => {
  17148. for (const k in list) {
  17149. let v = list[k];
  17150. if (!v)
  17151. continue;
  17152. if (force) {
  17153. this.loader.clearRes(v);
  17154. delete this.resMap[v];
  17155. }
  17156. else {
  17157. let count = this.resMap[v];
  17158. if (count && count > 1) {
  17159. count--;
  17160. this.resMap[v] = count;
  17161. }
  17162. else {
  17163. this.loader.clearRes(v);
  17164. delete this.resMap[v];
  17165. }
  17166. }
  17167. }
  17168. if (!window.hasOwnProperty("ks"))
  17169. Laya.Resource.destroyUnusedResources();
  17170. };
  17171. Laya.timer.clearAll(this);
  17172. Laya.timer.once(2000, this, cr);
  17173. }
  17174. clear3D() {
  17175. for (const k in this.loader.tdResMap) {
  17176. this.loader.clearRes(k);
  17177. if (this.resMap[k])
  17178. delete this.resMap[k];
  17179. }
  17180. if (!window.hasOwnProperty("ks"))
  17181. Laya.Resource.destroyUnusedResources();
  17182. }
  17183. clear(path, force = false) {
  17184. this.clearList([path], force);
  17185. }
  17186. getResInfo() {
  17187. if (this.doneList.length > 0)
  17188. return this.doneList.pop();
  17189. else
  17190. return new ResInfo();
  17191. }
  17192. startLoad() {
  17193. if (this.currentLoad)
  17194. return;
  17195. this.currentLoad = this.resList.pop();
  17196. if (this.currentLoad) {
  17197. this.loader.load(this.currentLoad.resList);
  17198. }
  17199. }
  17200. onComplete() {
  17201. if (!this.currentLoad)
  17202. return;
  17203. for (const k in this.currentLoad.resList) {
  17204. let v = this.currentLoad.resList[k];
  17205. let count = this.resMap[v];
  17206. if (count)
  17207. count++;
  17208. else
  17209. count = 1;
  17210. this.resMap[v] = count;
  17211. }
  17212. if (this.currentLoad.completeHandler)
  17213. this.currentLoad.completeHandler.run();
  17214. this.doneList.push(this.currentLoad);
  17215. this.currentLoad = null;
  17216. this.startLoad();
  17217. }
  17218. onProgress(pro) {
  17219. if (!this.currentLoad)
  17220. return;
  17221. if (this.currentLoad.progressHandler)
  17222. this.currentLoad.progressHandler.runWith(pro);
  17223. }
  17224. showLog(str, ...args) {
  17225. console.log("[ResLoader] " + str);
  17226. }
  17227. }
  17228. ResMgr._instance = null;
  17229. class EventMgr extends Laya.EventDispatcher {
  17230. }
  17231. let eventMgr = new EventMgr();
  17232. /*! *****************************************************************************
  17233. Copyright (c) Microsoft Corporation. All rights reserved.
  17234. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17235. this file except in compliance with the License. You may obtain a copy of the
  17236. License at http://www.apache.org/licenses/LICENSE-2.0
  17237. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17238. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17239. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17240. MERCHANTABLITY OR NON-INFRINGEMENT.
  17241. See the Apache Version 2.0 License for specific language governing permissions
  17242. and limitations under the License.
  17243. ***************************************************************************** */
  17244. /* global Reflect, Promise */
  17245. var extendStatics = function(d, b) {
  17246. extendStatics = Object.setPrototypeOf ||
  17247. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17248. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17249. return extendStatics(d, b);
  17250. };
  17251. function __extends(d, b) {
  17252. extendStatics(d, b);
  17253. function __() { this.constructor = d; }
  17254. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17255. }
  17256. var __assign = function() {
  17257. __assign = Object.assign || function __assign(t) {
  17258. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17259. s = arguments[i];
  17260. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17261. }
  17262. return t;
  17263. };
  17264. return __assign.apply(this, arguments);
  17265. };
  17266. function __rest(s, e) {
  17267. var t = {};
  17268. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17269. t[p] = s[p];
  17270. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17271. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17272. t[p[i]] = s[p[i]];
  17273. return t;
  17274. }
  17275. function __decorate(decorators, target, key, desc) {
  17276. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17277. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17278. 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;
  17279. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17280. }
  17281. function __param(paramIndex, decorator) {
  17282. return function (target, key) { decorator(target, key, paramIndex); }
  17283. }
  17284. function __metadata(metadataKey, metadataValue) {
  17285. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17286. }
  17287. function __awaiter(thisArg, _arguments, P, generator) {
  17288. return new (P || (P = Promise))(function (resolve, reject) {
  17289. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17290. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17291. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17292. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17293. });
  17294. }
  17295. function __generator(thisArg, body) {
  17296. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17297. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17298. function verb(n) { return function (v) { return step([n, v]); }; }
  17299. function step(op) {
  17300. if (f) throw new TypeError("Generator is already executing.");
  17301. while (_) try {
  17302. 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;
  17303. if (y = 0, t) op = [op[0] & 2, t.value];
  17304. switch (op[0]) {
  17305. case 0: case 1: t = op; break;
  17306. case 4: _.label++; return { value: op[1], done: false };
  17307. case 5: _.label++; y = op[1]; op = [0]; continue;
  17308. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17309. default:
  17310. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17311. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17312. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17313. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17314. if (t[2]) _.ops.pop();
  17315. _.trys.pop(); continue;
  17316. }
  17317. op = body.call(thisArg, _);
  17318. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17319. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17320. }
  17321. }
  17322. function __exportStar(m, exports) {
  17323. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17324. }
  17325. function __values(o) {
  17326. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17327. if (m) return m.call(o);
  17328. return {
  17329. next: function () {
  17330. if (o && i >= o.length) o = void 0;
  17331. return { value: o && o[i++], done: !o };
  17332. }
  17333. };
  17334. }
  17335. function __read(o, n) {
  17336. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17337. if (!m) return o;
  17338. var i = m.call(o), r, ar = [], e;
  17339. try {
  17340. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17341. }
  17342. catch (error) { e = { error: error }; }
  17343. finally {
  17344. try {
  17345. if (r && !r.done && (m = i["return"])) m.call(i);
  17346. }
  17347. finally { if (e) throw e.error; }
  17348. }
  17349. return ar;
  17350. }
  17351. function __spread() {
  17352. for (var ar = [], i = 0; i < arguments.length; i++)
  17353. ar = ar.concat(__read(arguments[i]));
  17354. return ar;
  17355. }
  17356. function __await(v) {
  17357. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17358. }
  17359. function __asyncGenerator(thisArg, _arguments, generator) {
  17360. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17361. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17362. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17363. 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); }); }; }
  17364. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17365. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17366. function fulfill(value) { resume("next", value); }
  17367. function reject(value) { resume("throw", value); }
  17368. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17369. }
  17370. function __asyncDelegator(o) {
  17371. var i, p;
  17372. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17373. 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; }
  17374. }
  17375. function __asyncValues(o) {
  17376. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17377. var m = o[Symbol.asyncIterator], i;
  17378. 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);
  17379. 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); }); }; }
  17380. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17381. }
  17382. function __makeTemplateObject(cooked, raw) {
  17383. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17384. return cooked;
  17385. };
  17386. function __importStar(mod) {
  17387. if (mod && mod.__esModule) return mod;
  17388. var result = {};
  17389. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17390. result.default = mod;
  17391. return result;
  17392. }
  17393. function __importDefault(mod) {
  17394. return (mod && mod.__esModule) ? mod : { default: mod };
  17395. }
  17396. class CustomAlert {
  17397. static show(title, content, buttons) {
  17398. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17399. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17400. return;
  17401. }
  17402. const bg = new Laya.Box();
  17403. bg.alpha = 0;
  17404. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17405. Laya.stage.addChild(bg);
  17406. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17407. const panel = new Laya.Box();
  17408. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17409. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17410. bg.addChild(panel);
  17411. const titleText = new Laya.Text();
  17412. titleText.text = title;
  17413. titleText.fontSize = 32;
  17414. titleText.color = "#333333";
  17415. titleText.bold = true;
  17416. titleText.pos(20, 20);
  17417. titleText.width = 360;
  17418. titleText.align = "center";
  17419. panel.addChild(titleText);
  17420. const contentText = new Laya.Text();
  17421. contentText.text = content;
  17422. contentText.fontSize = 21;
  17423. contentText.color = "#555555";
  17424. contentText.pos(20, 70);
  17425. contentText.width = 360;
  17426. contentText.wordWrap = true;
  17427. contentText.align = "center";
  17428. panel.addChild(contentText);
  17429. const buttonContainer = new Laya.Box();
  17430. buttonContainer.pos(20, 160);
  17431. panel.addChild(buttonContainer);
  17432. const btnWidth = 120;
  17433. const spacing = 30;
  17434. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17435. buttons.forEach((btn, index) => {
  17436. const button = new Laya.Button();
  17437. button.label = btn.label;
  17438. button.size(btnWidth, 40);
  17439. button.labelSize = 22;
  17440. button.pos(index * (btnWidth + spacing), 0);
  17441. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17442. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17443. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17444. button.alpha = 0.9;
  17445. });
  17446. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17447. button.alpha = 1;
  17448. });
  17449. button.on(Laya.Event.CLICK, this, () => {
  17450. btn.handler();
  17451. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17452. bg.removeSelf();
  17453. }));
  17454. });
  17455. buttonContainer.addChild(button);
  17456. });
  17457. buttonContainer.x = (panel.width - totalWidth) / 2;
  17458. }
  17459. }
  17460. class ConfigMgr {
  17461. constructor() {
  17462. this.httpReqCount = 4;
  17463. this.httpReqOkCount = 0;
  17464. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17465. try {
  17466. this.httpReqOkCount = 0;
  17467. let reqData = xGame.httpMgr.getReqData();
  17468. console.log('zh:第1个请求getClassicCfg');
  17469. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17470. this.classicCfg = classicCfg;
  17471. this.httpReqOkCount++;
  17472. console.log('zh:第2个请求getLevelCfg');
  17473. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17474. this.levelCfg = levelCfg;
  17475. this.httpReqOkCount++;
  17476. console.log('zh:第3个请求 getPlaceBallCfg');
  17477. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17478. this.placeBallCfg = placeBallCfg;
  17479. this.httpReqOkCount++;
  17480. console.log('zh:第4个请求 npc');
  17481. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17482. this.npcJson = npc.Data;
  17483. this.httpReqOkCount++;
  17484. console.log('zh:所有配置加载完成');
  17485. }
  17486. catch (error) {
  17487. console.error('❌请求失败:', error);
  17488. Laya.timer.once(5000, this, () => {
  17489. let retryCount = 0;
  17490. const maxRetries = 3;
  17491. const tryFetchConfig = () => {
  17492. try {
  17493. xGame.cfgMgr.getConfigFromServer();
  17494. }
  17495. catch (error) {
  17496. if (retryCount < maxRetries) {
  17497. retryCount++;
  17498. console.log(`🔄 第${retryCount}次重试获取配置...`);
  17499. Laya.timer.once(5000, this, tryFetchConfig);
  17500. }
  17501. else {
  17502. console.error("❌ 达到最大重试次数,配置获取失败");
  17503. }
  17504. }
  17505. };
  17506. tryFetchConfig();
  17507. });
  17508. }
  17509. finally {
  17510. if (this.httpReqCount > this.httpReqOkCount) {
  17511. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17512. {
  17513. label: "Okay", handler: () => {
  17514. console.log("zh:好的知道了");
  17515. JSBridgeUtils.instance.exitAndCloseGame();
  17516. }
  17517. }
  17518. ]);
  17519. }
  17520. }
  17521. });
  17522. this.sendPostAsync = (action, reqData) => {
  17523. return new Promise((resolve, reject) => {
  17524. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17525. try {
  17526. let code = res.code;
  17527. if (code == 200) {
  17528. const parsedData = JSON.parse(res.msg);
  17529. resolve(parsedData);
  17530. }
  17531. else {
  17532. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17533. reject(new Error(`Request failed with code: ${code}`));
  17534. }
  17535. }
  17536. catch (error) {
  17537. console.error(`ERROR=${error}`);
  17538. alert("Please check your network connection.");
  17539. reject(error);
  17540. }
  17541. finally {
  17542. console.log(`zh:${action}的请求处理完毕`);
  17543. }
  17544. });
  17545. });
  17546. };
  17547. }
  17548. static getInstance() {
  17549. if (!this._instance) {
  17550. this._instance = new ConfigMgr();
  17551. }
  17552. return this._instance;
  17553. }
  17554. init() {
  17555. this.getConfigFromServer();
  17556. }
  17557. test() {
  17558. let reqData = xGame.httpMgr.getReqData();
  17559. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17560. console.log('zh:1s');
  17561. try {
  17562. let code = res.code;
  17563. let data = res.data;
  17564. if (code == 200) {
  17565. const parsedData = JSON.parse(data);
  17566. this.classicCfg = parsedData;
  17567. }
  17568. else {
  17569. console.log('zh:res = ' + JSON.stringify(res));
  17570. }
  17571. }
  17572. catch (error) {
  17573. console.log('error=' + error);
  17574. alert("Please check your network connection.");
  17575. }
  17576. finally {
  17577. console.log('zh:1');
  17578. }
  17579. });
  17580. }
  17581. getUserInfoByIndex(index) {
  17582. return this.npcJson[index];
  17583. }
  17584. getRandomUserInfo() {
  17585. let index = xGame.tools.random(0, this.npcJson.length);
  17586. let rs = this.npcJson[index];
  17587. return rs;
  17588. }
  17589. getMaxBigMoveLength() {
  17590. return Object.keys(this.levelCfg).length;
  17591. }
  17592. getBigMoveLevelByIndex(index) {
  17593. let cfg = this.levelCfg;
  17594. cfg = cfg[index];
  17595. return cfg;
  17596. }
  17597. getRandomClassicLevel() {
  17598. let cfg = this.classicCfg;
  17599. let num = Object.keys(cfg).length;
  17600. let rand = xGame.common.randomNum(1, num);
  17601. return cfg[rand];
  17602. }
  17603. getPlaceBallByLevel(level) {
  17604. return this.placeBallCfg[level];
  17605. }
  17606. getMaxPlaceBall() {
  17607. return Object.keys(this.placeBallCfg).length;
  17608. }
  17609. }
  17610. class PoolD3Mgr {
  17611. constructor() {
  17612. this.pool = {};
  17613. }
  17614. static get ins() {
  17615. return this._ins || (this._ins = new PoolD3Mgr);
  17616. }
  17617. createList(key, prefab, parent) {
  17618. if (!this.pool[key]) {
  17619. this.pool[key] = {};
  17620. this.pool[key].prefab = prefab;
  17621. this.pool[key].list = [];
  17622. this.pool[key].parent = parent;
  17623. }
  17624. }
  17625. getItem(key) {
  17626. if (!this.pool[key]) {
  17627. return;
  17628. }
  17629. let temp;
  17630. if (this.pool[key].list.length > 0) {
  17631. temp = this.pool[key].list.pop();
  17632. }
  17633. else {
  17634. temp = this.pool[key].prefab.clone();
  17635. if (this.pool[key].parent) {
  17636. this.pool[key].parent.addChild(temp);
  17637. }
  17638. }
  17639. temp.active = true;
  17640. return temp;
  17641. }
  17642. putItem(key, obj) {
  17643. if (!this.pool[key]) {
  17644. return;
  17645. }
  17646. obj.active = false;
  17647. this.pool[key].list.push(obj);
  17648. }
  17649. }
  17650. let context$1 = context;
  17651. let uiMgr = UIMgr.inst;
  17652. let soundMgr = SoundMgr.getInstance();
  17653. let resMgr = ResMgr.getInstance();
  17654. let httpMgr = HttpMgr.getInstance();
  17655. let common = Common.getInstance();
  17656. let cfgMgr = ConfigMgr.getInstance();
  17657. let poolD3Mgr = PoolD3Mgr.ins;
  17658. let d3TexUrl = "res/d3Res/";
  17659. let d3ModeUrl = "res/unityRes/";
  17660. function setStageSize(view) {
  17661. if (view.width) {
  17662. view.width = Laya.stage.width;
  17663. view.height = Laya.stage.height;
  17664. }
  17665. }
  17666. function filledBg(view) {
  17667. let wh = Laya.stage.height / Laya.stage.width;
  17668. if (wh > 16 / 9) {
  17669. view.height = Laya.stage.height;
  17670. view.width = Laya.stage.height / 1334 * 750;
  17671. }
  17672. else {
  17673. view.width = Laya.stage.width;
  17674. view.height = Laya.stage.width / 750 * 1334;
  17675. }
  17676. }
  17677. function setNotch(view) {
  17678. if (view.height) {
  17679. view.y += context$1.notchHeight;
  17680. }
  17681. }
  17682. function showTip(str) {
  17683. uiMgr.Show(UIMsg, str);
  17684. }
  17685. function log(...args) {
  17686. console.log(args);
  17687. }
  17688. let xGame = {
  17689. context: context$1,
  17690. eventMgr,
  17691. resMgr,
  17692. uiMgr,
  17693. soundMgr,
  17694. define,
  17695. tools,
  17696. httpMgr,
  17697. d3TexUrl,
  17698. d3ModeUrl,
  17699. common,
  17700. cfgMgr,
  17701. poolD3Mgr,
  17702. setStageSize,
  17703. filledBg,
  17704. setNotch,
  17705. showTip,
  17706. log,
  17707. };
  17708. window["xGame"] = xGame;
  17709. let dataName = 'tBall_';
  17710. class UserData {
  17711. constructor() {
  17712. this.userId = "";
  17713. this.isAgree = false;
  17714. this.coinNum = 0;
  17715. this.gemNum = 0;
  17716. this.sound = true;
  17717. this.vibration = true;
  17718. this.currentDate = 0;
  17719. this.createTime = 0;
  17720. this.awardTime = 0;
  17721. this.roleId = 1;
  17722. this.roleList = [];
  17723. this.roleAds = [];
  17724. this.dressId = 101;
  17725. this.itemId = 201;
  17726. this.bigSkills = [1, 1, 1, 1, 1];
  17727. this.coin = 4000;
  17728. this.diamond = 0;
  17729. this.skillSuccessTimes = 0;
  17730. this.skillGuide = 0;
  17731. this.skillAccTimes = 0;
  17732. this.placeBallData = [];
  17733. this.shareDiamondTimes = 0;
  17734. this.dailyVideoShareTimes = 0;
  17735. this.secretary = [1, 0];
  17736. this.curSecretary = 0;
  17737. this.ballRod = [1, 0, 0, 0, 0, 1];
  17738. this.curBallRod = 5;
  17739. this.signData = 0;
  17740. this.signTime = 0;
  17741. this.drawTimes = 0;
  17742. this.drawAwardTimes = 0;
  17743. this.dailyfreeDrawTimes = 1;
  17744. this.power = 5;
  17745. this.powerTime = 0;
  17746. this.challengeTimes = 0;
  17747. this.extraSign = 0;
  17748. this.classicTimes = 0;
  17749. this.guideHelpLine = 0;
  17750. this.newUser = true;
  17751. this.rootBallFoul = 0;
  17752. this.timeoutFoul = 0;
  17753. this.roleList = [1];
  17754. }
  17755. saveData() {
  17756. let data = {};
  17757. for (let k in this) {
  17758. data[k.toString()] = this[k];
  17759. }
  17760. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17761. }
  17762. getData() {
  17763. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17764. if (ld) {
  17765. let localData = JSON.parse(ld);
  17766. if (localData) {
  17767. for (let k in this) {
  17768. let key = k.toString();
  17769. let data = localData[key];
  17770. if (data != undefined) {
  17771. this[k] = data;
  17772. }
  17773. }
  17774. }
  17775. }
  17776. }
  17777. }
  17778. class ItemData {
  17779. constructor() {
  17780. this.itemList = {};
  17781. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17782. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17783. }
  17784. saveData() {
  17785. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17786. }
  17787. getData() {
  17788. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17789. if (ld) {
  17790. let localData = JSON.parse(ld);
  17791. if (localData) {
  17792. this.itemList = localData;
  17793. }
  17794. }
  17795. }
  17796. }
  17797. class GameData {
  17798. constructor() {
  17799. this.curLevel = 0;
  17800. this.gameType = 1;
  17801. this.signIdx = 0;
  17802. this.signMax = 0;
  17803. this.rotaryTime = 0;
  17804. this.rotaryCount = 0;
  17805. this.rotaryList = [];
  17806. this.diyCount = 3;
  17807. this.awardIdx = 0;
  17808. this.shareNum = 2;
  17809. this.rankWeek = 0;
  17810. this.rankScore = 0;
  17811. this.gameCount = 0;
  17812. this.trySkill = -1;
  17813. this.tryTime = 0;
  17814. }
  17815. saveData() {
  17816. let data = {};
  17817. for (let k in this) {
  17818. data[k.toString()] = this[k];
  17819. }
  17820. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17821. }
  17822. getData() {
  17823. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17824. if (ld) {
  17825. let localData = JSON.parse(ld);
  17826. if (localData) {
  17827. for (let k in this) {
  17828. let key = k.toString();
  17829. let data = localData[key];
  17830. if (data != undefined) {
  17831. this[k] = data;
  17832. }
  17833. }
  17834. }
  17835. }
  17836. }
  17837. }
  17838. class Diy2025GameData {
  17839. constructor() {
  17840. this.challengeMode_overLev = 0;
  17841. this.xszyForClassic = false;
  17842. this.xszyForChallenge = false;
  17843. }
  17844. saveData() {
  17845. let data = {};
  17846. for (let k in this) {
  17847. data[k.toString()] = this[k];
  17848. }
  17849. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17850. }
  17851. getData() {
  17852. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17853. if (ld) {
  17854. let localData = JSON.parse(ld);
  17855. if (localData) {
  17856. for (let k in this) {
  17857. let key = k.toString();
  17858. let data = localData[key];
  17859. if (data != undefined) {
  17860. this[k] = data;
  17861. }
  17862. }
  17863. }
  17864. }
  17865. }
  17866. }
  17867. class DataMgr {
  17868. static Init() {
  17869. this.userData = new UserData();
  17870. this.gameData = new GameData();
  17871. this.itemData = new ItemData();
  17872. this.diyGameData = new Diy2025GameData();
  17873. this.userData.getData();
  17874. this.gameData.getData();
  17875. this.itemData.getData();
  17876. this.diyGameData.getData();
  17877. this.roleId = this.userData.roleId;
  17878. this.resetUse();
  17879. }
  17880. static isNewDay() {
  17881. Moyu.isNewDay(this, (isnew) => {
  17882. xGame.common.isNewDay = isnew;
  17883. if (!isnew)
  17884. return;
  17885. DataMgr.setShareDiamondTimes(0, false);
  17886. DataMgr.setDailyVideoShareTimes(0, false);
  17887. DataMgr.setDailyfreeDrawTimes(1);
  17888. DataMgr.setExtraSign(0);
  17889. });
  17890. }
  17891. static deletData() {
  17892. Laya.LocalStorage.clear();
  17893. }
  17894. static upRankData() {
  17895. let num = xGame.common.getAllStarNum();
  17896. if (num > 0)
  17897. Moyu.upRankData(xGame.common.curRankID, num);
  17898. }
  17899. static addItem(id, count = 1) {
  17900. let v = this.itemData.itemList[id];
  17901. if (!v)
  17902. v = { id: id, count: count, adnum: 0, active: true };
  17903. else {
  17904. if (v.active) {
  17905. v.count += count;
  17906. }
  17907. else {
  17908. v.count = count;
  17909. v.active = true;
  17910. }
  17911. }
  17912. this.itemData.itemList[id] = v;
  17913. xGame.soundMgr.playGetSound();
  17914. this.saveItemData();
  17915. }
  17916. static hasItem(id) {
  17917. let v = this.itemData.itemList[id];
  17918. if (v && v.active)
  17919. return true;
  17920. return false;
  17921. }
  17922. static getItem(id) {
  17923. let v = this.itemData.itemList[id];
  17924. return v;
  17925. }
  17926. static getItemCount(id) {
  17927. let v = this.itemData.itemList[id];
  17928. if (v && v.active)
  17929. return v.count;
  17930. return 0;
  17931. }
  17932. static getItemAd(id) {
  17933. let v = this.itemData.itemList[id];
  17934. if (v) {
  17935. return v.adnum;
  17936. }
  17937. return 0;
  17938. }
  17939. static onItemAd(id, num = 1) {
  17940. let v = this.itemData.itemList[id];
  17941. if (!v)
  17942. v = { id: id, count: 1, adnum: num, active: false };
  17943. else
  17944. v.adnum += num;
  17945. this.itemData.itemList[id] = v;
  17946. this.saveItemData();
  17947. }
  17948. static costItem(id, count) {
  17949. let v = this.itemData.itemList[id];
  17950. if (v && v.active) {
  17951. if (v.count < count)
  17952. return false;
  17953. else {
  17954. v.count -= count;
  17955. this.itemData.itemList[id] = v;
  17956. return true;
  17957. }
  17958. }
  17959. return false;
  17960. }
  17961. static resetUse() {
  17962. this.dressId = this.userData.dressId;
  17963. this.itemId = this.userData.itemId;
  17964. }
  17965. static passLevel() {
  17966. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17967. this.gameData.curLevel++;
  17968. this.curLevel = this.gameData.curLevel;
  17969. this.saveGameData();
  17970. }
  17971. static useRole(id) {
  17972. this.roleId = id;
  17973. if (this.hasRole(id)) {
  17974. this.userData.roleId = id;
  17975. this.saveUserData();
  17976. }
  17977. }
  17978. static addRole(id) {
  17979. if (this.hasRole(id))
  17980. return;
  17981. this.userData.roleList.push(id);
  17982. this.saveUserData();
  17983. }
  17984. static hasRole(id) {
  17985. return this.userData.roleList.indexOf(id) >= 0;
  17986. }
  17987. static gemEnough(num) {
  17988. return this.userData.gemNum >= num;
  17989. }
  17990. static roleHasAd(id) {
  17991. let count = this.userData.roleAds[id];
  17992. if (count != undefined && count >= 0)
  17993. return true;
  17994. else
  17995. return false;
  17996. }
  17997. static saveUserData(time = 500, event, arg) {
  17998. if (this.userSaving)
  17999. return;
  18000. this.userSaving = true;
  18001. Laya.timer.once(time, this, () => {
  18002. this.userSaving = false;
  18003. this.userData.saveData();
  18004. if (event)
  18005. xGame.eventMgr.event(event, arg);
  18006. });
  18007. }
  18008. static saveGameData() {
  18009. if (this.gameSaving)
  18010. return;
  18011. this.gameSaving = true;
  18012. Laya.timer.once(1000, this, () => {
  18013. this.gameSaving = false;
  18014. this.gameData.saveData();
  18015. });
  18016. }
  18017. static saveItemData() {
  18018. let fun = () => {
  18019. this.itemData.saveData();
  18020. };
  18021. Laya.timer.clear(this, fun);
  18022. Laya.timer.once(500, this, fun);
  18023. }
  18024. static saveData() {
  18025. this.saveUserData();
  18026. this.saveGameData();
  18027. }
  18028. static getBigSkillList() {
  18029. return this.userData.bigSkills;
  18030. }
  18031. static getBigSkillByIndex(index) {
  18032. return this.userData.bigSkills[index];
  18033. }
  18034. static setBigSkill(index, val, addUp = true) {
  18035. if (addUp) {
  18036. this.userData.bigSkills[index] += val;
  18037. }
  18038. else {
  18039. this.userData.bigSkills[index] = val;
  18040. }
  18041. this.saveUserData();
  18042. }
  18043. static coinEnough(need) {
  18044. if (typeof need != "number") {
  18045. console.error("金币格式错误");
  18046. return;
  18047. }
  18048. return this.userData.coin >= need;
  18049. }
  18050. static setCoin(val) {
  18051. if (typeof val != "number") {
  18052. return;
  18053. }
  18054. this.userData.coin += val;
  18055. this.saveUserData();
  18056. xGame.eventMgr.event(COIN_CHANGE);
  18057. this.updateUserInfo2Server("jb");
  18058. }
  18059. static setCoinFormServer(val) {
  18060. if (typeof val != "number") {
  18061. return;
  18062. }
  18063. this.userData.coin = val;
  18064. this.saveUserData();
  18065. xGame.eventMgr.event(COIN_CHANGE);
  18066. }
  18067. static getCoin() {
  18068. return this.userData.coin;
  18069. }
  18070. static diamondEnough(need) {
  18071. if (typeof need != "number") {
  18072. console.error("金币格式错误");
  18073. return;
  18074. }
  18075. return this.userData.diamond >= need;
  18076. }
  18077. static setDiamond(val) {
  18078. if (typeof val != "number") {
  18079. return;
  18080. }
  18081. this.userData.diamond += val;
  18082. this.saveUserData();
  18083. xGame.eventMgr.event(DIAMOND_CHANGE);
  18084. this.updateUserInfo2Server("zs");
  18085. }
  18086. static setDiamondFormServer(val) {
  18087. if (typeof val != "number") {
  18088. return;
  18089. }
  18090. this.userData.diamond = val;
  18091. this.saveUserData();
  18092. xGame.eventMgr.event(DIAMOND_CHANGE);
  18093. }
  18094. static getDiamond() {
  18095. return this.userData.diamond;
  18096. }
  18097. static getSkillSuccessTimes() {
  18098. return this.userData.skillSuccessTimes;
  18099. }
  18100. static setSkillSuccessTimes(val, addUp = true) {
  18101. if (addUp)
  18102. this.userData.skillSuccessTimes += val;
  18103. else
  18104. this.userData.skillSuccessTimes = val;
  18105. this.saveUserData();
  18106. }
  18107. static getSkillAccTimes() {
  18108. return this.userData.skillAccTimes;
  18109. }
  18110. static setSkillAccTimes(val) {
  18111. this.userData.skillAccTimes += val;
  18112. this.saveUserData();
  18113. }
  18114. static getSkillGuide() {
  18115. if (!xGame.common.openGuide) {
  18116. return 1;
  18117. }
  18118. return this.userData.skillGuide;
  18119. }
  18120. static setSkillGuide(val) {
  18121. this.userData.skillGuide = val;
  18122. this.saveUserData();
  18123. }
  18124. static getPlaceBallLevelList() {
  18125. return this.userData.placeBallData;
  18126. }
  18127. static getPlaceBallLevel(level) {
  18128. let arr = this.userData.placeBallData;
  18129. let index = level - 1;
  18130. let out;
  18131. if (arr[index]) {
  18132. out = arr[index];
  18133. }
  18134. else {
  18135. let max = arr.length;
  18136. if (max == index) {
  18137. out = {
  18138. star: 0,
  18139. play: true,
  18140. isCur: true,
  18141. getAward: false
  18142. };
  18143. }
  18144. else {
  18145. out = {
  18146. star: 0,
  18147. play: false,
  18148. getAward: false
  18149. };
  18150. }
  18151. }
  18152. return out;
  18153. }
  18154. static setPlaceBallLevel(level, star) {
  18155. let arr = this.userData.placeBallData;
  18156. let index = level - 1;
  18157. if (arr[index]) {
  18158. arr[index].star = Math.max(arr[index].star, star);
  18159. }
  18160. else {
  18161. let max = arr.length;
  18162. if (max == index) {
  18163. arr.push({
  18164. star: star,
  18165. play: true,
  18166. getAward: false
  18167. });
  18168. }
  18169. else {
  18170. console.error("关卡存储出错");
  18171. }
  18172. }
  18173. this.saveUserData();
  18174. }
  18175. static setPlaceBallAward(level) {
  18176. let arr = this.userData.placeBallData;
  18177. let index = level - 1;
  18178. if (arr[index]) {
  18179. arr[index].getAward = true;
  18180. }
  18181. this.saveUserData();
  18182. }
  18183. static getShareDiamondTimes() {
  18184. return this.userData.shareDiamondTimes;
  18185. }
  18186. static setShareDiamondTimes(val, addUp = true) {
  18187. if (addUp) {
  18188. this.userData.shareDiamondTimes += val;
  18189. }
  18190. else {
  18191. this.userData.shareDiamondTimes = val;
  18192. }
  18193. this.saveUserData();
  18194. }
  18195. static getDailyVideoShareTimes() {
  18196. return this.userData.dailyVideoShareTimes;
  18197. }
  18198. static setDailyVideoShareTimes(val, addUp = true) {
  18199. if (addUp) {
  18200. this.userData.dailyVideoShareTimes += val;
  18201. }
  18202. else {
  18203. this.userData.dailyVideoShareTimes = val;
  18204. }
  18205. this.saveUserData();
  18206. }
  18207. static getSecretary(index) {
  18208. return this.userData.secretary[index];
  18209. }
  18210. static setSecretary(index, val) {
  18211. this.userData.secretary[index] = val;
  18212. this.saveUserData();
  18213. }
  18214. static getCurSecretary() {
  18215. return this.userData.curSecretary;
  18216. }
  18217. static setCurSecretary(index) {
  18218. this.userData.curSecretary = index;
  18219. this.saveUserData();
  18220. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18221. }
  18222. static getBallRod(index) {
  18223. return this.userData.ballRod[index];
  18224. }
  18225. static setBallRod(index, val) {
  18226. this.userData.ballRod[index] = val;
  18227. this.saveUserData();
  18228. }
  18229. static setBallRodFormServer(haveQiuGanJsonStr) {
  18230. if (!haveQiuGanJsonStr) {
  18231. console.log("setBallRodFormServer数据为空或未定义");
  18232. return;
  18233. }
  18234. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18235. const keys = Object.keys(haveQiuGanJsonObj);
  18236. keys.forEach(key => {
  18237. let v = haveQiuGanJsonObj[key];
  18238. let k = parseInt(key);
  18239. let idx = k - 1;
  18240. console.log('zh:更新IDX = ' + idx);
  18241. console.log('this.userData.ballRod[idx]===' + this.userData.ballRod[idx]);
  18242. if (this.userData.ballRod[idx] === 0) {
  18243. console.log('zh: uuuuu ' + (k - 1));
  18244. this.userData.ballRod[k - 1] = 1;
  18245. this.saveUserData();
  18246. }
  18247. });
  18248. }
  18249. static getCurBallRod() {
  18250. return this.userData.curBallRod;
  18251. }
  18252. static setCurBallRod(index) {
  18253. this.userData.curBallRod = index;
  18254. this.saveUserData();
  18255. }
  18256. static setSignData(val) {
  18257. this.userData.signData = val;
  18258. this.saveUserData();
  18259. }
  18260. static getSignData() {
  18261. return this.userData.signData;
  18262. }
  18263. static setSignTime(val) {
  18264. this.userData.signTime = val;
  18265. this.saveUserData();
  18266. }
  18267. static getSignTime() {
  18268. return this.userData.signTime;
  18269. }
  18270. static getDrawTimes() {
  18271. return this.userData.drawTimes;
  18272. }
  18273. static setDrawTimes(val, addUp = true) {
  18274. if (addUp) {
  18275. this.userData.drawTimes += val;
  18276. }
  18277. else {
  18278. this.userData.drawTimes = val;
  18279. }
  18280. this.saveUserData();
  18281. }
  18282. static getDrawAwardTimes() {
  18283. return this.userData.drawAwardTimes;
  18284. }
  18285. static setDrawAwardTimes(val) {
  18286. this.userData.drawAwardTimes = val;
  18287. this.saveUserData();
  18288. }
  18289. static getDailyfreeDrawTimes() {
  18290. return this.userData.dailyfreeDrawTimes;
  18291. }
  18292. static setDailyfreeDrawTimes(val) {
  18293. this.userData.dailyfreeDrawTimes = val;
  18294. this.saveUserData();
  18295. }
  18296. static setPower(val, addUp = true) {
  18297. if (addUp)
  18298. this.userData.power += val;
  18299. else
  18300. this.userData.power = val;
  18301. if (this.userData.power >= xGame.common.maxPower) {
  18302. this.userData.power = xGame.common.maxPower;
  18303. }
  18304. xGame.eventMgr.event(POWER_CHANGE, val);
  18305. this.saveUserData();
  18306. }
  18307. static getPower() {
  18308. return this.userData.power;
  18309. }
  18310. static setPowerTime(val) {
  18311. this.userData.powerTime = val;
  18312. this.saveUserData();
  18313. }
  18314. static getPowerTime() {
  18315. return this.userData.powerTime;
  18316. }
  18317. static powerEnough() {
  18318. return this.getPower() > 0;
  18319. }
  18320. static getChallengeTimes() {
  18321. return this.userData.challengeTimes;
  18322. }
  18323. static setChallengeTimes(val) {
  18324. this.userData.challengeTimes += val;
  18325. this.saveUserData();
  18326. }
  18327. static getExtraSign() {
  18328. return this.userData.extraSign;
  18329. }
  18330. static setExtraSign(val) {
  18331. this.userData.extraSign = val;
  18332. this.saveUserData();
  18333. }
  18334. static getClassicTimes() {
  18335. return this.userData.classicTimes;
  18336. }
  18337. static setClassicTimes() {
  18338. this.userData.classicTimes += 1;
  18339. this.saveUserData();
  18340. }
  18341. static getGuideHelpLine() {
  18342. return this.userData.guideHelpLine;
  18343. }
  18344. static setGuideHelpLine() {
  18345. this.userData.guideHelpLine = 1;
  18346. this.saveUserData();
  18347. }
  18348. static getNewUser() {
  18349. return this.userData.newUser;
  18350. }
  18351. static setNewUser() {
  18352. this.userData.newUser = false;
  18353. this.saveUserData();
  18354. }
  18355. static getRootBallFoul() {
  18356. return this.userData.rootBallFoul;
  18357. }
  18358. static setRootBallFoul() {
  18359. this.userData.rootBallFoul = 1;
  18360. this.saveUserData();
  18361. }
  18362. static getTimeoutFoul() {
  18363. return this.userData.timeoutFoul;
  18364. }
  18365. static setTimeoutFoul() {
  18366. this.userData.timeoutFoul = 1;
  18367. this.saveUserData();
  18368. }
  18369. static saveDiyGameData() {
  18370. if (this.diyGameSaving)
  18371. return;
  18372. this.diyGameSaving = true;
  18373. Laya.timer.once(500, this, () => {
  18374. this.diyGameSaving = false;
  18375. this.diyGameData.saveData();
  18376. });
  18377. }
  18378. static getChallengeMode_overLev() {
  18379. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18380. return this.challengeMode_overLev;
  18381. }
  18382. static setChallengeMode_overLev(levNum) {
  18383. this.diyGameData.challengeMode_overLev = levNum;
  18384. this.saveDiyGameData();
  18385. }
  18386. static updateUserInfo2Server(type, count = 0) {
  18387. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18388. if (userInfoData == null) {
  18389. return;
  18390. }
  18391. let reqData = xGame.httpMgr.getReqData();
  18392. let rd = JSON.parse(reqData);
  18393. rd.dataType = type;
  18394. let dataValue = 0;
  18395. if (type == "zs") {
  18396. dataValue = this.getDiamond();
  18397. }
  18398. if (type == "jb") {
  18399. dataValue = this.getCoin();
  18400. }
  18401. rd.dataValue = dataValue;
  18402. reqData = JSON.stringify(rd);
  18403. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18404. try {
  18405. let code = res.code;
  18406. let data = res.data;
  18407. if (code == 401) {
  18408. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18409. alert(TIP_MSG_key.pleaseLoginIn);
  18410. return;
  18411. }
  18412. if (code == 200) {
  18413. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18414. }
  18415. else {
  18416. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18417. }
  18418. }
  18419. catch (error) {
  18420. console.log('error=' + error);
  18421. alert("Please check your network connection.");
  18422. }
  18423. finally {
  18424. }
  18425. });
  18426. }
  18427. static getUserZiChanInfo() {
  18428. console.log('zh:开始获取用户资产信息');
  18429. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18430. if (userInfoData == null) {
  18431. return;
  18432. }
  18433. let reqData = xGame.httpMgr.getReqData();
  18434. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18435. try {
  18436. console.log('zh:buySp res = ' + JSON.stringify(res));
  18437. let code = res.code;
  18438. let msg = res.msg;
  18439. if (code == 401) {
  18440. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18441. alert(TIP_MSG_key.pleaseLoginIn);
  18442. return;
  18443. }
  18444. if (code == 200) {
  18445. let d = res.data;
  18446. let zuanShi = d.zuanShi;
  18447. let jinBi = d.jinBi;
  18448. let haveQiuGanJson = d.haveQiuGanJson;
  18449. DataMgr.setDiamondFormServer(zuanShi);
  18450. DataMgr.setCoinFormServer(jinBi);
  18451. console.log('zh:更新球杆信息');
  18452. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18453. }
  18454. else {
  18455. alert(msg);
  18456. }
  18457. }
  18458. catch (error) {
  18459. console.log('error=' + error);
  18460. alert(error);
  18461. }
  18462. finally {
  18463. }
  18464. });
  18465. }
  18466. }
  18467. DataMgr.isNewUser = false;
  18468. DataMgr.fristEnter = true;
  18469. DataMgr.levelType = 0;
  18470. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18471. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18472. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18473. DataMgr.challengeMode_overLev = 0;
  18474. DataMgr.xszyForClassic = false;
  18475. DataMgr.xszyForChallenge = false;
  18476. DataMgr.awardId = 0;
  18477. DataMgr.awardCoin = 0;
  18478. DataMgr.sceneId = -1;
  18479. DataMgr.tryId = 0;
  18480. DataMgr.curLevel = 1;
  18481. DataMgr.vipLevel = 0;
  18482. DataMgr.maxLevel = 0;
  18483. DataMgr.awardRatio = 1;
  18484. DataMgr.gameList = [];
  18485. DataMgr.rankList = [];
  18486. DataMgr.recoverTime = 480000;
  18487. DataMgr.minScore = 0;
  18488. DataMgr.rankDis = 0;
  18489. DataMgr.userSaving = false;
  18490. DataMgr.gameSaving = false;
  18491. DataMgr.diyGameSaving = false;
  18492. class D3Tween extends Laya.Script3D {
  18493. constructor() {
  18494. super();
  18495. this.isInited = false;
  18496. }
  18497. ;
  18498. init() {
  18499. if (this.isInited)
  18500. return;
  18501. this.isInited = true;
  18502. this.gameObj = this.owner;
  18503. this.transform = this.gameObj.transform;
  18504. }
  18505. get rotX() {
  18506. return this.transform.localRotationEulerX;
  18507. }
  18508. set rotX(v) {
  18509. this.transform.localRotationEulerX = v;
  18510. }
  18511. get rotY() {
  18512. return this.transform.localRotationEulerY;
  18513. }
  18514. set rotY(v) {
  18515. this.transform.localRotationEulerY = v;
  18516. }
  18517. get rotZ() {
  18518. return this.transform.localRotationEulerZ;
  18519. }
  18520. set rotZ(v) {
  18521. this.transform.localRotationEulerZ = v;
  18522. }
  18523. get posX() {
  18524. return this.transform.localPositionX;
  18525. }
  18526. set posX(v) {
  18527. this.transform.localPositionX = v;
  18528. }
  18529. get posY() {
  18530. return this.transform.localPositionY;
  18531. }
  18532. set posY(v) {
  18533. this.transform.localPositionY = v;
  18534. }
  18535. get posZ() {
  18536. return this.transform.localPositionZ;
  18537. }
  18538. set posZ(v) {
  18539. this.transform.localPositionZ = v;
  18540. }
  18541. get rotation() {
  18542. return this.transform.localRotation;
  18543. }
  18544. set rotation(v) {
  18545. this.transform.localRotation = v;
  18546. }
  18547. }
  18548. class D2Hole extends Laya.Script {
  18549. constructor() { super(); }
  18550. onTriggerEnter(collider) {
  18551. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18552. return;
  18553. }
  18554. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18555. if (collider.owner["mySrc"].isRunSkillAni) {
  18556. return;
  18557. }
  18558. if (collider.owner["mySrc"].number != 0) {
  18559. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18560. }
  18561. xGame.common.ballColliHole(collider);
  18562. xGame.common.recoverCameraView();
  18563. }
  18564. }
  18565. }
  18566. class Table extends Laya.Script3D {
  18567. constructor() {
  18568. super();
  18569. this.isSetBorder = false;
  18570. this.inited = false;
  18571. }
  18572. ;
  18573. onAwake() {
  18574. this.init();
  18575. }
  18576. init() {
  18577. if (this.inited)
  18578. return;
  18579. this.inited = true;
  18580. this.gameObj = this.owner;
  18581. this.border = this.gameObj.getChildByName("border");
  18582. }
  18583. setBorderPos() {
  18584. if (this.isSetBorder)
  18585. return;
  18586. this.isSetBorder = true;
  18587. let ui = xGame.common.gameUI.ui;
  18588. let bar1 = this.border.getChildByName("bar1");
  18589. let bar2 = this.border.getChildByName("bar2");
  18590. let bar3 = this.border.getChildByName("bar3");
  18591. let bar4 = this.border.getChildByName("bar4");
  18592. let bar5 = this.border.getChildByName("bar5");
  18593. let bar6 = this.border.getChildByName("bar6");
  18594. this.setInfo(bar1, ui.border.bar1, "box");
  18595. this.setInfo(bar2, ui.border.bar2, "box");
  18596. this.setInfo(bar3, ui.border.bar3, "box");
  18597. this.setInfo(bar4, ui.border.bar4, "box");
  18598. this.setInfo(bar5, ui.border.bar5, "box");
  18599. this.setInfo(bar6, ui.border.bar6, "box");
  18600. let circle1 = this.border.getChildByName("circle1");
  18601. let circle2 = this.border.getChildByName("circle2");
  18602. let circle3 = this.border.getChildByName("circle3");
  18603. let circle4 = this.border.getChildByName("circle4");
  18604. let circle5 = this.border.getChildByName("circle5");
  18605. let circle6 = this.border.getChildByName("circle6");
  18606. this.setInfo(circle1, ui.border.circle1, "circle");
  18607. this.setInfo(circle2, ui.border.circle2, "circle");
  18608. this.setInfo(circle3, ui.border.circle3, "circle");
  18609. this.setInfo(circle4, ui.border.circle4, "circle");
  18610. this.setInfo(circle5, ui.border.circle5, "circle");
  18611. this.setInfo(circle6, ui.border.circle6, "circle");
  18612. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18613. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18614. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18615. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  18616. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  18617. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  18618. let arr = xGame.common.gameMgr.holePosList;
  18619. xGame.common.gameMgr.posObj = {
  18620. "1": arr[0],
  18621. "3": arr[2],
  18622. "4": arr[3],
  18623. "6": arr[5]
  18624. };
  18625. }
  18626. initHolePos(x, y) {
  18627. if (x < 300)
  18628. x += 25;
  18629. else if (x > 1000)
  18630. x -= 25;
  18631. else if (y > 200)
  18632. y -= 10;
  18633. else
  18634. y += 10;
  18635. if (y < 200)
  18636. y += 30;
  18637. else if (y > 500)
  18638. y -= 30;
  18639. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  18640. }
  18641. setInfo(d3Obj, d2Obj, type) {
  18642. let ui = xGame.common.gameUI.ui;
  18643. let sprite = new Laya.Sprite();
  18644. ui.border.displayObject.addChild(sprite);
  18645. let colli = xGame.common.getCollider(type);
  18646. sprite.addComponentIntance(colli);
  18647. let rigy = xGame.common.getRigbody();
  18648. rigy.type = "static";
  18649. sprite.addComponentIntance(rigy);
  18650. let d3Pos = d3Obj.transform.position;
  18651. xGame.common.pos3to2Convert(d3Pos);
  18652. let scaleX = d3Obj.transform.localScaleX;
  18653. let scaleZ = d3Obj.transform.localScaleZ;
  18654. let width = xGame.common.scale3to2Convert(scaleZ);
  18655. let height = xGame.common.scale3to2Convert(scaleX);
  18656. sprite.pivotX = width / 2;
  18657. sprite.pivotY = height / 2;
  18658. sprite.x = d3Pos.x;
  18659. sprite.y = d3Pos.y;
  18660. sprite.width = width;
  18661. sprite.height = height;
  18662. d2Obj.x = d3Pos.x;
  18663. d2Obj.y = d3Pos.y;
  18664. d2Obj.width = width;
  18665. d2Obj.height = height;
  18666. if (type == "box") {
  18667. colli.width = width;
  18668. colli.height = height;
  18669. colli.isSensor = false;
  18670. colli.label = "border";
  18671. }
  18672. else {
  18673. colli.radius = width / 2;
  18674. colli.isSensor = true;
  18675. colli.label = "hole";
  18676. sprite.addComponent(D2Hole);
  18677. }
  18678. }
  18679. }
  18680. class D3World extends Laya.Script3D {
  18681. constructor() {
  18682. super();
  18683. this.loadNum = 0;
  18684. this.setLoadNum = 7;
  18685. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  18686. }
  18687. onAwake() {
  18688. }
  18689. loadScene() {
  18690. this.scene = this.owner;
  18691. let url = `res/unityRes/root.lh`;
  18692. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  18693. this.scene.addChild(prefab);
  18694. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  18695. this.putCameraInfo();
  18696. this.camera.enableHDR = false;
  18697. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  18698. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  18699. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  18700. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  18701. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  18702. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  18703. this.knife.active = false;
  18704. this.loadD3Obj();
  18705. }));
  18706. }
  18707. putCameraInfo() {
  18708. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  18709. this.cameraObj = new cameraType();
  18710. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  18711. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  18712. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  18713. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  18714. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  18715. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  18716. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  18717. this.visitAngleChild.init();
  18718. this.visitRootObj.posX = this.visitAngleChild.posX;
  18719. this.visitRootObj.posY = this.visitAngleChild.posY;
  18720. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  18721. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  18722. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  18723. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  18724. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18725. xGame.common.showOneCamera("mainCamera");
  18726. }
  18727. loadD3Obj() {
  18728. this.loadTable();
  18729. this.loadRoom();
  18730. this.loadInHoleParticial();
  18731. this.loadIceParticial();
  18732. this.loadHitParticial();
  18733. this.loadFireworksParticial();
  18734. this.loadBall();
  18735. }
  18736. loadInHoleParticial() {
  18737. this.loadD3Res("inHoleEft", "", (prefab) => {
  18738. prefab.addComponent(Partical);
  18739. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  18740. });
  18741. }
  18742. loadIceParticial() {
  18743. this.loadD3Res("iceEft", "", (prefab) => {
  18744. prefab.addComponent(Partical);
  18745. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  18746. });
  18747. }
  18748. loadHitParticial() {
  18749. this.loadD3Res("hitEft", "", (prefab) => {
  18750. prefab.addComponent(Partical);
  18751. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18752. });
  18753. }
  18754. loadFireworksParticial() {
  18755. this.loadD3Res("fireworksEft", "", (prefab) => {
  18756. prefab.addComponent(Partical);
  18757. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18758. });
  18759. }
  18760. loadBall(index = 1) {
  18761. this.loadD3Res("ball", index, (prefab) => {
  18762. this.ballPrefab = prefab;
  18763. this.ballPrefab.addComponent(Ball);
  18764. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18765. });
  18766. }
  18767. loadTable(index = 1) {
  18768. this.loadD3Res("table", index, (prefab) => {
  18769. this.tableSrc = prefab.addComponent(Table);
  18770. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18771. this.d3Hand.init();
  18772. this.tableRoot.addChild(prefab);
  18773. });
  18774. }
  18775. loadRoom(index = 1) {
  18776. this.loadD3Res("room", index, (prefab) => {
  18777. this.roomRoot.addChild(prefab);
  18778. });
  18779. }
  18780. loadD3Res(type, index, callback) {
  18781. let url = `res/unityRes/${type}${index}.lh`;
  18782. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18783. callback && callback(prefab);
  18784. this.checkResLoad();
  18785. }));
  18786. }
  18787. checkResLoad() {
  18788. this.loadNum++;
  18789. if (this.loadNum >= this.setLoadNum) {
  18790. xGame.eventMgr.event(D3RES_LOADED);
  18791. }
  18792. }
  18793. prePlayEft() {
  18794. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  18795. eft.transform.localPositionX = 0;
  18796. eft.transform.localPositionY = -5;
  18797. eft.transform.localPositionZ = 0;
  18798. eft.active = true;
  18799. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  18800. ice.transform.localPositionX = 0;
  18801. ice.transform.localPositionY = -5;
  18802. ice.transform.localPositionZ = 0;
  18803. ice.active = true;
  18804. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  18805. hit.transform.localPositionX = 0;
  18806. hit.transform.localPositionY = -5;
  18807. hit.transform.localPositionZ = 0;
  18808. hit.active = true;
  18809. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  18810. fireworks.transform.localPositionX = 0;
  18811. fireworks.transform.localPositionY = -5;
  18812. fireworks.transform.localPositionZ = 0;
  18813. fireworks.active = true;
  18814. }
  18815. }
  18816. class cameraType {
  18817. }
  18818. class MoyuMgr$1 {
  18819. static initMoyu() {
  18820. this.moyuView = new MoyuView$1();
  18821. Laya.stage.addChild(this.moyuView.ui.displayObject);
  18822. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  18823. this.moyuView.ui.displayObject.zOrder = 1000;
  18824. this.moyuView.init();
  18825. this.moyuView.showTip(true);
  18826. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  18827. window['XApk'] = this;
  18828. }
  18829. static showAge(show) {
  18830. if (this.moyuView)
  18831. this.moyuView.showAge(show);
  18832. }
  18833. static onPlatMsg(idx) {
  18834. if (!MoyuMgr$1.moyuView)
  18835. return;
  18836. if (idx == '0') {
  18837. MoyuMgr$1.moyuView.showTip(false);
  18838. }
  18839. }
  18840. static showAgree(call) {
  18841. if (this.moyuView)
  18842. this.moyuView.showAgree(call);
  18843. else
  18844. call && call();
  18845. }
  18846. static showXy(type = 1) {
  18847. if (this.moyuView)
  18848. this.moyuView.showXy(type);
  18849. }
  18850. }
  18851. MoyuMgr$1.isAdvise = false;
  18852. class MoyuView$1 {
  18853. constructor() {
  18854. this.ysxyNum = 1;
  18855. this.ysJson = null;
  18856. this.ui = ui_UIMoyu.createInstance();
  18857. }
  18858. init() {
  18859. this.ui.mainBg.visible = false;
  18860. this.ui.xyNode.visible = false;
  18861. this.ui.ageNode.visible = false;
  18862. this.ui.tipNode.visible = false;
  18863. this.ui.rnNode.visible = false;
  18864. this.ui.fcmNode.visible = false;
  18865. this.ui.ageTip.visible = false;
  18866. this.ui.msgNode.visible = false;
  18867. this.ui.visible = false;
  18868. this.ui.xyNode.xyList.setVirtual();
  18869. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  18870. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  18871. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  18872. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  18873. this.ui.xyNode.btnKnown.visible = false;
  18874. this.ui.xyNode.xy1.visible = false;
  18875. this.ui.xyNode.xy2.visible = false;
  18876. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  18877. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  18878. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  18879. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  18880. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  18881. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  18882. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  18883. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  18884. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  18885. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  18886. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  18887. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  18888. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  18889. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  18890. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  18891. this.ysxyNum = 2;
  18892. }
  18893. }
  18894. onClick(obj) {
  18895. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18896. switch (obj) {
  18897. case this.ui.ageTip:
  18898. if (Moyu.isTTApk) {
  18899. this.ui.ageNode.visible = true;
  18900. this.ui.mainBg.visible = true;
  18901. }
  18902. break;
  18903. case this.ui.tipNode:
  18904. this.showTip(false);
  18905. break;
  18906. case this.ui.ageNode.btnAge:
  18907. this.ui.ageNode.visible = false;
  18908. this.ui.mainBg.visible = false;
  18909. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  18910. this.ui.visible = false;
  18911. break;
  18912. case this.ui.xyNode.btnXy3:
  18913. case this.ui.xyNode.btnXy1:
  18914. this.loadXy(1);
  18915. break;
  18916. case this.ui.xyNode.btnXy2:
  18917. this.loadXy(2);
  18918. break;
  18919. case this.ui.xyNode.btnBack:
  18920. this.ui.xyNode.xy1.visible = true;
  18921. this.ui.xyNode.xy2.visible = false;
  18922. break;
  18923. case this.ui.xyNode.btnKnown:
  18924. this.ui.xyNode.visible = false;
  18925. this.ui.mainBg.visible = false;
  18926. this.ui.visible = false;
  18927. break;
  18928. case this.ui.rnNode.btnCheck:
  18929. this.check();
  18930. break;
  18931. case this.ui.rnNode.btnExit:
  18932. case this.ui.xyNode.btnNo:
  18933. this.ysxyNum--;
  18934. if (this.ysxyNum > 0)
  18935. this.showMsg("Refuse to quit the game once again");
  18936. else {
  18937. Moyu.userAgree(false);
  18938. Moyu.exit();
  18939. }
  18940. break;
  18941. case this.ui.xyNode.btnSure:
  18942. case this.ui.xyNode.btnYes:
  18943. DataMgr.userData.isAgree = true;
  18944. DataMgr.saveUserData();
  18945. this.onAgree();
  18946. break;
  18947. case this.ui.rnNode.btnDone:
  18948. this.ui.rnNode.visible = false;
  18949. this.ui.visible = false;
  18950. break;
  18951. case this.ui.fcmNode.btnRn:
  18952. this.showRn();
  18953. break;
  18954. }
  18955. }
  18956. showTip(show) {
  18957. if (!Moyu.isVVApk && !Moyu.isOPApk)
  18958. return;
  18959. if (show) {
  18960. MoyuMgr$1.isAdvise = true;
  18961. this.ui.visible = true;
  18962. this.ui.tipNode.visible = true;
  18963. this.ui.tipNode.alpha = 1;
  18964. Laya.timer.once(1000, this, this.showTip, [false]);
  18965. }
  18966. else {
  18967. this.ui.tipNode.alpha = 1;
  18968. this.ui.tipNode.visible = true;
  18969. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  18970. this.ui.tipNode.visible = false;
  18971. MoyuMgr$1.isAdvise = false;
  18972. }), 1000);
  18973. }
  18974. }
  18975. showAge(show, px = 0, py = 0) {
  18976. if (Moyu.platType > 10 && !Moyu.isIos) {
  18977. this.ui.ageTip.x = px;
  18978. this.ui.ageTip.y = py;
  18979. this.ui.ageTip.visible = show;
  18980. if (show)
  18981. this.ui.visible = true;
  18982. }
  18983. }
  18984. showAgree(call) {
  18985. this.agreeCall = call;
  18986. this.onAgree();
  18987. return;
  18988. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  18989. this.showXy(0);
  18990. }
  18991. else
  18992. this.onAgree();
  18993. }
  18994. onAgree() {
  18995. if (!this.ui.ageNode.visible)
  18996. this.ui.visible = false;
  18997. this.ui.xyNode.visible = false;
  18998. Moyu.userAgree(true);
  18999. this.showAge(false);
  19000. this.agreeCall && this.agreeCall();
  19001. this.showRn();
  19002. }
  19003. showMsg(txt) {
  19004. this.ui.msgNode.txtMsg.text = txt;
  19005. this.ui.msgNode.visible = true;
  19006. this.ui.msgNode.alpha = 1;
  19007. this.ui.visible = true;
  19008. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19009. this.ui.msgNode.visible = false;
  19010. }), 2500, true);
  19011. }
  19012. showRn() {
  19013. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19014. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19015. this.ui.rnNode.rn1.visible = true;
  19016. this.ui.rnNode.rn2.visible = false;
  19017. this.ui.rnNode.rn3.visible = false;
  19018. this.ui.rnNode.rn4.visible = false;
  19019. this.ui.rnNode.visible = true;
  19020. this.ui.mainBg.visible = true;
  19021. this.ui.rnNode.btnDone.visible = false;
  19022. this.ui.rnNode.btnExit.visible = true;
  19023. this.ui.rnNode.btnCheck.visible = true;
  19024. this.ui.fcmNode.visible = false;
  19025. this.ui.visible = true;
  19026. return;
  19027. }
  19028. }
  19029. this.showFcm();
  19030. }
  19031. showFcm() {
  19032. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19033. Moyu.initFCM(true);
  19034. if (Moyu.gameTime < 1)
  19035. this.fcmLoop();
  19036. else if (Moyu.gameTime < 999)
  19037. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19038. }
  19039. }
  19040. fcmLoop() {
  19041. if (Moyu.gameTime < 1) {
  19042. this.ui.rnNode.visible = false;
  19043. this.ui.fcmNode.visible = true;
  19044. this.ui.mainBg.visible = true;
  19045. this.ui.visible = true;
  19046. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19047. Laya.timer.clear(this.ui, this.fcmLoop);
  19048. }
  19049. }
  19050. check() {
  19051. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19052. this.ui.rnNode.rn1.visible = false;
  19053. this.ui.rnNode.rn2.visible = false;
  19054. this.ui.rnNode.rn4.visible = true;
  19055. }
  19056. else if (this.ui.rnNode.rn4.visible) {
  19057. let name = this.ui.rnNode.inputName.text;
  19058. let code = this.ui.rnNode.inputCode.text;
  19059. if (code && code.length == 18) {
  19060. this.ui.rnNode.rn1.visible = false;
  19061. this.ui.rnNode.rn4.visible = false;
  19062. Moyu.authenticate(name, code, (res) => {
  19063. this.ui.rnNode.rn2.visible = !res;
  19064. this.ui.rnNode.rn3.visible = res;
  19065. this.ui.rnNode.btnDone.visible = res;
  19066. this.ui.rnNode.btnExit.visible = !res;
  19067. this.ui.rnNode.btnCheck.visible = !res;
  19068. if (res)
  19069. this.showFcm();
  19070. });
  19071. }
  19072. else
  19073. this.showMsg("信息填写不完整");
  19074. }
  19075. }
  19076. loadXy(type = 0) {
  19077. this.ui.xyNode.xy1.visible = false;
  19078. this.ui.xyNode.xy2.visible = true;
  19079. this.ui.xyNode.xyList.scrollToView(0);
  19080. if (type == 1) {
  19081. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19082. }
  19083. else if (type == 2) {
  19084. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19085. }
  19086. }
  19087. showXy(type = 0) {
  19088. this.xyBtn();
  19089. if (type == 0) {
  19090. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19091. this.ui.xyNode.btnSure.visible = true;
  19092. }
  19093. else {
  19094. this.ui.xyNode.btnYes.visible = true;
  19095. this.ui.xyNode.btnNo.visible = true;
  19096. }
  19097. }
  19098. else {
  19099. this.ui.xyNode.btnKnown.visible = true;
  19100. this.ui.mainBg.visible = true;
  19101. }
  19102. this.ui.xyNode.xy1.visible = true;
  19103. this.ui.xyNode.xy2.visible = false;
  19104. this.ui.xyNode.visible = true;
  19105. this.ui.visible = true;
  19106. }
  19107. xyBtn() {
  19108. this.ui.xyNode.btnSure.visible = false;
  19109. this.ui.xyNode.btnYes.visible = false;
  19110. this.ui.xyNode.btnNo.visible = false;
  19111. this.ui.xyNode.btnKnown.visible = false;
  19112. {
  19113. this.ui.xyNode.btnXy3.visible = false;
  19114. this.ui.xyNode.btnXy2.visible = true;
  19115. this.ui.xyNode.btnXy1.visible = true;
  19116. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19117. }
  19118. }
  19119. createXY(json) {
  19120. this.ysJson = json.content;
  19121. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19122. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19123. this.ui.xyNode.xy2.visible = true;
  19124. }
  19125. renderListItem(idx, cell) {
  19126. let xy = this.ysJson[idx];
  19127. cell.height = xy.line * 30;
  19128. cell.xyItem.text = xy.text;
  19129. }
  19130. onDestroy() {
  19131. this.agreeCall = null;
  19132. }
  19133. }
  19134. class UILoading extends UIBase {
  19135. constructor() {
  19136. super();
  19137. this.accTime = 0;
  19138. this.curNum = 0;
  19139. this.rate = 1;
  19140. this.loadSubOk = false;
  19141. this.loadResOK = false;
  19142. this.openLoading = true;
  19143. this.beginLoadRes = false;
  19144. this.finishD2 = false;
  19145. this.finishD3 = false;
  19146. }
  19147. onConstructor() {
  19148. this.ui = ui_UILoading.createInstance();
  19149. this.contentPane = this.ui;
  19150. this.isEject = false;
  19151. this._initUI();
  19152. this._addEvent();
  19153. }
  19154. _initUI() {
  19155. MoyuMgr$1.initMoyu();
  19156. }
  19157. _addEvent() {
  19158. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19159. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19160. }
  19161. show() {
  19162. super.show();
  19163. console.log('zh:加载分包资源');
  19164. loadSubRes(this.subResProgress.bind(this));
  19165. this.ui.txtLoad.text = "Loading...";
  19166. }
  19167. subResProgress(pro, finish) {
  19168. this.curNum = pro;
  19169. if (finish) {
  19170. this.curNum = 1;
  19171. this.loadSubOk = true;
  19172. }
  19173. }
  19174. laodD3Res() {
  19175. let scene3D = new Laya.Scene3D();
  19176. xGame.common.d3Scene = scene3D;
  19177. xGame.common.d3World = scene3D.addComponent(D3World);
  19178. xGame.common.d3World.loadScene();
  19179. }
  19180. loadD2Res() {
  19181. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19182. this.finishD2 = true;
  19183. this.checkLoadAll();
  19184. this.curNum = 1;
  19185. }), Laya.Handler.create(this, (pro) => {
  19186. this.curNum = pro;
  19187. }, null, false));
  19188. }
  19189. d3ResFinish() {
  19190. this.finishD3 = true;
  19191. this.checkLoadAll();
  19192. }
  19193. checkLoadAll() {
  19194. if (this.finishD2 && this.finishD3) {
  19195. this.loadResOK = true;
  19196. }
  19197. }
  19198. loadRes() {
  19199. this.laodD3Res();
  19200. this.loadD2Res();
  19201. }
  19202. myUpdate(dt) {
  19203. if (!this.openLoading)
  19204. return;
  19205. this.accTime += dt * this.rate;
  19206. if (this.accTime >= this.curNum)
  19207. this.accTime = this.curNum;
  19208. this.ui.loadinfo.value = this.accTime * 100;
  19209. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19210. if (!this.beginLoadRes) {
  19211. this.beginLoadRes = true;
  19212. this.ui.txtLoad.text = "Loading...";
  19213. this.curNum = 0;
  19214. this.accTime = 0;
  19215. this.loadRes();
  19216. }
  19217. if (this.loadResOK) {
  19218. this.openLoading = false;
  19219. Laya.timer.once(300, this, () => {
  19220. xGame.common.d3Scene.active = false;
  19221. MoyuMgr$1.showAgree(enterGame);
  19222. });
  19223. }
  19224. }
  19225. }
  19226. release() {
  19227. }
  19228. hide() {
  19229. super.hide();
  19230. this.release();
  19231. }
  19232. onClose() {
  19233. this.hide();
  19234. }
  19235. }
  19236. UILoading.uiName = "UILoading";
  19237. class UIRepentProp$1 extends UIBase {
  19238. constructor() {
  19239. super();
  19240. this.viewType = 0;
  19241. this.regretType = 0;
  19242. }
  19243. onConstructor() {
  19244. this.ui = ui_UIRepentProp.createInstance();
  19245. this.contentPane = this.ui;
  19246. this.isEject = false;
  19247. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19248. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19249. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19250. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19251. }
  19252. show(viewType, regretType, callback) {
  19253. PlatMgr.showInsert(true);
  19254. this.viewType = viewType;
  19255. this.regretType = regretType;
  19256. this.callback = callback;
  19257. super.show();
  19258. this.ui.t0.play();
  19259. this.ui.c1.selectedIndex = this.viewType;
  19260. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19261. if (this.viewType == 0) {
  19262. let guide = DataMgr.getGuideHelpLine();
  19263. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19264. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19265. }
  19266. xGame.common.gameMgr.gamePause = true;
  19267. }
  19268. hideSelf() {
  19269. xGame.common.gameMgr.gamePause = false;
  19270. this.callback && this.callback(false);
  19271. this.hide();
  19272. }
  19273. videoRegret() {
  19274. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19275. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19276. }
  19277. else {
  19278. console.log('zh:AD 失败,直接发放奖励');
  19279. this.qjff_AD_for_UIrepentProp_videoRegret();
  19280. }
  19281. }
  19282. qjff_AD_for_UIrepentProp_videoRegret() {
  19283. this.callback && this.callback(true);
  19284. this.hideSelf();
  19285. }
  19286. videoAddHelpLine() {
  19287. let guide = DataMgr.getGuideHelpLine();
  19288. if (guide == 0) {
  19289. this.callback && this.callback(true);
  19290. this.hideSelf();
  19291. DataMgr.setGuideHelpLine();
  19292. xGame.common.gameUI.ui.guideNode.visible = false;
  19293. }
  19294. else {
  19295. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19296. if (Laya.Browser.onAndroid) {
  19297. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19298. if (!boo) {
  19299. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19300. return;
  19301. }
  19302. }
  19303. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19304. }
  19305. else {
  19306. console.log('zh:AD 失败,直接发放奖励');
  19307. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19308. }
  19309. }
  19310. }
  19311. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19312. this.callback && this.callback(true);
  19313. this.hideSelf();
  19314. }
  19315. }
  19316. UIRepentProp$1.uiName = "UIRepentProp";
  19317. class UIRodMethod$1 extends UIBase {
  19318. constructor() {
  19319. super();
  19320. this.isPressd = false;
  19321. }
  19322. onConstructor() {
  19323. this.ui = ui_UIRodMethod.createInstance();
  19324. this.contentPane = this.ui;
  19325. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19326. this.moveDir = new Laya.Vector2();
  19327. this.moveDest = new Laya.Vector2();
  19328. this.centerPos = new Laya.Vector2();
  19329. xGame.common.uiRodMethod = this;
  19330. }
  19331. show() {
  19332. super.show();
  19333. xGame.common.gameMgr.gamePause = true;
  19334. this.openPressDotEvent();
  19335. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19336. this.centerPos.x = this.ui.white.x;
  19337. this.centerPos.y = this.ui.white.y;
  19338. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19339. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19340. this.setDot();
  19341. }
  19342. setDot() {
  19343. this.ui.dot.x = this.moveDest.x;
  19344. this.ui.dot.y = this.moveDest.y;
  19345. }
  19346. closeSelf() {
  19347. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19348. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19349. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19350. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19351. xGame.common.gameMgr.gamePause = false;
  19352. this.hide();
  19353. }
  19354. openPressDotEvent() {
  19355. this.closePressDotEvent();
  19356. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19357. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19358. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19359. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19360. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19361. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19362. }
  19363. closePressDotEvent() {
  19364. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19365. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19366. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19367. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19368. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19369. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19370. }
  19371. onDown(e) {
  19372. if (e.type == Laya.Event.MOUSE_DOWN)
  19373. this.isPressd = true;
  19374. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19375. this.isPressd = false;
  19376. if (!this.isPressd)
  19377. return;
  19378. this.moveDest.x = e.stageX;
  19379. this.moveDest.y = e.stageY;
  19380. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19381. if (dis > 6724) {
  19382. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19383. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19384. }
  19385. this.setDot();
  19386. }
  19387. resetRod() {
  19388. this.ui.dot.x = this.ui.white.x;
  19389. this.ui.dot.y = this.ui.white.y;
  19390. this.gameRod.dot.x = this.gameRod.bg.x;
  19391. this.gameRod.dot.y = this.gameRod.bg.y;
  19392. xGame.common.rodOffest.x = 0;
  19393. xGame.common.rodOffest.y = 0;
  19394. }
  19395. }
  19396. UIRodMethod$1.uiName = "UIRodMethod";
  19397. class UIMsg$1 extends UIBase {
  19398. constructor() {
  19399. super();
  19400. }
  19401. onConstructor() {
  19402. this.ui = ui_UIMsg.createInstance();
  19403. this.contentPane = this.ui;
  19404. this.isEject = false;
  19405. this.isMuti = true;
  19406. }
  19407. show(msg, callback) {
  19408. super.show();
  19409. this.ui.tipsNode.msgTxt.text = msg;
  19410. this.ui.alpha = 1;
  19411. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19412. this.hide();
  19413. callback && callback();
  19414. }), 1000);
  19415. }
  19416. }
  19417. UIMsg$1.uiName = "UIMsg";
  19418. class UITips$1 extends UIBase {
  19419. constructor() {
  19420. super();
  19421. this.type = 0;
  19422. }
  19423. onConstructor() {
  19424. this.ui = ui_UITips.createInstance();
  19425. this.contentPane = this.ui;
  19426. this.isEject = false;
  19427. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19428. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19429. }
  19430. show(tipsTxt, womanTxt, type) {
  19431. super.show();
  19432. this.ui.t0.play();
  19433. this.ui.myNode.tipsTxt.text = tipsTxt;
  19434. this.ui.myNode.womanTxt.text = womanTxt;
  19435. PlatMgr.showInsert(true);
  19436. this.ui.myNode.c1.selectedIndex = type;
  19437. this.type = type;
  19438. switch (this.type) {
  19439. case TipsType.exitGame:
  19440. xGame.common.gameMgr.gamePause = true;
  19441. break;
  19442. case TipsType.foul:
  19443. Laya.timer.once(200, this, () => {
  19444. xGame.common.gameMgr.gamePause = true;
  19445. });
  19446. break;
  19447. default:
  19448. break;
  19449. }
  19450. }
  19451. clickLeftBtn() {
  19452. this.hide();
  19453. xGame.common.gameMgr.gamePause = false;
  19454. switch (this.type) {
  19455. case TipsType.exitGame:
  19456. break;
  19457. case TipsType.foul:
  19458. break;
  19459. default:
  19460. break;
  19461. }
  19462. }
  19463. clickRightBtn() {
  19464. this.hide();
  19465. switch (this.type) {
  19466. case TipsType.exitGame:
  19467. xGame.eventMgr.event(RESET_GAME);
  19468. xGame.uiMgr.Show(UIMain$1);
  19469. Moyu.recordEnd(this, null);
  19470. xGame.common.longHelpLine = false;
  19471. break;
  19472. case TipsType.foul:
  19473. xGame.common.gameMgr.gamePause = false;
  19474. Laya.timer.clearAll(this);
  19475. break;
  19476. default:
  19477. break;
  19478. }
  19479. }
  19480. }
  19481. UITips$1.uiName = "UITips";
  19482. class UIGame$1 extends UIBase {
  19483. constructor() {
  19484. super();
  19485. this.powerNum = 0;
  19486. this.isD3Inited = false;
  19487. this.isPrePlay = false;
  19488. this.isMoveRod = false;
  19489. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19490. this.rulerDis = 20;
  19491. this.rulerOffset = 0;
  19492. }
  19493. onConstructor() {
  19494. this.ui = ui_UIGame.createInstance();
  19495. this.contentPane = this.ui;
  19496. this.ui.x += xGame.common.sysOffestNum;
  19497. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19498. this.isEject = false;
  19499. xGame.common.gameUI = this;
  19500. this.initSelf();
  19501. }
  19502. isTurnSelf() {
  19503. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19504. return true;
  19505. }
  19506. }
  19507. initSelf() {
  19508. let topUI = this.ui.topNode;
  19509. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19510. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19511. this.barInfo = {};
  19512. this.barInfo.curY = 0;
  19513. this.barInfo.height = this.ui.powerNode.height;
  19514. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19515. this.barInfo.powerStartY = this.ui.powerNode.y;
  19516. xGame.common.aiPlayer = new AIPlayer();
  19517. xGame.common.gameMgr = new GameMgr();
  19518. xGame.common.skillMgr = new SkillMgr();
  19519. xGame.common.wordsMgr = new WordsMgr();
  19520. xGame.common.talkMgr = new TalkMgr();
  19521. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19522. console.log("加载经典模式表情文件chenggon !");
  19523. });
  19524. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19525. console.log("挑战模式奖励模式spine加载成功!");
  19526. });
  19527. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19528. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19529. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19530. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19531. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19532. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19533. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19534. }
  19535. getGanZiImg() {
  19536. let index = DataMgr.getCurBallRod();
  19537. let data = cfgTable.ballrodData[index + 1];
  19538. let gan_url = xGame.common.getGameIconUrl(data.img);
  19539. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19540. this.ui.powerNode.showImg.url = gan_url;
  19541. console.log('zh:修改杆子图标O K');
  19542. }
  19543. returnHome() {
  19544. let tips = "Are you sure to exit the game?";
  19545. let woman = "Boss, why don't you play for a while longer?";
  19546. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19547. }
  19548. addRodMethodClick() {
  19549. if (this.isTurnSelf()) {
  19550. xGame.uiMgr.Show(UIRodMethod$1);
  19551. }
  19552. }
  19553. clickHelpLineBtn(force = false) {
  19554. if (!this.isTurnSelf())
  19555. return;
  19556. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19557. if (success) {
  19558. xGame.common.longHelpLine = true;
  19559. xGame.common.d2World.getHelpLine();
  19560. Moyu.sendDataEvent("guideNum");
  19561. }
  19562. else {
  19563. }
  19564. });
  19565. }
  19566. renderSelfDisplayBalls(index, target) {
  19567. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19568. target.myImg.url = xGame.common.getGameIconUrl(str);
  19569. }
  19570. renderAIDisplayBalls(index, target) {
  19571. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19572. target.myImg.url = xGame.common.getGameIconUrl(str);
  19573. ;
  19574. }
  19575. updateMode() {
  19576. if (xGame.common.gameMode == GameMode.classic) {
  19577. this.ui.topNode.scoreNode.visible = false;
  19578. }
  19579. else if (xGame.common.gameMode == GameMode.bigMove) {
  19580. this.ui.topNode.scoreNode.visible = true;
  19581. }
  19582. }
  19583. show() {
  19584. super.show();
  19585. console.log("zh:uigame show AADD");
  19586. this.ui.alpha = 0;
  19587. this.updateSelf();
  19588. xGame.common.gameMgr.gamePause = false;
  19589. xGame.common.gameUI.ui.blackAni.visible = false;
  19590. xGame.common.gameUI.ui.whiteAni.visible = false;
  19591. this.ui.powerEft.visible = false;
  19592. this.ui.colorNode.visible = false;
  19593. this.updateHead();
  19594. let curUse = DataMgr.getCurBallRod();
  19595. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19596. this.getGanZiImg();
  19597. }
  19598. updateSelf() {
  19599. if (xGame.common.gameMode == GameMode.classic) {
  19600. this.ui.c1.selectedIndex = 0;
  19601. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19602. this.ui.topNode.middleNode.visible = true;
  19603. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19604. }
  19605. else if (xGame.common.gameMode == GameMode.bigMove) {
  19606. this.ui.c1.selectedIndex = 0;
  19607. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19608. this.ui.topNode.middleNode.visible = false;
  19609. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19610. let rand = xGame.common.randomNum(1, max);
  19611. let guide = DataMgr.getSkillGuide();
  19612. if (guide == 0)
  19613. rand = 1;
  19614. xGame.common.bigMoveLevelIndex = rand;
  19615. }
  19616. else if (xGame.common.gameMode == GameMode.placeBall) {
  19617. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19618. this.ui.c1.selectedIndex = 1 + data.type;
  19619. this.ui.alpha = 1;
  19620. this.startGame();
  19621. }
  19622. this.updateMode();
  19623. this.initD3world();
  19624. this.initD2world();
  19625. }
  19626. startGame() {
  19627. this.ui.snowNode.visible = Math.random() <= 0.1;
  19628. this.ui.d2Node.visible = false;
  19629. xGame.common.d3World.d3Hand.gameObj.active = false;
  19630. xGame.common.d3World.tableSrc.init();
  19631. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19632. this.cameraViewChange(() => {
  19633. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  19634. switch (xGame.common.gameMode) {
  19635. case GameMode.classic:
  19636. xGame.common.d3World.d3Hand.gameObj.active = true;
  19637. this.playPutBallD3Ani();
  19638. break;
  19639. case GameMode.bigMove:
  19640. this.enterGame();
  19641. Laya.timer.once(500, this, () => {
  19642. this.ui.topNode.middleNode.visible = true;
  19643. this.ui.topNode.middleNode.t0.play();
  19644. });
  19645. break;
  19646. case GameMode.placeBall:
  19647. this.enterGame();
  19648. break;
  19649. default:
  19650. break;
  19651. }
  19652. });
  19653. PlatMgr.showBanner(false);
  19654. }
  19655. enterGame() {
  19656. this.ui.d2Node.visible = true;
  19657. xGame.common.d3World.d3Hand.gameObj.active = false;
  19658. xGame.common.showOneCamera("mainCamera");
  19659. Moyu.recordGame(30, true);
  19660. if (!this.isPrePlay) {
  19661. this.isPrePlay = true;
  19662. xGame.common.d3World.prePlayEft();
  19663. }
  19664. xGame.common.gameMgr.gameReady();
  19665. this.openAllEvent();
  19666. this.ui.snowNode.visible = false;
  19667. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  19668. this.ui.helpBtn.visible = condition;
  19669. }
  19670. showHelpLineGuide() {
  19671. let longGuide = DataMgr.getGuideHelpLine();
  19672. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  19673. this.ui.helpBtn.visible = true;
  19674. this.ui.guideNode.visible = true;
  19675. }
  19676. }
  19677. setTurnAlpha(alpha) {
  19678. this.ui.keduNode.alpha = alpha;
  19679. this.ui.ganNode.alpha = alpha;
  19680. this.ui.rodMethodNode.alpha = alpha;
  19681. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  19682. }
  19683. cameraViewChange(callback) {
  19684. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19685. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  19686. xGame.common.showOneCamera("visitAngle");
  19687. cameraSrc.localRotationEulerY = 180;
  19688. cameraSrc.localRotationEulerZ = 0;
  19689. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  19690. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  19691. callback && callback();
  19692. }));
  19693. }));
  19694. }
  19695. playPutBallD3Ani() {
  19696. xGame.common.showOneCamera("mainCamera");
  19697. let handSrc = xGame.common.d3World.d3Hand;
  19698. handSrc.gameObj.active = true;
  19699. handSrc.transform.localPositionZ = 3;
  19700. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  19701. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  19702. handSrc.gameObj.active = false;
  19703. this.enterGame();
  19704. }), 400);
  19705. }));
  19706. }
  19707. updateHead() {
  19708. let user = Moyu.getUserInfo();
  19709. this.ui.topNode.selfNameTxt.text = user.nickName;
  19710. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  19711. let aiData = xGame.cfgMgr.getRandomUserInfo();
  19712. if (DataMgr.getSkillGuide() < 1) {
  19713. this.ui.topNode.aiNameTxt.text = 'billiards';
  19714. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  19715. }
  19716. else {
  19717. this.ui.topNode.aiNameTxt.text = aiData.name;
  19718. let randNo = Math.floor(Math.random() * 10) + 1;
  19719. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  19720. }
  19721. }
  19722. initD2world() {
  19723. let node = this.ui.d2Root.displayObject;
  19724. let src = node.getComponent(D2World);
  19725. if (!src) {
  19726. xGame.common.d2World = node.addComponent(D2World);
  19727. }
  19728. xGame.common.d2World.initSelf();
  19729. }
  19730. initD3world() {
  19731. if (this.isD3Inited)
  19732. return;
  19733. this.isD3Inited = true;
  19734. let scene3D = xGame.common.d3Scene;
  19735. this.ui.d3Root.displayObject.addChild(scene3D);
  19736. scene3D.active = true;
  19737. xGame.common.d3World.tableSrc.setBorderPos();
  19738. }
  19739. onRootMove(e) {
  19740. let rootBall = xGame.common.d2World.rootBall;
  19741. this.ui.moveNode.x = e.x;
  19742. this.ui.moveNode.y = e.y;
  19743. rootBall.gameObj.x = e.x;
  19744. rootBall.gameObj.y = e.y;
  19745. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  19746. }
  19747. aiRootMove(move) {
  19748. if (move)
  19749. this.hideBallUI();
  19750. else {
  19751. this.showBallUI();
  19752. xGame.common.d2World.getHelpLine();
  19753. }
  19754. }
  19755. aiForce(type, force = 0) {
  19756. this.pressTarget = PressType.powerNode;
  19757. if (type == 1)
  19758. this.onEventUp({ force: true });
  19759. else if (type == 2)
  19760. this.onEventMove({ stageY: force, force: true });
  19761. }
  19762. onEventPress(e) {
  19763. if (e.stopPropagation)
  19764. e.stopPropagation();
  19765. if (!this.isTurnSelf())
  19766. return;
  19767. let target = e.target;
  19768. switch (target) {
  19769. case this.ui.myPowerNode.displayObject:
  19770. this.pressTarget = PressType.powerNode;
  19771. this.barInfo.curY = e.stageY;
  19772. this.updateBarInfo();
  19773. break;
  19774. case this.ui.moveNode.displayObject:
  19775. this.pressTarget = PressType.moveNode;
  19776. this.hideBallUI();
  19777. this.eventObj.curX = this.ui.moveNode.x;
  19778. this.eventObj.curY = this.ui.moveNode.y;
  19779. this.ui.moveNode.finger.visible = false;
  19780. this.eventObj.lastX = e.stageX;
  19781. this.eventObj.lastY = e.stageY;
  19782. break;
  19783. case this.ui.rulerClickNode.displayObject:
  19784. this.pressTarget = PressType.rulerNode;
  19785. this.eventObj.lastY = e.stageY;
  19786. break;
  19787. case this.ui.d2Root.displayObject:
  19788. this.pressTarget = PressType.d2Root;
  19789. this.eventObj.lastX = e.stageX;
  19790. this.eventObj.lastY = e.stageY;
  19791. this.eventObj.starX = e.stageX;
  19792. this.eventObj.starY = e.stageY;
  19793. this.eventObj.curX = 0;
  19794. this.eventObj.curY = 0;
  19795. xGame.common.d2World.d2Gan.setGanLastInfo();
  19796. this.rulerOffset = 0;
  19797. break;
  19798. default:
  19799. break;
  19800. }
  19801. }
  19802. onEventMove(e) {
  19803. if (e.stopPropagation)
  19804. e.stopPropagation();
  19805. if (e && e.force) {
  19806. }
  19807. else {
  19808. if (!this.isTurnSelf())
  19809. return;
  19810. }
  19811. switch (this.pressTarget) {
  19812. case PressType.powerNode:
  19813. this.barInfo.curY = e.stageY;
  19814. this.updateBarInfo();
  19815. this.isMoveRod = true;
  19816. break;
  19817. case PressType.moveNode:
  19818. let rootBall = xGame.common.d2World.rootBall;
  19819. let radius = rootBall.gameObj.width / 2;
  19820. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  19821. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  19822. let border = xGame.common.d2World.borderRect;
  19823. if (curX <= border.x + radius)
  19824. curX = border.x + radius;
  19825. else if (curX >= border.x + border.width - radius)
  19826. curX = border.x + border.width - radius;
  19827. if (curY <= border.y + radius)
  19828. curY = border.y + radius;
  19829. else if (curY >= border.y + border.height - radius)
  19830. curY = border.y + border.height - radius;
  19831. if (xGame.common.gameMgr.isOpenBall) {
  19832. if (curX >= border.x + border.openBallW - radius)
  19833. curX = border.x + border.openBallW - radius;
  19834. }
  19835. this.ui.moveNode.x = curX;
  19836. this.ui.moveNode.y = curY;
  19837. rootBall.gameObj.x = curX;
  19838. rootBall.gameObj.y = curY;
  19839. rootBall.d3BallSrc.setTransPos(curX, curY);
  19840. this.isMoveRod = true;
  19841. break;
  19842. case PressType.rulerNode:
  19843. let yy = e.stageY - this.eventObj.lastY;
  19844. this.eventObj.lastY = e.stageY;
  19845. let ruler1 = this.ui.rulerNode.img1;
  19846. let ruler2 = this.ui.rulerNode.img2;
  19847. ruler1.y += yy;
  19848. ruler2.y += yy;
  19849. this.rulerOffset += yy;
  19850. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  19851. this.rulerOffset = 0;
  19852. xGame.soundMgr.playSound("inch", 1, 10);
  19853. }
  19854. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  19855. let h = ruler1.height;
  19856. this.checkGuide();
  19857. this.isMoveRod = true;
  19858. if (ruler1.y >= h) {
  19859. ruler1.y = -h;
  19860. ruler2.y = 0;
  19861. return;
  19862. }
  19863. else if (ruler1.y <= -h) {
  19864. ruler1.y = h;
  19865. ruler2.y = 0;
  19866. return;
  19867. }
  19868. if (ruler2.y >= h) {
  19869. ruler2.y = -h;
  19870. ruler1.y = 0;
  19871. return;
  19872. }
  19873. else if (ruler2.y <= -h) {
  19874. ruler2.y = h;
  19875. ruler1.y = 0;
  19876. return;
  19877. }
  19878. break;
  19879. case PressType.d2Root:
  19880. this.eventObj.curX = e.stageX;
  19881. this.eventObj.curY = e.stageY;
  19882. let offset = this.checkRodMoveDir();
  19883. xGame.common.d2World.d2Gan.rotateSelf(offset);
  19884. this.eventObj.lastX = e.stageX;
  19885. this.eventObj.lastY = e.stageY;
  19886. break;
  19887. default:
  19888. break;
  19889. }
  19890. }
  19891. onEventUp(e) {
  19892. if (e.stopPropagation)
  19893. e.stopPropagation();
  19894. if (e && e.force) {
  19895. }
  19896. else {
  19897. if (!this.isTurnSelf())
  19898. return;
  19899. }
  19900. switch (this.pressTarget) {
  19901. case PressType.powerNode:
  19902. this.ui.powerNode.value = 0;
  19903. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19904. this.ui.powerTxt.text = "";
  19905. if (this.powerNum > 0) {
  19906. xGame.eventMgr.event(BALL_SHOOT);
  19907. xGame.common.d2World.shoot(this.powerNum);
  19908. xGame.common.d2World.d2Gan.shoot();
  19909. xGame.common.d2World.d2HelpLine.shoot();
  19910. this.finishGuide();
  19911. this.ui.powerEft.visible = false;
  19912. this.ui.colorNode.visible = false;
  19913. let ganStr = "";
  19914. if (this.powerNum <= 30) {
  19915. ganStr = "gan_30";
  19916. }
  19917. else if (this.powerNum <= 60) {
  19918. ganStr = "gan_50";
  19919. }
  19920. else {
  19921. ganStr = "gan_80";
  19922. }
  19923. xGame.soundMgr.playSound(ganStr);
  19924. }
  19925. break;
  19926. case PressType.moveNode:
  19927. let rootBall = xGame.common.d2World.rootBall;
  19928. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  19929. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  19930. let isIntersect = this.judgeBallIntersect();
  19931. if (isIntersect) {
  19932. this.ui.moveNode.x = lastX;
  19933. this.ui.moveNode.y = lastY;
  19934. rootBall.gameObj.x = lastX;
  19935. rootBall.gameObj.y = lastY;
  19936. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  19937. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  19938. }
  19939. else {
  19940. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  19941. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  19942. }
  19943. this.showBallUI();
  19944. this.ui.moveNode.finger.visible = true;
  19945. xGame.common.d2World.getHelpLine();
  19946. break;
  19947. case PressType.rulerNode:
  19948. break;
  19949. case PressType.d2Root:
  19950. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  19951. if (dis <= 25) {
  19952. this.moveToClickDot(e);
  19953. }
  19954. break;
  19955. default:
  19956. break;
  19957. }
  19958. this.pressTarget = -1;
  19959. }
  19960. checkGuide() {
  19961. let guide = DataMgr.getSkillGuide();
  19962. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  19963. xGame.common.guideStep++;
  19964. xGame.common.gameUI.ui.guide2.visible = false;
  19965. xGame.common.gameUI.ui.guide3.visible = true;
  19966. }
  19967. }
  19968. finishGuide() {
  19969. let guide = DataMgr.getSkillGuide();
  19970. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  19971. xGame.common.guideStep = 10;
  19972. this.closeAllGuide();
  19973. console.log('zh: 新手引导完毕');
  19974. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  19975. }
  19976. }
  19977. closeAllGuide() {
  19978. xGame.common.gameUI.ui.guide1.visible = false;
  19979. xGame.common.gameUI.ui.guide2.visible = false;
  19980. xGame.common.gameUI.ui.guide3.visible = false;
  19981. }
  19982. updateBarInfo() {
  19983. let star = this.ui.powerNode.y;
  19984. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  19985. if (rate >= 1)
  19986. rate = 1;
  19987. if (rate <= 0)
  19988. rate = 0;
  19989. this.powerNum = Math.ceil(rate * 100);
  19990. this.ui.powerNode.value = this.powerNum;
  19991. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  19992. this.ui.colorNode.value = this.powerNum;
  19993. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  19994. this.ui.powerEft.visible = this.powerNum != 0;
  19995. this.ui.colorNode.visible = this.powerNum != 0;
  19996. this.ui.powerTxt.text = this.powerNum + "";
  19997. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  19998. }
  19999. forceCancel() {
  20000. this.ui.powerNode.value = 0;
  20001. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20002. this.ui.powerTxt.text = "";
  20003. }
  20004. checkRodMoveDir() {
  20005. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20006. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20007. if (tempX >= 0 && tempY <= 0) {
  20008. return this.checkDir();
  20009. }
  20010. else if (tempX < 0 && tempY < 0) {
  20011. return this.checkDir(1, -1);
  20012. }
  20013. else if (tempX < 0 && tempY > 0) {
  20014. return this.checkDir(-1, -1);
  20015. }
  20016. else {
  20017. return this.checkDir(-1, 1);
  20018. }
  20019. }
  20020. checkDir(flagX = 1, flagY = 1) {
  20021. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20022. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20023. if (offsetY == 0) {
  20024. return offsetX * flagX;
  20025. }
  20026. if (offsetX == 0) {
  20027. return offsetY * flagY;
  20028. }
  20029. let angle = offsetY / offsetX;
  20030. if (Math.abs(angle) >= 1) {
  20031. return offsetY * flagY;
  20032. }
  20033. else {
  20034. return offsetX * flagX;
  20035. }
  20036. }
  20037. judgeBallIntersect() {
  20038. let rootBall = xGame.common.d2World.rootBall;
  20039. let ballArr = xGame.common.d2World.ballArr;
  20040. let radius = rootBall.gameObj.width / 2;
  20041. let temp;
  20042. let isIntersect = false;
  20043. for (let index = 0; index < ballArr.length; index++) {
  20044. temp = ballArr[index];
  20045. if (temp.number == rootBall.number)
  20046. continue;
  20047. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20048. if (isIntersect) {
  20049. break;
  20050. }
  20051. }
  20052. return isIntersect;
  20053. }
  20054. hideBallUI() {
  20055. let d2Gan = xGame.common.d2World.d2Gan;
  20056. if (!d2Gan.ui.isDisposed)
  20057. d2Gan.ui.visible = false;
  20058. let d2Help = xGame.common.d2World.d2HelpLine;
  20059. if (!d2Help.ui.isDisposed)
  20060. d2Help.ui.visible = false;
  20061. let rootBall = xGame.common.d2World.rootBall;
  20062. if (!rootBall.destroyed) {
  20063. rootBall.gameObj.active = false;
  20064. }
  20065. }
  20066. showBallUI() {
  20067. let d2Gan = xGame.common.d2World.d2Gan;
  20068. if (!d2Gan.ui.isDisposed)
  20069. d2Gan.ui.visible = true;
  20070. let d2Help = xGame.common.d2World.d2HelpLine;
  20071. if (!d2Help.ui.isDisposed)
  20072. d2Help.ui.visible = true;
  20073. let rootBall = xGame.common.d2World.rootBall;
  20074. if (!rootBall.destroyed) {
  20075. rootBall.gameObj.active = true;
  20076. }
  20077. }
  20078. moveToClickDot(e) {
  20079. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20080. let root = xGame.common.d2World.rootBall.gameObj;
  20081. let xx = e.stageX - xGame.common.sysOffestNum;
  20082. let yy = e.stageY;
  20083. let x = xx - root.x;
  20084. let y = yy - root.y;
  20085. let angle = xGame.common.getfguiRotation(x, y);
  20086. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20087. xGame.common.d2World.getHelpLine();
  20088. }
  20089. this.isMoveRod = false;
  20090. xGame.common.clickedBall = false;
  20091. }
  20092. openAllEvent() {
  20093. this.closeAllEvent();
  20094. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20095. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20096. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20097. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20098. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20099. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20100. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20101. }
  20102. closeAllEvent() {
  20103. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20104. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20105. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20106. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20107. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20108. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20109. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20110. }
  20111. resetGame() {
  20112. this.closeAllEvent();
  20113. this.hideBallUI();
  20114. xGame.common.gameMgr.gamePause = true;
  20115. }
  20116. }
  20117. UIGame$1.uiName = "UIGame";
  20118. class UIAddCoin$1 extends UIBase {
  20119. constructor() {
  20120. super();
  20121. this.coinNum = 2000;
  20122. }
  20123. onConstructor() {
  20124. this.ui = ui_UIAddCoin.createInstance();
  20125. this.contentPane = this.ui;
  20126. this.isEject = false;
  20127. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20128. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20129. }
  20130. show() {
  20131. super.show();
  20132. this.ui.t0.play();
  20133. }
  20134. videoAddCoin() {
  20135. console.log('zh:qjff_AD_for_UIAddCoin');
  20136. if (Laya.Browser.onAndroid) {
  20137. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20138. if (!boo) {
  20139. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20140. return;
  20141. }
  20142. }
  20143. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20144. }
  20145. else {
  20146. console.log('zh:AD 失败,直接发放奖励');
  20147. this.qjff_AD_for_UIAddCoin();
  20148. }
  20149. }
  20150. qjff_AD_for_UIAddCoin() {
  20151. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20152. this.hide();
  20153. }
  20154. }
  20155. UIAddCoin$1.uiName = "UIAddCoin";
  20156. class UIInvitation$1 extends UIBase {
  20157. constructor() {
  20158. super();
  20159. }
  20160. onConstructor() {
  20161. this.ui = ui_UIInvitation.createInstance();
  20162. this.contentPane = this.ui;
  20163. this.isEject = false;
  20164. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20165. }
  20166. show() {
  20167. super.show();
  20168. }
  20169. enterGame() {
  20170. xGame.common.gameMode = GameMode.classic;
  20171. DataMgr.setChallengeTimes(1);
  20172. xGame.common.passAwardCoin = 2000;
  20173. let need = xGame.common.classicNiceNeddCoin;
  20174. if (DataMgr.coinEnough(need)) {
  20175. DataMgr.setCoin(-need);
  20176. xGame.eventMgr.event(RESTART_GAME, true);
  20177. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20178. }
  20179. else {
  20180. xGame.eventMgr.event(RESTART_GAME, true);
  20181. }
  20182. this.hide();
  20183. }
  20184. hide() {
  20185. super.hide();
  20186. }
  20187. }
  20188. UIInvitation$1.uiName = "UIInvitation";
  20189. class UIPower$1 extends UIBase {
  20190. constructor() {
  20191. super();
  20192. }
  20193. onConstructor() {
  20194. this.ui = ui_UIPower.createInstance();
  20195. this.contentPane = this.ui;
  20196. this.isEject = false;
  20197. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20198. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20199. }
  20200. show() {
  20201. super.show();
  20202. this.ui.t0.play();
  20203. }
  20204. videoGetPower() {
  20205. console.log('zh:qjff_AD_for_uipower');
  20206. if (Laya.Browser.onAndroid) {
  20207. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20208. if (!boo) {
  20209. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20210. return;
  20211. }
  20212. }
  20213. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20214. }
  20215. else {
  20216. console.log('zh:AD 失败,直接发放奖励');
  20217. this.qjff_AD_for_uipower();
  20218. }
  20219. }
  20220. qjff_AD_for_uipower() {
  20221. DataMgr.setPower(xGame.common.videoPower, true);
  20222. xGame.eventMgr.event(POWER_TIME);
  20223. this.hide();
  20224. }
  20225. }
  20226. UIPower$1.uiName = "UIPower";
  20227. class UIGameEnd$1 extends UIBase {
  20228. constructor() {
  20229. super();
  20230. this.success = false;
  20231. this.awardCoinNum = 1000;
  20232. this.awardDiamondNum = 10;
  20233. }
  20234. onConstructor() {
  20235. this.ui = ui_UIGameEnd.createInstance();
  20236. this.contentPane = this.ui;
  20237. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20238. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20239. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20240. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20241. this.ui.talkNode.visible = false;
  20242. if (Moyu.isKs)
  20243. this.ui.closeNode.closeBtn.x += 100;
  20244. }
  20245. updateType() {
  20246. switch (xGame.common.gameMode) {
  20247. case GameMode.classic:
  20248. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20249. this.ui.coinNode.visible = this.success;
  20250. if (!this.success) {
  20251. Laya.timer.once(500, this, () => {
  20252. xGame.uiMgr.Show(UIAddCoin$1);
  20253. });
  20254. }
  20255. else {
  20256. this.logEventForClassic_win();
  20257. }
  20258. this.logEventForClassic_complete();
  20259. this.ui.isGetAward.visible = false;
  20260. this.ui.leftBtn.c1.selectedIndex = 3;
  20261. this.ui.rightBtn.c1.selectedIndex = 0;
  20262. this.moneyNode.ui.c1.selectedIndex = 1;
  20263. break;
  20264. case GameMode.bigMove:
  20265. console.log('zh:招法模式 aaaaaa bigMove');
  20266. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20267. this.ui.coinNode.visible = this.success;
  20268. if (xGame.common.gameMode == GameMode.bigMove) {
  20269. if (this.success) {
  20270. DataMgr.setSkillSuccessTimes(1, true);
  20271. DataMgr.setSkillAccTimes(1);
  20272. }
  20273. else {
  20274. DataMgr.setSkillSuccessTimes(0, false);
  20275. }
  20276. }
  20277. this.logEventForRod_complete_N();
  20278. if (!this.success) {
  20279. Laya.timer.once(500, this, () => {
  20280. xGame.uiMgr.Show(UIAddCoin$1);
  20281. });
  20282. }
  20283. else {
  20284. this.logEventForRod_win();
  20285. }
  20286. this.ui.isGetAward.visible = false;
  20287. this.ui.leftBtn.c1.selectedIndex = 3;
  20288. this.ui.rightBtn.c1.selectedIndex = 0;
  20289. this.moneyNode.ui.c1.selectedIndex = 1;
  20290. break;
  20291. case GameMode.placeBall:
  20292. this.ui.coinNode.visible = false;
  20293. if (this.success) {
  20294. if (xGame.common.placeBallStarNum == 3) {
  20295. this.ui.c1.selectedIndex = 2;
  20296. }
  20297. else {
  20298. this.ui.c1.selectedIndex = 3;
  20299. }
  20300. let level = xGame.common.placeBallCurLevel;
  20301. if (level > 59) {
  20302. this.logEventForChallenge_level_complete(level);
  20303. }
  20304. else {
  20305. this.logEventForChallenge_level_N(level);
  20306. }
  20307. }
  20308. else {
  20309. this.ui.c1.selectedIndex = 4;
  20310. }
  20311. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20312. if (cfg.type == PlaceBallType.challenge) {
  20313. this.ui.c1.selectedIndex = 2;
  20314. }
  20315. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20316. this.updatePlaceBallBtn();
  20317. this.updatePlaceBallStarNum();
  20318. this.updatePlaceBallAwardState();
  20319. this.moneyNode.ui.c1.selectedIndex = 2;
  20320. this.moneyNode.checkPowerTime();
  20321. this.moneyNode.powerChange();
  20322. DataMgr.upRankData();
  20323. break;
  20324. default:
  20325. break;
  20326. }
  20327. }
  20328. logEventForRod_complete_N() {
  20329. let gfmsIdx = xGame.common.curPlayerSkillType;
  20330. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20331. let gfmc = 'Skyfall Shot';
  20332. if (gfmsIdx == 0) {
  20333. gfmc = 'Skyfall Shot';
  20334. }
  20335. if (gfmsIdx == 1) {
  20336. gfmc = 'Surging break';
  20337. }
  20338. if (gfmsIdx == 2) {
  20339. gfmc = 'Frost Lock';
  20340. }
  20341. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20342. console.log('zh:logEventForRod_complete_N level = ' + level);
  20343. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20344. let jsonStr = {
  20345. "count": 0,
  20346. "name": gfmc
  20347. };
  20348. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20349. const d = LocalStorageManager.getItem(keyStr);
  20350. jsonStr.count = d.count + 1;
  20351. LocalStorageManager.setItem(keyStr, jsonStr);
  20352. }
  20353. else {
  20354. LocalStorageManager.setItem(keyStr, jsonStr);
  20355. }
  20356. const d2 = LocalStorageManager.getItem(keyStr);
  20357. let count = d2.count;
  20358. console.log('zh:logEventForRod_complete_N count = ' + count);
  20359. if (count % 5 == 0) {
  20360. const reqStr = JSON.stringify(jsonStr);
  20361. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20362. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20363. }
  20364. }
  20365. logEventForRod_win() {
  20366. console.log('zh:logEventForRod_win,胜利');
  20367. let gfmsIdx = xGame.common.curPlayerSkillType;
  20368. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20369. let gfmc = 'Skyfall Shot';
  20370. if (gfmsIdx == 0) {
  20371. gfmc = 'Skyfall Shot';
  20372. }
  20373. if (gfmsIdx == 1) {
  20374. gfmc = 'Surging break';
  20375. }
  20376. if (gfmsIdx == 2) {
  20377. gfmc = 'Frost Lock';
  20378. }
  20379. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20380. console.log('zh:logEventForRod_win level = ' + level);
  20381. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20382. let jsonStr = {
  20383. "count": 1,
  20384. "name": gfmc + ' Lev' + level
  20385. };
  20386. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20387. const d = LocalStorageManager.getItem(keyStr);
  20388. jsonStr.count = d.count + 1;
  20389. LocalStorageManager.setItem(keyStr, jsonStr);
  20390. }
  20391. else {
  20392. LocalStorageManager.setItem(keyStr, jsonStr);
  20393. }
  20394. const reqStr = JSON.stringify(jsonStr);
  20395. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20396. }
  20397. logEventForClassic_win() {
  20398. console.log('zh:logEventForClassic_win,胜利');
  20399. let rtype = xGame.common.classicRoomType;
  20400. let msmc = '';
  20401. if (rtype == 1) {
  20402. msmc = 'beginner';
  20403. }
  20404. if (rtype == 2) {
  20405. msmc = 'expert';
  20406. }
  20407. if (rtype == 3) {
  20408. msmc = 'master';
  20409. }
  20410. let keyStr = 'sjmd_classic_win_' + rtype;
  20411. let jsonStr = {
  20412. "difficulty": msmc,
  20413. "classic_count": 1,
  20414. "difficulty_count": 1
  20415. };
  20416. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20417. const d = LocalStorageManager.getItem(keyStr);
  20418. jsonStr.classic_count = d.classic_count + 1;
  20419. jsonStr.difficulty_count = d.difficulty_count + 1;
  20420. LocalStorageManager.setItem(keyStr, jsonStr);
  20421. }
  20422. else {
  20423. LocalStorageManager.setItem(keyStr, jsonStr);
  20424. }
  20425. const reqStr = JSON.stringify(jsonStr);
  20426. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20427. }
  20428. logEventForClassic_complete() {
  20429. console.log('zh:logEventForClassic_complete,胜利');
  20430. let rtype = xGame.common.classicRoomType;
  20431. let msmc = '';
  20432. if (rtype == 1) {
  20433. msmc = 'beginner';
  20434. }
  20435. if (rtype == 2) {
  20436. msmc = 'expert';
  20437. }
  20438. if (rtype == 3) {
  20439. msmc = 'master';
  20440. }
  20441. let keyStr = 'sjmd_classic_complete_' + rtype;
  20442. let jsonStr = {
  20443. "msmc": msmc,
  20444. "count": 0
  20445. };
  20446. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20447. const d = LocalStorageManager.getItem(keyStr);
  20448. jsonStr.count = d.count + 1;
  20449. LocalStorageManager.setItem(keyStr, jsonStr);
  20450. }
  20451. else {
  20452. LocalStorageManager.setItem(keyStr, jsonStr);
  20453. }
  20454. if (jsonStr.count % 5 == 0) {
  20455. const reqStr = JSON.stringify(jsonStr);
  20456. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20457. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20458. }
  20459. }
  20460. updatePlaceBallBtn() {
  20461. this.ui.leftBtn.c1.selectedIndex = 5;
  20462. if (this.success) {
  20463. this.ui.rightBtn.c1.selectedIndex = 14;
  20464. }
  20465. else {
  20466. if (xGame.common.placeBallStarNum == 3) {
  20467. this.ui.rightBtn.c1.selectedIndex = 14;
  20468. }
  20469. else {
  20470. this.ui.rightBtn.c1.selectedIndex = 1;
  20471. }
  20472. }
  20473. }
  20474. updatePlaceBallStarNum() {
  20475. let starNum = xGame.common.placeBallStarNum;
  20476. if (starNum == 0)
  20477. this.ui.starNumNode.c1.selectedIndex = 3;
  20478. else {
  20479. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20480. }
  20481. }
  20482. updatePlaceBallAwardState() {
  20483. let level = xGame.common.placeBallCurLevel;
  20484. let starNum = xGame.common.placeBallStarNum;
  20485. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20486. let data = cfgTable.placeballData[level].award;
  20487. let cfg = cfgTable.placeballData[level];
  20488. this.awardDiamondNum = data[1];
  20489. this.awardCoinNum = data[0];
  20490. if (cfg.type == PlaceBallType.challenge) {
  20491. this.awardDiamondNum = 0;
  20492. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20493. }
  20494. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20495. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20496. if (cfg.type == PlaceBallType.challenge) {
  20497. this.ui.awardNode.coinNode.visible = true;
  20498. }
  20499. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20500. this.ui.awardNode.diamondNode.x = 265;
  20501. this.ui.awardNode.coinNode.x = 354;
  20502. }
  20503. else {
  20504. this.ui.awardNode.diamondNode.x = 291;
  20505. this.ui.awardNode.coinNode.x = 291;
  20506. }
  20507. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20508. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20509. if (this.awardCoinNum == 0) {
  20510. this.ui.awardNode.coinNode.numTxt.text = "";
  20511. }
  20512. if (getAward) {
  20513. this.ui.isGetAward.visible = true;
  20514. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20515. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20516. }
  20517. else {
  20518. this.ui.isGetAward.visible = false;
  20519. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20520. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20521. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20522. }
  20523. else {
  20524. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20525. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20526. }
  20527. }
  20528. }
  20529. show(success) {
  20530. super.show();
  20531. xGame.eventMgr.event(RESET_GAME);
  20532. this.success = success;
  20533. Laya.timer.clearAll(this);
  20534. this.playSecretaryAni();
  20535. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20536. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20537. offsetTime = Math.floor(offsetTime / 1000);
  20538. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20539. this.updateType();
  20540. Laya.timer.once(200, this, () => {
  20541. this.addAward(() => {
  20542. this.updateType();
  20543. Laya.timer.once(500, this, () => {
  20544. this.showChallengeLevel();
  20545. });
  20546. });
  20547. });
  20548. if (this.success) {
  20549. JSBridgeUtils.instance.showInternAd('gameend_success');
  20550. console.log('zh:game end 成功');
  20551. xGame.soundMgr.playSound('slots_roll01');
  20552. xGame.soundMgr.playSound("s_win");
  20553. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20554. this.diyGameDataUtilForGameWin();
  20555. }
  20556. else {
  20557. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20558. console.log('zh:game end失败');
  20559. xGame.soundMgr.playSound('matchwin01');
  20560. xGame.soundMgr.playSound("s_lose");
  20561. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20562. }
  20563. let challengeNum = DataMgr.getChallengeTimes();
  20564. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20565. DataMgr.setChallengeTimes(1);
  20566. }
  20567. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20568. DataMgr.setClassicTimes();
  20569. }
  20570. }
  20571. diyGameDataUtilForGameWin() {
  20572. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20573. switch (xGame.common.gameMode) {
  20574. case GameMode.classic:
  20575. console.log('zh:DiyGameDataUtilForGameWin 111');
  20576. case GameMode.bigMove:
  20577. console.log('zh:DiyGameDataUtilForGameWin 222');
  20578. this.restartGame();
  20579. break;
  20580. case GameMode.placeBall:
  20581. console.log('zh:DiyGameDataUtilForGameWin 333');
  20582. var level = xGame.common.placeBallCurLevel;
  20583. console.log('zh:练习模式 联系了多少LEV=' + level);
  20584. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20585. if (level > db_over_lev) {
  20586. DataMgr.setChallengeMode_overLev(level);
  20587. }
  20588. break;
  20589. default:
  20590. console.log('zh:DiyGameDataUtilForGameWin 444');
  20591. break;
  20592. }
  20593. }
  20594. showChallengeLevel() {
  20595. if (DataMgr.getChallengeTimes() != 0)
  20596. return;
  20597. let skill = DataMgr.getSkillAccTimes();
  20598. let put = DataMgr.getPlaceBallLevelList().length;
  20599. if (skill >= 3 || put >= 5) {
  20600. xGame.uiMgr.Show(UIInvitation$1);
  20601. this.hide();
  20602. }
  20603. }
  20604. addAward(callback) {
  20605. if (!this.success) {
  20606. callback && callback();
  20607. return;
  20608. }
  20609. switch (xGame.common.gameMode) {
  20610. case GameMode.classic:
  20611. this.awardCoinNum = xGame.common.passAwardCoin;
  20612. this.awardDiamondNum = 0;
  20613. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20614. break;
  20615. case GameMode.bigMove:
  20616. this.awardCoinNum = xGame.common.passAwardCoin;
  20617. this.awardDiamondNum = 0;
  20618. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20619. callback && callback();
  20620. break;
  20621. case GameMode.placeBall:
  20622. let level = xGame.common.placeBallCurLevel;
  20623. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  20624. if (xGame.common.placeBallStarNum != 3) {
  20625. callback && callback();
  20626. return;
  20627. }
  20628. else {
  20629. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20630. if (getAward) {
  20631. callback && callback();
  20632. return;
  20633. }
  20634. }
  20635. let cfg = cfgTable.placeballData[level];
  20636. let data = cfgTable.placeballData[level].award;
  20637. this.awardCoinNum = data[0];
  20638. this.awardDiamondNum = data[1];
  20639. if (cfg.type == PlaceBallType.challenge) {
  20640. this.awardDiamondNum = 0;
  20641. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20642. }
  20643. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  20644. let diamondAward;
  20645. if (this.awardDiamondNum > 0) {
  20646. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  20647. xGame.common.getAward([diamondAward, coinAward], callback);
  20648. }
  20649. else {
  20650. xGame.common.getAward([coinAward], callback);
  20651. }
  20652. if (cfg.type == PlaceBallType.normal) {
  20653. DataMgr.setPlaceBallAward(level);
  20654. }
  20655. break;
  20656. default:
  20657. break;
  20658. }
  20659. }
  20660. playSecretaryAni_old() {
  20661. let parent = this.ui.secretary.displayObject;
  20662. parent.destroyChildren();
  20663. let xx = this.ui.secretary.width / 2;
  20664. let yy = this.ui.secretary.height;
  20665. let scale = xGame.common.getSecretaryScale();
  20666. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20667. if (this.success) {
  20668. let rand = Math.random() <= 0.5 ? 2 : 3;
  20669. xGame.common.secretary.play(data, rand, false, parent, () => {
  20670. xGame.common.secretary.play(data, 1, true, parent);
  20671. });
  20672. }
  20673. else {
  20674. xGame.common.secretary.play(data, 0, true, parent);
  20675. }
  20676. }
  20677. playSecretaryAni() {
  20678. let parent = this.ui.secretary.displayObject;
  20679. parent.destroyChildren();
  20680. let xx = this.ui.secretary.width / 2;
  20681. let yy = this.ui.secretary.height;
  20682. let scale = xGame.common.getSecretaryScale();
  20683. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20684. if (this.success) {
  20685. let rand = 0;
  20686. xGame.common.secretary.play(data, 0, true, parent);
  20687. }
  20688. else {
  20689. xGame.common.secretary.play(data, 0, true, parent);
  20690. }
  20691. }
  20692. restartGame() {
  20693. switch (xGame.common.gameMode) {
  20694. case GameMode.classic:
  20695. xGame.eventMgr.event(RESTART_GAME);
  20696. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20697. break;
  20698. case GameMode.bigMove:
  20699. this.hide();
  20700. xGame.eventMgr.event(RESTART_GAME);
  20701. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20702. break;
  20703. default:
  20704. break;
  20705. }
  20706. }
  20707. hide() {
  20708. super.hide();
  20709. xGame.common.stopGirlPop(this.ui.talkNode);
  20710. PlatMgr.showBanner(false);
  20711. }
  20712. returnHome() {
  20713. this.hide();
  20714. let showFailWords = !this.success;
  20715. xGame.uiMgr.Show(UIMain$1, showFailWords);
  20716. }
  20717. clickLeftBtn() {
  20718. switch (xGame.common.gameMode) {
  20719. case GameMode.classic:
  20720. case GameMode.bigMove:
  20721. this.returnHome();
  20722. break;
  20723. case GameMode.placeBall:
  20724. let level = xGame.common.placeBallCurLevel;
  20725. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  20726. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20727. break;
  20728. default:
  20729. break;
  20730. }
  20731. }
  20732. powerStartPlaceBallLevel(level, btn) {
  20733. if (DataMgr.powerEnough()) {
  20734. btn.touchable = false;
  20735. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20736. btn.touchable = true;
  20737. DataMgr.setPower(-1);
  20738. xGame.eventMgr.event(POWER_TIME);
  20739. this.startPlaceBallLevel(level);
  20740. this.logEventForChallenge_level_start(level);
  20741. }));
  20742. }
  20743. else {
  20744. xGame.uiMgr.Show(UIPower$1, 0);
  20745. }
  20746. }
  20747. clickRightBtn() {
  20748. switch (xGame.common.gameMode) {
  20749. case GameMode.classic:
  20750. console.log('zh:clickRightBtn 111');
  20751. case GameMode.bigMove:
  20752. console.log('zh:clickRightBtn 222');
  20753. this.restartGame();
  20754. break;
  20755. case GameMode.placeBall:
  20756. console.log('zh:clickRightBtn 333');
  20757. let level = xGame.common.placeBallCurLevel;
  20758. let data = DataMgr.getPlaceBallLevel(level);
  20759. let curPss = data.play && !data.isCur;
  20760. if (curPss) {
  20761. console.log('zh:clickRightBtn 333-111');
  20762. console.log('zh:当前LV=' + level);
  20763. if (level == 60) {
  20764. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  20765. Laya.timer.once(3000, this, () => {
  20766. this.returnHome();
  20767. });
  20768. }
  20769. else {
  20770. let lev = level + 1;
  20771. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20772. }
  20773. }
  20774. else {
  20775. console.log('zh:clickRightBtn 333-000');
  20776. Moyu.sendDataEvent("placeBallNextLevel");
  20777. console.log('zh:qjff_AD_for_uiGameEnd');
  20778. if (Laya.Browser.onAndroid) {
  20779. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20780. if (!boo) {
  20781. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20782. return;
  20783. }
  20784. }
  20785. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  20786. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  20787. }
  20788. else {
  20789. console.log('zh:AD 失败,直接发放奖励');
  20790. this.qjff_AD_for_uiGameEnd(level);
  20791. }
  20792. }
  20793. break;
  20794. default:
  20795. console.log('zh:clickRightBtn 444');
  20796. break;
  20797. }
  20798. }
  20799. logEventForChallenge_level_start(level) {
  20800. let keyStr = 'sjmd_challenge_level_start';
  20801. let jsonStr = {
  20802. "count": 0,
  20803. "gold_balance ": DataMgr.getCoin(),
  20804. "level": level,
  20805. "diamond_balance ": DataMgr.getDiamond()
  20806. };
  20807. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20808. const d = LocalStorageManager.getItem(keyStr);
  20809. if (level > d.level) {
  20810. jsonStr.count = d.count + 1;
  20811. LocalStorageManager.setItem(keyStr, jsonStr);
  20812. }
  20813. else {
  20814. }
  20815. }
  20816. else {
  20817. LocalStorageManager.setItem(keyStr, jsonStr);
  20818. }
  20819. const reqStr = JSON.stringify(jsonStr);
  20820. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20821. }
  20822. qjff_AD_for_uiGameEnd(level) {
  20823. DataMgr.setPlaceBallLevel(level, 1);
  20824. this.startPlaceBallLevel(level + 1);
  20825. }
  20826. startPlaceBallLevel(level) {
  20827. xGame.common.gameMode = GameMode.placeBall;
  20828. xGame.common.placeBallCurLevel = level;
  20829. xGame.uiMgr.Show(UIGame$1);
  20830. this.hide();
  20831. }
  20832. logEventForChallenge_level_complete(level) {
  20833. let keyStr = 'sjmd_challenge_level_complete';
  20834. let jsonStr = {
  20835. "count": 1,
  20836. "gold_balance ": DataMgr.getCoin(),
  20837. "level": level,
  20838. "diamond_balance ": DataMgr.getDiamond()
  20839. };
  20840. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20841. const d = LocalStorageManager.getItem(keyStr);
  20842. jsonStr.count = d.count + 1;
  20843. LocalStorageManager.setItem(keyStr, jsonStr);
  20844. }
  20845. else {
  20846. LocalStorageManager.setItem(keyStr, jsonStr);
  20847. }
  20848. const reqStr = JSON.stringify(jsonStr);
  20849. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  20850. }
  20851. logEventForChallenge_level_N(level) {
  20852. console.log('zh:logEventForChallenge_level_N ' + level);
  20853. let keyStr = 'sjmd_challenge_level_N';
  20854. if (LocalStorageManager.hasKey(keyStr)) {
  20855. let lev = LocalStorageManager.getItem(keyStr);
  20856. if (level > lev) {
  20857. LocalStorageManager.setItem(keyStr, level);
  20858. }
  20859. if ((level) % 5 == 0) {
  20860. console.log('zh:每5关上报1次');
  20861. let sjmc = 'challenge_level_' + level;
  20862. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  20863. let sjmcForFirebase = 'challenge_level_' + level;
  20864. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  20865. }
  20866. else {
  20867. console.log('zh:5 no 上报');
  20868. }
  20869. }
  20870. else {
  20871. LocalStorageManager.setItem(keyStr, level);
  20872. }
  20873. }
  20874. }
  20875. UIGameEnd$1.uiName = "UIGameEnd";
  20876. class ShowItem$1 {
  20877. constructor() {
  20878. this.ui = ui_ShowItem.createInstance();
  20879. }
  20880. destroySelf() {
  20881. if (!this.ui.isDisposed) {
  20882. this.ui.removeFromParent();
  20883. this.ui.dispose();
  20884. }
  20885. }
  20886. setParent(parent) {
  20887. parent.addChild(this.ui);
  20888. }
  20889. setPos(x, y) {
  20890. this.ui.x = x;
  20891. this.ui.y = y;
  20892. }
  20893. setUrl(index) {
  20894. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  20895. }
  20896. }
  20897. class UILevelProp$1 extends UIBase {
  20898. constructor() {
  20899. super();
  20900. this.firstPos = 385;
  20901. this.secondPos = 467;
  20902. this.showItemArr = [];
  20903. }
  20904. onFontLoaded() {
  20905. try {
  20906. this.ui.myNode.conditionTxt.font = "arial";
  20907. console.log("zh: onFontLoaded 设置arial字体成功");
  20908. }
  20909. catch (error) {
  20910. console.log("zh: constructor onFontLoaded加载arial字体失败");
  20911. }
  20912. }
  20913. onConstructor() {
  20914. this.ui = ui_UILevelProp.createInstance();
  20915. this.contentPane = this.ui;
  20916. this.isEject = false;
  20917. this.addUIClick(this.ui.closeBtn, this.hide);
  20918. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20919. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  20920. }
  20921. show(level) {
  20922. super.show();
  20923. this.ui.t1.play();
  20924. this.level = level;
  20925. this.data = cfgTable.placeballData[this.level];
  20926. this.updateSelf();
  20927. this.showPreView();
  20928. this.moneyNode.ui.c1.selectedIndex = 2;
  20929. this.moneyNode.checkPowerTime();
  20930. this.moneyNode.powerChange();
  20931. }
  20932. showPreView() {
  20933. let item;
  20934. let data;
  20935. for (let index = 0; index < this.showItemArr.length; index++) {
  20936. item = this.showItemArr[index];
  20937. item.destroySelf();
  20938. }
  20939. this.showItemArr = [];
  20940. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  20941. for (const key in cfgData) {
  20942. data = cfgData[key];
  20943. item = new ShowItem$1();
  20944. item.setParent(this.ui.myNode.displayRoot);
  20945. item.setPos(data.x, data.y);
  20946. item.setUrl(data.value);
  20947. this.showItemArr.push(item);
  20948. }
  20949. }
  20950. updateSelf() {
  20951. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  20952. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  20953. if (this.data.ball == -1) {
  20954. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  20955. }
  20956. else {
  20957. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  20958. }
  20959. let localData = DataMgr.getPlaceBallLevel(this.level);
  20960. let getAward = localData.getAward;
  20961. let cfg = cfgTable.placeballData[this.level];
  20962. let coin = this.data.award[0];
  20963. let diamond = this.data.award[1];
  20964. if (cfg.type == PlaceBallType.challenge) {
  20965. diamond = 0;
  20966. coin = 100;
  20967. }
  20968. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  20969. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  20970. this.ui.myNode.coinNode.numTxt.text = coin + "";
  20971. if (cfg.type == PlaceBallType.challenge) {
  20972. this.ui.myNode.coinNode.numTxt.text = "";
  20973. }
  20974. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  20975. if (coin > 0 && diamond > 0) {
  20976. this.ui.myNode.diamondNode.x = 385;
  20977. this.ui.myNode.coinNode.x = 467;
  20978. }
  20979. else {
  20980. this.ui.myNode.diamondNode.x = 385;
  20981. this.ui.myNode.coinNode.x = 385;
  20982. }
  20983. if (!getAward) {
  20984. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  20985. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  20986. }
  20987. else {
  20988. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  20989. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  20990. }
  20991. }
  20992. startGame() {
  20993. if (DataMgr.powerEnough()) {
  20994. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  20995. this.ui.myNode.startBtn.touchable = false;
  20996. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20997. console.log('zh:startGame ');
  20998. this.ui.myNode.startBtn.touchable = true;
  20999. DataMgr.setPower(-1);
  21000. xGame.eventMgr.event(POWER_TIME);
  21001. xGame.common.gameMode = GameMode.placeBall;
  21002. xGame.common.placeBallCurLevel = this.level;
  21003. xGame.uiMgr.Show(UIGame$1);
  21004. this.logEventForChallenge_level_start(this.level);
  21005. xGame.uiMgr.Hide(UILevelDisplay$1);
  21006. xGame.uiMgr.Hide(UIMain$1);
  21007. this.hide();
  21008. }));
  21009. }
  21010. else {
  21011. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21012. xGame.uiMgr.Show(UIPower$1);
  21013. }
  21014. }
  21015. logEventForChallenge_level_start(level) {
  21016. let keyStr = 'sjmd_challenge_level_start';
  21017. let jsonStr = {
  21018. "count": 1,
  21019. "gold_balance ": DataMgr.getCoin(),
  21020. "level": level,
  21021. "diamond_balance ": DataMgr.getDiamond()
  21022. };
  21023. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21024. const d = LocalStorageManager.getItem(keyStr);
  21025. if (level > d.level) {
  21026. jsonStr.count = d.count + 1;
  21027. LocalStorageManager.setItem(keyStr, jsonStr);
  21028. }
  21029. else {
  21030. }
  21031. }
  21032. else {
  21033. LocalStorageManager.setItem(keyStr, jsonStr);
  21034. }
  21035. const reqStr = JSON.stringify(jsonStr);
  21036. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21037. }
  21038. hide() {
  21039. super.hide();
  21040. }
  21041. }
  21042. UILevelProp$1.uiName = "UILevelProp";
  21043. class PutBallLevelDisplay$1 {
  21044. constructor(ui, index) {
  21045. this.index = 0;
  21046. this.ui = ui;
  21047. this.index = index;
  21048. this.ui.onClick(this, this.clickSelf);
  21049. this.updateSelf();
  21050. this.ui.levelTxt.text = (this.index + 1) + "";
  21051. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21052. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21053. }
  21054. updateSelf() {
  21055. let level = this.index + 1;
  21056. this.data = DataMgr.getPlaceBallLevel(level);
  21057. this.ui.starNode.c1.selectedIndex = this.data.star;
  21058. let isChallenge = cfgTable.placeballData[level].type;
  21059. if (this.data.isCur) {
  21060. if (isChallenge) {
  21061. this.ui.c1.selectedIndex = 5;
  21062. }
  21063. else {
  21064. this.ui.c1.selectedIndex = 2;
  21065. }
  21066. }
  21067. else {
  21068. if (this.data.play) {
  21069. if (this.data.star == 3) {
  21070. this.ui.c1.selectedIndex = 0;
  21071. }
  21072. else {
  21073. this.ui.c1.selectedIndex = 1;
  21074. }
  21075. }
  21076. else {
  21077. if (isChallenge) {
  21078. this.ui.c1.selectedIndex = 4;
  21079. }
  21080. else {
  21081. this.ui.c1.selectedIndex = 3;
  21082. }
  21083. }
  21084. }
  21085. }
  21086. clickSelf() {
  21087. if (!this.data.play)
  21088. return;
  21089. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21090. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21091. }
  21092. }
  21093. class UILevelDisplay$1 extends UIBase {
  21094. constructor() {
  21095. super();
  21096. }
  21097. onConstructor() {
  21098. this.ui = ui_UILevelDisplay.createInstance();
  21099. this.contentPane = this.ui;
  21100. this.isEject = false;
  21101. this.myList = this.ui.myNode.myList;
  21102. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21103. this.levelItemArr = [];
  21104. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21105. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21106. this.myList.numItems = levelNum;
  21107. if (Moyu.isKs)
  21108. this.ui.closeNode.closeBtn.x += 100;
  21109. }
  21110. levelItemRender(index, target) {
  21111. let item = new PutBallLevelDisplay$1(target, index);
  21112. this.levelItemArr.push(item);
  21113. }
  21114. show() {
  21115. super.show();
  21116. this.updateLevel();
  21117. this.scrollToPlace();
  21118. }
  21119. updateLevel() {
  21120. let temp;
  21121. for (let index = 0; index < this.levelItemArr.length; index++) {
  21122. temp = this.levelItemArr[index];
  21123. temp.updateSelf();
  21124. }
  21125. }
  21126. scrollToPlace() {
  21127. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21128. let passArr = DataMgr.getPlaceBallLevelList();
  21129. let offest = passArr.length;
  21130. if (offest >= maxNum - 1)
  21131. offest = maxNum - 1;
  21132. this.myList.scrollToView(offest, true, true);
  21133. }
  21134. hide() {
  21135. super.hide();
  21136. }
  21137. }
  21138. UILevelDisplay$1.uiName = "UILevelDisplay";
  21139. class UIMatching$1 extends UIBase {
  21140. constructor() {
  21141. super();
  21142. }
  21143. onConstructor() {
  21144. this.ui = ui_UIMatching.createInstance();
  21145. this.contentPane = this.ui;
  21146. this.isEject = false;
  21147. }
  21148. show(callback) {
  21149. super.show();
  21150. PlatMgr.showBanner(true);
  21151. this.callback = callback;
  21152. let user = Moyu.getUserInfo();
  21153. if (!this.selfPot) {
  21154. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21155. }
  21156. if (!this.aiPot) {
  21157. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21158. }
  21159. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21160. this.ui.selfHead.nameTxt.text = user.nickName;
  21161. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21162. this.ui.aiHead.nameTxt.text = "???";
  21163. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21164. this.ui.selfHead.c1.selectedIndex = 0;
  21165. this.ui.aiHead.c1.selectedIndex = 0;
  21166. this.ui.selfHead.x = this.selfPot.x;
  21167. this.ui.selfHead.y = this.selfPot.y;
  21168. this.ui.aiHead.x = this.aiPot.x;
  21169. this.ui.aiHead.y = this.aiPot.y;
  21170. switch (xGame.common.gameMode) {
  21171. case GameMode.classic:
  21172. break;
  21173. case GameMode.bigMove:
  21174. this.initSkillData();
  21175. break;
  21176. default:
  21177. break;
  21178. }
  21179. this.ui.t1.play(Laya.Handler.create(this, () => {
  21180. this.ui.t2.play(Laya.Handler.create(this, () => {
  21181. switch (xGame.common.gameMode) {
  21182. case GameMode.classic:
  21183. this.waitingPeople();
  21184. break;
  21185. case GameMode.bigMove:
  21186. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21187. break;
  21188. default:
  21189. break;
  21190. }
  21191. }));
  21192. }));
  21193. }
  21194. initSkillData() {
  21195. this.skillSelectData = [];
  21196. let skillUrl = xGame.common.skillIconList;
  21197. let skillName = xGame.common.skillNameList;
  21198. let skillLevel = DataMgr.getBigSkillList();
  21199. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21200. for (let index = 0; index < 5; index++) {
  21201. let obj = {};
  21202. obj.skillImg = skillUrl[index];
  21203. obj.skillName = skillName[index];
  21204. obj.skillType = skillType[index];
  21205. obj.skillLevel = skillLevel[index];
  21206. this.skillSelectData.push(obj);
  21207. }
  21208. }
  21209. getAISkillLevel(myLevel) {
  21210. let video = xGame.common.upSkillLevel;
  21211. let aiLevel;
  21212. let temp;
  21213. if (video) {
  21214. temp = xGame.common.randomNum(-2, -1);
  21215. }
  21216. else {
  21217. if (myLevel <= 5) {
  21218. temp = xGame.common.randomNum(1, 3);
  21219. }
  21220. else if (myLevel <= 9) {
  21221. temp = xGame.common.randomNum(-2, 1);
  21222. }
  21223. else {
  21224. temp = xGame.common.randomNum(-4, 0);
  21225. }
  21226. }
  21227. aiLevel = temp + myLevel;
  21228. if (aiLevel <= 1)
  21229. aiLevel = 1;
  21230. if (aiLevel >= 10)
  21231. aiLevel = 10;
  21232. return aiLevel;
  21233. }
  21234. getAISkillType() {
  21235. return xGame.common.randomNum(1, 4);
  21236. let successTimes = DataMgr.getSkillSuccessTimes();
  21237. let info = cfgTable.aiskillData[successTimes];
  21238. if (!info) {
  21239. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21240. info = cfgTable.aiskillData[max];
  21241. }
  21242. let dataArr = info.skillselect;
  21243. let myCfg = {};
  21244. for (let index = 0; index < dataArr.length; index++) {
  21245. let temp = dataArr[index].split('-');
  21246. myCfg[temp[0]] = {};
  21247. myCfg[temp[0]].id = parseInt(temp[0]);
  21248. myCfg[temp[0]].weight = parseInt(temp[1]);
  21249. }
  21250. let aiCfg = xGame.common.initWeight(myCfg);
  21251. let curData = xGame.common.getRandomWeightData(aiCfg);
  21252. return parseInt(curData.id);
  21253. }
  21254. getAISkillData(index) {
  21255. let myLevel = this.skillSelectData[index].skillLevel;
  21256. let aiLevel = this.getAISkillLevel(myLevel);
  21257. let aiType = this.getAISkillType() - 1;
  21258. return { aiLevel, aiType } = { aiLevel, aiType };
  21259. }
  21260. skillSelectFinish(index) {
  21261. let aiInfo = this.getAISkillData(index);
  21262. xGame.common.gameMgr.selfCurSkill = index;
  21263. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21264. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21265. this.ui.selfHead.c1.selectedIndex = 1;
  21266. this.ui.aiHead.c1.selectedIndex = 1;
  21267. let myData = this.skillSelectData[index];
  21268. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21269. let guide = DataMgr.getSkillGuide();
  21270. if (guide == 0) {
  21271. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21272. }
  21273. else {
  21274. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21275. }
  21276. let aiData = this.skillSelectData[aiInfo.aiType];
  21277. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21278. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21279. this.waitingPeople();
  21280. }
  21281. waitingPeople() {
  21282. let time = xGame.common.randomNum(1000, 3000);
  21283. time += 1000;
  21284. Laya.timer.once(time, this, () => {
  21285. this.matchingSuccess();
  21286. });
  21287. }
  21288. matchingSuccess() {
  21289. let gameUI = xGame.common.gameUI;
  21290. let name = gameUI.ui.topNode.aiNameTxt.text;
  21291. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21292. this.ui.aiHead.nameTxt.text = name;
  21293. this.ui.aiHead.headImg.url = url;
  21294. name = gameUI.ui.topNode.selfNameTxt.text;
  21295. url = gameUI.ui.topNode.selfHeadLoader.url;
  21296. this.ui.selfHead.nameTxt.text = name;
  21297. this.ui.selfHead.headImg.url = url;
  21298. this.ui.t3.play(Laya.Handler.create(this, () => {
  21299. this.callback && this.callback();
  21300. this.ui.t4.play(Laya.Handler.create(this, () => {
  21301. this.destroySelf();
  21302. }));
  21303. }));
  21304. }
  21305. destroySelf() {
  21306. this.callback = null;
  21307. this.skillSelectData = null;
  21308. this.selfPot = null;
  21309. this.aiPot = null;
  21310. if (!this.ui.isDisposed) {
  21311. this.ui.removeFromParent();
  21312. this.ui.dispose();
  21313. }
  21314. xGame.uiMgr.destroyUI(this);
  21315. }
  21316. }
  21317. UIMatching$1.uiName = "UIMatching";
  21318. class SkillDisplay$1 {
  21319. constructor(ui, data, uiIndex) {
  21320. this.starX = 0;
  21321. this.starY = 0;
  21322. this.index = 0;
  21323. this.ui = ui;
  21324. this.data = data;
  21325. this.index = uiIndex;
  21326. this.initSelf();
  21327. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21328. }
  21329. initSelf() {
  21330. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21331. this.ui.nameTxt.text = this.data.name;
  21332. this.ui.describeTxt.text = this.data.describe;
  21333. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21334. this.ui.startBtn.onClick(this, this.startGame);
  21335. this.updateSelf();
  21336. }
  21337. updateSelf() {
  21338. this.checkTry();
  21339. let level = DataMgr.getBigSkillByIndex(this.index);
  21340. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21341. }
  21342. checkTry() {
  21343. let index = this.index;
  21344. let level = DataMgr.getBigSkillByIndex(index);
  21345. if (level == null) {
  21346. DataMgr.setBigSkill(index, 1, false);
  21347. level = 1;
  21348. }
  21349. this.ui.levelTxt.text = "LV." + level;
  21350. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21351. this.ui.tryNode.visible = true;
  21352. else
  21353. this.ui.tryNode.visible = false;
  21354. }
  21355. clickAddLevel() {
  21356. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21357. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21358. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21359. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21360. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21361. }
  21362. else {
  21363. console.log('zh:AD 失败,直接发放奖励');
  21364. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21365. }
  21366. }
  21367. qjff_AD_for_skilldisplay_clickAddLevel() {
  21368. DataMgr.setBigSkill(this.data.index, 1);
  21369. this.updateSelf();
  21370. xGame.common.upSkillLevel = true;
  21371. }
  21372. startGame() {
  21373. console.log('zh:rod skill startgame');
  21374. if (this.data.index == 3) {
  21375. alert('Coming soon!');
  21376. return;
  21377. }
  21378. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21379. let needCoin = xGame.common.bigMoveNeedCoin;
  21380. xGame.common.passAwardCoin = 2000;
  21381. let guide = DataMgr.getSkillGuide();
  21382. console.log('zh:startGame guide=' + guide);
  21383. xGame.common.temSelfLevel = 0;
  21384. if (guide == 0) {
  21385. needCoin = 0;
  21386. xGame.common.temSelfLevel = 100;
  21387. }
  21388. if (DataMgr.coinEnough(needCoin)) {
  21389. DataMgr.setCoin(-needCoin);
  21390. xGame.common.curPlayerSkillType = this.index;
  21391. if (guide == 0)
  21392. xGame.common.curPlayerSkillType = 0;
  21393. console.log('zh: skilldisplay 1');
  21394. xGame.uiMgr.Show(UIGame$1);
  21395. xGame.uiMgr.Hide(UIMain$1);
  21396. xGame.uiMgr.Show(UIMatching$1, () => {
  21397. xGame.common.gameUI.ui.alpha = 1;
  21398. xGame.common.gameUI.startGame();
  21399. xGame.uiMgr.Hide(UISkill$1);
  21400. });
  21401. this.logEventForRod_start();
  21402. }
  21403. else {
  21404. console.log('zh: skilldisplay 2');
  21405. xGame.uiMgr.Show(UIAddProp$1, 0);
  21406. Moyu.sendDataEvent("AddCoinVideo");
  21407. }
  21408. }
  21409. logEventForRod_start() {
  21410. let gfmsIdx = xGame.common.curPlayerSkillType;
  21411. console.log('zh:选择的技能=' + gfmsIdx);
  21412. let gfmc = 'Skyfall Shot';
  21413. if (gfmsIdx == 0) {
  21414. gfmc = 'Skyfall Shot';
  21415. }
  21416. if (gfmsIdx == 1) {
  21417. gfmc = 'Surging break';
  21418. }
  21419. if (gfmsIdx == 2) {
  21420. gfmc = 'Frost Lock';
  21421. }
  21422. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21423. let jsonStr = {
  21424. "count": 0,
  21425. "name": gfmc
  21426. };
  21427. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21428. const d = LocalStorageManager.getItem(keyStr);
  21429. jsonStr.count = d.count + 1;
  21430. LocalStorageManager.setItem(keyStr, jsonStr);
  21431. }
  21432. else {
  21433. LocalStorageManager.setItem(keyStr, jsonStr);
  21434. }
  21435. const reqStr = JSON.stringify(jsonStr);
  21436. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21437. }
  21438. }
  21439. class UISkill$1 extends UIBase {
  21440. constructor() {
  21441. super();
  21442. this.skillData = [];
  21443. }
  21444. onConstructor() {
  21445. this.ui = ui_UISkill.createInstance();
  21446. this.contentPane = this.ui;
  21447. this.isEject = false;
  21448. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21449. this.initSkillData();
  21450. console.log('zh:aaaaaa1111111111');
  21451. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21452. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21453. console.log('zh:aaaaaa22222222');
  21454. this.displayList = [];
  21455. this.ui.skillNode.skillList.numItems = 3;
  21456. this.addUIClick(this.ui, this.interuptSecretary);
  21457. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21458. this.ui.talkNode.visible = false;
  21459. if (Moyu.isKs)
  21460. this.ui.closeNode.closeBtn.x += 100;
  21461. }
  21462. show() {
  21463. super.show();
  21464. this.playSecretaryIdle();
  21465. this.moneyNode.ui.c1.selectedIndex = 1;
  21466. Laya.timer.clearAll(this);
  21467. xGame.soundMgr.playSound("s_start");
  21468. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21469. let guide = DataMgr.getSkillGuide();
  21470. this.ui.guideNode.visible = guide == 0;
  21471. let item = this.getSkillItemByUIIndex(0);
  21472. if (guide == 0) {
  21473. item.ui.c1.selectedIndex = 1;
  21474. }
  21475. else {
  21476. item.ui.c1.selectedIndex = 0;
  21477. }
  21478. this.ui.guideNode.guideBtn.visible = guide == 0;
  21479. for (let index = 0; index < this.displayList.length; index++) {
  21480. this.displayList[index].checkTry();
  21481. }
  21482. }
  21483. getSkillItemByUIIndex(cur) {
  21484. for (let index = 0; index < this.displayList.length; index++) {
  21485. if (this.displayList[index].index == cur) {
  21486. return this.displayList[index];
  21487. }
  21488. }
  21489. }
  21490. enterGuideLevel() {
  21491. let item = this.getSkillItemByUIIndex(0);
  21492. item.startGame();
  21493. if (DataMgr.getNewUser())
  21494. Moyu.sendDataEvent("gameStart1");
  21495. }
  21496. initSkillData() {
  21497. this.skillData = [];
  21498. let nameList = xGame.common.skillNameList;
  21499. let iconList = xGame.common.skillIconList;
  21500. let describeList = [
  21501. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21502. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21503. "The power of frost descends—freezing the flow and taking full control of the game!"
  21504. ];
  21505. console.log('zh:initSkillData 111111111');
  21506. let data;
  21507. for (let index = 0; index < nameList.length; index++) {
  21508. data = {};
  21509. data.name = nameList[index];
  21510. data.icon = iconList[index];
  21511. data.describe = describeList[index];
  21512. data.index = index;
  21513. this.skillData.push(data);
  21514. }
  21515. }
  21516. updateSkillItem(index, target) {
  21517. if (this.displayList[index] == null) {
  21518. let uiIndex;
  21519. switch (index) {
  21520. case 0:
  21521. uiIndex = 1;
  21522. break;
  21523. case 1:
  21524. uiIndex = 0;
  21525. break;
  21526. case 2:
  21527. uiIndex = 2;
  21528. break;
  21529. case 3:
  21530. uiIndex = 3;
  21531. break;
  21532. default:
  21533. break;
  21534. }
  21535. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21536. this.displayList.push(temp);
  21537. }
  21538. }
  21539. playSecretaryIdle() {
  21540. let parent = this.ui.secretary.displayObject;
  21541. parent.destroyChildren();
  21542. let xx = this.ui.secretary.width / 2;
  21543. let yy = this.ui.secretary.height;
  21544. let scale = xGame.common.getSecretaryScale();
  21545. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21546. xGame.common.secretary.play(data, 0, true, parent);
  21547. }
  21548. returnUIMain() {
  21549. this.hide();
  21550. xGame.common.stopGirlPop(this.ui.talkNode);
  21551. xGame.uiMgr.Show(UIMain$1);
  21552. }
  21553. interuptSecretary() {
  21554. Laya.timer.clearAll(this);
  21555. this.playSecretaryRandomSound();
  21556. }
  21557. playSecretaryRandomSound() {
  21558. if (this.isHide)
  21559. return;
  21560. let time = xGame.common.randomNum(45000, 60000);
  21561. Laya.timer.once(time, this, () => {
  21562. if (this.isHide)
  21563. return;
  21564. let index = xGame.common.randomNum(4, 7);
  21565. xGame.soundMgr.playSound("s_main0" + index);
  21566. let words = 1;
  21567. switch (index) {
  21568. case 4:
  21569. words = 5;
  21570. break;
  21571. case 5:
  21572. words = 3;
  21573. break;
  21574. case 6:
  21575. words = 6;
  21576. break;
  21577. case 7:
  21578. words = 7;
  21579. break;
  21580. default:
  21581. break;
  21582. }
  21583. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21584. this.playSecretaryRandomSound();
  21585. });
  21586. }
  21587. }
  21588. UISkill$1.uiName = "UISkill";
  21589. class UIAddProp$1 extends UIBase {
  21590. constructor() {
  21591. super();
  21592. this.curType = "";
  21593. }
  21594. onConstructor() {
  21595. this.ui = ui_UIAddProp.createInstance();
  21596. this.contentPane = this.ui;
  21597. this.isEject = false;
  21598. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21599. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  21600. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  21601. this.updateUI();
  21602. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  21603. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  21604. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  21605. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  21606. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  21607. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  21608. }
  21609. show(type) {
  21610. super.show();
  21611. this.curType = type == 0 ? "coin" : "diamond";
  21612. this.switchBtn("");
  21613. this.ui.t0.play();
  21614. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  21615. PlatMgr.showInsert(true);
  21616. }
  21617. closeSelf() {
  21618. this.hide();
  21619. }
  21620. updateUI() {
  21621. let data = cfgTable.moneyData;
  21622. let temp;
  21623. let obj;
  21624. for (const key in data) {
  21625. temp = data[key];
  21626. obj = this.ui.myNode["node" + key];
  21627. if (parseInt(key) <= 2) {
  21628. obj.diamondTxt.text = "+" + temp.num;
  21629. }
  21630. else {
  21631. obj.coinTxt.text = temp.num;
  21632. obj.diamondTxt.text = temp.get.split('_')[1];
  21633. }
  21634. }
  21635. this.updateDiamondShare();
  21636. }
  21637. updateDiamondShare() {
  21638. let data = DataMgr.getShareDiamondTimes();
  21639. if (data >= xGame.common.maxShareDiamondTimes) {
  21640. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  21641. this.ui.myNode.node1.touchable = false;
  21642. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21643. }
  21644. else {
  21645. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  21646. this.ui.myNode.node1.touchable = true;
  21647. }
  21648. }
  21649. switchBtn(type) {
  21650. if (type == "")
  21651. type = this.curType;
  21652. else {
  21653. if (this.curType == type) {
  21654. return;
  21655. }
  21656. else {
  21657. this.curType = type;
  21658. }
  21659. }
  21660. if (type == "coin") {
  21661. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  21662. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  21663. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  21664. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  21665. this.ui.myNode.c1.selectedIndex = 0;
  21666. }
  21667. else {
  21668. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  21669. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  21670. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  21671. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  21672. this.ui.myNode.c1.selectedIndex = 1;
  21673. }
  21674. }
  21675. convertCoin(index) {
  21676. let data = cfgTable.moneyData[index];
  21677. let coinNum = data.num;
  21678. let str = data.get.split('_')[1];
  21679. let needDiamond = parseInt(str);
  21680. if (DataMgr.diamondEnough(needDiamond)) {
  21681. DataMgr.setDiamond(-needDiamond);
  21682. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  21683. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  21684. }
  21685. else {
  21686. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  21687. this.switchBtn("diamond");
  21688. }
  21689. }
  21690. videoGetDiamond() {
  21691. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  21692. if (Laya.Browser.onAndroid) {
  21693. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21694. if (!boo) {
  21695. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21696. return;
  21697. }
  21698. }
  21699. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  21700. }
  21701. else {
  21702. console.log('zh:AD 失败,直接发放奖励');
  21703. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  21704. }
  21705. }
  21706. qjff_AD_for_uiAddProp_videoGetDiamond() {
  21707. let num = cfgTable.moneyData[2].num;
  21708. xGame.common.playObjFlyAnim(num, Prop.diamond);
  21709. this.closeSelf();
  21710. }
  21711. videoGetCoin() {
  21712. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  21713. if (Laya.Browser.onAndroid) {
  21714. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21715. if (!boo) {
  21716. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21717. return;
  21718. }
  21719. }
  21720. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  21721. }
  21722. else {
  21723. console.log('zh:AD 失败,直接发放奖励');
  21724. this.qjff_AD_for_uiAddProp_videoGetCoin();
  21725. }
  21726. }
  21727. qjff_AD_for_uiAddProp_videoGetCoin() {
  21728. xGame.common.playObjFlyAnim(2000, Prop.coin);
  21729. this.closeSelf();
  21730. }
  21731. shareGetDiamond() {
  21732. let times = DataMgr.getShareDiamondTimes();
  21733. if (times >= xGame.common.maxShareDiamondTimes) {
  21734. console.log('zh: 233333333333 maxShareDiamondTimes');
  21735. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21736. }
  21737. else {
  21738. console.log('zh:33333333333333ad');
  21739. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  21740. if (Laya.Browser.onAndroid) {
  21741. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21742. if (!boo) {
  21743. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21744. return;
  21745. }
  21746. }
  21747. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  21748. }
  21749. else {
  21750. console.log('zh:AD 失败,直接发放奖励');
  21751. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  21752. }
  21753. }
  21754. }
  21755. qjff_AD_for_uiAddProp_shareGetDiamond() {
  21756. let diamond = xGame.common.randomNum(50, 100);
  21757. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  21758. DataMgr.setShareDiamondTimes(1);
  21759. this.updateDiamondShare();
  21760. }
  21761. openPutBallView() {
  21762. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  21763. let skill = xGame.uiMgr.getUI(UISkill$1);
  21764. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  21765. let uigame = xGame.uiMgr.getUI(UIGame$1);
  21766. if (end && !end.isHide) {
  21767. xGame.uiMgr.Hide(UIGameEnd$1);
  21768. xGame.uiMgr.Show(UIMain$1);
  21769. }
  21770. if (skill && !skill.isHide)
  21771. xGame.uiMgr.Hide(UISkill$1);
  21772. if (uigame && !uigame.isHide)
  21773. xGame.uiMgr.Hide(UIGame$1);
  21774. if (level && !level.isHide) {
  21775. }
  21776. else {
  21777. xGame.uiMgr.Show(UILevelDisplay$1);
  21778. }
  21779. this.closeSelf();
  21780. }
  21781. }
  21782. UIAddProp$1.uiName = "UIAddProp";
  21783. class MoneyNode$1 {
  21784. constructor(ui) {
  21785. this.leftTime = 0;
  21786. this.ui = ui;
  21787. this.ui.addCoinBtn.onClick(this, this.addCoin);
  21788. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  21789. this.ui.addPowerBtn.onClick(this, this.addPower);
  21790. this.ui.c1.selectedIndex = 1;
  21791. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  21792. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  21793. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  21794. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  21795. this.coinChange();
  21796. this.diamondChange();
  21797. this.powerChange();
  21798. }
  21799. addPower() {
  21800. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21801. xGame.uiMgr.Show(UIPower$1);
  21802. }
  21803. powerChange() {
  21804. let powerNum = DataMgr.getPower();
  21805. this.ui.powerTxt.text = powerNum + "";
  21806. }
  21807. checkPowerTime() {
  21808. let cur = new Date().getTime();
  21809. let last = DataMgr.getPowerTime();
  21810. if (last == 0) {
  21811. last = cur;
  21812. DataMgr.setPowerTime(cur);
  21813. }
  21814. let power = DataMgr.getPower();
  21815. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  21816. Laya.timer.clearAll(this);
  21817. if (power >= xGame.common.natureMaxPower) {
  21818. this.ui.powerTimeTxt.text = "";
  21819. DataMgr.setPowerTime(cur);
  21820. return;
  21821. }
  21822. if (power + offset >= xGame.common.natureMaxPower) {
  21823. DataMgr.setPower(xGame.common.natureMaxPower, false);
  21824. this.ui.powerTimeTxt.text = "";
  21825. DataMgr.setPowerTime(cur);
  21826. }
  21827. else {
  21828. if (offset > 0) {
  21829. DataMgr.setPower(offset);
  21830. DataMgr.setPowerTime(cur);
  21831. }
  21832. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  21833. this.leftTime = xGame.common.powerRecoverNum - time;
  21834. if (this.leftTime <= 0)
  21835. this.leftTime = 0;
  21836. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21837. Laya.timer.loop(1000, this, this.updatePowerTime);
  21838. }
  21839. }
  21840. updatePowerTime() {
  21841. this.leftTime -= 1;
  21842. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21843. if (this.leftTime <= 0) {
  21844. this.checkPowerTime();
  21845. }
  21846. }
  21847. coinChange() {
  21848. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  21849. }
  21850. diamondChange() {
  21851. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  21852. }
  21853. addCoin() {
  21854. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21855. Moyu.sendDataEvent("AddCoinBtn");
  21856. xGame.uiMgr.Show(UIAddProp$1, 0);
  21857. }
  21858. addDiamond() {
  21859. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21860. Moyu.sendDataEvent("AddDiamondBtn");
  21861. xGame.uiMgr.Show(UIAddProp$1, 1);
  21862. }
  21863. }
  21864. class SettingNode$1 {
  21865. constructor(ui) {
  21866. this.showSetting = false;
  21867. this.openSound = true;
  21868. this.openShake = true;
  21869. this.ui = ui;
  21870. this.ui.soundBtn.onClick(this, this.switchSound);
  21871. this.ui.shakeBtn.onClick(this, this.switchShake);
  21872. this.ui.xyBtn.onClick(this, this.onXy);
  21873. this.ui.clickNode.onClick(this, this.changeSetting);
  21874. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  21875. this.ui.xyBtn.visible = false;
  21876. this.ui.shakeBtn.visible = false;
  21877. }
  21878. changeSetting() {
  21879. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21880. this.showSetting = !this.showSetting;
  21881. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  21882. }
  21883. switchSound() {
  21884. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21885. this.openSound = !this.openSound;
  21886. Moyu.onSetting(this.openSound, this.openShake);
  21887. xGame.soundMgr.onSetting(this.openSound);
  21888. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  21889. }
  21890. switchShake() {
  21891. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21892. this.openShake = !this.openShake;
  21893. Moyu.onSetting(this.openSound, this.openShake);
  21894. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  21895. }
  21896. onXy() {
  21897. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21898. MoyuMgr$1.showXy(1);
  21899. }
  21900. }
  21901. class UIDraw$1 extends UIBase {
  21902. constructor() {
  21903. super();
  21904. this.curKey = 0;
  21905. }
  21906. onConstructor() {
  21907. this.ui = ui_UIDraw.createInstance();
  21908. this.contentPane = this.ui;
  21909. this.isEject = false;
  21910. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21911. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21912. this.addUIClick(this.ui.drawBtn, this.startDraw);
  21913. this.initDraw();
  21914. this.initUI();
  21915. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21916. if (Moyu.isKs)
  21917. this.ui.closeNode.closeBtn.x += 100;
  21918. }
  21919. show() {
  21920. super.show();
  21921. this.ui.t0.play();
  21922. this.playSecretaryIdle();
  21923. this.updateDraw();
  21924. this.checkFree();
  21925. if (PlatMgr.bannerDelay > 0) {
  21926. this.ui.closeNode.closeBtn.visible = false;
  21927. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  21928. this.ui.closeNode.closeBtn.visible = true;
  21929. });
  21930. }
  21931. PlatMgr.showRateBanner();
  21932. }
  21933. hide() {
  21934. Laya.timer.clearAll(this);
  21935. super.hide();
  21936. }
  21937. checkFree() {
  21938. let isFree = DataMgr.getDailyfreeDrawTimes();
  21939. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  21940. }
  21941. initDraw() {
  21942. this.drawObj = [];
  21943. let data = cfgTable.drawData;
  21944. let temp;
  21945. let weight = 0;
  21946. for (const key in data) {
  21947. temp = data[key];
  21948. weight += temp.weight;
  21949. this.drawObj.push(weight);
  21950. }
  21951. this.allWeight = weight;
  21952. }
  21953. initUI() {
  21954. let data = cfgTable.drawData;
  21955. let temp;
  21956. let img;
  21957. let txt;
  21958. for (const key in data) {
  21959. temp = data[key];
  21960. img = this.ui.myNode.rotNode["img" + key];
  21961. txt = this.ui.myNode.rotNode["txt" + key];
  21962. img.url = xGame.common.getGameIconUrl(temp.icon);
  21963. txt.visible = true;
  21964. if (temp.award > 2) {
  21965. img.rotation = 0;
  21966. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  21967. }
  21968. else {
  21969. img.rotation = temp.rotation;
  21970. txt.text = temp.num;
  21971. }
  21972. }
  21973. }
  21974. getCurkey() {
  21975. let rand = Math.random() * this.allWeight;
  21976. let temp;
  21977. for (let index = 0; index < this.drawObj.length - 1; index++) {
  21978. temp = this.drawObj[index];
  21979. if (index == 0) {
  21980. if (rand < temp) {
  21981. return index + 1;
  21982. }
  21983. }
  21984. else {
  21985. if (rand >= temp && rand < this.drawObj[index + 1]) {
  21986. return index + 1;
  21987. }
  21988. }
  21989. }
  21990. return 2;
  21991. }
  21992. startDraw() {
  21993. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  21994. if (freeTimes > 0) {
  21995. this.beginDraw();
  21996. DataMgr.setDailyfreeDrawTimes(0);
  21997. this.checkFree();
  21998. }
  21999. else {
  22000. if (Laya.Browser.onAndroid) {
  22001. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22002. if (!boo) {
  22003. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22004. return;
  22005. }
  22006. }
  22007. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22008. }
  22009. else {
  22010. console.log('zh:AD 失败,直接发放奖励');
  22011. this.qjff_chouJiang();
  22012. }
  22013. }
  22014. }
  22015. qjff_chouJiang() {
  22016. this.beginDraw();
  22017. }
  22018. beginDraw() {
  22019. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22020. this.ui.drawBtn.touchable = false;
  22021. this.curKey = this.getCurkey();
  22022. console.log("当前key", this.curKey);
  22023. let cell = 60;
  22024. let lap = 3;
  22025. let angle = cell * (this.curKey - 1) + lap * 360;
  22026. let target = this.ui.myNode.rotNode;
  22027. target.rotation = 0;
  22028. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22029. console.log("旋转完成");
  22030. this.ui.drawBtn.touchable = true;
  22031. this.getAward();
  22032. }));
  22033. }
  22034. getAward() {
  22035. let data = cfgTable.drawData[this.curKey];
  22036. let temp = new AwardType();
  22037. temp.type = data.award;
  22038. temp.num = data.num;
  22039. xGame.common.getAward([temp], () => {
  22040. DataMgr.setDrawTimes(1);
  22041. this.updateDraw();
  22042. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22043. });
  22044. }
  22045. updateDraw() {
  22046. let drawTimes = DataMgr.getDrawTimes();
  22047. let awardTimes = DataMgr.getDrawAwardTimes();
  22048. if (Math.floor(drawTimes / 3) > awardTimes) {
  22049. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22050. this.ui.extraNode.boxBtn.touchable = true;
  22051. this.ui.extraNode.tipsTxt.text = "3/3";
  22052. this.ui.extraNode.barNode.width = 265;
  22053. this.getExtraAward();
  22054. }
  22055. else {
  22056. this.ui.extraNode.boxBtn.t0.stop();
  22057. this.ui.extraNode.boxBtn.touchable = false;
  22058. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22059. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22060. }
  22061. let data = cfgTable.drawData[1];
  22062. if (awardTimes == 0) {
  22063. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22064. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22065. this.ui.myNode.rotNode.img1.rotation = 0;
  22066. }
  22067. else {
  22068. let award = data.nextid;
  22069. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22070. this.ui.myNode.rotNode.txt1.text = award[1];
  22071. this.ui.myNode.rotNode.img1.rotation = 0;
  22072. }
  22073. }
  22074. getExtraAward() {
  22075. let drawTimes = DataMgr.getDrawTimes();
  22076. let awardTimes = DataMgr.getDrawAwardTimes();
  22077. let data = cfgTable.drawData[1];
  22078. let award = new AwardType();
  22079. if (awardTimes == 0) {
  22080. award.num = data.num;
  22081. award.type = data.award;
  22082. xGame.common.getAward([award], () => {
  22083. let all = Math.floor(drawTimes / 3);
  22084. DataMgr.setDrawAwardTimes(all);
  22085. this.updateDraw();
  22086. });
  22087. }
  22088. else {
  22089. award.num = parseInt(data.nextid[1]);
  22090. award.type = parseInt(data.nextid[0]);
  22091. xGame.common.getAward([award], () => {
  22092. let all = Math.floor(drawTimes / 3);
  22093. DataMgr.setDrawAwardTimes(all);
  22094. this.updateDraw();
  22095. });
  22096. }
  22097. }
  22098. closeSelf() {
  22099. this.hide();
  22100. }
  22101. playSecretaryIdle() {
  22102. let parent = this.ui.secretary.displayObject;
  22103. parent.destroyChildren();
  22104. let xx = this.ui.secretary.width / 2;
  22105. let yy = this.ui.secretary.height;
  22106. let scale = xGame.common.getSecretaryScale();
  22107. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22108. xGame.common.secretary.play(data, 0, true, parent);
  22109. }
  22110. }
  22111. UIDraw$1.uiName = "UIDraw";
  22112. class UIRanking$1 extends UIBase {
  22113. constructor() {
  22114. super();
  22115. this.showSelf = true;
  22116. this.rankType = 1;
  22117. this.rankList = [];
  22118. this.topX = 10;
  22119. this.myIndex = this.topX + 1;
  22120. this.myStar = 0;
  22121. }
  22122. onConstructor() {
  22123. this.ui = ui_UIRanking.createInstance();
  22124. this.contentPane = this.ui;
  22125. this.isEject = false;
  22126. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22127. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22128. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22129. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22130. this.ui.myNode.myList.setVirtual();
  22131. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22132. }
  22133. show() {
  22134. super.show();
  22135. this.getPaiHangBangDataFormJosnFile();
  22136. this.updateSelf();
  22137. let self = Moyu.getUserInfo();
  22138. if (!self.isAuth) {
  22139. Moyu.initUser(this, () => {
  22140. DataMgr.upRankData();
  22141. });
  22142. }
  22143. }
  22144. getPaiHangBangDataFormJosnFile() {
  22145. const rankingList = cfgTable.paiHangBangData.list;
  22146. this.updateItemData(rankingList);
  22147. }
  22148. updateSelfItem() {
  22149. console.log('zh:Moyu.platType =' + Moyu.platType);
  22150. let self = Moyu.getUserInfo();
  22151. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22152. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22153. if (this.myIndex > this.topX) {
  22154. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22155. }
  22156. else {
  22157. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22158. }
  22159. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22160. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22161. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22162. }
  22163. updateItemData(data) {
  22164. this.myStar = xGame.common.getAllStarNum();
  22165. if (this.rankList.length < 2) {
  22166. this.rankList = data;
  22167. let self = Moyu.getUserInfo();
  22168. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22169. self.headIcon = self.headIcon;
  22170. for (let i = 0; i < data.length; i++) {
  22171. let data = this.rankList[i];
  22172. if (data.userId == self.userId) {
  22173. this.rankList.splice(i, 1);
  22174. break;
  22175. }
  22176. }
  22177. for (let i = 0; i < data.length; i++) {
  22178. let data = this.rankList[i];
  22179. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22180. this.myIndex = i + 1;
  22181. let user = { headIcon: self.headIcon, nickName: "myself" };
  22182. let ud = { user: user, data: {} };
  22183. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22184. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22185. if (Moyu.platType < 11) {
  22186. user.headIcon = self.headIcon;
  22187. user.nickName = self.nickName;
  22188. }
  22189. this.rankList.splice(i, 0, md);
  22190. break;
  22191. }
  22192. }
  22193. }
  22194. this.updateSelfItem();
  22195. this.ui.myNode.myList.numItems = this.rankList.length;
  22196. }
  22197. updateItemUI(index, obj) {
  22198. let data = this.rankList[index];
  22199. let userData = JSON.parse(data.userData).user;
  22200. obj.nameTxt.text = userData.nickName.toString();
  22201. obj.valueTxt.text = data.rankScore;
  22202. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22203. obj.rankTxt.text = index + 1;
  22204. switch (index) {
  22205. case 0:
  22206. this.setImg(obj, 1, 0, 0);
  22207. obj.rankTxt.color = "#FFC047";
  22208. break;
  22209. case 1:
  22210. this.setImg(obj, 0, 1, 0);
  22211. obj.rankTxt.color = "#ACACAC";
  22212. break;
  22213. case 2:
  22214. this.setImg(obj, 0, 0, 1);
  22215. obj.rankTxt.color = "#D09672";
  22216. break;
  22217. default:
  22218. this.setImg(obj, 0, 0, 0);
  22219. obj.rankTxt.color = "#496FAB";
  22220. break;
  22221. }
  22222. }
  22223. setImg(obj, a, b, c) {
  22224. obj.img1.visible = a ? true : false;
  22225. obj.img2.visible = b ? true : false;
  22226. obj.img3.visible = c ? true : false;
  22227. }
  22228. changeList(type) {
  22229. this.rankType = type;
  22230. this.updateSelf();
  22231. }
  22232. changeSelfNode() {
  22233. this.showSelf = !this.showSelf;
  22234. this.updateSelf();
  22235. }
  22236. updateSelf() {
  22237. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22238. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22239. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22240. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22241. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22242. }
  22243. }
  22244. UIRanking$1.uiName = "UIRanking";
  22245. class UISecretary$1 extends UIBase {
  22246. constructor() {
  22247. super();
  22248. this.curIndex = 1;
  22249. }
  22250. onConstructor() {
  22251. this.ui = ui_UISecretary.createInstance();
  22252. this.contentPane = this.ui;
  22253. this.isEject = false;
  22254. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22255. this.nodeObj = { left: null, right: null, cur: null };
  22256. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22257. }
  22258. show() {
  22259. super.show();
  22260. this.ui.t0.play();
  22261. this.updateData();
  22262. }
  22263. addSecretarySpine(node, spineName) {
  22264. if (spineName == "mishu") {
  22265. if (this.secretarySpine1) {
  22266. node.displayObject.destroyChildren();
  22267. this.playWoman(this.secretarySpine1, node.displayObject);
  22268. }
  22269. else {
  22270. let spine1 = new SpineMgr("mishu", () => {
  22271. this.secretarySpine1 = spine1;
  22272. this.playWoman(this.secretarySpine1, node.displayObject);
  22273. });
  22274. }
  22275. }
  22276. else {
  22277. if (this.secretarySpine2) {
  22278. node.displayObject.destroyChildren();
  22279. this.playWoman(this.secretarySpine2, node.displayObject);
  22280. }
  22281. else {
  22282. let spine2 = new SpineMgr("xiaomishu2", () => {
  22283. this.secretarySpine2 = spine2;
  22284. this.playWoman(this.secretarySpine2, node.displayObject);
  22285. });
  22286. }
  22287. }
  22288. }
  22289. playWoman(node, parent) {
  22290. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22291. let yy = this.ui.myNode.gameNode3.secretary.height;
  22292. let scale = 1.5;
  22293. if (node == this.secretarySpine2) {
  22294. scale = 1.2;
  22295. }
  22296. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22297. node.play(data, 0, true, parent);
  22298. }
  22299. turnLeft() {
  22300. this.curIndex--;
  22301. if (this.curIndex < 1) {
  22302. this.curIndex = 2;
  22303. }
  22304. let left = this.nodeObj.left;
  22305. let right = this.nodeObj.right;
  22306. let cur = this.nodeObj.cur;
  22307. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22308. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22309. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22310. this.updateData();
  22311. }));
  22312. this.ui.myNode.setChildIndex(right, 2);
  22313. this.nodeObj.left = cur;
  22314. this.nodeObj.right = left;
  22315. this.nodeObj.cur = right;
  22316. }
  22317. turnRight() {
  22318. this.curIndex++;
  22319. if (this.curIndex > 2) {
  22320. this.curIndex = 1;
  22321. }
  22322. let left = this.nodeObj.left;
  22323. let right = this.nodeObj.right;
  22324. let cur = this.nodeObj.cur;
  22325. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22326. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22327. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22328. this.updateData();
  22329. }));
  22330. this.ui.myNode.setChildIndex(left, 2);
  22331. this.nodeObj.left = right;
  22332. this.nodeObj.right = cur;
  22333. this.nodeObj.cur = left;
  22334. }
  22335. updateData() {
  22336. console.log('zh: updateData FFFFFFFFFF');
  22337. let data = cfgTable.secretaryshopData;
  22338. let children = this.ui.myNode._children;
  22339. let temp;
  22340. let curData;
  22341. for (let index = 0; index < children.length; index++) {
  22342. temp = children[index];
  22343. curData = data[1];
  22344. temp.heightTxt.text = curData.height;
  22345. temp.foodTxt.text = curData.food;
  22346. temp.historyTxt.text = curData.history;
  22347. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22348. this.addSecretarySpine(temp.secretary, curData.spine);
  22349. let womanIndex = curData.id - 1;
  22350. let getWoman = DataMgr.getSecretary(womanIndex);
  22351. let curUse = DataMgr.getCurSecretary();
  22352. if (getWoman) {
  22353. if (curUse == womanIndex) {
  22354. temp.purchaseBtn.c1.selectedIndex = 1;
  22355. }
  22356. else {
  22357. temp.purchaseBtn.c1.selectedIndex = 2;
  22358. }
  22359. }
  22360. else {
  22361. temp.purchaseBtn.c1.selectedIndex = 0;
  22362. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22363. }
  22364. temp.purchaseBtn.visible = false;
  22365. }
  22366. }
  22367. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22368. console.log('zh: 点击了clickSecretary ');
  22369. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22370. if (getWoman) {
  22371. if (curUse != womanIndex) {
  22372. console.log();
  22373. DataMgr.setCurSecretary(womanIndex);
  22374. this.updateData();
  22375. }
  22376. }
  22377. else {
  22378. console.log('zh:点击购买了');
  22379. let need = needDiamond;
  22380. if (DataMgr.diamondEnough(need)) {
  22381. DataMgr.setDiamond(-need);
  22382. DataMgr.setSecretary(womanIndex, 1);
  22383. DataMgr.setCurSecretary(womanIndex);
  22384. this.updateData();
  22385. }
  22386. else {
  22387. xGame.uiMgr.Show(UIAddProp$1, 1);
  22388. }
  22389. }
  22390. }
  22391. closeSelf() {
  22392. this.hide();
  22393. }
  22394. }
  22395. UISecretary$1.uiName = "UISecretary";
  22396. class BallRodDisplay$1 {
  22397. constructor(ui, index) {
  22398. this.index = 0;
  22399. this.uiIndex = 0;
  22400. this.ui = ui;
  22401. this.index = index;
  22402. this.initData();
  22403. }
  22404. initData() {
  22405. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22406. let data = cfgTable.ballrodData[this.index + 1];
  22407. this.ui.nameTxt.text = data.name;
  22408. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22409. this.ui.levelNode.c1.selectedIndex = data.quality;
  22410. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22411. if (data.spine) {
  22412. this.mySpine = new SpineMgr(data.spine, () => {
  22413. let xx = 150;
  22414. let yy = 70;
  22415. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22416. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22417. });
  22418. }
  22419. }
  22420. updateSelf() {
  22421. console.log('zh:updateSelf -------------- ');
  22422. let get = DataMgr.getBallRod(this.index);
  22423. if (get == null)
  22424. get = 1;
  22425. let curUse = DataMgr.getCurBallRod();
  22426. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22427. if (get) {
  22428. if (curUse == this.index) {
  22429. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22430. }
  22431. else {
  22432. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22433. }
  22434. }
  22435. else {
  22436. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22437. }
  22438. }
  22439. buyBallRod() {
  22440. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22441. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22442. switch (selectedIndex) {
  22443. case 0:
  22444. break;
  22445. case 1:
  22446. console.log('zh:点击了 USE THIS');
  22447. DataMgr.setCurBallRod(this.index);
  22448. let curUse = DataMgr.getCurBallRod();
  22449. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22450. let ui = xGame.uiMgr.getUI(UIShop$1);
  22451. ui.updateBallRod();
  22452. break;
  22453. case 2:
  22454. let data = cfgTable.ballrodData[this.index + 1];
  22455. let need = data.price;
  22456. if (DataMgr.diamondEnough(need)) {
  22457. this.buyQiuGan(data);
  22458. DataMgr.setDiamond(-need);
  22459. DataMgr.setBallRod(this.index, 1);
  22460. DataMgr.setCurBallRod(this.index);
  22461. let ui = xGame.uiMgr.getUI(UIShop$1);
  22462. ui.updateBallRod();
  22463. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22464. }
  22465. else {
  22466. xGame.uiMgr.Show(UIAddProp$1, 1);
  22467. }
  22468. break;
  22469. default:
  22470. break;
  22471. }
  22472. }
  22473. buyQiuGan(qgItem) {
  22474. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  22475. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22476. if (userInfo == null) {
  22477. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22478. return;
  22479. }
  22480. let reqData = xGame.httpMgr.getReqData();
  22481. let pd = JSON.parse(reqData);
  22482. pd.qiuGanData = qgItem;
  22483. reqData = JSON.stringify(pd);
  22484. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  22485. try {
  22486. console.log('zh:buySp res = ' + JSON.stringify(res));
  22487. let code = res.code;
  22488. let msg = res.msg;
  22489. if (code == 401) {
  22490. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22491. alert(TIP_MSG_key.loginTimeOut);
  22492. xGame.uiMgr.Show(UIMsg$1, msg);
  22493. return;
  22494. }
  22495. if (code == 200) {
  22496. xGame.uiMgr.Show(UIMsg$1, msg);
  22497. DataMgr.getUserZiChanInfo();
  22498. }
  22499. else {
  22500. xGame.uiMgr.Show(UIMsg$1, msg);
  22501. }
  22502. }
  22503. catch (error) {
  22504. console.log('error=' + error);
  22505. alert(error);
  22506. }
  22507. finally {
  22508. }
  22509. });
  22510. }
  22511. logEventForGouMaiGan(qiuGanName) {
  22512. const ev = {
  22513. value: qiuGanName
  22514. };
  22515. const jsonStr = JSON.stringify(ev);
  22516. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22517. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22518. }
  22519. }
  22520. class DaoJuDisplay$1 {
  22521. constructor(ui, index) {
  22522. this.index = 0;
  22523. this.uiIndex = 0;
  22524. this.ui = ui;
  22525. this.index = index;
  22526. this.initData();
  22527. }
  22528. initData() {
  22529. this.ui.btn_buy.onClick(this, this.buySp);
  22530. this.ui.btn_buy.onClick(this, this.buyDj);
  22531. let data = cfgTable.daoJuData[this.index + 1];
  22532. console.log('zh:' + JSON.stringify(data));
  22533. this.ui.nameTxt.text = data.spbt;
  22534. this.ui.n_jiaGe.text = data.spjg + "";
  22535. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22536. let baseUrl = "asset/sound/ogg/";
  22537. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  22538. }
  22539. buyDj() {
  22540. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22541. }
  22542. buySp() {
  22543. let djItem = cfgTable.daoJuData[this.index + 1];
  22544. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  22545. let userInfo = LocalStorageManager.getItem('userInfo');
  22546. if (userInfo == null) {
  22547. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22548. return;
  22549. }
  22550. let reqData = xGame.httpMgr.getReqData();
  22551. let pd = JSON.parse(reqData);
  22552. pd.spItem = djItem;
  22553. reqData = JSON.stringify(pd);
  22554. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  22555. try {
  22556. console.log('zh:buySp res = ' + JSON.stringify(res));
  22557. let code = res.code;
  22558. let msg = res.msg;
  22559. if (code == 401) {
  22560. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22561. alert(TIP_MSG_key.pleaseLoginIn);
  22562. return;
  22563. }
  22564. if (code == 200) {
  22565. xGame.uiMgr.Show(UIMsg$1, msg);
  22566. DataMgr.getUserZiChanInfo();
  22567. }
  22568. else {
  22569. xGame.uiMgr.Show(UIMsg$1, msg);
  22570. }
  22571. }
  22572. catch (error) {
  22573. console.log('error=' + error);
  22574. alert(error);
  22575. }
  22576. finally {
  22577. }
  22578. });
  22579. }
  22580. }
  22581. class UIShop$1 extends UIBase {
  22582. constructor() {
  22583. super();
  22584. this.itemNums = 0;
  22585. this.itemNumsForDj = 0;
  22586. this.curType = "";
  22587. }
  22588. onConstructor() {
  22589. this.ui = ui_UIShop.createInstance();
  22590. this.contentPane = this.ui;
  22591. this.isEject = false;
  22592. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22593. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22594. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  22595. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  22596. this.addUIClick(this.ui, this.interuptSecretary);
  22597. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  22598. this.ballRodArr = [];
  22599. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  22600. this.ui.myNode.myList.numItems = this.itemNums;
  22601. this.loadDjdata_old();
  22602. }
  22603. loadDjdata_old() {
  22604. let fff = cfgTable.daoJuData;
  22605. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  22606. this.daoJuArr = [];
  22607. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  22608. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  22609. }
  22610. getProductList() {
  22611. let reqData = xGame.httpMgr.getReqData();
  22612. let pd = JSON.parse(reqData);
  22613. pd.splx = "Consumable";
  22614. reqData = JSON.stringify(pd);
  22615. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  22616. try {
  22617. let code = res.code;
  22618. let msg = res.msg;
  22619. if (code == 401) {
  22620. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22621. alert(TIP_MSG_key.pleaseLoginIn);
  22622. return;
  22623. }
  22624. if (code == 200) {
  22625. let data = res.data;
  22626. for (let index = 0; index < data.length; index++) {
  22627. let element = data[index];
  22628. cfgTable.daoJuData[element.spid] = element;
  22629. }
  22630. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  22631. }
  22632. else {
  22633. xGame.uiMgr.Show(UIMsg, msg);
  22634. }
  22635. }
  22636. catch (error) {
  22637. console.log('error=' + error);
  22638. alert(error);
  22639. }
  22640. finally {
  22641. }
  22642. });
  22643. }
  22644. show(type) {
  22645. super.show();
  22646. this.curType = type == 0 ? "qiugan" : "daoju";
  22647. this.switchBtn("qiugan");
  22648. this.playSecretaryIdle();
  22649. this.updateBallRod();
  22650. }
  22651. test123() {
  22652. console.log('zh:test123 ');
  22653. }
  22654. switchBtn(type) {
  22655. console.log('zh:1111切換 sel type=' + type);
  22656. if (type == "") {
  22657. type = this.curType;
  22658. }
  22659. else {
  22660. if (this.curType == type) {
  22661. return;
  22662. }
  22663. else {
  22664. this.curType = type;
  22665. }
  22666. }
  22667. if (type == "qiugan") {
  22668. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  22669. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  22670. this.ui.myNode.c1.selectedIndex = 0;
  22671. this.ui.myNode.myList.visible = true;
  22672. this.ui.myNode.djList.visible = false;
  22673. }
  22674. else {
  22675. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  22676. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  22677. this.ui.myNode.c1.selectedIndex = 1;
  22678. this.ui.myNode.myList.visible = false;
  22679. this.ui.myNode.djList.visible = true;
  22680. }
  22681. }
  22682. updateBallRod() {
  22683. for (let index = 0; index < this.ballRodArr.length; index++) {
  22684. this.ballRodArr[index].updateSelf();
  22685. }
  22686. }
  22687. renderBallRod(sort, obj) {
  22688. let index = this.getIndexBySort(sort + 1) - 1;
  22689. let ballRod = new BallRodDisplay$1(obj, index);
  22690. this.ballRodArr.push(ballRod);
  22691. }
  22692. renderDaoJu(idx, obj) {
  22693. let index = this.getIndexBySortForDj(idx + 1) - 1;
  22694. let b = new DaoJuDisplay$1(obj, index);
  22695. this.daoJuArr.push(b);
  22696. }
  22697. getIndexBySort(sort) {
  22698. let object = cfgTable.ballrodData;
  22699. for (const key in object) {
  22700. if (object[key].sort == sort) {
  22701. return parseInt(key);
  22702. }
  22703. }
  22704. }
  22705. getIndexBySortForDj(idx) {
  22706. let object = cfgTable.daoJuData;
  22707. for (const key in object) {
  22708. if (object[key].idx == idx) {
  22709. return parseInt(key);
  22710. }
  22711. }
  22712. }
  22713. playSecretaryIdle() {
  22714. let parent = this.ui.secretary.displayObject;
  22715. parent.destroyChildren();
  22716. let xx = this.ui.secretary.width / 2;
  22717. let yy = this.ui.secretary.height;
  22718. let scale = xGame.common.getSecretaryScale();
  22719. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22720. xGame.common.secretary.play(data, 0, true, parent);
  22721. }
  22722. interuptSecretary() {
  22723. Laya.timer.clearAll(this);
  22724. this.playSecretaryRandomSound();
  22725. }
  22726. playSecretaryRandomSound() {
  22727. if (this.isHide)
  22728. return;
  22729. let time = xGame.common.randomNum(45000, 60000);
  22730. Laya.timer.once(time, this, () => {
  22731. if (this.isHide)
  22732. return;
  22733. let index = xGame.common.randomNum(4, 7);
  22734. xGame.soundMgr.playSound("s_main0" + index);
  22735. let words = 1;
  22736. switch (index) {
  22737. case 4:
  22738. words = 5;
  22739. break;
  22740. case 5:
  22741. words = 3;
  22742. break;
  22743. case 6:
  22744. words = 6;
  22745. break;
  22746. case 7:
  22747. words = 7;
  22748. break;
  22749. default:
  22750. break;
  22751. }
  22752. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22753. this.playSecretaryRandomSound();
  22754. });
  22755. }
  22756. closeSelf() {
  22757. this.hide();
  22758. }
  22759. }
  22760. UIShop$1.uiName = "UIShop";
  22761. class SignMax$1 {
  22762. constructor(ui) {
  22763. this.ui = ui;
  22764. }
  22765. updateSelf(index, sameDay, curDayIndex) {
  22766. let data = cfgTable.signData[index + 1];
  22767. this.ui.titleTxt.text = data.title;
  22768. let arr1 = data.award[0].split('-');
  22769. let arr2 = data.award[1].split('-');
  22770. let num1 = parseInt(arr1[1]);
  22771. let num2 = parseInt(arr2[1]);
  22772. this.ui.numTxt1.text = num1 + "";
  22773. this.ui.numTxt2.text = num2 + "";
  22774. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  22775. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  22776. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  22777. this.ui.numTxt1.visible = false;
  22778. }
  22779. else {
  22780. this.ui.numTxt1.visible = true;
  22781. }
  22782. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  22783. this.ui.numTxt2.visible = false;
  22784. }
  22785. else {
  22786. this.ui.numTxt2.visible = true;
  22787. }
  22788. if (index < curDayIndex) {
  22789. this.ui.c1.selectedIndex = 1;
  22790. }
  22791. else if (index == curDayIndex) {
  22792. if (sameDay) {
  22793. this.ui.c1.selectedIndex = 2;
  22794. }
  22795. else {
  22796. this.ui.c1.selectedIndex = 2;
  22797. }
  22798. }
  22799. else {
  22800. this.ui.c1.selectedIndex = 0;
  22801. }
  22802. }
  22803. }
  22804. class SignNormal$1 {
  22805. constructor(ui) {
  22806. this.ui = ui;
  22807. }
  22808. updateSelf(index, sameDay, curDayIndex) {
  22809. let data = cfgTable.signData[index + 1];
  22810. this.ui.titleTxt.text = data.title;
  22811. let arr = data.award[0].split('-');
  22812. let type = parseInt(arr[0]);
  22813. let num = parseInt(arr[1]);
  22814. this.ui.numTxt.text = num + "";
  22815. if (type > 2) {
  22816. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  22817. this.ui.myIcon.rotation = 0;
  22818. }
  22819. else {
  22820. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  22821. this.ui.myIcon.rotation = 0;
  22822. }
  22823. if (xGame.common.signAwardContainsRod(data.award)) {
  22824. this.ui.numTxt.visible = false;
  22825. }
  22826. else {
  22827. this.ui.numTxt.visible = true;
  22828. }
  22829. if (index < curDayIndex) {
  22830. this.ui.c1.selectedIndex = 1;
  22831. }
  22832. else if (index == curDayIndex) {
  22833. if (sameDay) {
  22834. this.ui.c1.selectedIndex = 2;
  22835. }
  22836. else {
  22837. this.ui.c1.selectedIndex = 2;
  22838. }
  22839. }
  22840. else {
  22841. this.ui.c1.selectedIndex = 0;
  22842. }
  22843. }
  22844. }
  22845. class UISign$1 extends UIBase {
  22846. constructor() {
  22847. super();
  22848. this.curDayIndex = 0;
  22849. this.starX = 0;
  22850. }
  22851. onConstructor() {
  22852. this.ui = ui_UISign.createInstance();
  22853. this.contentPane = this.ui;
  22854. this.isEject = false;
  22855. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22856. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22857. this.initSignItem();
  22858. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  22859. this.addUIClick(this.ui.againBtn, this.againGetAward);
  22860. }
  22861. show() {
  22862. super.show();
  22863. this.ui.t0.play();
  22864. this.playSecretaryIdle();
  22865. this.updateSign();
  22866. }
  22867. initSignItem() {
  22868. this.signArr = [];
  22869. for (let index = 0; index < 6; index++) {
  22870. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  22871. this.signArr.push(temp);
  22872. }
  22873. this.signMax = new SignMax$1(this.ui.myNode.day7);
  22874. if (Moyu.isKs)
  22875. this.ui.closeNode.closeBtn.x += 100;
  22876. }
  22877. updateSign() {
  22878. let sameDay = xGame.common.judgeSameDay();
  22879. let max = 7;
  22880. this.curDayIndex = DataMgr.getSignData();
  22881. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  22882. this.curDayIndex = 0;
  22883. if (!sameDay) {
  22884. this.ui.normalBtn.visible = true;
  22885. this.ui.tipsNode.visible = false;
  22886. this.ui.againBtn.visible = false;
  22887. }
  22888. else {
  22889. this.ui.normalBtn.visible = false;
  22890. let again = DataMgr.getExtraSign();
  22891. let isCurrency = false;
  22892. let index = this.curDayIndex;
  22893. if (index == 0)
  22894. index = 7;
  22895. let award = cfgTable.signData[index].award;
  22896. let num = award[0].split("-")[0];
  22897. if (num == "1" || num == "2")
  22898. isCurrency = true;
  22899. let showAgain = again == 0 && isCurrency;
  22900. this.ui.againBtn.visible = showAgain;
  22901. this.ui.tipsNode.visible = !showAgain;
  22902. }
  22903. for (let index = 0; index < this.signArr.length; index++) {
  22904. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  22905. }
  22906. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  22907. }
  22908. playSecretaryIdle() {
  22909. let parent = this.ui.secretary.displayObject;
  22910. parent.destroyChildren();
  22911. let xx = this.ui.secretary.width / 2;
  22912. let yy = this.ui.secretary.height;
  22913. let scale = xGame.common.getSecretaryScale();
  22914. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22915. xGame.common.secretary.play(data, 0, true, parent);
  22916. }
  22917. closeSelf() {
  22918. this.hide();
  22919. }
  22920. normalGetAward() {
  22921. let sameDay = xGame.common.judgeSameDay();
  22922. if (!sameDay) {
  22923. let award = cfgTable.signData[this.curDayIndex + 1].award;
  22924. let temp;
  22925. let type;
  22926. let num;
  22927. let arr = [];
  22928. for (let index = 0; index < award.length; index++) {
  22929. temp = award[index].split("-");
  22930. type = parseInt(temp[0]);
  22931. num = parseInt(temp[1]);
  22932. let awardType = new AwardType();
  22933. awardType.num = num;
  22934. awardType.type = type;
  22935. arr.push(awardType);
  22936. }
  22937. xGame.common.getAward(arr, (watchVideo) => {
  22938. this.curDayIndex++;
  22939. if (this.curDayIndex > 7)
  22940. this.curDayIndex = 0;
  22941. DataMgr.setSignData(this.curDayIndex);
  22942. DataMgr.setSignTime(new Date().getTime());
  22943. if (watchVideo) {
  22944. DataMgr.setExtraSign(1);
  22945. Moyu.sendDataEvent("signIn1");
  22946. }
  22947. this.updateSign();
  22948. });
  22949. }
  22950. }
  22951. againGetAward() {
  22952. Moyu.sendDataEvent("signIn2");
  22953. console.log('zh:qjff_AD_for_uisign');
  22954. if (Laya.Browser.onAndroid) {
  22955. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22956. if (!boo) {
  22957. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22958. return;
  22959. }
  22960. }
  22961. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  22962. }
  22963. else {
  22964. console.log('zh:AD 失败,直接发放奖励');
  22965. this.qjff_AD_for_uisign();
  22966. }
  22967. }
  22968. qjff_AD_for_uisign() {
  22969. let index = this.curDayIndex;
  22970. if (index == 0)
  22971. index = 7;
  22972. let award = cfgTable.signData[index].award;
  22973. let temp;
  22974. let type;
  22975. let num;
  22976. for (let index = 0; index < award.length; index++) {
  22977. temp = award[index].split("-");
  22978. type = parseInt(temp[0]);
  22979. num = parseInt(temp[1]) * 3;
  22980. xGame.common.playObjFlyAnim(num, type);
  22981. }
  22982. DataMgr.setExtraSign(1);
  22983. this.updateSign();
  22984. }
  22985. }
  22986. UISign$1.uiName = "UISign";
  22987. class UIModeSelection$1 extends UIBase {
  22988. constructor() {
  22989. super();
  22990. }
  22991. onConstructor() {
  22992. this.ui = ui_UIModeSelection.createInstance();
  22993. this.contentPane = this.ui;
  22994. this.isEject = false;
  22995. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  22996. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  22997. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  22998. this.addUIClick(this.ui.closeBtn, this.hide);
  22999. this.peopleArr = [65, 990, 580];
  23000. this.peopleOffest = [5, 10, 10];
  23001. }
  23002. show(callback) {
  23003. this.updateSelf();
  23004. super.show();
  23005. this.ui.t0.play();
  23006. this.callback = callback;
  23007. }
  23008. updateSelf() {
  23009. let cfg = cfgTable.modeselectData;
  23010. for (let index = 1; index <= 3; index++) {
  23011. let node = this.ui.myNode["type" + index];
  23012. node.need.text = cfg[index].need;
  23013. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23014. node.peopleTxt.text = this.getRandPeople(index - 1);
  23015. }
  23016. }
  23017. enterGame(type) {
  23018. console.log('zh: 进入经典模式 type: ' + type);
  23019. xGame.common.classicRoomType = type;
  23020. let cfg = cfgTable.modeselectData[type];
  23021. let need = cfg.need;
  23022. xGame.common.passAwardCoin = cfg.award;
  23023. if (DataMgr.coinEnough(need)) {
  23024. DataMgr.setCoin(-need);
  23025. this.ui.myNode["type" + type].t0.play();
  23026. Laya.timer.once(200, this, () => {
  23027. this.callback && this.callback();
  23028. });
  23029. this.logEventForClassic_start();
  23030. }
  23031. else {
  23032. Moyu.sendDataEvent("AddCoinVideo");
  23033. xGame.uiMgr.Show(UIAddProp$1, 0);
  23034. }
  23035. }
  23036. getRandPeople(index) {
  23037. let rand = this.peopleOffest[index];
  23038. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23039. }
  23040. logEventForClassic_start() {
  23041. let rtype = xGame.common.classicRoomType;
  23042. let msmc = '';
  23043. if (rtype == 1) {
  23044. msmc = 'beginner';
  23045. }
  23046. if (rtype == 2) {
  23047. msmc = 'expert';
  23048. }
  23049. if (rtype == 3) {
  23050. msmc = 'master';
  23051. }
  23052. let keyStr = 'sjmd_classic_start_' + rtype;
  23053. let jsonStr = {
  23054. "difficulty": msmc,
  23055. "classic_count": 1,
  23056. "difficulty_count": 1
  23057. };
  23058. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23059. const d = LocalStorageManager.getItem(keyStr);
  23060. jsonStr.classic_count = d.classic_count + 1;
  23061. jsonStr.difficulty_count = d.difficulty_count + 1;
  23062. LocalStorageManager.setItem(keyStr, jsonStr);
  23063. }
  23064. else {
  23065. LocalStorageManager.setItem(keyStr, jsonStr);
  23066. }
  23067. const reqStr = JSON.stringify(jsonStr);
  23068. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23069. }
  23070. }
  23071. UIModeSelection$1.uiName = "UIModeSelection";
  23072. class UILogin$1 extends UIBase {
  23073. constructor() {
  23074. super();
  23075. }
  23076. onConstructor() {
  23077. this.ui = ui_UILogin.createInstance();
  23078. this.contentPane = this.ui;
  23079. this.isEject = false;
  23080. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23081. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23082. this.addUIClick(this.ui.btn_login, this.userLogin);
  23083. }
  23084. show() {
  23085. super.show();
  23086. this.x = (Laya.stage.width - this.width) / 2;
  23087. this.y = (Laya.stage.height - this.height) / 2;
  23088. }
  23089. closeSelf() {
  23090. this.hide();
  23091. }
  23092. userLogin() {
  23093. let ua = this.ui.txt_ua.text;
  23094. let up = this.ui.txt_up.text;
  23095. if (ua && up) {
  23096. let reqData = JSON.stringify({
  23097. username: ua.trim(),
  23098. password: up.trim(),
  23099. fromMark: 'app_game'
  23100. });
  23101. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23102. try {
  23103. console.log('zh:res = ' + JSON.stringify(res));
  23104. let code = res.code;
  23105. let msg = res.msg;
  23106. if (code == 200) {
  23107. let keyStr = 'userInfo';
  23108. let jsonStr = {
  23109. "username": res.username,
  23110. "token": res.token
  23111. };
  23112. LocalStorageManager.setItem(keyStr, jsonStr);
  23113. xGame.uiMgr.Show(UIMsg$1, msg);
  23114. DataMgr.getUserZiChanInfo();
  23115. this.closeSelf();
  23116. }
  23117. else {
  23118. xGame.uiMgr.Show(UIMsg$1, msg);
  23119. }
  23120. }
  23121. catch (error) {
  23122. console.log('error=' + error);
  23123. alert(error);
  23124. }
  23125. finally {
  23126. }
  23127. });
  23128. }
  23129. else {
  23130. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23131. }
  23132. }
  23133. gotoRegPage() {
  23134. this.closeSelf();
  23135. xGame.uiMgr.Show(UIReg$1);
  23136. }
  23137. }
  23138. UILogin$1.uiName = "UILogin";
  23139. class UIReg$1 extends UIBase {
  23140. constructor() {
  23141. super();
  23142. }
  23143. onConstructor() {
  23144. this.ui = ui_UIReg.createInstance();
  23145. this.contentPane = this.ui;
  23146. this.isEject = false;
  23147. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23148. this.addUIClick(this.ui.btn_reg, this.regUser);
  23149. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23150. }
  23151. show() {
  23152. super.show();
  23153. this.x = (Laya.stage.width - this.width) / 2;
  23154. this.y = (Laya.stage.height - this.height) / 2;
  23155. }
  23156. closeSelf() {
  23157. this.hide();
  23158. }
  23159. regUser() {
  23160. this.ui.lab_tip.visible = false;
  23161. let ua = this.ui.txt_ua.text;
  23162. let up1 = this.ui.txt_up1.text;
  23163. let up2 = this.ui.txt_up2.text;
  23164. if (ua && up1 && up2 && up1 == up2) {
  23165. let reqData = JSON.stringify({
  23166. username: ua.trim(),
  23167. password: up1.trim(),
  23168. fromMark: 'app_game'
  23169. });
  23170. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23171. try {
  23172. console.log('zh:res = ' + JSON.stringify(res));
  23173. let code = res.code;
  23174. let msg = res.msg;
  23175. xGame.uiMgr.Show(UIMsg$1, msg);
  23176. if (code == 200) {
  23177. this.ui.lab_tip.color = "#FFFFFF";
  23178. xGame.uiMgr.Show(UIMsg$1, msg);
  23179. this.closeSelf();
  23180. }
  23181. else {
  23182. this.ui.lab_tip.color = "#FF0000";
  23183. xGame.uiMgr.Show(UIMsg$1, msg);
  23184. }
  23185. }
  23186. catch (error) {
  23187. console.log('error=' + error);
  23188. alert(error);
  23189. }
  23190. finally {
  23191. }
  23192. });
  23193. }
  23194. else {
  23195. if (up1 != up2) {
  23196. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23197. }
  23198. else {
  23199. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23200. }
  23201. }
  23202. }
  23203. gotoLogin() {
  23204. this.closeSelf();
  23205. xGame.uiMgr.Show(UILogin$1);
  23206. }
  23207. }
  23208. UIReg$1.uiName = "UIReg";
  23209. class UIFuli1$1 extends UIBase {
  23210. constructor() {
  23211. super();
  23212. }
  23213. onConstructor() {
  23214. this.ui = ui_UIFuli1.createInstance();
  23215. this.contentPane = this.ui;
  23216. this.isEject = false;
  23217. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23218. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23219. }
  23220. show() {
  23221. super.show();
  23222. this.x = (Laya.stage.width - this.width) / 2;
  23223. this.y = (Laya.stage.height - this.height) / 2;
  23224. }
  23225. closeSelf() {
  23226. this.hide();
  23227. }
  23228. gotoBuy() {
  23229. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23230. if (userInfo == null) {
  23231. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23232. return;
  23233. }
  23234. let reqData = xGame.httpMgr.getReqData();
  23235. let pd = JSON.parse(reqData);
  23236. pd.productId = 1;
  23237. reqData = JSON.stringify(pd);
  23238. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23239. try {
  23240. console.log('zh:buySp res = ' + JSON.stringify(res));
  23241. let code = res.code;
  23242. let msg = res.msg;
  23243. if (code == 401) {
  23244. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23245. alert(TIP_MSG_key.loginTimeOut);
  23246. xGame.uiMgr.Show(UIMsg$1, msg);
  23247. return;
  23248. }
  23249. if (code == 200) {
  23250. xGame.uiMgr.Show(UIMsg$1, msg);
  23251. DataMgr.getUserZiChanInfo();
  23252. this.closeSelf();
  23253. }
  23254. else {
  23255. xGame.uiMgr.Show(UIMsg$1, msg);
  23256. }
  23257. }
  23258. catch (error) {
  23259. console.log('error=' + error);
  23260. alert(error);
  23261. }
  23262. finally {
  23263. }
  23264. });
  23265. }
  23266. }
  23267. UIFuli1$1.uiName = "UIFuli1";
  23268. class UIFuli2$1 extends UIBase {
  23269. constructor() {
  23270. super();
  23271. }
  23272. onConstructor() {
  23273. this.ui = ui_UIFuli2.createInstance();
  23274. this.contentPane = this.ui;
  23275. this.isEject = false;
  23276. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  23277. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  23278. }
  23279. show() {
  23280. super.show();
  23281. this.x = (Laya.stage.width - this.width) / 2;
  23282. this.y = (Laya.stage.height - this.height) / 2;
  23283. }
  23284. closeSelf() {
  23285. this.hide();
  23286. }
  23287. gotoBuy() {
  23288. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23289. if (userInfo == null) {
  23290. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23291. return;
  23292. }
  23293. let reqData = xGame.httpMgr.getReqData();
  23294. let pd = JSON.parse(reqData);
  23295. pd.productId = 2;
  23296. reqData = JSON.stringify(pd);
  23297. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23298. try {
  23299. console.log('zh:buySp res = ' + JSON.stringify(res));
  23300. let code = res.code;
  23301. let msg = res.msg;
  23302. if (code == 401) {
  23303. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23304. alert(TIP_MSG_key.loginTimeOut);
  23305. xGame.uiMgr.Show(UIMsg$1, msg);
  23306. return;
  23307. }
  23308. if (code == 200) {
  23309. xGame.uiMgr.Show(UIMsg$1, msg);
  23310. DataMgr.getUserZiChanInfo();
  23311. this.closeSelf();
  23312. }
  23313. else {
  23314. xGame.uiMgr.Show(UIMsg$1, msg);
  23315. }
  23316. }
  23317. catch (error) {
  23318. console.log('error=' + error);
  23319. alert(error);
  23320. }
  23321. finally {
  23322. }
  23323. });
  23324. }
  23325. }
  23326. UIFuli2$1.uiName = "UIFuli2";
  23327. class UITry$1 extends UIBase {
  23328. constructor() {
  23329. super();
  23330. this.closeTime = 0;
  23331. this.closeNum = 0;
  23332. this.skillUrl = xGame.common.skillIconList;
  23333. }
  23334. onConstructor() {
  23335. this.ui = ui_UITry.createInstance();
  23336. this.contentPane = this.ui;
  23337. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23338. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23339. }
  23340. show() {
  23341. super.show();
  23342. this.closeNum = 0;
  23343. this.closeTime = 15;
  23344. this.ui.t0.play();
  23345. PlatMgr.showRateBanner();
  23346. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23347. Laya.timer.loop(1000, this, this.updateTime);
  23348. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23349. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23350. xGame.common.gameMgr.gamePause = true;
  23351. }
  23352. updateTime() {
  23353. if (this.closeTime > 1) {
  23354. this.closeTime--;
  23355. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23356. }
  23357. else
  23358. this.hide();
  23359. }
  23360. hide() {
  23361. Laya.timer.clearAll(this);
  23362. Moyu.showBannerAd(false);
  23363. super.hide();
  23364. xGame.common.gameMgr.gamePause = false;
  23365. }
  23366. onTry() {
  23367. console.log('zh:qjff_AD_for_uitry');
  23368. if (Laya.Browser.onAndroid) {
  23369. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23370. if (!boo) {
  23371. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23372. return;
  23373. }
  23374. }
  23375. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  23376. }
  23377. else {
  23378. console.log('zh:AD 失败,直接发放奖励');
  23379. this.qjff_AD_for_uitry();
  23380. }
  23381. }
  23382. qjff_AD_for_uitry() {
  23383. let select = xGame.common.curPlayerSkillType;
  23384. DataMgr.gameData.trySkill = select;
  23385. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  23386. DataMgr.saveGameData();
  23387. DataMgr.setBigSkill(select, 1);
  23388. xGame.showTip("Trial Successful");
  23389. this.hide();
  23390. }
  23391. onCancel() {
  23392. if (this.closeNum > 0) {
  23393. this.closeNum--;
  23394. if (this.closeNum < 2)
  23395. this.hide();
  23396. return;
  23397. }
  23398. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  23399. this.onTry();
  23400. }
  23401. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  23402. this.closeNum = 3;
  23403. }
  23404. else
  23405. this.hide();
  23406. }
  23407. }
  23408. UITry$1.uiName = "UITry";
  23409. class UIGetAward$1 extends UIBase {
  23410. constructor() {
  23411. super();
  23412. this.showTriple = true;
  23413. }
  23414. onConstructor() {
  23415. this.ui = ui_UIGetAward.createInstance();
  23416. this.contentPane = this.ui;
  23417. this.isEject = false;
  23418. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  23419. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  23420. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  23421. }
  23422. show(arr, showTriple, callback) {
  23423. super.show();
  23424. this.ui.t0.play();
  23425. this.ui.eftNode.visible = true;
  23426. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  23427. this.ui.eftNode.visible = false;
  23428. }), 1, 0, 0, 0.9);
  23429. this.awardArr = arr;
  23430. this.showTriple = showTriple;
  23431. this.callback = callback;
  23432. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  23433. this.ui.myList.numItems = arr.length;
  23434. xGame.soundMgr.playSound("getaward");
  23435. }
  23436. updateSelf(index, obj) {
  23437. let temp = this.awardArr[index];
  23438. let icon = this.getIcon(temp.type);
  23439. let str = icon;
  23440. if (temp.type > 2) {
  23441. str = "s" + icon;
  23442. }
  23443. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  23444. obj.myIcon.rotation = 0;
  23445. obj.numTxt.text = temp.num + "";
  23446. obj.numTxt.visible = temp.type > 2 ? false : true;
  23447. obj.nameTxt.text = this.getNameStr(temp.type);
  23448. }
  23449. renderItem(index, obj) {
  23450. this.updateSelf(index, obj);
  23451. }
  23452. tripleGetAward() {
  23453. console.log('zh:qjff_AD_for_uigetAward');
  23454. if (Laya.Browser.onAndroid) {
  23455. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23456. if (!boo) {
  23457. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23458. return;
  23459. }
  23460. }
  23461. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  23462. }
  23463. else {
  23464. console.log('zh:AD 失败,直接发放奖励');
  23465. this.qjff_AD_for_uigetAward();
  23466. }
  23467. }
  23468. qjff_AD_for_uigetAward() {
  23469. this.getAward(3);
  23470. }
  23471. normalGetAward() {
  23472. if (PlatMgr.isMisVideo())
  23473. this.tripleGetAward();
  23474. else
  23475. this.getAward();
  23476. }
  23477. getAward(times = 1) {
  23478. this.hide();
  23479. for (let index = 0; index < this.awardArr.length; index++) {
  23480. this.awardArr[index].num *= times;
  23481. }
  23482. this.callback && this.callback(times != 1);
  23483. }
  23484. getIcon(type) {
  23485. switch (type) {
  23486. case Prop.diamond:
  23487. return "ty_zs";
  23488. case Prop.coin:
  23489. return "ty_jb";
  23490. case Prop.gan1:
  23491. return "qg1";
  23492. case Prop.gan2:
  23493. return "qg2";
  23494. case Prop.gan3:
  23495. return "qg3";
  23496. case Prop.gan4:
  23497. return "qg4";
  23498. default:
  23499. break;
  23500. }
  23501. }
  23502. getNameStr(type) {
  23503. switch (type) {
  23504. case Prop.diamond:
  23505. return "Diamond";
  23506. case Prop.coin:
  23507. return "Coins";
  23508. case Prop.gan1:
  23509. case Prop.gan2:
  23510. case Prop.gan3:
  23511. case Prop.gan4:
  23512. return cfgTable.ballrodData[type - 1].name;
  23513. default:
  23514. break;
  23515. }
  23516. }
  23517. }
  23518. UIGetAward$1.uiName = "UIGetAward";
  23519. class UIBox$1 extends UIBase {
  23520. constructor() {
  23521. super();
  23522. this.boxNum = 0;
  23523. this.boxMax = 10;
  23524. this.inAd = false;
  23525. this.isClose = false;
  23526. }
  23527. onConstructor() {
  23528. this.ui = ui_UIBox.createInstance();
  23529. this.contentPane = this.ui;
  23530. this.isEject = false;
  23531. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  23532. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  23533. Laya.timer.loop(1000, this, this.update);
  23534. }
  23535. update() {
  23536. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  23537. this.boxNum -= 1;
  23538. this.upBar();
  23539. }
  23540. }
  23541. upBar() {
  23542. if (this.boxNum > this.boxMax)
  23543. this.boxNum = this.boxMax;
  23544. this.ui.bar.value = this.boxNum * 10;
  23545. }
  23546. show() {
  23547. super.show();
  23548. this.isClose = false;
  23549. this.boxNum = 0;
  23550. this.inAd = false;
  23551. this.upBar();
  23552. this.ui.t0.play();
  23553. this.ui.closeBtn.visible = false;
  23554. Laya.timer.once(3000, this, () => {
  23555. this.ui.closeBtn.visible = true;
  23556. this.ui.bar.alpha = 1;
  23557. });
  23558. Laya.timer.once(500, this, () => {
  23559. this.ui.t1.play();
  23560. });
  23561. }
  23562. hide() {
  23563. Laya.timer.clearAll(this);
  23564. Moyu.showBannerAd(false);
  23565. super.hide();
  23566. }
  23567. onOpenBox() {
  23568. this.boxNum++;
  23569. if (this.boxNum < this.boxMax) {
  23570. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  23571. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  23572. }
  23573. }
  23574. else if (this.boxNum == this.boxMax) {
  23575. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  23576. this.ui.openBtn.c1.selectedIndex = 13;
  23577. this.inAd = true;
  23578. }
  23579. else
  23580. this.getAward();
  23581. }
  23582. else if (this.inAd) {
  23583. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  23584. if (Laya.Browser.onAndroid) {
  23585. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23586. if (!boo) {
  23587. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23588. return;
  23589. }
  23590. }
  23591. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  23592. }
  23593. else {
  23594. console.log('zh:AD 失败,直接发放奖励');
  23595. this.qjff_AD_for_UIBOX_onOpenBox();
  23596. }
  23597. }
  23598. this.upBar();
  23599. }
  23600. qjff_AD_for_UIBOX_onOpenBox() {
  23601. this.getAward();
  23602. }
  23603. onCloseBox() {
  23604. if (this.isClose)
  23605. this.hide();
  23606. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  23607. this.isClose = true;
  23608. PlatMgr.showBanner(true, 0, 3000);
  23609. }
  23610. else
  23611. this.hide();
  23612. }
  23613. getAward() {
  23614. let str = "";
  23615. if (Math.random() < 0.5) {
  23616. let max = Moyu.isLegal ? 500 : 2500;
  23617. let num = xGame.tools.random(max, 500 + max);
  23618. DataMgr.setCoin(num);
  23619. str = "金币x" + num;
  23620. }
  23621. else {
  23622. let max = Moyu.isLegal ? 10 : 30;
  23623. let num = xGame.tools.random(max, 30 + max);
  23624. DataMgr.setDiamond(num);
  23625. str = "钻石x" + num;
  23626. }
  23627. xGame.showTip("恭喜获得-" + str);
  23628. this.hide();
  23629. }
  23630. }
  23631. UIBox$1.uiName = "UIBox";
  23632. class UIMain$1 extends UIBase {
  23633. constructor() {
  23634. super();
  23635. this.firstEnter = true;
  23636. }
  23637. nativeCallJs(msg) {
  23638. let t = msg;
  23639. console.log("zh: nativeCallJs 奖励开始发放:", t);
  23640. switch (t) {
  23641. case 'qjff_chouJiang':
  23642. let dui = xGame.uiMgr.getUI(UIDraw$1);
  23643. dui.qjff_chouJiang();
  23644. break;
  23645. case 'qjff_AD_for_uisign':
  23646. let dui2 = xGame.uiMgr.getUI(UISign$1);
  23647. dui2.qjff_AD_for_uisign();
  23648. break;
  23649. case 'qjff_AD_for_uitry':
  23650. let dui3 = xGame.uiMgr.getUI(UITry$1);
  23651. dui3.qjff_AD_for_uitry();
  23652. break;
  23653. case 'qjff_AD_for_uipower':
  23654. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  23655. dui4.qjff_AD_for_uipower();
  23656. break;
  23657. case 'qjff_AD_for_uigetAward':
  23658. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  23659. dui5.qjff_AD_for_uigetAward();
  23660. break;
  23661. case 'qjff_AD_for_uiGameEnd':
  23662. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  23663. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  23664. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  23665. break;
  23666. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  23667. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  23668. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  23669. break;
  23670. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  23671. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  23672. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  23673. break;
  23674. case 'qjff_AD_for_UIrepentProp_videoRegret':
  23675. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  23676. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  23677. break;
  23678. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  23679. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  23680. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  23681. break;
  23682. case 'qjff_AD_for_UIBOX_onOpenBox':
  23683. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  23684. dui11.qjff_AD_for_UIBOX_onOpenBox();
  23685. break;
  23686. case 'qjff_AD_for_UIAddCoin':
  23687. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  23688. dui12.qjff_AD_for_UIAddCoin();
  23689. break;
  23690. case '111a':
  23691. let dui14 = xGame.uiMgr.getUI(UISign$1);
  23692. dui14.qjff_AD_for_uisign();
  23693. break;
  23694. case '222a':
  23695. let dui15 = xGame.uiMgr.getUI(UISign$1);
  23696. dui15.qjff_AD_for_uisign();
  23697. break;
  23698. case '333a':
  23699. let dui16 = xGame.uiMgr.getUI(UISign$1);
  23700. dui16.qjff_AD_for_uisign();
  23701. break;
  23702. default:
  23703. console.log('zh:未知的方法名字' + t);
  23704. break;
  23705. }
  23706. }
  23707. onConstructor() {
  23708. console.log('zh: UIMain onConstructor');
  23709. this.ui = ui_UIMain.createInstance();
  23710. this.contentPane = this.ui;
  23711. this.isEject = false;
  23712. this.addEvent();
  23713. this.addClickSpine();
  23714. this.settingNode = new SettingNode$1(this.ui.settingNode);
  23715. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23716. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  23717. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  23718. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  23719. let curUse = DataMgr.getCurSecretary();
  23720. this.changeSecretary(curUse);
  23721. this.ui.talkNode.visible = false;
  23722. let guide = DataMgr.getSkillGuide();
  23723. if (xGame.common.isNewDay && guide == 1) {
  23724. xGame.common.isNewDay = false;
  23725. xGame.soundMgr.playSound("s_main01");
  23726. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23727. console.log("zh:播放小秘书每天语音");
  23728. }
  23729. this.onGetUserInfo();
  23730. DataMgr.getUserZiChanInfo();
  23731. this.ui.n83.visible = false;
  23732. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23733. const d = LocalStorageManager.getItem(keyForLoginInfo);
  23734. let ua = d.username;
  23735. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23736. }
  23737. this.c_btn_for_user();
  23738. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  23739. }
  23740. Logout() {
  23741. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23742. LocalStorageManager.removeItem(keyForLoginInfo);
  23743. this.freshUser();
  23744. }
  23745. JSBridgeUtils.instance.loginOutForApp();
  23746. }
  23747. gotoLogin() {
  23748. xGame.uiMgr.Show(UILogin$1);
  23749. }
  23750. gotoRegUser() {
  23751. xGame.uiMgr.Show(UIReg$1);
  23752. }
  23753. showFuLi() {
  23754. console.log('zh:福利2');
  23755. xGame.uiMgr.Show(UIFuli1$1);
  23756. xGame.uiMgr.Show(UIFuli2$1);
  23757. console.log('zh:福利2222');
  23758. }
  23759. c_btn_for_user() {
  23760. this.ui.n_Logout.visible = false;
  23761. this.ui.n_dengLu.visible = false;
  23762. this.ui.n_zhuCe.visible = false;
  23763. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23764. this.ui.n_Logout.visible = true;
  23765. }
  23766. else {
  23767. this.ui.n_dengLu.visible = true;
  23768. }
  23769. }
  23770. changeSecretary(curUse) {
  23771. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  23772. xGame.common.secretary && xGame.common.secretary.dispose();
  23773. this.addSecretarySpine(name);
  23774. }
  23775. addSecretarySpine(name) {
  23776. let spine = new SpineMgr(name, () => {
  23777. this.playSecretaryIdle();
  23778. });
  23779. xGame.common.secretary = spine;
  23780. }
  23781. addClickSpine() {
  23782. let clickSpine = new SpineMgr("dianji", () => {
  23783. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  23784. let parent = Laya.stage;
  23785. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  23786. clickSpine.play(data, 0, false, parent, (spine) => {
  23787. spine.destroy(true);
  23788. });
  23789. });
  23790. });
  23791. }
  23792. addEvent() {
  23793. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  23794. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  23795. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  23796. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  23797. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  23798. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  23799. this.addUIClick(this.ui, this.interuptSecretary);
  23800. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  23801. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  23802. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  23803. this.addUIClick(this.ui.shopBtn, this.openShopView);
  23804. this.addUIClick(this.ui.signBtn, this.openSignView);
  23805. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  23806. this.addUIClick(this.ui.rankBtn, this.openRanking);
  23807. this.addUIClick(this.ui.n_Logout, this.Logout);
  23808. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  23809. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  23810. this.addUIClick(this.ui.n_fuli, this.showFuLi);
  23811. }
  23812. show(showFailWords) {
  23813. super.show();
  23814. this.moneyNode.ui.c1.selectedIndex = 1;
  23815. this.playSecretaryIdle();
  23816. xGame.soundMgr.playMusic("caromhall01", 0);
  23817. Laya.timer.clearAll(this);
  23818. this.playSecretaryRandomSound();
  23819. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  23820. if (showFailWords) {
  23821. console.log('zh:uimain.ts ');
  23822. setTimeout(() => {
  23823. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  23824. let words = -1;
  23825. if (str == "s_main02") {
  23826. words = 2;
  23827. }
  23828. else {
  23829. words = 3;
  23830. }
  23831. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23832. xGame.soundMgr.playSound(str);
  23833. }, 300);
  23834. }
  23835. this.showGuide();
  23836. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  23837. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  23838. let guide = DataMgr.getSkillGuide();
  23839. if (guide == 1) {
  23840. let randTime = xGame.common.randomNum(300, 800);
  23841. if (this.firstEnter) {
  23842. console.log("zh: firstEnter");
  23843. this.firstEnter = false;
  23844. randTime += 900;
  23845. }
  23846. else {
  23847. console.log("zh: no firstEnter");
  23848. }
  23849. Laya.timer.once(randTime, this, () => {
  23850. xGame.common.autoPopUIView();
  23851. });
  23852. }
  23853. }
  23854. checkActive(show) {
  23855. }
  23856. showGuide() {
  23857. let guide = DataMgr.getSkillGuide();
  23858. this.ui.guideBtn.visible = guide == 0;
  23859. this.ui.enterGuide.visible = false;
  23860. this.ui.secretaryGuide.visible = guide == 0;
  23861. if (guide == 0) {
  23862. console.log("zh:显示引导");
  23863. xGame.soundMgr.playSound("s_guide");
  23864. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23865. }
  23866. else {
  23867. console.log("zh:不需要显示引导");
  23868. }
  23869. }
  23870. ensureSecretary() {
  23871. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  23872. this.ui.secretaryGuide.visible = false;
  23873. this.ui.enterGuide.visible = true;
  23874. this.ui.wordsNode.t0.play();
  23875. if (DataMgr.getNewUser())
  23876. Moyu.sendDataEvent("gameReady");
  23877. }
  23878. playSecretaryIdle() {
  23879. let parent = this.ui.secretary.displayObject;
  23880. parent.destroyChildren();
  23881. let xx = this.ui.secretary.width / 2;
  23882. let yy = this.ui.secretary.height;
  23883. let scale = xGame.common.getSecretaryScale();
  23884. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23885. xGame.common.secretary.play(data, 0, true, parent);
  23886. }
  23887. startGame(type) {
  23888. if (!this.isReadyForLoadNetSource()) {
  23889. return;
  23890. }
  23891. xGame.common.gameMode = type;
  23892. Moyu.sendDataEvent("PlayGame", { type: type });
  23893. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  23894. switch (xGame.common.gameMode) {
  23895. case GameMode.classic:
  23896. console.log('zh:进入经典模式111111111');
  23897. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  23898. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23899. console.log('zh:classic db_over_lev=', db_over_lev);
  23900. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  23901. console.log('zh:判断是否可以玩该模式classic =NO');
  23902. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  23903. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23904. return;
  23905. }
  23906. else {
  23907. console.log('zh:可以玩该模式classic 66666666666666');
  23908. this.beginGame();
  23909. }
  23910. }
  23911. else {
  23912. console.log('zh:不需要判断是否可以玩该classic');
  23913. let challengeTimes = DataMgr.getChallengeTimes();
  23914. if (challengeTimes == 0) {
  23915. xGame.uiMgr.Show(UIInvitation$1);
  23916. }
  23917. else {
  23918. this.beginGame();
  23919. }
  23920. break;
  23921. }
  23922. case GameMode.bigMove:
  23923. console.error('zh:bigMove check');
  23924. let guide = DataMgr.getSkillGuide();
  23925. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  23926. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23927. console.log('zh:bigMove db_over_lev=', db_over_lev);
  23928. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  23929. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  23930. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23931. return;
  23932. }
  23933. else {
  23934. console.log('zh:可以玩该模式 bigMove');
  23935. this.beginGame();
  23936. if (DataMgr.getNewUser())
  23937. Moyu.sendDataEvent("gameStart0");
  23938. }
  23939. }
  23940. else {
  23941. this.beginGame();
  23942. if (DataMgr.getNewUser())
  23943. Moyu.sendDataEvent("gameStart0");
  23944. }
  23945. break;
  23946. default:
  23947. console.error('zh:未知错误!!!!');
  23948. break;
  23949. }
  23950. }
  23951. beginGame(isNice = false) {
  23952. console.log('zh:beginGame ');
  23953. let guide = DataMgr.getSkillGuide();
  23954. if (guide == 1) {
  23955. console.log('zh:非新手引导,showInternAd ');
  23956. JSBridgeUtils.instance.showInternAd('beginGame');
  23957. }
  23958. else {
  23959. console.log('zh:新手引导,不显示AD ');
  23960. }
  23961. console.log('zh:beginGame 2 go');
  23962. if (xGame.common.gameMode == GameMode.classic) {
  23963. if (isNice) {
  23964. this.enterClassic();
  23965. }
  23966. else {
  23967. xGame.uiMgr.Show(UIModeSelection$1, () => {
  23968. console.log('zh:BBBBBBBBBBBBBBB');
  23969. this.enterClassic();
  23970. });
  23971. }
  23972. }
  23973. else if (xGame.common.gameMode == GameMode.bigMove) {
  23974. this.ui.enterGuide.visible = false;
  23975. xGame.uiMgr.Show(UISkill$1);
  23976. }
  23977. }
  23978. enterClassic() {
  23979. xGame.uiMgr.Show(UIGame$1);
  23980. xGame.uiMgr.Show(UIMatching$1, () => {
  23981. if (!this.isHide)
  23982. this.hide();
  23983. xGame.common.gameUI.ui.alpha = 1;
  23984. xGame.common.gameUI.startGame();
  23985. xGame.uiMgr.Hide(UIGameEnd$1);
  23986. });
  23987. }
  23988. startGlobal() {
  23989. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  23990. let userInfo = LocalStorageManager.getItem('userInfo');
  23991. if (userInfo != null) {
  23992. let token = userInfo.token;
  23993. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  23994. JSBridgeUtils.instance.testPay1(token, ggSpid);
  23995. return;
  23996. }
  23997. }
  23998. startWeekly() {
  23999. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24000. }
  24001. zhouSaiMonth() {
  24002. console.log('zh: zhouSaiMonth 被调用');
  24003. }
  24004. isReadyForLoadNetSource() {
  24005. let reqCount = xGame.cfgMgr.httpReqCount;
  24006. let ok = xGame.cfgMgr.httpReqOkCount;
  24007. if (reqCount > ok) {
  24008. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24009. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24010. Laya.timer.once(5000, this, () => {
  24011. let retryCount = 0;
  24012. const maxRetries = 3;
  24013. const tryFetchConfig = () => {
  24014. try {
  24015. xGame.cfgMgr.getConfigFromServer();
  24016. }
  24017. catch (error) {
  24018. if (retryCount < maxRetries) {
  24019. retryCount++;
  24020. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24021. Laya.timer.once(5000, this, tryFetchConfig);
  24022. }
  24023. else {
  24024. console.error("❌ 达到最大重试次数,配置获取失败");
  24025. }
  24026. }
  24027. };
  24028. tryFetchConfig();
  24029. });
  24030. return false;
  24031. }
  24032. return true;
  24033. }
  24034. startPlaceBall() {
  24035. if (!this.isReadyForLoadNetSource()) {
  24036. return;
  24037. }
  24038. xGame.uiMgr.Show(UILevelDisplay$1);
  24039. }
  24040. hide() {
  24041. console.log('zh:uimain hide ...');
  24042. super.hide();
  24043. xGame.common.stopGirlPop(this.ui.talkNode);
  24044. }
  24045. onGetUserInfo(force = false) {
  24046. if (Moyu.isWx) {
  24047. let info = Moyu.getSystemInfo();
  24048. if (info)
  24049. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24050. }
  24051. else {
  24052. Moyu.initUser(this, this.freshUser, force);
  24053. }
  24054. this.freshUser();
  24055. }
  24056. freshUser() {
  24057. let user = Moyu.getUserInfo();
  24058. if (!user.isAuth) {
  24059. user.headIcon = 'res/ty_touxiang.png';
  24060. }
  24061. else {
  24062. DataMgr.upRankData();
  24063. }
  24064. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24065. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24066. let keyStr = keyForLoginInfo;
  24067. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24068. const d = LocalStorageManager.getItem(keyStr);
  24069. let ua = d.username;
  24070. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24071. }
  24072. else {
  24073. }
  24074. this.c_btn_for_user();
  24075. }
  24076. interuptSecretary() {
  24077. Laya.timer.clearAll(this);
  24078. this.playSecretaryRandomSound();
  24079. }
  24080. playSecretaryRandomSound() {
  24081. if (this.isHide)
  24082. return;
  24083. let time = xGame.common.randomNum(45000, 60000);
  24084. Laya.timer.once(time, this, () => {
  24085. if (this.isHide)
  24086. return;
  24087. let index = xGame.common.randomNum(4, 7);
  24088. xGame.soundMgr.playSound("s_main0" + index);
  24089. let words = 1;
  24090. switch (index) {
  24091. case 4:
  24092. words = 5;
  24093. break;
  24094. case 5:
  24095. words = 3;
  24096. break;
  24097. case 6:
  24098. words = 6;
  24099. break;
  24100. case 7:
  24101. words = 7;
  24102. break;
  24103. default:
  24104. break;
  24105. }
  24106. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24107. this.playSecretaryRandomSound();
  24108. });
  24109. }
  24110. openSecretaryView() {
  24111. xGame.uiMgr.Show(UISecretary$1);
  24112. Moyu.sendDataEvent("secretary");
  24113. }
  24114. openShopView() {
  24115. xGame.uiMgr.Show(UIShop$1, 0);
  24116. }
  24117. openSignView() {
  24118. xGame.uiMgr.Show(UISign$1);
  24119. }
  24120. openDrawView() {
  24121. xGame.uiMgr.Show(UIDraw$1);
  24122. }
  24123. openRanking() {
  24124. console.log('zh:phb openRanking');
  24125. xGame.uiMgr.Show(UIRanking$1);
  24126. Moyu.sendDataEvent("rankingList");
  24127. }
  24128. }
  24129. UIMain$1.uiName = "UIMain";
  24130. function InitShader() {
  24131. }
  24132. function appInit() {
  24133. xGame.context.init(getLoadingResList(), initCallback);
  24134. }
  24135. function getLoadingResList() {
  24136. return [
  24137. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24138. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24139. ];
  24140. }
  24141. function getGameResList() {
  24142. return [
  24143. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24144. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24145. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24146. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24147. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24148. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24149. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24150. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24151. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24152. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24153. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24154. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24155. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24156. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24157. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24158. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24159. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24160. ];
  24161. }
  24162. function initCallback() {
  24163. window["DataMgr"] = DataMgr;
  24164. DataMgr.Init();
  24165. Moyu.init(getPlat(), this, () => {
  24166. DataMgr.isNewDay();
  24167. PlatMgr.initConfig();
  24168. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24169. }, true);
  24170. console.log('zh:开始sm init1 start');
  24171. xGame.soundMgr.init();
  24172. console.log('zh:开始sm init1 end');
  24173. xGame.uiMgr.init();
  24174. xGame.uiMgr.clearTempData();
  24175. xGame.uiMgr.bindFUI(fguiRes.loading);
  24176. xGame.uiMgr.Show(UILoading);
  24177. }
  24178. function loadSubRes(callback) {
  24179. var tab = ["asset", "res", "spine"];
  24180. let subDone = 0;
  24181. for (var i = 0; i < tab.length; i++) {
  24182. let sub = tab[i];
  24183. Moyu.loadSubRes(sub, (pro) => {
  24184. callback && callback(pro, false);
  24185. }).then(() => {
  24186. subDone++;
  24187. if (subDone >= tab.length)
  24188. callback && callback(1, true);
  24189. });
  24190. }
  24191. }
  24192. function enterGame() {
  24193. xGame.cfgMgr.init();
  24194. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24195. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24196. xGame.uiMgr.Hide(UILoading);
  24197. fgui.UIPackage.removePackage(fguiRes.loading);
  24198. xGame.uiMgr.bindFUI(fguiRes.game);
  24199. xGame.uiMgr.Show(UIMain$1);
  24200. if (DataMgr.getNewUser())
  24201. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24202. }
  24203. function getPlat() {
  24204. let cfg = new MoyuCfg();
  24205. cfg.plat = MoyuPlat.web;
  24206. cfg.myId = 180;
  24207. cfg.myKey = '8848a885774230a4';
  24208. cfg.version = 0;
  24209. if (window.hasOwnProperty("gamebox")) {
  24210. cfg.plat = MoyuPlat.f399;
  24211. cfg.version = 0;
  24212. }
  24213. else if (window.hasOwnProperty("ks")) {
  24214. cfg.plat = MoyuPlat.ks;
  24215. cfg.version = 0;
  24216. cfg.ads.ksVideoId = '2300002254_01';
  24217. cfg.ads.ksInsertId = '2300002254_02';
  24218. }
  24219. else if (Laya.Browser.onTTMiniGame) {
  24220. cfg.plat = MoyuPlat.tt;
  24221. cfg.version = 0;
  24222. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  24223. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  24224. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  24225. }
  24226. else if (Laya.Browser.onMiniGame) {
  24227. cfg.plat = MoyuPlat.wx;
  24228. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  24229. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  24230. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  24231. }
  24232. else if (Laya.Browser.onQQMiniGame) {
  24233. cfg.plat = MoyuPlat.qq;
  24234. }
  24235. else if (Laya.Browser.onQGMiniGame) {
  24236. cfg.plat = MoyuPlat.op;
  24237. cfg.ads.opVideoId = '455502';
  24238. cfg.ads.opBannerId = '455507';
  24239. }
  24240. else if (Laya.Browser.onVVMiniGame) {
  24241. cfg.plat = MoyuPlat.vv;
  24242. cfg.version = 0;
  24243. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  24244. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  24245. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  24246. }
  24247. else if (Laya.Browser.onHWMiniGame) {
  24248. cfg.plat = MoyuPlat.hw;
  24249. }
  24250. else if (window["mz"]) {
  24251. cfg.plat = MoyuPlat.mz;
  24252. }
  24253. else {
  24254. let cfg = window['conchConfig'];
  24255. if (cfg) {
  24256. var os = cfg.getOS();
  24257. if (os == "Conch-ios") {
  24258. cfg.plat = MoyuPlat.ios;
  24259. }
  24260. else if (os == "Conch-android") {
  24261. }
  24262. }
  24263. }
  24264. return cfg;
  24265. }
  24266. class Main {
  24267. constructor() {
  24268. if (window["Laya3D"])
  24269. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  24270. else {
  24271. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  24272. this.initMain();
  24273. }
  24274. }
  24275. initMain() {
  24276. Laya["Physics"] && Laya["Physics"].enable();
  24277. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  24278. Laya.stage.scaleMode = GameConfig.scaleMode;
  24279. Laya.stage.screenMode = GameConfig.screenMode;
  24280. Laya.stage.alignV = GameConfig.alignV;
  24281. Laya.stage.alignH = GameConfig.alignH;
  24282. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  24283. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  24284. Laya.enableDebugPanel();
  24285. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  24286. Laya["PhysicsDebugDraw"].enable();
  24287. if (GameConfig.stat)
  24288. Laya.Stat.show();
  24289. Laya.alertGlobalError(true);
  24290. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  24291. }
  24292. onVersionLoaded() {
  24293. appInit();
  24294. }
  24295. }
  24296. new Main();
  24297. }());
  24298. //# sourceMappingURL=bundle.js.map