bundle.js 953 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878
  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 = false;
  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. console.log('zh: http url = ' + url);
  921. function errorHandler(error) {
  922. if (call) {
  923. call("{'msg':'Network exception','code':500}");
  924. }
  925. else {
  926. alert("Tip:Please check your network connection.");
  927. }
  928. }
  929. function completeHandler(data) {
  930. if (data && data.length > 0) {
  931. let jsonData = JSON.parse(data);
  932. if (call)
  933. call(jsonData);
  934. }
  935. }
  936. }
  937. sendGet(url, call) {
  938. let httpObj = new Laya.HttpRequest();
  939. httpObj.http.timeout = 5000;
  940. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  941. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  942. httpObj.send(url, '', 'get');
  943. function errorHandler(error) {
  944. console.log("errorHandler:" + error);
  945. }
  946. function completeHandler(data) {
  947. if (data && data.length > 0) {
  948. if (call)
  949. call(data);
  950. }
  951. }
  952. }
  953. }
  954. HttpMgr._instance = null;
  955. class LightShader extends Laya.Sprite {
  956. constructor() {
  957. super();
  958. this._time = 0;
  959. this._sin = 0;
  960. this.initShader();
  961. }
  962. initShader() {
  963. var vs = `
  964. #define FSHIGHPRECISION
  965. attribute vec4 posuv;
  966. uniform vec2 size;
  967. varying vec4 v_texcoord;
  968. void main() {
  969. vec4 pos = vec4(posuv.xy,0.,1.);
  970. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  971. gl_Position=pos1;
  972. v_texcoord.xy = posuv.xy;
  973. }
  974. `;
  975. var ps = `
  976. #define FSHIGHPRECISION
  977. precision highp float;
  978. varying vec4 v_texcoord;
  979. uniform vec2 size;
  980. uniform sampler2D texture;
  981. uniform float u_Time;
  982. void main() {
  983. vec4 color= texture2D(texture, v_texcoord.xy);
  984. float width = 0.2;
  985. float start = u_Time;
  986. float offset = 1.0;
  987. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  988. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  989. {
  990. color.r=1.1;
  991. color.g=1.1;
  992. color.b=1.1;
  993. gl_FragColor = color;
  994. } else {
  995. gl_FragColor = color;
  996. }
  997. }
  998. `;
  999. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  1000. this.customRenderEnable = true;
  1001. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1002. }
  1003. customRender(context, x, y) {
  1004. this.onUpdate();
  1005. if (!this.texture)
  1006. return;
  1007. let xx = x - this.pivotX;
  1008. let yy = y - this.pivotY;
  1009. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1010. }
  1011. onUpdate() {
  1012. this._time += 2 * Laya.timer.delta * 0.001;
  1013. this._sin = Math.sin(this._time);
  1014. if (this._sin > 0.99) {
  1015. this._sin = 0;
  1016. this._time = 0;
  1017. }
  1018. this.shaderValue['u_Time'] = this._sin;
  1019. }
  1020. }
  1021. LightShader.DissolveSurfaceSaveName = 9997;
  1022. class UIBase extends fairygui.Window {
  1023. constructor() {
  1024. super();
  1025. this.isEject = true;
  1026. this.isHide = true;
  1027. this.showbanner = true;
  1028. this.className = "";
  1029. this.isMuti = false;
  1030. this.showbanner = false;
  1031. this.onConstructor();
  1032. }
  1033. checkActive(show) {
  1034. }
  1035. getUIName() {
  1036. return UIBase.uiName;
  1037. }
  1038. onConstructor() {
  1039. }
  1040. onInit() {
  1041. if (!!this.contentPane) {
  1042. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1043. }
  1044. this.setPivot(0.5, 0.5, false);
  1045. }
  1046. doShowAnimation() {
  1047. if (!this.isEject)
  1048. return;
  1049. super.doShowAnimation();
  1050. Laya.Tween.clearTween(this);
  1051. this.scaleX = this.scaleY = 0.8;
  1052. let tweenFunc1 = (func) => {
  1053. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1054. };
  1055. let tweenFunc2 = (func) => {
  1056. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1057. };
  1058. tweenFunc1(tweenFunc2);
  1059. }
  1060. show(...args) {
  1061. super.show();
  1062. this._openParam = args;
  1063. this.isHide = false;
  1064. xGame.uiMgr.checkUIState();
  1065. }
  1066. moveBannerButton() {
  1067. }
  1068. showBannerButton() {
  1069. this.bannerButton.visible = true;
  1070. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1071. this.bannerButton.touchable = true;
  1072. }));
  1073. }
  1074. hide() {
  1075. super.hide();
  1076. this.isHide = true;
  1077. xGame.uiMgr.checkUIState();
  1078. }
  1079. Dispose() {
  1080. super.dispose();
  1081. }
  1082. myUpdate(delay) {
  1083. }
  1084. refresh() { }
  1085. addUIClick(obj, func, arr = null) {
  1086. obj.onClick(this, func, arr);
  1087. obj.onClick(this, this.playBtnSound);
  1088. }
  1089. offUIClick(obj, func) {
  1090. obj.offClick(this, func);
  1091. }
  1092. playBtnSound() {
  1093. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1094. }
  1095. }
  1096. UIBase.lastShowBanner = 0;
  1097. UIBase.showBannerNum = 0;
  1098. UIBase.uiName = "";
  1099. class ui_UIDraw extends fgui.GComponent {
  1100. static createInstance() {
  1101. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1102. }
  1103. onConstruct() {
  1104. this.n1 = (this.getChild("n1"));
  1105. this.extraNode = (this.getChild("extraNode"));
  1106. this.myNode = (this.getChild("myNode"));
  1107. this.closeNode = (this.getChild("closeNode"));
  1108. this.moneyNode = (this.getChild("moneyNode"));
  1109. this.n38 = (this.getChild("n38"));
  1110. this.secretary = (this.getChild("secretary"));
  1111. this.drawBtn = (this.getChild("drawBtn"));
  1112. this.talkNode = (this.getChild("talkNode"));
  1113. this.t0 = this.getTransition("t0");
  1114. }
  1115. }
  1116. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1117. class ui_UIBox extends fgui.GComponent {
  1118. static createInstance() {
  1119. return (fgui.UIPackage.createObject("game", "UIBox"));
  1120. }
  1121. onConstruct() {
  1122. this.n0 = (this.getChild("n0"));
  1123. this.n12 = (this.getChild("n12"));
  1124. this.n1 = (this.getChild("n1"));
  1125. this.n2 = (this.getChild("n2"));
  1126. this.bar = (this.getChild("bar"));
  1127. this.closeBtn = (this.getChild("closeBtn"));
  1128. this.openBtn = (this.getChild("openBtn"));
  1129. this.t0 = this.getTransition("t0");
  1130. this.t1 = this.getTransition("t1");
  1131. }
  1132. }
  1133. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1134. class GlobalManager {
  1135. constructor() {
  1136. }
  1137. registerMethod(name, method) {
  1138. console.log('zh: 注册全局方法', name);
  1139. this[name] = method;
  1140. }
  1141. callMethod(name, ...args) {
  1142. console.log('zh: 调用全局方法', name);
  1143. if (this[name]) {
  1144. return this[name](...args);
  1145. }
  1146. else {
  1147. console.error(`zh: 全局方法 Method ${name} not found`);
  1148. }
  1149. }
  1150. }
  1151. GlobalManager.instance = new GlobalManager();
  1152. class JSBridgeUtils {
  1153. constructor() { }
  1154. static get instance() {
  1155. if (!this._instance) {
  1156. this._instance = new JSBridgeUtils();
  1157. }
  1158. return this._instance;
  1159. }
  1160. initBridge() {
  1161. if (!Laya.Browser.onAndroid) {
  1162. console.log('zh:非android dev');
  1163. return;
  1164. }
  1165. let cfg = window['conchConfig'];
  1166. if (cfg) {
  1167. var os = cfg.getOS();
  1168. if (os == "Conch-android") {
  1169. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1170. if (this.bridge) {
  1171. return true;
  1172. }
  1173. else {
  1174. return false;
  1175. }
  1176. }
  1177. else {
  1178. return false;
  1179. }
  1180. }
  1181. else {
  1182. return false;
  1183. }
  1184. }
  1185. testAd1() {
  1186. if (!Laya.Browser.onAndroid) {
  1187. console.log('zh:非android dev');
  1188. return;
  1189. }
  1190. if (!this.initBridge()) {
  1191. return;
  1192. }
  1193. let rs = this.bridge.call("testString", "hello");
  1194. console.log('zh:testString rs=' + rs);
  1195. }
  1196. testAdCallBack() {
  1197. if (!this.initBridge()) {
  1198. return;
  1199. }
  1200. console.log("zh:testAdCallBack start");
  1201. const defaultObj = { code: 200, msg: "req update Ui" };
  1202. const reqObj = { code: 300, msg: "hello java ui" };
  1203. this.bridge.callWithBack((rsStr) => {
  1204. const rsObj = JSON.parse(rsStr);
  1205. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1206. }, "testAsyncCallback", JSON.stringify(reqObj));
  1207. }
  1208. showInternAd(mark) {
  1209. console.log('zh:showInternAd start');
  1210. if (!Laya.Browser.onAndroid) {
  1211. console.log('zh:showInternAd 非android dev');
  1212. return false;
  1213. }
  1214. if (!this.initBridge()) {
  1215. return false;
  1216. }
  1217. let rs = this.bridge.call("showInternAd", mark);
  1218. try {
  1219. const result = JSON.parse(rs);
  1220. if (result.code === 200) {
  1221. console.log("zh:showInternAd OK");
  1222. return true;
  1223. }
  1224. else {
  1225. console.warn("zh:showInternAd FAILL:", result.msg);
  1226. return false;
  1227. }
  1228. }
  1229. catch (e) {
  1230. console.error("zh:解析桥接返回值失败:", e);
  1231. return false;
  1232. }
  1233. }
  1234. exitAndCloseGame() {
  1235. if (!Laya.Browser.onAndroid) {
  1236. return;
  1237. }
  1238. if (!this.initBridge()) {
  1239. return;
  1240. }
  1241. console.log('zh:开始关闭游戏-');
  1242. this.bridge.call("exitAndCloseGame");
  1243. }
  1244. showRewardAd(mark) {
  1245. if (!Laya.Browser.onAndroid) {
  1246. return false;
  1247. }
  1248. if (!this.initBridge()) {
  1249. return false;
  1250. }
  1251. let rs = this.bridge.call("showRewardAd", mark);
  1252. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1253. try {
  1254. const result = JSON.parse(rs);
  1255. if (result.code === 200) {
  1256. console.log("zh:广告显示成功");
  1257. return true;
  1258. }
  1259. else {
  1260. console.warn("zh:广告显示失败:", result.msg);
  1261. return false;
  1262. }
  1263. }
  1264. catch (e) {
  1265. console.error("zh:解析桥接返回值失败:", e);
  1266. return false;
  1267. }
  1268. }
  1269. logEventForAdNoParams(eventName) {
  1270. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1271. if (!Laya.Browser.onAndroid) {
  1272. return;
  1273. }
  1274. if (!this.initBridge()) {
  1275. return;
  1276. }
  1277. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1278. this.bridge.call("logEventForAdNoParams", eventName);
  1279. }
  1280. logEventForAdHaveParams(eventName, jsonStr) {
  1281. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1282. if (!Laya.Browser.onAndroid) {
  1283. return;
  1284. }
  1285. if (!this.initBridge()) {
  1286. return;
  1287. }
  1288. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1289. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1290. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1291. }
  1292. logEventForFirebase(eventName, jsonStr) {
  1293. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1294. if (!Laya.Browser.onAndroid) {
  1295. return;
  1296. }
  1297. if (!this.initBridge()) {
  1298. return;
  1299. }
  1300. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1301. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1302. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1303. }
  1304. testNetTip() {
  1305. if (Laya.Browser.onAndroid) {
  1306. let boo = this.getNetworkAvailable();
  1307. this.showToast2("Network error, reward unavailable");
  1308. return;
  1309. }
  1310. }
  1311. getNetworkAvailable() {
  1312. if (!Laya.Browser.onAndroid) {
  1313. return;
  1314. }
  1315. if (!this.initBridge()) {
  1316. return;
  1317. }
  1318. let boo = this.bridge.call("getNetworkAvailable");
  1319. console.log("zh:getNetworkAvailable boo=" + boo);
  1320. return boo;
  1321. }
  1322. showToast2(msg) {
  1323. if (!Laya.Browser.onAndroid) {
  1324. return;
  1325. }
  1326. if (!this.initBridge()) {
  1327. return;
  1328. }
  1329. this.bridge.call("showToast2", msg);
  1330. }
  1331. loginOutForApp() {
  1332. if (!Laya.Browser.onAndroid) {
  1333. return;
  1334. }
  1335. if (!this.initBridge()) {
  1336. return;
  1337. }
  1338. this.bridge.call("loginOutForApp");
  1339. }
  1340. startGgPay(token, ggSpid) {
  1341. if (!Laya.Browser.onAndroid) {
  1342. return;
  1343. }
  1344. if (!this.initBridge()) {
  1345. return;
  1346. }
  1347. let jsonObj = {
  1348. token: token,
  1349. ggSpid: ggSpid,
  1350. spsl: 1
  1351. };
  1352. let reqData = JSON.stringify(jsonObj);
  1353. console.log("zh:startGgPay ts reqData=" + reqData);
  1354. this.bridge.call("startGgPay", reqData);
  1355. }
  1356. testPay1ForMoNiPayOver(token, ggSpid) {
  1357. if (!Laya.Browser.onAndroid) {
  1358. return;
  1359. }
  1360. if (!this.initBridge()) {
  1361. return;
  1362. }
  1363. let jsonObj = {
  1364. token: token,
  1365. ggSpid: ggSpid,
  1366. spsl: 1
  1367. };
  1368. let reqData = JSON.stringify(jsonObj);
  1369. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1370. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1371. }
  1372. nativeCallJs(msg) {
  1373. console.log("zh:nativeCallJs received data: 1111", msg);
  1374. if (msg === 'Ad1') {
  1375. GlobalManager.instance.callMethod('Ad1');
  1376. console.log("zh: Ad1 奖励发送成功");
  1377. }
  1378. else if (msg === 'Ad2') {
  1379. GlobalManager.instance.callMethod('Ad2');
  1380. console.log("zh: Ad2 奖励发送成功");
  1381. }
  1382. else if (msg === 'Ad3') {
  1383. GlobalManager.instance.callMethod('Ad3');
  1384. console.log("zh: Ad3 奖励发送成功");
  1385. }
  1386. else if (msg === 'Ad4') {
  1387. GlobalManager.instance.callMethod('Ad4');
  1388. console.log("zh: Ad4 奖励发送成功");
  1389. }
  1390. else if (msg === 'Ad5') {
  1391. console.log("zh: Ad5 奖励发送成功");
  1392. GlobalManager.instance.callMethod('Ad5');
  1393. }
  1394. }
  1395. }
  1396. class UIBox extends UIBase {
  1397. constructor() {
  1398. super();
  1399. this.boxNum = 0;
  1400. this.boxMax = 10;
  1401. this.inAd = false;
  1402. this.isClose = false;
  1403. }
  1404. onConstructor() {
  1405. this.ui = ui_UIBox.createInstance();
  1406. this.contentPane = this.ui;
  1407. this.isEject = false;
  1408. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1409. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1410. Laya.timer.loop(1000, this, this.update);
  1411. }
  1412. update() {
  1413. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1414. this.boxNum -= 1;
  1415. this.upBar();
  1416. }
  1417. }
  1418. upBar() {
  1419. if (this.boxNum > this.boxMax)
  1420. this.boxNum = this.boxMax;
  1421. this.ui.bar.value = this.boxNum * 10;
  1422. }
  1423. show() {
  1424. super.show();
  1425. this.isClose = false;
  1426. this.boxNum = 0;
  1427. this.inAd = false;
  1428. this.upBar();
  1429. this.ui.t0.play();
  1430. this.ui.closeBtn.visible = false;
  1431. Laya.timer.once(3000, this, () => {
  1432. this.ui.closeBtn.visible = true;
  1433. this.ui.bar.alpha = 1;
  1434. });
  1435. Laya.timer.once(500, this, () => {
  1436. this.ui.t1.play();
  1437. });
  1438. }
  1439. hide() {
  1440. Laya.timer.clearAll(this);
  1441. Moyu.showBannerAd(false);
  1442. super.hide();
  1443. }
  1444. onOpenBox() {
  1445. this.boxNum++;
  1446. if (this.boxNum < this.boxMax) {
  1447. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1448. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1449. }
  1450. }
  1451. else if (this.boxNum == this.boxMax) {
  1452. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1453. this.ui.openBtn.c1.selectedIndex = 13;
  1454. this.inAd = true;
  1455. }
  1456. else
  1457. this.getAward();
  1458. }
  1459. else if (this.inAd) {
  1460. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1461. if (Laya.Browser.onAndroid) {
  1462. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1463. if (!boo) {
  1464. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1465. return;
  1466. }
  1467. }
  1468. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1469. }
  1470. else {
  1471. console.log('zh:AD 失败,直接发放奖励');
  1472. this.qjff_AD_for_UIBOX_onOpenBox();
  1473. }
  1474. }
  1475. this.upBar();
  1476. }
  1477. qjff_AD_for_UIBOX_onOpenBox() {
  1478. this.getAward();
  1479. }
  1480. onCloseBox() {
  1481. if (this.isClose)
  1482. this.hide();
  1483. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1484. this.isClose = true;
  1485. PlatMgr.showBanner(true, 0, 3000);
  1486. }
  1487. else
  1488. this.hide();
  1489. }
  1490. getAward() {
  1491. let str = "";
  1492. if (Math.random() < 0.5) {
  1493. let max = Moyu.isLegal ? 500 : 2500;
  1494. let num = xGame.tools.random(max, 500 + max);
  1495. DataMgr.setCoin(num);
  1496. str = "金币x" + num;
  1497. }
  1498. else {
  1499. let max = Moyu.isLegal ? 10 : 30;
  1500. let num = xGame.tools.random(max, 30 + max);
  1501. DataMgr.setDiamond(num);
  1502. str = "钻石x" + num;
  1503. }
  1504. xGame.showTip("恭喜获得-" + str);
  1505. this.hide();
  1506. }
  1507. }
  1508. UIBox.uiName = "UIBox";
  1509. class ui_UITry extends fgui.GComponent {
  1510. static createInstance() {
  1511. return (fgui.UIPackage.createObject("game", "UITry"));
  1512. }
  1513. onConstruct() {
  1514. this.n11 = (this.getChild("n11"));
  1515. this.myNode = (this.getChild("myNode"));
  1516. this.t0 = this.getTransition("t0");
  1517. }
  1518. }
  1519. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1520. class UITry extends UIBase {
  1521. constructor() {
  1522. super();
  1523. this.closeTime = 0;
  1524. this.closeNum = 0;
  1525. this.skillUrl = xGame.common.skillIconList;
  1526. }
  1527. onConstructor() {
  1528. this.ui = ui_UITry.createInstance();
  1529. this.contentPane = this.ui;
  1530. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1531. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1532. }
  1533. show() {
  1534. super.show();
  1535. this.closeNum = 0;
  1536. this.closeTime = 15;
  1537. this.ui.t0.play();
  1538. PlatMgr.showRateBanner();
  1539. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1540. Laya.timer.loop(1000, this, this.updateTime);
  1541. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1542. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1543. xGame.common.gameMgr.gamePause = true;
  1544. }
  1545. updateTime() {
  1546. if (this.closeTime > 1) {
  1547. this.closeTime--;
  1548. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1549. }
  1550. else
  1551. this.hide();
  1552. }
  1553. hide() {
  1554. Laya.timer.clearAll(this);
  1555. Moyu.showBannerAd(false);
  1556. super.hide();
  1557. xGame.common.gameMgr.gamePause = false;
  1558. }
  1559. onTry() {
  1560. console.log('zh:qjff_AD_for_uitry');
  1561. if (Laya.Browser.onAndroid) {
  1562. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1563. if (!boo) {
  1564. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1565. return;
  1566. }
  1567. }
  1568. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1569. }
  1570. else {
  1571. console.log('zh:AD 失败,直接发放奖励');
  1572. this.qjff_AD_for_uitry();
  1573. }
  1574. }
  1575. qjff_AD_for_uitry() {
  1576. let select = xGame.common.curPlayerSkillType;
  1577. DataMgr.gameData.trySkill = select;
  1578. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1579. DataMgr.saveGameData();
  1580. DataMgr.setBigSkill(select, 1);
  1581. xGame.showTip("Trial Successful");
  1582. this.hide();
  1583. }
  1584. onCancel() {
  1585. if (this.closeNum > 0) {
  1586. this.closeNum--;
  1587. if (this.closeNum < 2)
  1588. this.hide();
  1589. return;
  1590. }
  1591. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1592. this.onTry();
  1593. }
  1594. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1595. this.closeNum = 3;
  1596. }
  1597. else
  1598. this.hide();
  1599. }
  1600. }
  1601. UITry.uiName = "UITry";
  1602. class PlatMgr {
  1603. static initConfig() {
  1604. this.lastVt = 0;
  1605. if (!Moyu.platConfig)
  1606. return;
  1607. for (let k in Moyu.platConfig) {
  1608. let pd = this[k];
  1609. let pc = Moyu.platConfig[k];
  1610. if (pd != undefined && pc != undefined)
  1611. this[k] = pc;
  1612. }
  1613. Moyu.setBannerPos(0.5, 1);
  1614. }
  1615. static rand100(num) {
  1616. return xGame.tools.random(0, 100) < num;
  1617. }
  1618. static isMisVideo() {
  1619. let dt = Laya.timer.currTimer - this.lastVt;
  1620. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1621. this.lastVt = Laya.timer.currTimer;
  1622. return true;
  1623. }
  1624. else {
  1625. if (this.rand100(this.fullVideoRate)) {
  1626. console.log('zh:插屏 ad start');
  1627. JSBridgeUtils.instance.showInternAd('platMgr');
  1628. }
  1629. return false;
  1630. }
  1631. }
  1632. static showVideo(call, type) {
  1633. Moyu.showVideoAd(() => {
  1634. this.lastVt = Laya.timer.currTimer;
  1635. call && call();
  1636. }, type);
  1637. }
  1638. static showInsert(delay = false) {
  1639. if (this.getRand() < this.insertRate) {
  1640. let dt = delay ? this.insertDelay : 0;
  1641. console.log('zh:插屏 ad start');
  1642. JSBridgeUtils.instance.showInternAd('gameInsert');
  1643. }
  1644. }
  1645. static gameInsert() {
  1646. let t = this.getRand();
  1647. let r = this.gameInsertRate;
  1648. if (t < r) {
  1649. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1650. }
  1651. }
  1652. static showRateBanner() {
  1653. if (this.getRand() < this.bannerRate)
  1654. this.showBanner(true, this.bannerDelay, 3000);
  1655. }
  1656. static showBanner(show, delay = 0, hide = 0) {
  1657. if (2 > 1) {
  1658. console.log('zh:显示showBanner广告 直接返回');
  1659. return;
  1660. }
  1661. if (!show)
  1662. Moyu.showBannerAd(false);
  1663. else {
  1664. Laya.timer.clear(this, this.bannerShow);
  1665. if (delay > 0)
  1666. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1667. else
  1668. this.bannerShow(true);
  1669. if (hide > 0)
  1670. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1671. }
  1672. }
  1673. static bannerShow(show) {
  1674. if (2 > 1) {
  1675. console.log('zh:显示showBanner广告 直接返回');
  1676. return;
  1677. }
  1678. Moyu.showBannerAd(show);
  1679. console.log("showBanner" + show);
  1680. }
  1681. static getRand() {
  1682. return xGame.tools.random(0, 100);
  1683. }
  1684. static openBox() {
  1685. if (this.getRand() < this.boxRate)
  1686. xGame.uiMgr.Show(UIBox);
  1687. }
  1688. static openTry() {
  1689. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1690. return;
  1691. if (this.getRand() < this.tryRate)
  1692. xGame.uiMgr.Show(UITry);
  1693. else if (DataMgr.gameData.gameCount == 1)
  1694. xGame.uiMgr.Show(UITry);
  1695. }
  1696. }
  1697. PlatMgr.forceShare = 0;
  1698. PlatMgr.signAdRate = 0;
  1699. PlatMgr.forceVideoRate = 0;
  1700. PlatMgr.forceVideoGap = 0;
  1701. PlatMgr.fullVideoRate = 0;
  1702. PlatMgr.gameInsertRate = 0;
  1703. PlatMgr.insertGap = 0;
  1704. PlatMgr.insertDelay = 0;
  1705. PlatMgr.insertRate = 0;
  1706. PlatMgr.boxRate = 0;
  1707. PlatMgr.boxVideoRate = 0;
  1708. PlatMgr.boxInsertRate = 0;
  1709. PlatMgr.boxBannerRate = 0;
  1710. PlatMgr.tryRate = 0;
  1711. PlatMgr.tryClose3Rate = 0;
  1712. PlatMgr.tryVideoRate = 0;
  1713. PlatMgr.bannerRate = 0;
  1714. PlatMgr.lastVt = 0;
  1715. class ui_UIAddProp extends fgui.GComponent {
  1716. static createInstance() {
  1717. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1718. }
  1719. onConstruct() {
  1720. this.n11 = (this.getChild("n11"));
  1721. this.myNode = (this.getChild("myNode"));
  1722. this.closeBtn = (this.getChild("closeBtn"));
  1723. this.t0 = this.getTransition("t0");
  1724. }
  1725. }
  1726. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1727. class SpineMgr {
  1728. constructor(name, loadCb = null) {
  1729. this.loaded = false;
  1730. this.spineName = '';
  1731. this.loadedCallback = loadCb;
  1732. this.templet = new Laya.Templet();
  1733. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1734. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1735. if (name === 'mishu') {
  1736. this.templet.loadAni('spine/nvmishu.sk');
  1737. }
  1738. else {
  1739. this.templet.loadAni(`spine/${name}.sk`);
  1740. }
  1741. this.templet.lock = true;
  1742. this.spineName = name;
  1743. }
  1744. onError() {
  1745. console.log("zh:spine加载出错");
  1746. }
  1747. parseComplete() {
  1748. this.loaded = true;
  1749. this.loadedCallback && this.loadedCallback();
  1750. }
  1751. dispose() {
  1752. if (this.templet && !this.templet.destroyed) {
  1753. this.templet.destroy();
  1754. }
  1755. this.templet = null;
  1756. }
  1757. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1758. if (!this.loaded) {
  1759. return;
  1760. }
  1761. let spine;
  1762. if (mySpine) {
  1763. spine = mySpine;
  1764. }
  1765. else {
  1766. spine = this.createSpine(data, parent);
  1767. }
  1768. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1769. if (!isLoop) {
  1770. spine.on(Laya.Event.STOPPED, this, () => {
  1771. spine.offAll(Laya.Event.STOPPED);
  1772. callback && callback(spine);
  1773. });
  1774. }
  1775. return spine;
  1776. }
  1777. createSpine(data, parent, type = 1) {
  1778. let spine;
  1779. spine = this.templet.buildArmature(type);
  1780. spine.showSkinByIndex(0);
  1781. parent.addChild(spine);
  1782. spine.pos(data.x, data.y);
  1783. spine.scale(data.scaleX, data.scaleY, true);
  1784. return spine;
  1785. }
  1786. }
  1787. var AIState;
  1788. (function (AIState) {
  1789. AIState[AIState["none"] = 0] = "none";
  1790. AIState[AIState["idle"] = 1] = "idle";
  1791. AIState[AIState["reset"] = 2] = "reset";
  1792. AIState[AIState["move"] = 3] = "move";
  1793. AIState[AIState["wait"] = 4] = "wait";
  1794. AIState[AIState["select"] = 5] = "select";
  1795. AIState[AIState["turn"] = 6] = "turn";
  1796. AIState[AIState["shoot"] = 7] = "shoot";
  1797. AIState[AIState["leave"] = 8] = "leave";
  1798. })(AIState || (AIState = {}));
  1799. class AIPlayer {
  1800. constructor() {
  1801. this.dtime = 30;
  1802. this.awayTime = 0;
  1803. this.awayNum = 0;
  1804. this.hideTime = 0;
  1805. this.rootMoveTime = 0;
  1806. this.isGuide = false;
  1807. this.state = AIState.none;
  1808. this.waitTime = 0;
  1809. this.forceNum = 0;
  1810. this.forceMax = 0;
  1811. this.ballSize = 33;
  1812. this.selectNum = 0;
  1813. this.destRot = 0;
  1814. this.aiLv = 10;
  1815. this.kickBall = [];
  1816. this.lineBall = [];
  1817. this.scoreBall = [];
  1818. this.holeBall = [];
  1819. this.turnNum = 0;
  1820. this.setNum = 0;
  1821. this.setMax = 0;
  1822. this.setRate = 0;
  1823. this.rectL = 0;
  1824. this.rectR = 0;
  1825. this.rectT = 0;
  1826. this.rectB = 0;
  1827. this.rootPos = { x: 0, y: 0 };
  1828. this.bestForce = 0;
  1829. this.bestAngle = 180;
  1830. this.bestPos = { x: 0, y: 0 };
  1831. this.bestKick = { x: 0, y: 0 };
  1832. this.posList = [];
  1833. this.posIdx = 0;
  1834. this.chatTime = 3000;
  1835. this.tempDir1 = new Laya.Vector2();
  1836. this.tempDir2 = new Laya.Vector2();
  1837. this.tempDir3 = new Laya.Vector2();
  1838. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1839. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1840. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1841. this.gameSrc = xGame.common.gameUI;
  1842. this.hideTime = Laya.timer.currTimer;
  1843. Moyu.setOnTipCall((id) => {
  1844. if (id == 20012)
  1845. this.hideTime = Laya.timer.currTimer;
  1846. else
  1847. (id == 20011);
  1848. {
  1849. let dt = Laya.timer.currTimer - this.hideTime;
  1850. console.log("onshow" + dt);
  1851. if (dt > 30000 && this.state > AIState.none)
  1852. xGame.common.gameMgr.aiGameEnd(false);
  1853. }
  1854. }, this);
  1855. }
  1856. init() {
  1857. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1858. this.awayTime = xGame.tools.random(5000, 10000);
  1859. this.awayNum = 0;
  1860. this.hideTime = Laya.timer.currTimer;
  1861. let rect = xGame.common.d2World.borderRect;
  1862. this.rectL = Math.ceil(rect.x) + 17;
  1863. this.rectT = Math.ceil(rect.y) + 17;
  1864. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1865. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1866. this.wBall = xGame.common.d2World.rootBall;
  1867. this.ballSize = this.wBall.gameObj.width - 1;
  1868. if (this.posList.length < 1) {
  1869. let dp = 40;
  1870. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1871. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1872. let dx = i < this.rectR ? i : this.rectR;
  1873. let dy = j < this.rectB ? j : this.rectB;
  1874. let order = xGame.tools.random(0, 1000);
  1875. this.posList.push({ x: dx, y: dy, order: order });
  1876. }
  1877. }
  1878. this.posList.sort(function (a, b) {
  1879. return a.order - b.order;
  1880. });
  1881. this.setMax = this.posList.length;
  1882. }
  1883. this.state = AIState.idle;
  1884. }
  1885. setAiLevel(num) {
  1886. this.aiLv = num;
  1887. }
  1888. initBall() {
  1889. this.rootPos.x = this.wBall.gameObj.x;
  1890. this.rootPos.y = this.wBall.gameObj.y;
  1891. this.initHoleBall();
  1892. }
  1893. initHoleBall() {
  1894. this.kickBall = [];
  1895. this.lineBall = [];
  1896. this.scoreBall = [];
  1897. this.holeBall = [];
  1898. this.selectNum = 0;
  1899. this.forceNum = 0;
  1900. this.forceMax = 0;
  1901. this.turnNum = 0;
  1902. let list = xGame.common.d2World.ballArr;
  1903. if (list.length < 20 && !this.isGuide) {
  1904. let holes = xGame.common.gameMgr.holePosList;
  1905. for (let i = 0; i < list.length; i++) {
  1906. let obj = list[i];
  1907. if (!obj)
  1908. continue;
  1909. obj.kickPos.x = 0;
  1910. obj.kickPos.y = 0;
  1911. obj.poleAngle = 0;
  1912. obj.hard = 0;
  1913. obj.borderDis = 0;
  1914. obj.kickAngle = 180;
  1915. if (obj.number == 0)
  1916. continue;
  1917. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1918. continue;
  1919. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1920. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1921. continue;
  1922. }
  1923. let b = obj.gameObj;
  1924. let wbp = this.rootPos;
  1925. let bx = wbp.x - b.x;
  1926. let by = wbp.y - b.y;
  1927. obj.borderDis = xGame.tools.random(0, 100);
  1928. this.kickBall.push(obj);
  1929. if (!this.isLine(wbp, obj))
  1930. continue;
  1931. obj.kickAngle = xGame.tools.random(90, 180);
  1932. obj.kickPos.x = b.x;
  1933. obj.kickPos.y = b.y;
  1934. this.lineBall.push(obj);
  1935. let minDis = 999999;
  1936. let hole = false;
  1937. for (let j = 0; j < holes.length; j++) {
  1938. let hp = holes[j];
  1939. if (bx >= 0 && hp.x > b.x + 100)
  1940. continue;
  1941. if (bx <= 0 && hp.x < b.x - 100)
  1942. continue;
  1943. if (by < -10 && hp.y < wbp.y)
  1944. continue;
  1945. if (by > 10 && hp.y > wbp.y)
  1946. continue;
  1947. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1948. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1949. if (dis < minDis) {
  1950. let dx = b.x - this.tempDir1.x * this.ballSize;
  1951. let dy = b.y - this.tempDir1.y * this.ballSize;
  1952. this.tempDir3.x = this.tempDir1.x;
  1953. this.tempDir3.y = this.tempDir1.y;
  1954. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1955. obj.kickPos.x = dx;
  1956. obj.kickPos.y = dy;
  1957. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1958. if (num > 1)
  1959. num = 1;
  1960. obj.kickAngle = Math.acos(num) * 57.3;
  1961. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1962. dis = dis * 2;
  1963. if (Math.abs(hp.x - 600) < 100)
  1964. dis += 50;
  1965. obj.hard = dis + obj.kickAngle * 3;
  1966. hole = true;
  1967. }
  1968. }
  1969. }
  1970. }
  1971. if (hole) {
  1972. this.scoreBall.push(obj);
  1973. this.holeBall.push(obj);
  1974. }
  1975. }
  1976. this.scoreBall.sort(function (a, b) {
  1977. return a.hard - b.hard;
  1978. });
  1979. this.holeBall.sort(function (a, b) {
  1980. return a.kickAngle - b.kickAngle;
  1981. });
  1982. this.kickBall.sort(function (a, b) {
  1983. return a.borderDis - b.borderDis;
  1984. });
  1985. }
  1986. else {
  1987. let max = list.length - 1;
  1988. let i = xGame.tools.random(0, max);
  1989. for (i; i <= max; i++) {
  1990. let idx = i >= max ? i -= max : i;
  1991. let obj = list[idx];
  1992. if (obj && obj.number != 0) {
  1993. obj.kickAngle = xGame.tools.random(90, 180);
  1994. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1995. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1996. this.lineBall.push(obj);
  1997. break;
  1998. }
  1999. }
  2000. }
  2001. }
  2002. selectBall() {
  2003. let ball = null;
  2004. this.destRot = 0;
  2005. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2006. let ai = 110 - this.aiLv * 10;
  2007. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2008. let score = false;
  2009. if (this.scoreBall.length < 1) {
  2010. if (this.lineBall.length < 1) {
  2011. for (let i = 0; i < this.kickBall.length; i++) {
  2012. let list = [];
  2013. let bo = this.kickBall[i];
  2014. let bobj = bo.gameObj;
  2015. let rect = xGame.common.d2World.borderRect;
  2016. let mobj = this.wBall.gameObj;
  2017. let minb = bobj.y - rect.y - 20;
  2018. let minw = mobj.y - rect.y - 50;
  2019. if (minb > 0 && minw > 0) {
  2020. let dlenx = 0;
  2021. let dleny = mobj.y - rect.y;
  2022. let spx = mobj.x;
  2023. let spy = rect.y - dleny;
  2024. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2025. }
  2026. minb = rect.y + rect.height - bobj.y - 20;
  2027. minw = rect.y + rect.height - mobj.y - 50;
  2028. if (minb > 0 && minw > 0) {
  2029. let dlenx = 0;
  2030. let dleny = rect.y + rect.height - mobj.y;
  2031. let spx = mobj.x;
  2032. let spy = rect.y + rect.height + dleny;
  2033. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2034. }
  2035. minb = bobj.x - rect.x - 20;
  2036. minw = mobj.x - rect.x - 50;
  2037. if (minb > 0 && minw > 0) {
  2038. let dlenx = mobj.x - rect.x;
  2039. let dleny = 0;
  2040. let spx = rect.x - dlenx;
  2041. let spy = mobj.y;
  2042. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2043. }
  2044. minb = rect.x + rect.width - bobj.x - 20;
  2045. minw = rect.x + rect.width - mobj.x - 50;
  2046. if (minb > 0 && minw > 0) {
  2047. let dlenx = rect.x + rect.width - mobj.x;
  2048. let dleny = 0;
  2049. let spx = rect.x + rect.width + dlenx;
  2050. let spy = mobj.y;
  2051. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2052. }
  2053. list.sort(function (a, b) {
  2054. return a.order - b.order;
  2055. });
  2056. for (let i = 0; i < list.length; i++) {
  2057. let data = list[i];
  2058. let mx = mobj.x - bobj.x;
  2059. let my = mobj.y - bobj.y;
  2060. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2061. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2062. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2063. if (num > 1)
  2064. num = 1;
  2065. let cos = Math.acos(num);
  2066. if (cos > 1.57)
  2067. cos = 1.57;
  2068. else if (cos < 0.01)
  2069. cos = 0.01;
  2070. let tan = Math.tan(cos);
  2071. let dx = tan * data.dleny;
  2072. let dy = tan * data.dlenx;
  2073. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2074. if (Math.abs(bx - 667) < 40)
  2075. continue;
  2076. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2077. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2078. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2079. this.forceMax = dis * 0.08;
  2080. this.destRot += mis * 0.1;
  2081. this.setKick(bx, by);
  2082. return true;
  2083. }
  2084. }
  2085. }
  2086. }
  2087. else {
  2088. ball = xGame.common.getRandArrEle(this.lineBall);
  2089. }
  2090. }
  2091. else {
  2092. for (let i = 0; i < this.scoreBall.length; i++) {
  2093. if (i < this.scoreBall.length - 1) {
  2094. let rand = 70 + this.aiLv * 10 + i * 10;
  2095. if (xGame.tools.random(0, 100) < rand) {
  2096. ball = this.scoreBall[i];
  2097. break;
  2098. }
  2099. }
  2100. else {
  2101. ball = this.scoreBall[i];
  2102. break;
  2103. }
  2104. }
  2105. score = true;
  2106. this.selectNum++;
  2107. }
  2108. if (!ball)
  2109. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2110. if (this.selectNum >= max) {
  2111. let dx = ball.gameObj.x;
  2112. let dy = ball.gameObj.y;
  2113. let kickAngle = 0;
  2114. if (score) {
  2115. dx = ball.kickPos.x;
  2116. dy = ball.kickPos.y;
  2117. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2118. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2119. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2120. if (adot > 1)
  2121. adot = 1;
  2122. kickAngle = Math.acos(adot) * 57.3;
  2123. if (kickAngle > 45) {
  2124. let kdx = ball.kickPos.x - ball.gameObj.x;
  2125. let kdy = ball.kickPos.y - ball.gameObj.y;
  2126. dx = ball.kickPos.x - kdx * mis * 0.3;
  2127. dy = ball.kickPos.y - kdy * mis * 0.3;
  2128. }
  2129. else
  2130. this.destRot += mis;
  2131. }
  2132. else if (ball.poleAngle != 0) {
  2133. this.destRot += ball.poleAngle;
  2134. }
  2135. if (xGame.common.gameMode == 0) {
  2136. let af = kickAngle * 0.08;
  2137. this.forceMax = ball.hard * 0.1 + af * af;
  2138. }
  2139. this.setKick(dx, dy);
  2140. }
  2141. else {
  2142. let rand = this.aiLv * 5 + 40;
  2143. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2144. ball = xGame.common.getRandArrEle(this.scoreBall);
  2145. else
  2146. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2147. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2148. if (xGame.tools.random(0, 100) > rand) {
  2149. this.selectNum = max;
  2150. }
  2151. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2152. this.selectNum++;
  2153. }
  2154. ball.onClick(0, true);
  2155. }
  2156. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2157. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2158. let balls = xGame.common.d2World.ballArr;
  2159. let max = xGame.tools.getDis(hx, hy, bx, by);
  2160. for (let index = 0; index < balls.length; index++) {
  2161. let obj = balls[index];
  2162. if (obj.number == 0)
  2163. continue;
  2164. if (obj.number == bn || obj.number == dn)
  2165. continue;
  2166. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2167. if (dis * dis > max)
  2168. continue;
  2169. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2170. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2171. if (num > 1)
  2172. num = 1;
  2173. if (num < 0)
  2174. continue;
  2175. let gap = Math.sin(Math.acos(num)) * dis;
  2176. if (gap < this.ballSize)
  2177. return true;
  2178. }
  2179. return false;
  2180. }
  2181. isLine(xy, ball) {
  2182. let bx = xy.x;
  2183. let by = xy.y;
  2184. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2185. let dis = ball.getDestDis(xy);
  2186. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2187. let sin = Math.sin(angle);
  2188. let cos = Math.cos(angle);
  2189. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2190. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2191. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2192. let dx = bx + this.tempDir2.x * dis;
  2193. let dy = by + this.tempDir2.y * dis;
  2194. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2195. sin = Math.sin(-angle);
  2196. cos = Math.cos(-angle);
  2197. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2198. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2199. dx = bx + this.tempDir2.x * dis;
  2200. dy = by + this.tempDir2.y * dis;
  2201. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2202. if (isr && isl)
  2203. return false;
  2204. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2205. }
  2206. return true;
  2207. }
  2208. turnPole() {
  2209. this.turnNum++;
  2210. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2211. let dr = rot - this.destRot;
  2212. let abs = Math.abs(dr) % 360;
  2213. if (abs > 180) {
  2214. if (rot > 180)
  2215. rot -= 360;
  2216. if (this.destRot > 180)
  2217. this.destRot -= 360;
  2218. }
  2219. let max = this.turnNum * 5 + this.aiLv * 5;
  2220. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2221. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2222. let at = xGame.tools.random(1000, 2000);
  2223. if (!this.onAway(3))
  2224. at += xGame.tools.random(10000, 15000);
  2225. this.setState(AIState.shoot, at);
  2226. }
  2227. else {
  2228. let mr = 0;
  2229. if (abs > 3)
  2230. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2231. else if (Math.random() > 0.6)
  2232. mr = xGame.tools.random(1, 10) * 0.1;
  2233. mr = dr > 0 ? -mr : mr;
  2234. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2235. }
  2236. }
  2237. setKick(dx, dy) {
  2238. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2239. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2240. this.tempDir1.x = 0;
  2241. this.tempDir1.y = 1;
  2242. this.tempDir2.y = -this.tempDir2.y;
  2243. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2244. if (num > 1)
  2245. num = 1;
  2246. let rot = Math.acos(num) * 57.3;
  2247. if (this.tempDir2.x < 0)
  2248. rot = 360 - rot;
  2249. this.destRot += rot;
  2250. if (!xGame.common.gameMgr.finishOneShoot) {
  2251. this.forceMax += xGame.tools.random(10, 50);
  2252. this.forceMax -= this.aiLv * 2;
  2253. if (this.forceMax < 20)
  2254. this.forceMax = 20;
  2255. }
  2256. if (this.forceMax > 100)
  2257. this.forceMax = 101;
  2258. else if (this.forceMax < 10)
  2259. this.forceMax += xGame.tools.random(0, 10);
  2260. if (xGame.common.gameMode == 1)
  2261. this.forceMax = xGame.tools.random(80, 100);
  2262. else
  2263. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2264. let max = 2000 - this.aiLv * 100;
  2265. if (Math.random() > 0.8)
  2266. max += xGame.tools.random(100, 2000);
  2267. this.setState(AIState.turn, xGame.tools.random(500, max));
  2268. }
  2269. shoot() {
  2270. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2271. if (Math.random() > 0.8) {
  2272. this.gameSrc.aiForce(1);
  2273. this.setState(AIState.wait);
  2274. }
  2275. }
  2276. else {
  2277. let df = xGame.tools.random(3, 8);
  2278. if (this.forceNum < this.forceMax)
  2279. this.forceNum += df;
  2280. else
  2281. this.forceNum -= df;
  2282. let startY = this.gameSrc.ui.powerNode.y;
  2283. let height = this.gameSrc.ui.powerNode.height;
  2284. let force = startY + height * this.forceNum * 0.01;
  2285. this.gameSrc.aiForce(2, force);
  2286. }
  2287. }
  2288. reset() {
  2289. for (let i = 0; i < 4; i++) {
  2290. this.setRate--;
  2291. this.setNum++;
  2292. let pos = this.posList[this.posIdx];
  2293. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2294. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2295. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2296. this.rootPos.x = 387;
  2297. if (this.rootPos.x < this.rectL)
  2298. this.rootPos.x = this.rectL;
  2299. else if (this.rootPos.x > this.rectR)
  2300. this.rootPos.x = this.rectR;
  2301. if (this.rootPos.y < this.rectT)
  2302. this.rootPos.y = this.rectT;
  2303. else if (this.rootPos.y > this.rectB)
  2304. this.rootPos.y = this.rectB;
  2305. this.posIdx++;
  2306. let max = this.posList.length;
  2307. if (this.posIdx >= max)
  2308. this.posIdx -= max;
  2309. this.initHoleBall();
  2310. let ball = null;
  2311. if (this.scoreBall.length > 0)
  2312. ball = this.scoreBall[0];
  2313. else if (this.lineBall.length > 0)
  2314. ball = xGame.common.getRandArrEle(this.lineBall);
  2315. if (ball && ball.kickAngle < this.bestAngle) {
  2316. this.bestAngle = ball.kickAngle;
  2317. this.bestKick.x = ball.kickPos.x;
  2318. this.bestKick.y = ball.kickPos.y;
  2319. this.bestPos.x = this.rootPos.x;
  2320. this.bestPos.y = this.rootPos.y;
  2321. this.bestForce = ball.hard * 0.08;
  2322. }
  2323. }
  2324. if (this.setNum >= this.setMax)
  2325. this.setMax = 0;
  2326. if (this.setRate < 1) {
  2327. this.setState(AIState.move, 0);
  2328. this.rootMoveTime = Laya.timer.currTimer;
  2329. this.gameSrc.aiRootMove(true);
  2330. }
  2331. }
  2332. delayLine() {
  2333. this.gameSrc.aiRootMove(false);
  2334. }
  2335. move() {
  2336. if (this.bestPos.x < 1)
  2337. this.bestPos = this.rootPos;
  2338. let wObj = this.wBall.gameObj;
  2339. let destx = wObj.x;
  2340. let desty = wObj.y;
  2341. let dx = Math.abs(destx - this.bestPos.x);
  2342. let dy = Math.abs(desty - this.bestPos.y);
  2343. let mx = 3 + dx * 0.03;
  2344. let my = 3 + dy * 0.03;
  2345. if (dx < 4 && dy < 4) {
  2346. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2347. dt = dt < 1000 ? 1000 - dt : 0;
  2348. if (this.setMax > 0) {
  2349. let min = this.setMax * 0.3 + this.aiLv * 5;
  2350. this.setRate = xGame.tools.random(min, this.setMax);
  2351. this.setState(AIState.reset, 0);
  2352. }
  2353. else {
  2354. this.destRot = 0;
  2355. this.forceMax = this.bestForce;
  2356. this.setKick(this.bestKick.x, this.bestKick.y);
  2357. }
  2358. if (dt > 100) {
  2359. Laya.timer.clear(this, this.delayLine);
  2360. Laya.timer.once(dt, this, this.delayLine);
  2361. }
  2362. else
  2363. this.gameSrc.aiRootMove(false);
  2364. }
  2365. else {
  2366. if (dx > 4)
  2367. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2368. if (dy > 4)
  2369. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2370. this.gameSrc.onRootMove({ x: destx, y: desty });
  2371. }
  2372. }
  2373. resetRoot() {
  2374. this.bestAngle = 180;
  2375. this.bestForce = 0;
  2376. this.setMax = this.posList.length;
  2377. this.posIdx = xGame.tools.random(0, this.setMax);
  2378. let min = this.setMax * 0.3 + this.aiLv * 5;
  2379. this.setRate = xGame.tools.random(min, this.setMax);
  2380. let max = 2000 - this.aiLv * 100;
  2381. if (Math.random() > 0.8)
  2382. max += xGame.tools.random(100, 1000);
  2383. if (this.isGuide)
  2384. this.setState(AIState.select, 500);
  2385. else if (this.onAway(2))
  2386. this.setState(AIState.reset, xGame.tools.random(400, max));
  2387. else
  2388. this.setState(AIState.none);
  2389. if (xGame.common.gameMgr.finishOneShoot)
  2390. this.chat();
  2391. }
  2392. runAI() {
  2393. if (this.state > AIState.idle)
  2394. return;
  2395. this.initBall();
  2396. this.onGame(2500);
  2397. if (Math.random() > 0.6)
  2398. this.chat();
  2399. }
  2400. stopRun() {
  2401. this.setState(AIState.idle);
  2402. }
  2403. onGame(base) {
  2404. let max = base - this.aiLv * 100;
  2405. if (Math.random() > 0.8)
  2406. max += xGame.tools.random(100, 1000);
  2407. if (this.onAway(2))
  2408. this.setState(AIState.select, xGame.tools.random(500, max));
  2409. else
  2410. this.setState(AIState.none);
  2411. }
  2412. setState(sta, wt = 0) {
  2413. if (this.state == AIState.none)
  2414. return;
  2415. this.state = sta;
  2416. this.waitTime = wt;
  2417. }
  2418. onUpdate() {
  2419. if (this.state == AIState.none)
  2420. return;
  2421. this.awayTime -= this.dtime;
  2422. if (this.awayTime < 1) {
  2423. this.awayTime = xGame.tools.random(6000, 10000);
  2424. this.awayNum += (11 - this.aiLv);
  2425. this.onAway(1);
  2426. }
  2427. if (this.waitTime >= 0) {
  2428. this.waitTime -= this.dtime;
  2429. return;
  2430. }
  2431. switch (this.state) {
  2432. case AIState.idle:
  2433. this.chat();
  2434. break;
  2435. case AIState.reset:
  2436. this.reset();
  2437. break;
  2438. case AIState.move:
  2439. this.move();
  2440. break;
  2441. case AIState.leave:
  2442. this.state = AIState.none;
  2443. xGame.common.gameMgr.aiGameEnd(true);
  2444. break;
  2445. case AIState.select:
  2446. this.selectBall();
  2447. break;
  2448. case AIState.turn:
  2449. this.turnPole();
  2450. break;
  2451. case AIState.shoot:
  2452. this.shoot();
  2453. break;
  2454. }
  2455. }
  2456. onAway(type) {
  2457. if (type == 1) {
  2458. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2459. let num = this.awayNum + db * 20;
  2460. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2461. xGame.common.gameMgr.aiLeave();
  2462. this.setState(AIState.leave, 6666);
  2463. }
  2464. }
  2465. else if (type == 2) {
  2466. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2467. let num = this.awayNum + db * 30;
  2468. if (xGame.tools.random(0, 10000) < num)
  2469. return false;
  2470. }
  2471. else if (type == 3) {
  2472. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2473. let num = this.awayNum + db * 10;
  2474. if (xGame.tools.random(0, 4000) < num)
  2475. return false;
  2476. }
  2477. return true;
  2478. }
  2479. chat() {
  2480. if (this.chatTime > 0) {
  2481. this.chatTime -= this.dtime;
  2482. return;
  2483. }
  2484. this.chatTime = xGame.tools.random(2000, 10000);
  2485. let rand = xGame.tools.random(0, 100);
  2486. if (rand < 15)
  2487. this.talk();
  2488. else if (rand < 35)
  2489. this.emotion();
  2490. }
  2491. talk() {
  2492. xGame.common.talkMgr.showAITalk(0);
  2493. }
  2494. emotion() {
  2495. xGame.common.talkMgr.showAIEmotion(0);
  2496. }
  2497. resetAI() {
  2498. this.stopRun();
  2499. this.state = AIState.none;
  2500. }
  2501. }
  2502. class Partical extends Laya.Script3D {
  2503. constructor() {
  2504. super();
  2505. this.duration = 2000;
  2506. }
  2507. ;
  2508. onAwake() {
  2509. this.gameObj = this.owner;
  2510. }
  2511. onEnable() {
  2512. this.openTimer();
  2513. }
  2514. openTimer() {
  2515. Laya.timer.once(this.duration, this, this.disappear);
  2516. }
  2517. setCallback(obj, callback) {
  2518. this.obj = obj;
  2519. this.callback = callback;
  2520. Laya.timer.clearAll(this);
  2521. Laya.timer.once(this.duration, this, this.disappear);
  2522. }
  2523. disappear() {
  2524. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2525. this.callback && this.callback(this.obj);
  2526. }
  2527. }
  2528. class Ball extends Laya.Script3D {
  2529. constructor() {
  2530. super();
  2531. this.posV3 = new Laya.Vector3();
  2532. this.rotRate = 2.1;
  2533. this.rotSpeed = new Laya.Vector3();
  2534. this.myIndex = 0;
  2535. }
  2536. onAwake() {
  2537. this.gameObj = this.owner;
  2538. this.transform = this.gameObj.transform;
  2539. this.ballNode = this.gameObj.getChildByName("Ball");
  2540. this.shadowNode = this.gameObj.getChildByName("shadow");
  2541. }
  2542. initSelf(index, x, y, owner) {
  2543. this.d2BallSrc = owner;
  2544. this.myIndex = index;
  2545. this.setAlbedoTexture();
  2546. this.setTransPos(x, y);
  2547. this.setScale();
  2548. this.ballNode.transform.localRotationEulerX = 90;
  2549. if (index == 0) {
  2550. }
  2551. }
  2552. setAlbedoTexture(isIce = false) {
  2553. let url;
  2554. if (isIce) {
  2555. url = `res/d3Res/ballTexture/ice.jpg`;
  2556. }
  2557. else {
  2558. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2559. }
  2560. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2561. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2562. }));
  2563. }
  2564. runFireworks(obj, delay, callback) {
  2565. Laya.timer.clearAll(this);
  2566. Laya.timer.once(delay + 1, this, () => {
  2567. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2568. fire.transform.localPositionX = this.transform.localPositionX;
  2569. fire.transform.localPositionY = this.transform.localPositionY;
  2570. fire.transform.localPositionZ = this.transform.localPositionZ;
  2571. let src = fire.getComponent(Partical);
  2572. src.duration = 1000;
  2573. src.setCallback(obj, callback);
  2574. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2575. eft.transform.localPositionX = this.transform.localPositionX;
  2576. eft.transform.localPositionY = this.transform.localPositionY;
  2577. eft.transform.localPositionZ = this.transform.localPositionZ;
  2578. });
  2579. }
  2580. setTransPos(x, y) {
  2581. this.setRotation();
  2582. xGame.common.pos2to3Convert(x, y, this.posV3);
  2583. this.transform.localPositionX = this.posV3.x;
  2584. this.transform.localPositionY = 0;
  2585. this.transform.localPositionZ = this.posV3.z;
  2586. this.transform.localRotationEulerX = 0;
  2587. this.transform.localRotationEulerY = 0;
  2588. this.transform.localRotationEulerZ = 0;
  2589. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2590. this.shadowNode.transform.localPositionY = 0.1;
  2591. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2592. }
  2593. setRotation() {
  2594. if (this.d2BallSrc.canRot) {
  2595. let speed = this.d2BallSrc.rigy.linearVelocity;
  2596. this.rotSpeed.x = speed.x * this.rotRate;
  2597. this.rotSpeed.z = speed.y * this.rotRate;
  2598. this.rotSpeed.y = this.d2BallSrc.rotY;
  2599. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2600. }
  2601. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2602. this.rotSpeed.x = this.rotSpeed.y = 0;
  2603. this.rotSpeed.y = this.d2BallSrc.rotY;
  2604. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2605. }
  2606. }
  2607. setScale() {
  2608. let radius = xGame.common.d2World.rootBall.ui.width;
  2609. let scale = xGame.common.scale2to3Convert(radius);
  2610. this.transform.localScaleX = scale;
  2611. this.transform.localScaleY = scale;
  2612. this.transform.localScaleZ = scale;
  2613. }
  2614. playInHoleEft() {
  2615. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2616. eft.transform.position = this.transform.position;
  2617. }
  2618. playIceEft() {
  2619. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2620. eft.transform.position = this.transform.position;
  2621. }
  2622. get scaleXYZ() {
  2623. return this.transform.localScaleX;
  2624. }
  2625. set scaleXYZ(val) {
  2626. this.transform.localScaleX = val;
  2627. this.transform.localScaleY = val;
  2628. this.transform.localScaleZ = val;
  2629. }
  2630. get posX() {
  2631. return this.transform.localPositionX;
  2632. }
  2633. set posX(val) {
  2634. this.transform.localPositionX = val;
  2635. }
  2636. get posY() {
  2637. return this.transform.localPositionY;
  2638. }
  2639. set posY(val) {
  2640. this.transform.localPositionY = val;
  2641. }
  2642. get posZ() {
  2643. return this.transform.localPositionZ;
  2644. }
  2645. set posZ(val) {
  2646. this.transform.localPositionZ = val;
  2647. }
  2648. destroySelf() {
  2649. this.posV3 = null;
  2650. this.rotSpeed = null;
  2651. this.d2BallSrc = null;
  2652. this.ballNode = null;
  2653. this.gameObj.destroy(true);
  2654. this.transform = null;
  2655. this.destroy();
  2656. }
  2657. }
  2658. class ui_D2Ball extends fgui.GComponent {
  2659. static createInstance() {
  2660. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2661. }
  2662. onConstruct() {
  2663. this.myIcon = (this.getChild("myIcon"));
  2664. this.inner = (this.getChild("inner"));
  2665. this.n8 = (this.getChild("n8"));
  2666. this.n4 = (this.getChild("n4"));
  2667. this.wrongTips = (this.getChild("wrongTips"));
  2668. this.rightTips = (this.getChild("rightTips"));
  2669. this.breathAni = this.getTransition("breathAni");
  2670. }
  2671. }
  2672. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2673. class D2BallSrc extends Laya.Script {
  2674. constructor() {
  2675. super();
  2676. this.number = 0;
  2677. this.startX = 0;
  2678. this.startY = 0;
  2679. this.angleV2 = new Laya.Vector2();
  2680. this.isRootBall = false;
  2681. this.isBlackBall = false;
  2682. this.ballType = "";
  2683. this.canRot = true;
  2684. this.rotY = 0;
  2685. this.poleAngle = 0;
  2686. this.kickPos = { x: 0, y: 0 };
  2687. this.hard = 0;
  2688. this.kickAngle = 0;
  2689. this.borderDis = 0;
  2690. this.speedP10 = 5.6;
  2691. this.lastSpeed = { x: 0, y: 0 };
  2692. this.stillSpeed = 0.12;
  2693. this.ballFunc = "normal";
  2694. this.isRunSkillAni = false;
  2695. this.isInHole = false;
  2696. this.iceOwner = "";
  2697. this.forceRun = false;
  2698. this.myUNID = "";
  2699. this.rectL = 0;
  2700. this.rectR = 0;
  2701. this.rectT = 0;
  2702. this.rectB = 0;
  2703. this.forceVec = new Laya.Vector2();
  2704. this.lastDis = 0;
  2705. this.helpOut = { type: "", x: 0, y: 0 };
  2706. }
  2707. initSelf(number, x, y, d3Ball) {
  2708. if (!this.gameObj)
  2709. this.gameObj = this.owner;
  2710. this.number = number;
  2711. this.startX = x;
  2712. this.startY = y;
  2713. this.d3Ball = d3Ball;
  2714. this.isRootBall = false;
  2715. this.isBlackBall = false;
  2716. this.ballType = "";
  2717. if (number == 0) {
  2718. this.isRootBall = true;
  2719. }
  2720. else if (number == 8) {
  2721. this.isBlackBall = true;
  2722. }
  2723. else {
  2724. if (number <= 7) {
  2725. this.ballType = ballCamp.full;
  2726. }
  2727. else {
  2728. this.ballType = ballCamp.flower;
  2729. }
  2730. }
  2731. this.setInfo();
  2732. this.setD3Ball();
  2733. this.owner["mySrc"] = this;
  2734. this.rigy.linearDamping = 1;
  2735. D2BallSrc._unid++;
  2736. this.myUNID = "d2ball" + D2BallSrc._unid;
  2737. let rect = xGame.common.d2World.borderRect;
  2738. this.rectL = Math.ceil(rect.x) + 20;
  2739. this.rectT = Math.ceil(rect.y) + 20;
  2740. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2741. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2742. }
  2743. setInfo() {
  2744. this.gameObj.x = this.startX;
  2745. this.gameObj.y = this.startY;
  2746. let radius = this.ui.width / 2;
  2747. this.gameObj.width = radius * 2;
  2748. this.gameObj.height = radius * 2;
  2749. if (xGame.common.showDebug) {
  2750. this.ui.myIcon.alpha = 1;
  2751. this.ui.inner.alpha = 1;
  2752. }
  2753. else {
  2754. this.ui.myIcon.alpha = 0;
  2755. this.ui.inner.alpha = 0;
  2756. }
  2757. }
  2758. setD3Ball() {
  2759. this.d3Ball = this.d3Ball;
  2760. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2761. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2762. }
  2763. onUpdate() {
  2764. if (xGame.common.gameMgr.gamePause)
  2765. return;
  2766. if (this.isInHole)
  2767. return;
  2768. if (!xGame.common.d2World.openCheckStill)
  2769. return;
  2770. this.runBall();
  2771. }
  2772. runBall() {
  2773. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2774. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2775. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2776. this.judgeBorder();
  2777. }
  2778. getDestDis(dest) {
  2779. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2780. }
  2781. setmyXY(x, y) {
  2782. this.d3BallSrc.setTransPos(x, y);
  2783. }
  2784. getSpeed() {
  2785. let speed = this.rigy.linearVelocity;
  2786. return speed.x * speed.x + speed.y * speed.y;
  2787. }
  2788. onTriggerEnter(collider) {
  2789. if (!collider || !collider.owner)
  2790. return;
  2791. let coll = "collide";
  2792. let speed = this.getSpeed();
  2793. let sv2 = this.speedP10 * this.speedP10;
  2794. if (collider.label == "ball") {
  2795. if (speed < 9 && this.number != 0)
  2796. coll = "";
  2797. else if (speed < sv2)
  2798. coll = "collide_4";
  2799. else if (speed < sv2 * 6.2)
  2800. coll = "collide_3";
  2801. else if (speed < sv2 * 25)
  2802. coll = "collide_2";
  2803. else if (speed < sv2 * 56)
  2804. coll = "collide_1";
  2805. xGame.soundMgr.playSound(coll);
  2806. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2807. if (collider.owner) {
  2808. let rig = collider.owner.getComponent(D2BallSrc);
  2809. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2810. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2811. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2812. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2813. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2814. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2815. let rx = 0;
  2816. let ry = 0;
  2817. if (this.gameObj.x < this.rectL)
  2818. rx = vx;
  2819. else if (this.gameObj.x > this.rectR)
  2820. rx = -vx;
  2821. else if (this.gameObj.y < this.rectT)
  2822. ry = vy;
  2823. else if (this.gameObj.y > this.rectB)
  2824. ry = -vy;
  2825. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2826. }
  2827. }
  2828. if (this.number != 0) {
  2829. return;
  2830. }
  2831. else {
  2832. if (this.forceRun) {
  2833. console.log("randon force");
  2834. this.applyForce(collider);
  2835. }
  2836. }
  2837. if (xGame.common.d2World.isOnSameLine) {
  2838. xGame.common.d2World.isOnSameLine = false;
  2839. this.rigy.linearVelocity = { x: 0, y: 0 };
  2840. }
  2841. if (xGame.common.gameMgr.firstColliObj == null) {
  2842. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2843. xGame.common.gameMgr.isTouchedBall = true;
  2844. }
  2845. }
  2846. else {
  2847. xGame.common.recoverCameraView();
  2848. let wallStr = "";
  2849. if (speed < 9) { }
  2850. else if (speed < sv2) { }
  2851. else if (speed < sv2 * 6.2)
  2852. wallStr = "wall_30";
  2853. else if (speed < sv2 * 25)
  2854. wallStr = "wall_50";
  2855. else if (speed < sv2 * 56)
  2856. wallStr = "wall_80";
  2857. xGame.soundMgr.playSound(wallStr);
  2858. }
  2859. }
  2860. applyForce(collider) {
  2861. let src = collider.owner.mySrc;
  2862. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2863. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2864. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2865. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2866. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2867. }
  2868. checkWrongBall(playEft = true) {
  2869. if (this.isInHole)
  2870. return;
  2871. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2872. if (this.number != 0 && playEft)
  2873. this.d3BallSrc.playInHoleEft();
  2874. let coll = "inpocket_1";
  2875. let speed = this.getSpeed();
  2876. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2877. if (speed < 9 && this.number != 0)
  2878. coll = "";
  2879. else if (speed < sv2 * 6.2)
  2880. coll = "inpocket_4";
  2881. else if (speed < sv2 * 25)
  2882. coll = "collide_3";
  2883. else if (speed < sv2 * 56)
  2884. coll = "collide_2";
  2885. xGame.soundMgr.playSound(coll);
  2886. this.isInHole = true;
  2887. if (this.number == 0) {
  2888. console.log("白球进了。。");
  2889. this.reset();
  2890. this.rigy.linearVelocity = { x: 0, y: 0 };
  2891. this.hideSelf();
  2892. xGame.common.gameUI.ui.whiteAni.visible = true;
  2893. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2894. xGame.common.gameUI.ui.whiteAni.visible = false;
  2895. }));
  2896. }
  2897. else {
  2898. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2899. xGame.common.d2World.removeOneBall(this);
  2900. this.destroySelf();
  2901. xGame.common.playHappySound(this.number);
  2902. this.runFlyEft();
  2903. }
  2904. }
  2905. runFlyEft() {
  2906. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2907. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2908. }
  2909. }
  2910. hideSelf() {
  2911. if (this.d3Ball)
  2912. this.d3Ball.active = false;
  2913. }
  2914. showSelf() {
  2915. this.isInHole = false;
  2916. if (this.d3Ball && !this.d3Ball.active)
  2917. this.d3Ball.active = true;
  2918. }
  2919. isStill() {
  2920. let speed = this.rigy.linearVelocity;
  2921. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2922. this.rigy.linearVelocity = { x: 0, y: 0 };
  2923. return true;
  2924. }
  2925. return false;
  2926. }
  2927. reset() {
  2928. }
  2929. destroySelf() {
  2930. this.d3BallSrc.destroySelf();
  2931. if (!this.ui.isDisposed) {
  2932. this.ui.removeFromParent();
  2933. this.ui.dispose();
  2934. this.ui = null;
  2935. }
  2936. this.outColli = null;
  2937. this.innerColli = null;
  2938. this.rigy = null;
  2939. this.d3Ball = null;
  2940. this.d3BallSrc = null;
  2941. this.angleV2 = null;
  2942. this.gameObj.destroy(true);
  2943. this.destroy();
  2944. }
  2945. judgeBorder() {
  2946. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2947. return;
  2948. }
  2949. if (this.destroyed)
  2950. return;
  2951. if (xGame.common.gameMode == GameMode.classic)
  2952. return;
  2953. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2954. if (isOver) {
  2955. this.checkWrongBall();
  2956. }
  2957. }
  2958. onClick(e, force = false) {
  2959. if (this.number == 0)
  2960. return;
  2961. if (force) {
  2962. }
  2963. else {
  2964. if (xGame.common.d2World.openCheckStill)
  2965. return;
  2966. if (!xGame.common.gameMgr.selfTurn) {
  2967. return;
  2968. }
  2969. }
  2970. if (!xGame.common.gameMgr.finishOneShoot)
  2971. return;
  2972. let root = xGame.common.d2World.rootBall.gameObj;
  2973. let x = this.gameObj.x - root.x;
  2974. let y = this.gameObj.y - root.y;
  2975. let angle = xGame.common.getfguiRotation(x, y);
  2976. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2977. xGame.common.d2World.getHelpLine();
  2978. xGame.common.clickedBall = true;
  2979. this.checkGuide();
  2980. }
  2981. checkGuide() {
  2982. let guide = DataMgr.getSkillGuide();
  2983. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2984. xGame.common.guideStep++;
  2985. xGame.common.gameUI.ui.guide1.visible = false;
  2986. xGame.common.gameUI.ui.guide2.visible = true;
  2987. }
  2988. }
  2989. checkDistance(disX, disY, angle) {
  2990. let diameter = this.gameObj.width - 1;
  2991. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2992. if (!this.lastDis)
  2993. this.lastDis = dis;
  2994. else {
  2995. if (dis > this.lastDis) {
  2996. this.helpOut.type = "remove";
  2997. return this.helpOut;
  2998. }
  2999. }
  3000. if (dis <= Math.pow(diameter, 2)) {
  3001. let del = 0.01;
  3002. let offest = 0;
  3003. let realX = disX - this.gameObj.x;
  3004. let realY = disY - this.gameObj.y;
  3005. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3006. offest += del;
  3007. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3008. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3009. }
  3010. this.helpOut.type = "ok";
  3011. this.helpOut.x = realX + this.gameObj.x;
  3012. this.helpOut.y = realY + this.gameObj.y;
  3013. return this.helpOut;
  3014. }
  3015. else {
  3016. this.helpOut.type = "no";
  3017. return this.helpOut;
  3018. }
  3019. }
  3020. clearBallEft() {
  3021. this.clearBallRightEft();
  3022. this.clearBallWrongEft();
  3023. }
  3024. clearBallRightEft() {
  3025. this.ui.breathAni.stop();
  3026. this.ui.rightTips.visible = false;
  3027. }
  3028. clearBallWrongEft() {
  3029. this.ui.wrongTips.visible = false;
  3030. }
  3031. showWrongEft() {
  3032. if (!xGame.common.gameMgr.selfTurn)
  3033. return;
  3034. this.ui.wrongTips.visible = true;
  3035. }
  3036. showRightEft() {
  3037. if (!xGame.common.gameMgr.selfTurn)
  3038. return;
  3039. this.ui.rightTips.visible = true;
  3040. this.ui.rightTips.scaleX = 1;
  3041. this.ui.rightTips.scaleY = 1;
  3042. this.ui.breathAni.play();
  3043. }
  3044. setBallFunc(type, owner) {
  3045. if (type == "ice") {
  3046. this.ballFunc = type;
  3047. this.d3BallSrc.setAlbedoTexture(true);
  3048. this.rigy.type = "static";
  3049. this.iceOwner = owner;
  3050. }
  3051. else {
  3052. if (owner == this.iceOwner) {
  3053. this.ballFunc = type;
  3054. this.d3BallSrc.setAlbedoTexture(false);
  3055. this.rigy.type = "dynamic";
  3056. }
  3057. }
  3058. }
  3059. }
  3060. D2BallSrc._unid = 0;
  3061. class D2RootBallSrc extends D2BallSrc {
  3062. constructor() {
  3063. super();
  3064. this.maxSpeed = 0;
  3065. this.classicMaxSpeed = 2.2;
  3066. this.bigSkillMaxSpeed = 4;
  3067. this.angle = 0;
  3068. this.allPercent = 0;
  3069. this.linearPercent = 0;
  3070. this.anglePercent = 0;
  3071. this.maxAngleRate = 0.6;
  3072. this.baseRot = 7;
  3073. this.angleMax = 0;
  3074. this.speed = new Laya.Vector2();
  3075. this.rotSpeed = new Laya.Vector2();
  3076. }
  3077. isStill() {
  3078. let speed = this.rigy.linearVelocity;
  3079. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3080. if (this.anglePercent <= 0.1) {
  3081. this.rigy.linearVelocity = { x: 0, y: 0 };
  3082. return true;
  3083. }
  3084. }
  3085. return false;
  3086. }
  3087. reset() {
  3088. this.linearPercent = 0;
  3089. this.anglePercent = 0;
  3090. }
  3091. setSpeed(percent, angle) {
  3092. this.allPercent = percent;
  3093. this.angle = angle;
  3094. this.setAngleSpeed();
  3095. this.setLinearSpeed();
  3096. let hit = "hit";
  3097. if (percent < 25)
  3098. hit = "hit03";
  3099. else if (percent < 50)
  3100. hit = "hit02";
  3101. else if (percent < 75)
  3102. hit = "hit01";
  3103. xGame.soundMgr.playSound(hit);
  3104. }
  3105. setAngleSpeed() {
  3106. let offest = xGame.common.rodOffest;
  3107. let radius = 82;
  3108. let rate = Math.abs(offest.y / radius) * 0.5;
  3109. if (offest.y > 0)
  3110. this.angleMax = -this.baseRot * 2;
  3111. else
  3112. this.angleMax = this.baseRot;
  3113. this.rotY = -offest.x / radius * 100;
  3114. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3115. this.linearPercent = this.allPercent - this.anglePercent;
  3116. }
  3117. setLinearSpeed() {
  3118. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3119. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3120. if (!xGame.common.longHelpLine) {
  3121. let offset = -150 + xGame.common.randomNum(0, 300);
  3122. offset /= 100;
  3123. this.angle += offset;
  3124. }
  3125. }
  3126. }
  3127. let sin = Math.sin(this.angle * Math.PI / 180);
  3128. let cos = Math.cos(this.angle * Math.PI / 180);
  3129. switch (xGame.common.gameMode) {
  3130. case GameMode.classic:
  3131. this.maxSpeed = this.classicMaxSpeed;
  3132. break;
  3133. case GameMode.bigMove:
  3134. this.maxSpeed = this.bigSkillMaxSpeed;
  3135. break;
  3136. case GameMode.placeBall:
  3137. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3138. if (data.type == 1) {
  3139. this.maxSpeed = this.bigSkillMaxSpeed;
  3140. }
  3141. else {
  3142. this.maxSpeed = this.classicMaxSpeed;
  3143. }
  3144. break;
  3145. default:
  3146. break;
  3147. }
  3148. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3149. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3150. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3151. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3152. this.rigy.applyLinearImpulseToCenter(this.speed);
  3153. }
  3154. onUpdate() {
  3155. if (this.anglePercent > 0.1) {
  3156. this.anglePercent *= 0.97;
  3157. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3158. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3159. this.rigy.applyForceToCenter(this.rotSpeed);
  3160. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3161. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3162. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3163. if (num > 0.9)
  3164. this.canRot = true;
  3165. }
  3166. else
  3167. this.canRot = true;
  3168. if (Math.abs(this.rotY) > 0.1)
  3169. this.rotY *= 0.98;
  3170. super.onUpdate();
  3171. }
  3172. destroySelf() {
  3173. super.destroySelf();
  3174. this.speed = null;
  3175. }
  3176. }
  3177. class D2Ball extends Laya.Sprite {
  3178. constructor(isRootBall = false) {
  3179. super();
  3180. this.ui = ui_D2Ball.createInstance();
  3181. this.pivotX = this.ui.width / 2;
  3182. this.pivotY = this.ui.width / 2;
  3183. this.x = 0;
  3184. this.y = 0;
  3185. this.addChild(this.ui.displayObject);
  3186. this.ui.displayObject.x += this.ui.width / 2;
  3187. this.ui.displayObject.y += this.ui.width / 2;
  3188. if (isRootBall) {
  3189. this.d2Src = this.addComponent(D2RootBallSrc);
  3190. }
  3191. else {
  3192. this.d2Src = this.addComponent(D2BallSrc);
  3193. }
  3194. this.d2Src.ui = this.ui;
  3195. this.addCircleCollider();
  3196. this.addInnerCircleCollider();
  3197. this.addRigyBody();
  3198. }
  3199. addCircleCollider() {
  3200. let colli = xGame.common.getCollider("circle");
  3201. colli.radius = this.ui.width / 2;
  3202. this.addComponentIntance(colli);
  3203. this.d2Src.outColli = colli;
  3204. colli.label = "ball";
  3205. }
  3206. addInnerCircleCollider() {
  3207. let colli = xGame.common.getCollider("circle");
  3208. colli.radius = this.ui.inner.width / 2;
  3209. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3210. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3211. this.addComponentIntance(colli);
  3212. this.d2Src.innerColli = colli;
  3213. colli.label = "inner";
  3214. }
  3215. addRigyBody() {
  3216. let rigy = xGame.common.getRigbody();
  3217. rigy.type = "dynamic";
  3218. this.addComponentIntance(rigy);
  3219. this.d2Src.rigy = rigy;
  3220. }
  3221. disposeSelf() {
  3222. if (!this.ui.isDisposed) {
  3223. this.ui.dispose();
  3224. this.ui.removeFromParent();
  3225. this.ui = null;
  3226. }
  3227. }
  3228. }
  3229. class ui_D2Gan extends fgui.GComponent {
  3230. static createInstance() {
  3231. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3232. }
  3233. onConstruct() {
  3234. this.myIcon = (this.getChild("myIcon"));
  3235. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3236. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3237. this.self = (this.getChild("self"));
  3238. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3239. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3240. this.ai = (this.getChild("ai"));
  3241. }
  3242. }
  3243. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3244. class D2Gan {
  3245. constructor() {
  3246. this.offset = 0.15;
  3247. this.cell = 1.5;
  3248. this.onBallCell = 0.4;
  3249. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3250. this.moveNum = 70;
  3251. this.rulerRate = 0.1;
  3252. this.ui = ui_D2Gan.createInstance();
  3253. this.changeSelfRod();
  3254. this.changeAIRod();
  3255. }
  3256. changeSelfRod() {
  3257. let index = DataMgr.getCurBallRod();
  3258. let data = cfgTable.ballrodData[index + 1];
  3259. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3260. this.selfMySpine && this.selfMySpine.dispose();
  3261. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3262. if (data.spine) {
  3263. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3264. this.selfMySpine = new SpineMgr(data.spine, () => {
  3265. let xx = this.ui.selfEftRoot.width / 2;
  3266. let yy = this.ui.selfEftRoot.height / 2;
  3267. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3268. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3269. outSpine.rotation = -90;
  3270. });
  3271. }
  3272. }
  3273. changeAIRod() {
  3274. let length = Object.keys(cfgTable.ballrodData).length;
  3275. let rand = Math.floor(length * Math.random()) + 1;
  3276. let data = cfgTable.ballrodData[rand];
  3277. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3278. this.aiMySpine && this.aiMySpine.dispose();
  3279. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3280. if (data.spine) {
  3281. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3282. this.aiMySpine = new SpineMgr(data.spine, () => {
  3283. let xx = this.ui.aiEftRoot.width / 2;
  3284. let yy = this.ui.aiEftRoot.height / 2;
  3285. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3286. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3287. outSpine.rotation = -90;
  3288. });
  3289. }
  3290. }
  3291. setGanLastInfo() {
  3292. this.lastInfo.rotation = this.ui.rotation;
  3293. this.lastInfo.x = this.ui.x;
  3294. this.lastInfo.y = this.ui.y;
  3295. }
  3296. rotateSelf(flag, isRuler = false) {
  3297. let angle;
  3298. flag = flag * this.offset;
  3299. if (xGame.common.d2World.isHelpLineOnBall) {
  3300. angle = flag * this.onBallCell;
  3301. }
  3302. else {
  3303. angle = flag * this.cell;
  3304. }
  3305. if (isRuler) {
  3306. angle *= this.rulerRate;
  3307. }
  3308. this.ui.rotation += angle;
  3309. xGame.common.d2World.getHelpLine();
  3310. }
  3311. checkDistance() {
  3312. let target = xGame.common.d2World.targetBall;
  3313. let root = xGame.common.d2World.rootBall;
  3314. if (target == null) {
  3315. return 1;
  3316. }
  3317. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3318. if (dis <= 2500) {
  3319. return 5;
  3320. }
  3321. return 1;
  3322. }
  3323. rotDest(rot) {
  3324. this.ui.rotation = rot;
  3325. xGame.common.d2World.getHelpLine();
  3326. }
  3327. storagePower(powerNum) {
  3328. let pos = (powerNum / 100) * this.moveNum;
  3329. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3330. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3331. this.ui.x = this.lastInfo.x + xx;
  3332. this.ui.y = this.lastInfo.y + yy;
  3333. }
  3334. shoot() {
  3335. this.storagePower(0);
  3336. this.ui.visible = false;
  3337. }
  3338. destroySelf() {
  3339. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3340. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3341. this.selfMySpine && this.selfMySpine.dispose();
  3342. this.aiMySpine && this.aiMySpine.dispose();
  3343. this.lastInfo = null;
  3344. if (!this.ui.isDisposed) {
  3345. this.ui.removeFromParent();
  3346. this.ui.dispose();
  3347. }
  3348. }
  3349. }
  3350. class ui_HelpLine extends fgui.GComponent {
  3351. static createInstance() {
  3352. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3353. }
  3354. onConstruct() {
  3355. this.n10 = (this.getChild("n10"));
  3356. this.rect = (this.getChild("rect"));
  3357. this.dir11 = (this.getChild("dir11"));
  3358. this.dir = (this.getChild("dir"));
  3359. this.rootDir = (this.getChild("rootDir"));
  3360. this.dirDot = (this.getChild("dirDot"));
  3361. }
  3362. }
  3363. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3364. class D2HelpLine {
  3365. constructor() {
  3366. this.starX = 0;
  3367. this.starY = 0;
  3368. this.ui = ui_HelpLine.createInstance();
  3369. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3370. this.starX = this.ui.rect.x;
  3371. this.starY = this.ui.rect.y;
  3372. }
  3373. shoot() {
  3374. this.ui.visible = false;
  3375. }
  3376. destroySelf() {
  3377. if (this.ui.isDisposed) {
  3378. this.ui.removeFromParent();
  3379. this.ui.dispose();
  3380. }
  3381. }
  3382. }
  3383. class D2World extends Laya.Script {
  3384. constructor() {
  3385. super();
  3386. this.ballArr = [];
  3387. this.openCheckStill = false;
  3388. this.checkArr = [];
  3389. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3390. this.isHelpLineOnBall = false;
  3391. this.isOnSameLine = false;
  3392. this.reflectAngle = 0;
  3393. this.powerPercent = 0;
  3394. this.inHolesSpeed = [];
  3395. this.outDir = new Laya.Vector2();
  3396. this.rootDir = new Laya.Vector2();
  3397. this.aiLv = 0;
  3398. this.rootPos = new Laya.Vector2();
  3399. this.tempDir1 = new Laya.Vector2();
  3400. this.tempDir2 = new Laya.Vector2();
  3401. this.tempDir3 = new Laya.Vector2();
  3402. this.ballSize = 33;
  3403. this.destRot = 0;
  3404. }
  3405. initSelf() {
  3406. this.createBalls();
  3407. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3408. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3409. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3410. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3411. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3412. }
  3413. setBorderRect() {
  3414. let ui = xGame.common.gameUI.ui;
  3415. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3416. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3417. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3418. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3419. this.borderRect.x = starX;
  3420. this.borderRect.y = starY;
  3421. this.borderRect.width = width;
  3422. this.borderRect.height = height;
  3423. }
  3424. resetGame() {
  3425. this.openCheckStill = false;
  3426. let temp;
  3427. for (let index = 0; index < this.ballArr.length; index++) {
  3428. temp = this.ballArr[index];
  3429. temp.destroySelf();
  3430. }
  3431. xGame.common.d3World.ballRoot.destroyChildren();
  3432. xGame.common.gameUI.ui.ballNode.removeChildren();
  3433. console.log("进入摧毁逻辑");
  3434. this.d2Gan.destroySelf();
  3435. this.d2HelpLine.destroySelf();
  3436. this.ballArr = [];
  3437. }
  3438. setD2Gan() {
  3439. let ballNode = this.rootBall.ui;
  3440. let d2Gan = new D2Gan();
  3441. this.d2Gan = d2Gan;
  3442. let ganNode = d2Gan.ui;
  3443. ballNode.addChild(ganNode);
  3444. ganNode.pivotX = ganNode.pivotX;
  3445. ganNode.pivotY = ganNode.pivotY;
  3446. ganNode.x = ganNode.myIcon.width / 2;
  3447. ganNode.y = this.rootBall.gameObj.width;
  3448. d2Gan.setGanLastInfo();
  3449. }
  3450. setHelpLine() {
  3451. let d2Help = new D2HelpLine();
  3452. this.d2HelpLine = d2Help;
  3453. }
  3454. createBalls() {
  3455. let cfg;
  3456. switch (xGame.common.gameMode) {
  3457. case GameMode.classic:
  3458. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3459. break;
  3460. case GameMode.bigMove:
  3461. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3462. break;
  3463. case GameMode.placeBall:
  3464. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3465. break;
  3466. default:
  3467. break;
  3468. }
  3469. cfg = JSON.parse(JSON.stringify(cfg));
  3470. for (const key in cfg) {
  3471. if (cfg[key].value == 0) {
  3472. this.createRootBall(cfg[key]);
  3473. delete cfg[key];
  3474. break;
  3475. }
  3476. }
  3477. this.createOtherBalls(cfg);
  3478. }
  3479. createRootBall(data) {
  3480. let root = new D2Ball(true);
  3481. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3482. this.rootBall = root.d2Src;
  3483. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3484. let d3BallSrc = d3Ball.getComponent(Ball);
  3485. xGame.common.d3World.rootBall = d3Ball;
  3486. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3487. let xx = data.x;
  3488. let yy = data.y;
  3489. let numer = data.value;
  3490. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3491. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3492. this.ballArr.push(this.rootBall);
  3493. this.setD2Gan();
  3494. this.setHelpLine();
  3495. }
  3496. createOtherBalls(cfg) {
  3497. let temp;
  3498. let src;
  3499. let data;
  3500. for (const key in cfg) {
  3501. data = cfg[key];
  3502. temp = new D2Ball();
  3503. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3504. src = temp.d2Src;
  3505. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3506. src.initSelf(data.value, data.x, data.y, d3Ball);
  3507. this.ballArr.push(src);
  3508. }
  3509. }
  3510. shoot(percent) {
  3511. this.powerPercent = percent;
  3512. this.openCheckStill = true;
  3513. let d2Angle = this.d2Gan.ui.rotation;
  3514. this.rootBall.setSpeed(percent, d2Angle);
  3515. this.clearBallAllEft();
  3516. this.changePlayerView();
  3517. }
  3518. onUpdate() {
  3519. if (!this.openCheckStill)
  3520. return;
  3521. this.checkStill();
  3522. }
  3523. checkStill() {
  3524. for (let index = 0; index < this.ballArr.length; index++) {
  3525. if (!this.ballArr[index].isStill()) {
  3526. return;
  3527. }
  3528. }
  3529. xGame.eventMgr.event(ALL_BALL_STOP);
  3530. }
  3531. allBallStop() {
  3532. this.openCheckStill = false;
  3533. xGame.common.recoverCameraView();
  3534. }
  3535. waitShoot() {
  3536. if (!this.d2Gan.ui.isDisposed) {
  3537. this.d2Gan.ui.visible = true;
  3538. }
  3539. if (!this.d2HelpLine.ui.isDisposed) {
  3540. this.d2HelpLine.ui.visible = true;
  3541. }
  3542. this.clearBallAllEft();
  3543. this.showBallRightEft();
  3544. this.getHelpLine();
  3545. this.inHolesSpeed = [];
  3546. this.selectOneBall();
  3547. }
  3548. _getAllBallArr() {
  3549. let arr = this.ballArr;
  3550. let outArr = [];
  3551. for (let index = 0; index < arr.length; index++) {
  3552. if (arr[index] instanceof D2RootBallSrc)
  3553. continue;
  3554. if (arr[index].ballFunc == "ice")
  3555. continue;
  3556. if (arr[index].destroyed)
  3557. continue;
  3558. outArr.push(arr[index]);
  3559. }
  3560. return outArr;
  3561. }
  3562. _getBlackObj() {
  3563. let arr = this.ballArr;
  3564. for (let index = 0; index < arr.length; index++) {
  3565. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3566. return arr[index];
  3567. }
  3568. }
  3569. }
  3570. selectOneBall() {
  3571. let all = this._getAllBallArr();
  3572. let target;
  3573. switch (xGame.common.gameMode) {
  3574. case GameMode.classic:
  3575. if (xGame.common.gameMgr.selfTurn) {
  3576. let self = xGame.common.gameMgr.selfBallArr;
  3577. let black = this._getBlackObj();
  3578. if (xGame.common.gameMgr.ensureBallType) {
  3579. if (self.length > 0) {
  3580. let out = [];
  3581. for (let j = 0; j < all.length; j++) {
  3582. if (self.indexOf(all[j].number) > -1) {
  3583. out.push(all[j]);
  3584. }
  3585. }
  3586. target = this.selectBestEnterOne(out);
  3587. }
  3588. else {
  3589. target = this.selectBestEnterOne([black]);
  3590. }
  3591. }
  3592. else {
  3593. target = this.selectBestEnterOne(all);
  3594. }
  3595. }
  3596. else {
  3597. target = this.selectBestEnterOne(all);
  3598. }
  3599. break;
  3600. case GameMode.bigMove:
  3601. target = this.selectBestEnterOne(all);
  3602. break;
  3603. case GameMode.placeBall:
  3604. if (all.length > 0) {
  3605. target = this.selectBestEnterOne(all);
  3606. }
  3607. break;
  3608. default:
  3609. break;
  3610. }
  3611. if (target && !target.destroyed && target.onClick) {
  3612. target.onClick(0, true);
  3613. let num = -200 + xGame.common.randomNum(0, 400);
  3614. num /= 150;
  3615. if (xGame.common.longHelpLine) {
  3616. num = 0;
  3617. }
  3618. this.destRot += num;
  3619. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3620. }
  3621. }
  3622. removeOneBall(ball) {
  3623. for (let index = 0; index < this.ballArr.length; index++) {
  3624. if (this.ballArr[index].id == ball.id) {
  3625. this.ballArr.splice(index, 1);
  3626. break;
  3627. }
  3628. }
  3629. }
  3630. getHelpLine() {
  3631. this.d2HelpLine.ui.dirDot.visible = false;
  3632. this.isOnSameLine = false;
  3633. let startX = this.rootBall.gameObj.x;
  3634. let startY = this.rootBall.gameObj.y;
  3635. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3636. if (dis == null) {
  3637. this.d2HelpLine.ui.visible = false;
  3638. console.error("辅助线异常");
  3639. return;
  3640. }
  3641. this.d2HelpLine.ui.visible = true;
  3642. let angle = this.d2Gan.ui.rotation;
  3643. let radius = 16.5;
  3644. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3645. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3646. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3647. if (colliObj == null) {
  3648. this.getColliPos(disX, disY, radius, angle);
  3649. xGame.common.d2World.isHelpLineOnBall = false;
  3650. this.targetBall = null;
  3651. this.reflectAngle = 0;
  3652. this.showBallWrongEft();
  3653. }
  3654. else {
  3655. let target = colliObj.src;
  3656. let radius = 16.5;
  3657. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3658. dis1 = Math.sqrt(dis1);
  3659. let realDis = colliObj.disHon - dis1;
  3660. let dir = colliObj.dir;
  3661. let xx = startX + dir.x * realDis;
  3662. let yy = startY + dir.y * realDis;
  3663. this.getColliPos(xx, yy, radius, angle);
  3664. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3665. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3666. let offset = xGame.common.rodOffest;
  3667. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3668. this.isOnSameLine = true;
  3669. }
  3670. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3671. xGame.common.d2World.isHelpLineOnBall = true;
  3672. this.targetBall = target;
  3673. this.reflectAngle = reflectAngle;
  3674. this.showBallWrongEft();
  3675. if (xGame.common.longHelpLine) {
  3676. this.delayReflectLine(target, reflectAngle);
  3677. }
  3678. }
  3679. }
  3680. getBorderDot(startX, startY, angle) {
  3681. let radius = 17;
  3682. let distance;
  3683. let isDone;
  3684. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3685. isDone = this.judgeUpDown(distance, angle, startX);
  3686. if (isDone != null) {
  3687. return isDone;
  3688. }
  3689. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3690. isDone = this.judgeUpDown(distance, angle, startX);
  3691. if (isDone != null) {
  3692. return isDone;
  3693. }
  3694. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3695. isDone = this.judgeLeftRight(distance, angle, startY);
  3696. if (isDone != null) {
  3697. return isDone;
  3698. }
  3699. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3700. isDone = this.judgeLeftRight(distance, angle, startY);
  3701. if (isDone != null) {
  3702. return isDone;
  3703. }
  3704. }
  3705. judgeUpDown(distance, angle, startX) {
  3706. let flag = Math.sin(angle * Math.PI / 180);
  3707. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3708. if (distance >= 0) {
  3709. if (flag > 0) {
  3710. if (temp < this.borderRect.x + this.borderRect.width) {
  3711. return distance;
  3712. }
  3713. }
  3714. else {
  3715. if (temp > this.borderRect.x) {
  3716. return distance;
  3717. }
  3718. }
  3719. }
  3720. }
  3721. judgeLeftRight(distance, angle, starY) {
  3722. let flag = -Math.cos(angle * Math.PI / 180);
  3723. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3724. if (distance >= 0) {
  3725. if (flag > 0) {
  3726. if (temp < this.borderRect.y + this.borderRect.height) {
  3727. return distance;
  3728. }
  3729. }
  3730. else {
  3731. if (temp > this.borderRect.y) {
  3732. return distance;
  3733. }
  3734. }
  3735. }
  3736. }
  3737. clearBallAllEft() {
  3738. let temp;
  3739. for (let index = 0; index < this.ballArr.length; index++) {
  3740. temp = this.ballArr[index];
  3741. temp.clearBallEft();
  3742. }
  3743. }
  3744. showBallRightEft() {
  3745. let gameMgr = xGame.common.gameMgr;
  3746. let temp;
  3747. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3748. if (targetArr.length <= 0)
  3749. return;
  3750. for (let index = 0; index < this.ballArr.length; index++) {
  3751. temp = this.ballArr[index];
  3752. if (targetArr.indexOf(temp.number) > -1) {
  3753. temp.showRightEft();
  3754. }
  3755. }
  3756. }
  3757. showBallWrongEft() {
  3758. let gameMgr = xGame.common.gameMgr;
  3759. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3760. if (targetArr.length <= 0)
  3761. return;
  3762. let temp;
  3763. for (let index = 0; index < this.ballArr.length; index++) {
  3764. temp = this.ballArr[index];
  3765. if (this.targetBall && this.targetBall.number == temp.number) {
  3766. if (targetArr.indexOf(temp.number) <= -1) {
  3767. temp.showWrongEft();
  3768. }
  3769. else {
  3770. temp.clearBallWrongEft();
  3771. }
  3772. }
  3773. else {
  3774. temp.clearBallWrongEft();
  3775. }
  3776. }
  3777. }
  3778. getColliPos(x, y, radius, angle) {
  3779. this.d2HelpLine.ui.x = x;
  3780. this.d2HelpLine.ui.y = y;
  3781. let dirX = x - this.rootBall.gameObj.x;
  3782. let dirY = y - this.rootBall.gameObj.y;
  3783. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3784. if (rectH <= 0)
  3785. rectH = 0;
  3786. this.d2HelpLine.ui.rect.height = 0;
  3787. this.d2HelpLine.ui.rect.height = rectH;
  3788. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3789. if (rectH < this.rootBall.gameObj.width) {
  3790. this.d2HelpLine.ui.rect.visible = false;
  3791. }
  3792. else {
  3793. this.d2HelpLine.ui.rect.visible = true;
  3794. }
  3795. this.d2HelpLine.ui.dir.visible = false;
  3796. this.d2HelpLine.ui.rootDir.visible = false;
  3797. }
  3798. getReflectLine(x, y, radius, target) {
  3799. this.d2HelpLine.ui.dir.visible = true;
  3800. let dirX = target.x - x;
  3801. let dirY = target.y - y;
  3802. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3803. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3804. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3805. this.d2HelpLine.ui.dir.height = 48;
  3806. this.d2HelpLine.ui.dir.rotation = angle;
  3807. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3808. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3809. return angle;
  3810. }
  3811. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3812. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3813. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3814. let targetX = target.gameObj.x;
  3815. let targetY = target.gameObj.y;
  3816. this.outDir.setValue(targetX - xx, targetY - yy);
  3817. this.rootDir.setValue(rtX - xx, rtY - yy);
  3818. let ver = Math.PI / 2;
  3819. let sin = Math.sin(ver);
  3820. let cos = Math.cos(ver);
  3821. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3822. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3823. this.outDir.setValue(outX, outY);
  3824. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3825. Laya.Vector2.normalize(this.outDir, this.outDir);
  3826. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3827. if (Math.abs(result) <= 0.08) {
  3828. this.d2HelpLine.ui.rootDir.visible = false;
  3829. return;
  3830. }
  3831. if (result > 0) {
  3832. angle += 90;
  3833. }
  3834. else if (result < 0) {
  3835. angle -= 90;
  3836. }
  3837. this.d2HelpLine.ui.rootDir.visible = true;
  3838. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3839. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3840. this.d2HelpLine.ui.rootDir.rotation = angle;
  3841. }
  3842. delayReflectLine(obj, angle) {
  3843. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3844. return;
  3845. }
  3846. this.isOnSameLine = false;
  3847. let startX = obj.gameObj.x;
  3848. let startY = obj.gameObj.y;
  3849. let dis = this.getBorderDot(startX, startY, angle);
  3850. if (dis == null) {
  3851. this.d2HelpLine.ui.dirDot.visible = false;
  3852. return;
  3853. }
  3854. this.d2HelpLine.ui.visible = true;
  3855. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3856. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3857. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3858. if (colliObj == null) {
  3859. this.setDelayLine(disX, disY, obj, angle);
  3860. }
  3861. else {
  3862. let radius = 16;
  3863. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3864. dis1 = Math.sqrt(dis1);
  3865. let realDis = colliObj.disHon - dis1;
  3866. let dir = colliObj.dir;
  3867. let xx = startX + dir.x * realDis;
  3868. let yy = startY + dir.y * realDis;
  3869. this.setDelayLine(xx, yy, obj, angle);
  3870. }
  3871. }
  3872. setDelayLine(x, y, obj, angle) {
  3873. let dirX = x - obj.gameObj.x;
  3874. let dirY = y - obj.gameObj.y;
  3875. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3876. if (rectH <= 0)
  3877. rectH = 0;
  3878. this.d2HelpLine.ui.dir.height = rectH;
  3879. this.d2HelpLine.ui.dirDot.visible = true;
  3880. this.d2HelpLine.ui.dirDot.x = 17;
  3881. this.d2HelpLine.ui.dirDot.y = 17;
  3882. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3883. ;
  3884. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3885. }
  3886. changePlayerView() {
  3887. if (Math.random() >= 0.7)
  3888. return;
  3889. if (!this.targetBall) {
  3890. return;
  3891. }
  3892. if (!xGame.common.gameMgr.selfTurn)
  3893. return;
  3894. switch (xGame.common.gameMode) {
  3895. case GameMode.classic:
  3896. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3897. if (this.targetBall.number != 8) {
  3898. return;
  3899. }
  3900. }
  3901. break;
  3902. case GameMode.bigMove:
  3903. return;
  3904. case GameMode.placeBall:
  3905. break;
  3906. default:
  3907. break;
  3908. }
  3909. let startX = this.targetBall.gameObj.x;
  3910. let startY = this.targetBall.gameObj.y;
  3911. let angle = this.reflectAngle;
  3912. let dis = this.getBorderDot(startX, startY, angle);
  3913. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3914. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3915. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3916. if (colliObj) {
  3917. return;
  3918. }
  3919. let offset = 40;
  3920. let posObj = xGame.common.gameMgr.posObj;
  3921. let temp;
  3922. let radius;
  3923. let tarX, tarY;
  3924. for (const key in posObj) {
  3925. temp = posObj[key];
  3926. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3927. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3928. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3929. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3930. xGame.common.showOneCamera("angle" + key);
  3931. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3932. Laya.physicsTimer.scale = 0.7;
  3933. break;
  3934. }
  3935. }
  3936. }
  3937. selectBestEnterOne(arr) {
  3938. this.aiLv = xGame.tools.random(1, 11);
  3939. this.aiLv = 10;
  3940. this.wBall = xGame.common.d2World.rootBall;
  3941. this.rootPos.x = this.wBall.gameObj.x;
  3942. this.rootPos.y = this.wBall.gameObj.y;
  3943. this.initHoleBall(arr);
  3944. return this.selectBall();
  3945. }
  3946. selectBall() {
  3947. let ball = null;
  3948. this.destRot = 0;
  3949. let ai = 110 - this.aiLv * 10;
  3950. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3951. let score = false;
  3952. if (this.scoreBall.length < 1) {
  3953. if (this.lineBall.length < 1) {
  3954. for (let i = 0; i < this.kickBall.length; i++) {
  3955. let list = [];
  3956. let bo = this.kickBall[i];
  3957. let bobj = bo.gameObj;
  3958. let rect = xGame.common.d2World.borderRect;
  3959. let mobj = this.wBall.gameObj;
  3960. let minb = bobj.y - rect.y - 20;
  3961. let minw = mobj.y - rect.y - 50;
  3962. if (minb > 0 && minw > 0) {
  3963. let dlenx = 0;
  3964. let dleny = mobj.y - rect.y;
  3965. let spx = mobj.x;
  3966. let spy = rect.y - dleny;
  3967. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3968. }
  3969. minb = rect.y + rect.height - bobj.y - 20;
  3970. minw = rect.y + rect.height - mobj.y - 50;
  3971. if (minb > 0 && minw > 0) {
  3972. let dlenx = 0;
  3973. let dleny = rect.y + rect.height - mobj.y;
  3974. let spx = mobj.x;
  3975. let spy = rect.y + rect.height + dleny;
  3976. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3977. }
  3978. minb = bobj.x - rect.x - 20;
  3979. minw = mobj.x - rect.x - 50;
  3980. if (minb > 0 && minw > 0) {
  3981. let dlenx = mobj.x - rect.x;
  3982. let dleny = 0;
  3983. let spx = rect.x - dlenx;
  3984. let spy = mobj.y;
  3985. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3986. }
  3987. minb = rect.x + rect.width - bobj.x - 20;
  3988. minw = rect.x + rect.width - mobj.x - 50;
  3989. if (minb > 0 && minw > 0) {
  3990. let dlenx = rect.x + rect.width - mobj.x;
  3991. let dleny = 0;
  3992. let spx = rect.x + rect.width + dlenx;
  3993. let spy = mobj.y;
  3994. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3995. }
  3996. list.sort(function (a, b) {
  3997. return a.order - b.order;
  3998. });
  3999. for (let i = 0; i < list.length; i++) {
  4000. let data = list[i];
  4001. let mx = mobj.x - bobj.x;
  4002. let my = mobj.y - bobj.y;
  4003. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4004. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4005. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4006. if (num > 1)
  4007. num = 1;
  4008. let cos = Math.acos(num);
  4009. if (cos > 1.57)
  4010. cos = 1.57;
  4011. else if (cos < 0.01)
  4012. cos = 0.01;
  4013. let tan = Math.tan(cos);
  4014. let dx = tan * data.dleny;
  4015. let dy = tan * data.dlenx;
  4016. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4017. if (Math.abs(bx - 667) < 40)
  4018. continue;
  4019. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4020. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4021. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4022. this.forceMax = dis * 0.08;
  4023. this.destRot += mis * 0.1;
  4024. this.setKick(bx, by);
  4025. return true;
  4026. }
  4027. }
  4028. }
  4029. }
  4030. else {
  4031. ball = xGame.common.getRandArrEle(this.lineBall);
  4032. }
  4033. }
  4034. else {
  4035. for (let i = 0; i < this.scoreBall.length; i++) {
  4036. if (i < this.scoreBall.length - 1) {
  4037. let rand = 70 + this.aiLv * 10 + i * 10;
  4038. if (xGame.tools.random(0, 100) < rand) {
  4039. ball = this.scoreBall[i];
  4040. break;
  4041. }
  4042. }
  4043. else {
  4044. ball = this.scoreBall[i];
  4045. break;
  4046. }
  4047. }
  4048. score = true;
  4049. this.selectNum++;
  4050. }
  4051. if (!ball)
  4052. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4053. let dx = ball.gameObj.x;
  4054. let dy = ball.gameObj.y;
  4055. let kickAngle = 0;
  4056. if (score) {
  4057. dx = ball.kickPos.x;
  4058. dy = ball.kickPos.y;
  4059. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4060. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4061. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4062. if (adot > 1)
  4063. adot = 1;
  4064. kickAngle = Math.acos(adot) * 57.3;
  4065. if (kickAngle > 45) {
  4066. let kdx = ball.kickPos.x - ball.gameObj.x;
  4067. let kdy = ball.kickPos.y - ball.gameObj.y;
  4068. dx = ball.kickPos.x - kdx * mis * 0.3;
  4069. dy = ball.kickPos.y - kdy * mis * 0.3;
  4070. }
  4071. else
  4072. this.destRot += mis;
  4073. }
  4074. else if (ball.poleAngle != 0) {
  4075. this.destRot += ball.poleAngle;
  4076. }
  4077. if (xGame.common.gameMode == 0) {
  4078. let af = kickAngle * 0.08;
  4079. this.forceMax = ball.hard * 0.1 + af * af;
  4080. }
  4081. this.setKick(dx, dy);
  4082. return ball;
  4083. }
  4084. initHoleBall(arr) {
  4085. this.kickBall = [];
  4086. this.lineBall = [];
  4087. this.scoreBall = [];
  4088. this.holeBall = [];
  4089. this.selectNum = 0;
  4090. this.forceNum = 0;
  4091. this.forceMax = 0;
  4092. this.turnNum = 0;
  4093. let list = arr;
  4094. let holes = xGame.common.gameMgr.holePosList;
  4095. let self = xGame.common.aiPlayer;
  4096. for (let i = 0; i < list.length; i++) {
  4097. let obj = list[i];
  4098. if (!obj)
  4099. continue;
  4100. obj.kickPos.x = 0;
  4101. obj.kickPos.y = 0;
  4102. obj.poleAngle = 0;
  4103. obj.hard = 0;
  4104. obj.borderDis = 0;
  4105. obj.kickAngle = 180;
  4106. let b = obj.gameObj;
  4107. let wbp = this.rootPos;
  4108. let bx = wbp.x - b.x;
  4109. let by = wbp.y - b.y;
  4110. obj.borderDis = xGame.tools.random(0, 100);
  4111. this.kickBall.push(obj);
  4112. if (!this.isLine(wbp, obj))
  4113. continue;
  4114. obj.kickAngle = xGame.tools.random(90, 180);
  4115. obj.kickPos.x = b.x;
  4116. obj.kickPos.y = b.y;
  4117. this.lineBall.push(obj);
  4118. let minDis = 999999;
  4119. let hole = false;
  4120. for (let j = 0; j < holes.length; j++) {
  4121. let hp = holes[j];
  4122. if (bx >= 0 && hp.x > b.x + 100)
  4123. continue;
  4124. if (bx <= 0 && hp.x < b.x - 100)
  4125. continue;
  4126. if (by < -10 && hp.y < wbp.y)
  4127. continue;
  4128. if (by > 10 && hp.y > wbp.y)
  4129. continue;
  4130. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4131. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4132. if (dis < minDis) {
  4133. let dx = b.x - this.tempDir1.x * this.ballSize;
  4134. let dy = b.y - this.tempDir1.y * this.ballSize;
  4135. this.tempDir3.x = this.tempDir1.x;
  4136. this.tempDir3.y = this.tempDir1.y;
  4137. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4138. obj.kickPos.x = dx;
  4139. obj.kickPos.y = dy;
  4140. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4141. if (num > 1)
  4142. num = 1;
  4143. obj.kickAngle = Math.acos(num) * 57.3;
  4144. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4145. dis = dis * 2;
  4146. if (Math.abs(hp.x - 600) < 100)
  4147. dis += 50;
  4148. obj.hard = dis + obj.kickAngle * 3;
  4149. hole = true;
  4150. }
  4151. }
  4152. }
  4153. }
  4154. if (hole) {
  4155. this.scoreBall.push(obj);
  4156. this.holeBall.push(obj);
  4157. }
  4158. }
  4159. this.scoreBall.sort(function (a, b) {
  4160. return a.hard - b.hard;
  4161. });
  4162. this.holeBall.sort(function (a, b) {
  4163. return a.kickAngle - b.kickAngle;
  4164. });
  4165. this.kickBall.sort(function (a, b) {
  4166. return a.borderDis - b.borderDis;
  4167. });
  4168. }
  4169. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4170. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4171. let balls = xGame.common.d2World.ballArr;
  4172. let max = xGame.tools.getDis(hx, hy, bx, by);
  4173. for (let index = 0; index < balls.length; index++) {
  4174. let obj = balls[index];
  4175. if (obj.number == 0)
  4176. continue;
  4177. if (obj.number == bn || obj.number == dn)
  4178. continue;
  4179. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4180. if (dis * dis > max)
  4181. continue;
  4182. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4183. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4184. if (num > 1)
  4185. num = 1;
  4186. if (num < 0)
  4187. continue;
  4188. let gap = Math.sin(Math.acos(num)) * dis;
  4189. if (gap < this.ballSize)
  4190. return true;
  4191. }
  4192. return false;
  4193. }
  4194. isLine(xy, ball) {
  4195. let bx = xy.x;
  4196. let by = xy.y;
  4197. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4198. let dis = ball.getDestDis(xy);
  4199. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4200. let sin = Math.sin(angle);
  4201. let cos = Math.cos(angle);
  4202. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4203. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4204. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4205. let dx = bx + this.tempDir2.x * dis;
  4206. let dy = by + this.tempDir2.y * dis;
  4207. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4208. sin = Math.sin(-angle);
  4209. cos = Math.cos(-angle);
  4210. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4211. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4212. dx = bx + this.tempDir2.x * dis;
  4213. dy = by + this.tempDir2.y * dis;
  4214. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4215. if (isr && isl)
  4216. return false;
  4217. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4218. }
  4219. return true;
  4220. }
  4221. setKick(dx, dy) {
  4222. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4223. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4224. this.tempDir1.x = 0;
  4225. this.tempDir1.y = 1;
  4226. this.tempDir2.y = -this.tempDir2.y;
  4227. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4228. if (num > 1)
  4229. num = 1;
  4230. let rot = Math.acos(num) * 57.3;
  4231. if (this.tempDir2.x < 0)
  4232. rot = 360 - rot;
  4233. this.destRot += rot;
  4234. }
  4235. }
  4236. class ui_UIGame extends fgui.GComponent {
  4237. static createInstance() {
  4238. return (fgui.UIPackage.createObject("game", "UIGame"));
  4239. }
  4240. onConstruct() {
  4241. this.c1 = this.getController("c1");
  4242. this.d3Root = (this.getChild("d3Root"));
  4243. this.clickNode = (this.getChild("clickNode"));
  4244. this.d2Root = (this.getChild("d2Root"));
  4245. this.topNode = (this.getChild("topNode"));
  4246. this.n72 = (this.getChild("n72"));
  4247. this.n40 = (this.getChild("n40"));
  4248. this.rulerNode = (this.getChild("rulerNode"));
  4249. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4250. this.n50 = (this.getChild("n50"));
  4251. this.keduNode = (this.getChild("keduNode"));
  4252. this.powerTxt = (this.getChild("powerTxt"));
  4253. this.powerNode = (this.getChild("powerNode"));
  4254. this.colorNode = (this.getChild("colorNode"));
  4255. this.powerEft = (this.getChild("powerEft"));
  4256. this.myPowerNode = (this.getChild("myPowerNode"));
  4257. this.ganNode = (this.getChild("ganNode"));
  4258. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4259. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4260. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4261. this.skillRod = (this.getChild("skillRod"));
  4262. this.border = (this.getChild("border"));
  4263. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4264. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4265. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4266. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4267. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4268. this.guanyuNode = (this.getChild("guanyuNode"));
  4269. this.helpBtn = (this.getChild("helpBtn"));
  4270. this.wordsBtn = (this.getChild("wordsBtn"));
  4271. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4272. this.returnBtn = (this.getChild("returnBtn"));
  4273. this.ballNode = (this.getChild("ballNode"));
  4274. this.whiteAni = (this.getChild("whiteAni"));
  4275. this.blackAni = (this.getChild("blackAni"));
  4276. this.selfTurn = (this.getChild("selfTurn"));
  4277. this.aiTurn = (this.getChild("aiTurn"));
  4278. this.deskNode = (this.getChild("deskNode"));
  4279. this.moveNode = (this.getChild("moveNode"));
  4280. this.selfTalk = (this.getChild("selfTalk"));
  4281. this.aiTalk = (this.getChild("aiTalk"));
  4282. this.d2Node = (this.getChild("d2Node"));
  4283. this.snowNode = (this.getChild("snowNode"));
  4284. this.guide2 = (this.getChild("guide2"));
  4285. this.guide1 = (this.getChild("guide1"));
  4286. this.guide3 = (this.getChild("guide3"));
  4287. this.guideNode = (this.getChild("guideNode"));
  4288. }
  4289. }
  4290. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4291. class ui_UIGameEnd extends fgui.GComponent {
  4292. static createInstance() {
  4293. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4294. }
  4295. onConstruct() {
  4296. this.c1 = this.getController("c1");
  4297. this.n22 = (this.getChild("n22"));
  4298. this.n2 = (this.getChild("n2"));
  4299. this.n52 = (this.getChild("n52"));
  4300. this.n53 = (this.getChild("n53"));
  4301. this.coinNode = (this.getChild("coinNode"));
  4302. this.closeNode = (this.getChild("closeNode"));
  4303. this.moneyNode = (this.getChild("moneyNode"));
  4304. this.secretary = (this.getChild("secretary"));
  4305. this.n27 = (this.getChild("n27"));
  4306. this.n29 = (this.getChild("n29"));
  4307. this.talkNode = (this.getChild("talkNode"));
  4308. this.n38 = (this.getChild("n38"));
  4309. this.n39 = (this.getChild("n39"));
  4310. this.n40 = (this.getChild("n40"));
  4311. this.awardNode = (this.getChild("awardNode"));
  4312. this.starNumNode = (this.getChild("starNumNode"));
  4313. this.n47 = (this.getChild("n47"));
  4314. this.conditionNode = (this.getChild("conditionNode"));
  4315. this.isGetAward = (this.getChild("isGetAward"));
  4316. this.leftBtn = (this.getChild("leftBtn"));
  4317. this.rightBtn = (this.getChild("rightBtn"));
  4318. this.btnNode = (this.getChild("btnNode"));
  4319. }
  4320. }
  4321. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4322. class ui_UIAddCoin extends fgui.GComponent {
  4323. static createInstance() {
  4324. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4325. }
  4326. onConstruct() {
  4327. this.n11 = (this.getChild("n11"));
  4328. this.myNode = (this.getChild("myNode"));
  4329. this.t0 = this.getTransition("t0");
  4330. }
  4331. }
  4332. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4333. class UIAddCoin extends UIBase {
  4334. constructor() {
  4335. super();
  4336. this.coinNum = 2000;
  4337. }
  4338. onConstructor() {
  4339. this.ui = ui_UIAddCoin.createInstance();
  4340. this.contentPane = this.ui;
  4341. this.isEject = false;
  4342. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4343. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4344. }
  4345. show() {
  4346. super.show();
  4347. this.ui.t0.play();
  4348. }
  4349. videoAddCoin() {
  4350. console.log('zh:qjff_AD_for_UIAddCoin');
  4351. if (Laya.Browser.onAndroid) {
  4352. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4353. if (!boo) {
  4354. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4355. return;
  4356. }
  4357. }
  4358. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4359. }
  4360. else {
  4361. console.log('zh:AD 失败,直接发放奖励');
  4362. this.qjff_AD_for_UIAddCoin();
  4363. }
  4364. }
  4365. qjff_AD_for_UIAddCoin() {
  4366. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4367. this.hide();
  4368. }
  4369. }
  4370. UIAddCoin.uiName = "UIAddCoin";
  4371. class ui_UIInvitation extends fgui.GComponent {
  4372. static createInstance() {
  4373. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4374. }
  4375. onConstruct() {
  4376. this.n14 = (this.getChild("n14"));
  4377. this.myNode = (this.getChild("myNode"));
  4378. this.t0 = this.getTransition("t0");
  4379. }
  4380. }
  4381. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4382. class UIInvitation extends UIBase {
  4383. constructor() {
  4384. super();
  4385. }
  4386. onConstructor() {
  4387. this.ui = ui_UIInvitation.createInstance();
  4388. this.contentPane = this.ui;
  4389. this.isEject = false;
  4390. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4391. }
  4392. show() {
  4393. super.show();
  4394. }
  4395. enterGame() {
  4396. xGame.common.gameMode = GameMode.classic;
  4397. DataMgr.setChallengeTimes(1);
  4398. xGame.common.passAwardCoin = 2000;
  4399. let need = xGame.common.classicNiceNeddCoin;
  4400. if (DataMgr.coinEnough(need)) {
  4401. DataMgr.setCoin(-need);
  4402. xGame.eventMgr.event(RESTART_GAME, true);
  4403. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4404. }
  4405. else {
  4406. xGame.eventMgr.event(RESTART_GAME, true);
  4407. }
  4408. this.hide();
  4409. }
  4410. hide() {
  4411. super.hide();
  4412. }
  4413. }
  4414. UIInvitation.uiName = "UIInvitation";
  4415. class ui_UIMain extends fgui.GComponent {
  4416. static createInstance() {
  4417. return (fgui.UIPackage.createObject("game", "UIMain"));
  4418. }
  4419. onConstruct() {
  4420. this.n47 = (this.getChild("n47"));
  4421. this.n10 = (this.getChild("n10"));
  4422. this.secretary = (this.getChild("secretary"));
  4423. this.shopBtn = (this.getChild("shopBtn"));
  4424. this.moneyNode = (this.getChild("moneyNode"));
  4425. this.headNode = (this.getChild("headNode"));
  4426. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4427. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4428. this.classicBtn = (this.getChild("classicBtn"));
  4429. this.globalBtn = (this.getChild("globalBtn"));
  4430. this.n44 = (this.getChild("n44"));
  4431. this.signBtn = (this.getChild("signBtn"));
  4432. this.drawBtn = (this.getChild("drawBtn"));
  4433. this.settingNode = (this.getChild("settingNode"));
  4434. this.n_fuli = (this.getChild("n_fuli"));
  4435. this.n45 = (this.getChild("n45"));
  4436. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4437. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4438. this.rankBtn = (this.getChild("rankBtn"));
  4439. this.n46 = (this.getChild("n46"));
  4440. this.liucheng1 = (this.getChild("liucheng1"));
  4441. this.rightBtn = (this.getChild("rightBtn"));
  4442. this.n75 = (this.getChild("n75"));
  4443. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4444. this.liucheng2 = (this.getChild("liucheng2"));
  4445. this.guideBtn = (this.getChild("guideBtn"));
  4446. this.n73 = (this.getChild("n73"));
  4447. this.wordsNode = (this.getChild("wordsNode"));
  4448. this.enterGuide = (this.getChild("enterGuide"));
  4449. this.talkNode = (this.getChild("talkNode"));
  4450. this.n83 = (this.getChild("n83"));
  4451. this.n84 = (this.getChild("n84"));
  4452. this.n_Logout = (this.getChild("n_Logout"));
  4453. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4454. this.n_dengLu = (this.getChild("n_dengLu"));
  4455. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4456. }
  4457. }
  4458. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4459. class ui_UIMoyu extends fgui.GComponent {
  4460. static createInstance() {
  4461. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4462. }
  4463. onConstruct() {
  4464. this.ageTip = (this.getChild("ageTip"));
  4465. this.mainBg = (this.getChild("mainBg"));
  4466. this.xyNode = (this.getChild("xyNode"));
  4467. this.rnNode = (this.getChild("rnNode"));
  4468. this.fcmNode = (this.getChild("fcmNode"));
  4469. this.ageNode = (this.getChild("ageNode"));
  4470. this.tipNode = (this.getChild("tipNode"));
  4471. this.msgNode = (this.getChild("msgNode"));
  4472. }
  4473. }
  4474. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4475. class MoyuMgr {
  4476. static initMoyu() {
  4477. this.moyuView = new MoyuView();
  4478. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4479. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4480. this.moyuView.ui.displayObject.zOrder = 1000;
  4481. this.moyuView.init();
  4482. this.moyuView.showTip(true);
  4483. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4484. window['XApk'] = this;
  4485. }
  4486. static showAge(show) {
  4487. if (this.moyuView)
  4488. this.moyuView.showAge(show);
  4489. }
  4490. static onPlatMsg(idx) {
  4491. if (!MoyuMgr.moyuView)
  4492. return;
  4493. if (idx == '0') {
  4494. MoyuMgr.moyuView.showTip(false);
  4495. }
  4496. }
  4497. static showAgree(call) {
  4498. if (this.moyuView)
  4499. this.moyuView.showAgree(call);
  4500. else
  4501. call && call();
  4502. }
  4503. static showXy(type = 1) {
  4504. if (this.moyuView)
  4505. this.moyuView.showXy(type);
  4506. }
  4507. }
  4508. MoyuMgr.isAdvise = false;
  4509. class MoyuView {
  4510. constructor() {
  4511. this.ysxyNum = 1;
  4512. this.ysJson = null;
  4513. this.ui = ui_UIMoyu.createInstance();
  4514. }
  4515. init() {
  4516. this.ui.mainBg.visible = false;
  4517. this.ui.xyNode.visible = false;
  4518. this.ui.ageNode.visible = false;
  4519. this.ui.tipNode.visible = false;
  4520. this.ui.rnNode.visible = false;
  4521. this.ui.fcmNode.visible = false;
  4522. this.ui.ageTip.visible = false;
  4523. this.ui.msgNode.visible = false;
  4524. this.ui.visible = false;
  4525. this.ui.xyNode.xyList.setVirtual();
  4526. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4527. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4528. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4529. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4530. this.ui.xyNode.btnKnown.visible = false;
  4531. this.ui.xyNode.xy1.visible = false;
  4532. this.ui.xyNode.xy2.visible = false;
  4533. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4534. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4535. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4536. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4537. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4538. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4539. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4540. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4541. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4542. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4543. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4544. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4545. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4546. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4547. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4548. this.ysxyNum = 2;
  4549. }
  4550. }
  4551. onClick(obj) {
  4552. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4553. switch (obj) {
  4554. case this.ui.ageTip:
  4555. if (Moyu.isTTApk) {
  4556. this.ui.ageNode.visible = true;
  4557. this.ui.mainBg.visible = true;
  4558. }
  4559. break;
  4560. case this.ui.tipNode:
  4561. this.showTip(false);
  4562. break;
  4563. case this.ui.ageNode.btnAge:
  4564. this.ui.ageNode.visible = false;
  4565. this.ui.mainBg.visible = false;
  4566. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4567. this.ui.visible = false;
  4568. break;
  4569. case this.ui.xyNode.btnXy3:
  4570. case this.ui.xyNode.btnXy1:
  4571. this.loadXy(1);
  4572. break;
  4573. case this.ui.xyNode.btnXy2:
  4574. this.loadXy(2);
  4575. break;
  4576. case this.ui.xyNode.btnBack:
  4577. this.ui.xyNode.xy1.visible = true;
  4578. this.ui.xyNode.xy2.visible = false;
  4579. break;
  4580. case this.ui.xyNode.btnKnown:
  4581. this.ui.xyNode.visible = false;
  4582. this.ui.mainBg.visible = false;
  4583. this.ui.visible = false;
  4584. break;
  4585. case this.ui.rnNode.btnCheck:
  4586. this.check();
  4587. break;
  4588. case this.ui.rnNode.btnExit:
  4589. case this.ui.xyNode.btnNo:
  4590. this.ysxyNum--;
  4591. if (this.ysxyNum > 0)
  4592. this.showMsg("Refuse to quit the game once again");
  4593. else {
  4594. Moyu.userAgree(false);
  4595. Moyu.exit();
  4596. }
  4597. break;
  4598. case this.ui.xyNode.btnSure:
  4599. case this.ui.xyNode.btnYes:
  4600. DataMgr.userData.isAgree = true;
  4601. DataMgr.saveUserData();
  4602. this.onAgree();
  4603. break;
  4604. case this.ui.rnNode.btnDone:
  4605. this.ui.rnNode.visible = false;
  4606. this.ui.visible = false;
  4607. break;
  4608. case this.ui.fcmNode.btnRn:
  4609. this.showRn();
  4610. break;
  4611. }
  4612. }
  4613. showTip(show) {
  4614. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4615. return;
  4616. if (show) {
  4617. MoyuMgr.isAdvise = true;
  4618. this.ui.visible = true;
  4619. this.ui.tipNode.visible = true;
  4620. this.ui.tipNode.alpha = 1;
  4621. Laya.timer.once(1000, this, this.showTip, [false]);
  4622. }
  4623. else {
  4624. this.ui.tipNode.alpha = 1;
  4625. this.ui.tipNode.visible = true;
  4626. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4627. this.ui.tipNode.visible = false;
  4628. MoyuMgr.isAdvise = false;
  4629. }), 1000);
  4630. }
  4631. }
  4632. showAge(show, px = 0, py = 0) {
  4633. if (Moyu.platType > 10 && !Moyu.isIos) {
  4634. this.ui.ageTip.x = px;
  4635. this.ui.ageTip.y = py;
  4636. this.ui.ageTip.visible = show;
  4637. if (show)
  4638. this.ui.visible = true;
  4639. }
  4640. }
  4641. showAgree(call) {
  4642. this.agreeCall = call;
  4643. this.onAgree();
  4644. return;
  4645. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4646. this.showXy(0);
  4647. }
  4648. else
  4649. this.onAgree();
  4650. }
  4651. onAgree() {
  4652. if (!this.ui.ageNode.visible)
  4653. this.ui.visible = false;
  4654. this.ui.xyNode.visible = false;
  4655. Moyu.userAgree(true);
  4656. this.showAge(false);
  4657. this.agreeCall && this.agreeCall();
  4658. this.showRn();
  4659. }
  4660. showMsg(txt) {
  4661. this.ui.msgNode.txtMsg.text = txt;
  4662. this.ui.msgNode.visible = true;
  4663. this.ui.msgNode.alpha = 1;
  4664. this.ui.visible = true;
  4665. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4666. this.ui.msgNode.visible = false;
  4667. }), 2500, true);
  4668. }
  4669. showRn() {
  4670. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4671. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4672. this.ui.rnNode.rn1.visible = true;
  4673. this.ui.rnNode.rn2.visible = false;
  4674. this.ui.rnNode.rn3.visible = false;
  4675. this.ui.rnNode.rn4.visible = false;
  4676. this.ui.rnNode.visible = true;
  4677. this.ui.mainBg.visible = true;
  4678. this.ui.rnNode.btnDone.visible = false;
  4679. this.ui.rnNode.btnExit.visible = true;
  4680. this.ui.rnNode.btnCheck.visible = true;
  4681. this.ui.fcmNode.visible = false;
  4682. this.ui.visible = true;
  4683. return;
  4684. }
  4685. }
  4686. this.showFcm();
  4687. }
  4688. showFcm() {
  4689. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4690. Moyu.initFCM(true);
  4691. if (Moyu.gameTime < 1)
  4692. this.fcmLoop();
  4693. else if (Moyu.gameTime < 999)
  4694. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4695. }
  4696. }
  4697. fcmLoop() {
  4698. if (Moyu.gameTime < 1) {
  4699. this.ui.rnNode.visible = false;
  4700. this.ui.fcmNode.visible = true;
  4701. this.ui.mainBg.visible = true;
  4702. this.ui.visible = true;
  4703. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4704. Laya.timer.clear(this.ui, this.fcmLoop);
  4705. }
  4706. }
  4707. check() {
  4708. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4709. this.ui.rnNode.rn1.visible = false;
  4710. this.ui.rnNode.rn2.visible = false;
  4711. this.ui.rnNode.rn4.visible = true;
  4712. }
  4713. else if (this.ui.rnNode.rn4.visible) {
  4714. let name = this.ui.rnNode.inputName.text;
  4715. let code = this.ui.rnNode.inputCode.text;
  4716. if (code && code.length == 18) {
  4717. this.ui.rnNode.rn1.visible = false;
  4718. this.ui.rnNode.rn4.visible = false;
  4719. Moyu.authenticate(name, code, (res) => {
  4720. this.ui.rnNode.rn2.visible = !res;
  4721. this.ui.rnNode.rn3.visible = res;
  4722. this.ui.rnNode.btnDone.visible = res;
  4723. this.ui.rnNode.btnExit.visible = !res;
  4724. this.ui.rnNode.btnCheck.visible = !res;
  4725. if (res)
  4726. this.showFcm();
  4727. });
  4728. }
  4729. else
  4730. this.showMsg("信息填写不完整");
  4731. }
  4732. }
  4733. loadXy(type = 0) {
  4734. this.ui.xyNode.xy1.visible = false;
  4735. this.ui.xyNode.xy2.visible = true;
  4736. this.ui.xyNode.xyList.scrollToView(0);
  4737. if (type == 1) {
  4738. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4739. }
  4740. else if (type == 2) {
  4741. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4742. }
  4743. }
  4744. showXy(type = 0) {
  4745. this.xyBtn();
  4746. if (type == 0) {
  4747. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4748. this.ui.xyNode.btnSure.visible = true;
  4749. }
  4750. else {
  4751. this.ui.xyNode.btnYes.visible = true;
  4752. this.ui.xyNode.btnNo.visible = true;
  4753. }
  4754. }
  4755. else {
  4756. this.ui.xyNode.btnKnown.visible = true;
  4757. this.ui.mainBg.visible = true;
  4758. }
  4759. this.ui.xyNode.xy1.visible = true;
  4760. this.ui.xyNode.xy2.visible = false;
  4761. this.ui.xyNode.visible = true;
  4762. this.ui.visible = true;
  4763. }
  4764. xyBtn() {
  4765. this.ui.xyNode.btnSure.visible = false;
  4766. this.ui.xyNode.btnYes.visible = false;
  4767. this.ui.xyNode.btnNo.visible = false;
  4768. this.ui.xyNode.btnKnown.visible = false;
  4769. {
  4770. this.ui.xyNode.btnXy3.visible = false;
  4771. this.ui.xyNode.btnXy2.visible = true;
  4772. this.ui.xyNode.btnXy1.visible = true;
  4773. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4774. }
  4775. }
  4776. createXY(json) {
  4777. this.ysJson = json.content;
  4778. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4779. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4780. this.ui.xyNode.xy2.visible = true;
  4781. }
  4782. renderListItem(idx, cell) {
  4783. let xy = this.ysJson[idx];
  4784. cell.height = xy.line * 30;
  4785. cell.xyItem.text = xy.text;
  4786. }
  4787. onDestroy() {
  4788. this.agreeCall = null;
  4789. }
  4790. }
  4791. class SettingNode {
  4792. constructor(ui) {
  4793. this.showSetting = false;
  4794. this.openSound = true;
  4795. this.openShake = true;
  4796. this.ui = ui;
  4797. this.ui.soundBtn.onClick(this, this.switchSound);
  4798. this.ui.shakeBtn.onClick(this, this.switchShake);
  4799. this.ui.xyBtn.onClick(this, this.onXy);
  4800. this.ui.clickNode.onClick(this, this.changeSetting);
  4801. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4802. this.ui.xyBtn.visible = false;
  4803. this.ui.shakeBtn.visible = false;
  4804. }
  4805. changeSetting() {
  4806. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4807. this.showSetting = !this.showSetting;
  4808. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4809. }
  4810. switchSound() {
  4811. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4812. this.openSound = !this.openSound;
  4813. Moyu.onSetting(this.openSound, this.openShake);
  4814. xGame.soundMgr.onSetting(this.openSound);
  4815. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4816. }
  4817. switchShake() {
  4818. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4819. this.openShake = !this.openShake;
  4820. Moyu.onSetting(this.openSound, this.openShake);
  4821. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4822. }
  4823. onXy() {
  4824. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4825. MoyuMgr.showXy(1);
  4826. }
  4827. }
  4828. class ui_UILevelDisplay extends fgui.GComponent {
  4829. static createInstance() {
  4830. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4831. }
  4832. onConstruct() {
  4833. this.n9 = (this.getChild("n9"));
  4834. this.myNode = (this.getChild("myNode"));
  4835. this.closeNode = (this.getChild("closeNode"));
  4836. }
  4837. }
  4838. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4839. class ui_UILevelProp extends fgui.GComponent {
  4840. static createInstance() {
  4841. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4842. }
  4843. onConstruct() {
  4844. this.n16 = (this.getChild("n16"));
  4845. this.myNode = (this.getChild("myNode"));
  4846. this.closeBtn = (this.getChild("closeBtn"));
  4847. this.moneyNode = (this.getChild("moneyNode"));
  4848. this.t1 = this.getTransition("t1");
  4849. }
  4850. }
  4851. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4852. class ui_ShowItem extends fgui.GComponent {
  4853. static createInstance() {
  4854. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4855. }
  4856. onConstruct() {
  4857. this.myImg = (this.getChild("myImg"));
  4858. }
  4859. }
  4860. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4861. class ShowItem {
  4862. constructor() {
  4863. this.ui = ui_ShowItem.createInstance();
  4864. }
  4865. destroySelf() {
  4866. if (!this.ui.isDisposed) {
  4867. this.ui.removeFromParent();
  4868. this.ui.dispose();
  4869. }
  4870. }
  4871. setParent(parent) {
  4872. parent.addChild(this.ui);
  4873. }
  4874. setPos(x, y) {
  4875. this.ui.x = x;
  4876. this.ui.y = y;
  4877. }
  4878. setUrl(index) {
  4879. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4880. }
  4881. }
  4882. class ui_UIPower extends fgui.GComponent {
  4883. static createInstance() {
  4884. return (fgui.UIPackage.createObject("game", "UIPower"));
  4885. }
  4886. onConstruct() {
  4887. this.n11 = (this.getChild("n11"));
  4888. this.myNode = (this.getChild("myNode"));
  4889. this.t0 = this.getTransition("t0");
  4890. }
  4891. }
  4892. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4893. class UIPower extends UIBase {
  4894. constructor() {
  4895. super();
  4896. }
  4897. onConstructor() {
  4898. this.ui = ui_UIPower.createInstance();
  4899. this.contentPane = this.ui;
  4900. this.isEject = false;
  4901. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4902. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4903. }
  4904. show() {
  4905. super.show();
  4906. this.ui.t0.play();
  4907. }
  4908. videoGetPower() {
  4909. console.log('zh:qjff_AD_for_uipower');
  4910. if (Laya.Browser.onAndroid) {
  4911. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4912. if (!boo) {
  4913. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4914. return;
  4915. }
  4916. }
  4917. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4918. }
  4919. else {
  4920. console.log('zh:AD 失败,直接发放奖励');
  4921. this.qjff_AD_for_uipower();
  4922. }
  4923. }
  4924. qjff_AD_for_uipower() {
  4925. DataMgr.setPower(xGame.common.videoPower, true);
  4926. xGame.eventMgr.event(POWER_TIME);
  4927. this.hide();
  4928. }
  4929. }
  4930. UIPower.uiName = "UIPower";
  4931. class LocalStorageManager {
  4932. test1() {
  4933. LocalStorageManager.setItem("playerName", "Tom");
  4934. LocalStorageManager.setItem("playerLevel", 5);
  4935. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4936. const name = LocalStorageManager.getItem("playerName");
  4937. const level = LocalStorageManager.getItem("playerLevel");
  4938. const data = LocalStorageManager.getItem("playerData");
  4939. console.log(name);
  4940. console.log(level);
  4941. console.log(data);
  4942. LocalStorageManager.removeItem("playerLevel");
  4943. }
  4944. static setItem(key, value) {
  4945. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4946. }
  4947. static getItem(key) {
  4948. const data = Laya.LocalStorage.getItem(key);
  4949. if (data === null)
  4950. return null;
  4951. try {
  4952. return JSON.parse(data);
  4953. }
  4954. catch (e) {
  4955. return data;
  4956. }
  4957. }
  4958. static removeItem(key) {
  4959. Laya.LocalStorage.removeItem(key);
  4960. }
  4961. static clear() {
  4962. Laya.LocalStorage.clear();
  4963. }
  4964. static hasJosnKey(key) {
  4965. var value = Laya.LocalStorage.getJSON(key);
  4966. if (value != null) {
  4967. return true;
  4968. }
  4969. else {
  4970. return false;
  4971. }
  4972. }
  4973. static hasKey(key) {
  4974. return Laya.LocalStorage.getItem(key) !== null;
  4975. }
  4976. }
  4977. class UILevelProp extends UIBase {
  4978. constructor() {
  4979. super();
  4980. this.firstPos = 385;
  4981. this.secondPos = 467;
  4982. this.showItemArr = [];
  4983. }
  4984. onFontLoaded() {
  4985. try {
  4986. this.ui.myNode.conditionTxt.font = "arial";
  4987. console.log("zh: onFontLoaded 设置arial字体成功");
  4988. }
  4989. catch (error) {
  4990. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4991. }
  4992. }
  4993. onConstructor() {
  4994. this.ui = ui_UILevelProp.createInstance();
  4995. this.contentPane = this.ui;
  4996. this.isEject = false;
  4997. this.addUIClick(this.ui.closeBtn, this.hide);
  4998. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4999. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5000. }
  5001. show(level) {
  5002. super.show();
  5003. this.ui.t1.play();
  5004. this.level = level;
  5005. this.data = cfgTable.placeballData[this.level];
  5006. this.updateSelf();
  5007. this.showPreView();
  5008. this.moneyNode.ui.c1.selectedIndex = 2;
  5009. this.moneyNode.checkPowerTime();
  5010. this.moneyNode.powerChange();
  5011. }
  5012. showPreView() {
  5013. let item;
  5014. let data;
  5015. for (let index = 0; index < this.showItemArr.length; index++) {
  5016. item = this.showItemArr[index];
  5017. item.destroySelf();
  5018. }
  5019. this.showItemArr = [];
  5020. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5021. for (const key in cfgData) {
  5022. data = cfgData[key];
  5023. item = new ShowItem();
  5024. item.setParent(this.ui.myNode.displayRoot);
  5025. item.setPos(data.x, data.y);
  5026. item.setUrl(data.value);
  5027. this.showItemArr.push(item);
  5028. }
  5029. }
  5030. updateSelf() {
  5031. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5032. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5033. if (this.data.ball == -1) {
  5034. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5035. }
  5036. else {
  5037. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5038. }
  5039. let localData = DataMgr.getPlaceBallLevel(this.level);
  5040. let getAward = localData.getAward;
  5041. let cfg = cfgTable.placeballData[this.level];
  5042. let coin = this.data.award[0];
  5043. let diamond = this.data.award[1];
  5044. if (cfg.type == PlaceBallType.challenge) {
  5045. diamond = 0;
  5046. coin = 100;
  5047. }
  5048. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5049. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5050. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5051. if (cfg.type == PlaceBallType.challenge) {
  5052. this.ui.myNode.coinNode.numTxt.text = "";
  5053. }
  5054. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5055. if (coin > 0 && diamond > 0) {
  5056. this.ui.myNode.diamondNode.x = 385;
  5057. this.ui.myNode.coinNode.x = 467;
  5058. }
  5059. else {
  5060. this.ui.myNode.diamondNode.x = 385;
  5061. this.ui.myNode.coinNode.x = 385;
  5062. }
  5063. if (!getAward) {
  5064. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5065. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5066. }
  5067. else {
  5068. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5069. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5070. }
  5071. }
  5072. startGame() {
  5073. if (DataMgr.powerEnough()) {
  5074. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5075. this.ui.myNode.startBtn.touchable = false;
  5076. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5077. console.log('zh:startGame ');
  5078. this.ui.myNode.startBtn.touchable = true;
  5079. DataMgr.setPower(-1);
  5080. xGame.eventMgr.event(POWER_TIME);
  5081. xGame.common.gameMode = GameMode.placeBall;
  5082. xGame.common.placeBallCurLevel = this.level;
  5083. xGame.uiMgr.Show(UIGame);
  5084. this.logEventForChallenge_level_start(this.level);
  5085. xGame.uiMgr.Hide(UILevelDisplay);
  5086. xGame.uiMgr.Hide(UIMain);
  5087. this.hide();
  5088. }));
  5089. }
  5090. else {
  5091. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5092. xGame.uiMgr.Show(UIPower);
  5093. }
  5094. }
  5095. logEventForChallenge_level_start(level) {
  5096. let keyStr = 'sjmd_challenge_level_start';
  5097. let jsonStr = {
  5098. "count": 1,
  5099. "gold_balance ": DataMgr.getCoin(),
  5100. "level": level,
  5101. "diamond_balance ": DataMgr.getDiamond()
  5102. };
  5103. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5104. const d = LocalStorageManager.getItem(keyStr);
  5105. if (level > d.level) {
  5106. jsonStr.count = d.count + 1;
  5107. LocalStorageManager.setItem(keyStr, jsonStr);
  5108. }
  5109. else {
  5110. }
  5111. }
  5112. else {
  5113. LocalStorageManager.setItem(keyStr, jsonStr);
  5114. }
  5115. const reqStr = JSON.stringify(jsonStr);
  5116. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5117. }
  5118. hide() {
  5119. super.hide();
  5120. }
  5121. }
  5122. UILevelProp.uiName = "UILevelProp";
  5123. class PutBallLevelDisplay {
  5124. constructor(ui, index) {
  5125. this.index = 0;
  5126. this.ui = ui;
  5127. this.index = index;
  5128. this.ui.onClick(this, this.clickSelf);
  5129. this.updateSelf();
  5130. this.ui.levelTxt.text = (this.index + 1) + "";
  5131. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5132. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5133. }
  5134. updateSelf() {
  5135. let level = this.index + 1;
  5136. this.data = DataMgr.getPlaceBallLevel(level);
  5137. this.ui.starNode.c1.selectedIndex = this.data.star;
  5138. let isChallenge = cfgTable.placeballData[level].type;
  5139. if (this.data.isCur) {
  5140. if (isChallenge) {
  5141. this.ui.c1.selectedIndex = 5;
  5142. }
  5143. else {
  5144. this.ui.c1.selectedIndex = 2;
  5145. }
  5146. }
  5147. else {
  5148. if (this.data.play) {
  5149. if (this.data.star == 3) {
  5150. this.ui.c1.selectedIndex = 0;
  5151. }
  5152. else {
  5153. this.ui.c1.selectedIndex = 1;
  5154. }
  5155. }
  5156. else {
  5157. if (isChallenge) {
  5158. this.ui.c1.selectedIndex = 4;
  5159. }
  5160. else {
  5161. this.ui.c1.selectedIndex = 3;
  5162. }
  5163. }
  5164. }
  5165. }
  5166. clickSelf() {
  5167. if (!this.data.play)
  5168. return;
  5169. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5170. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5171. }
  5172. }
  5173. class UILevelDisplay extends UIBase {
  5174. constructor() {
  5175. super();
  5176. }
  5177. onConstructor() {
  5178. this.ui = ui_UILevelDisplay.createInstance();
  5179. this.contentPane = this.ui;
  5180. this.isEject = false;
  5181. this.myList = this.ui.myNode.myList;
  5182. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5183. this.levelItemArr = [];
  5184. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5185. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5186. this.myList.numItems = levelNum;
  5187. if (Moyu.isKs)
  5188. this.ui.closeNode.closeBtn.x += 100;
  5189. }
  5190. levelItemRender(index, target) {
  5191. let item = new PutBallLevelDisplay(target, index);
  5192. this.levelItemArr.push(item);
  5193. }
  5194. show() {
  5195. super.show();
  5196. this.updateLevel();
  5197. this.scrollToPlace();
  5198. }
  5199. updateLevel() {
  5200. let temp;
  5201. for (let index = 0; index < this.levelItemArr.length; index++) {
  5202. temp = this.levelItemArr[index];
  5203. temp.updateSelf();
  5204. }
  5205. }
  5206. scrollToPlace() {
  5207. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5208. let passArr = DataMgr.getPlaceBallLevelList();
  5209. let offest = passArr.length;
  5210. if (offest >= maxNum - 1)
  5211. offest = maxNum - 1;
  5212. this.myList.scrollToView(offest, true, true);
  5213. }
  5214. hide() {
  5215. super.hide();
  5216. }
  5217. }
  5218. UILevelDisplay.uiName = "UILevelDisplay";
  5219. class ui_UIMatching extends fgui.GComponent {
  5220. static createInstance() {
  5221. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5222. }
  5223. onConstruct() {
  5224. this.n5 = (this.getChild("n5"));
  5225. this.n49 = (this.getChild("n49"));
  5226. this.n51 = (this.getChild("n51"));
  5227. this.n64 = (this.getChild("n64"));
  5228. this.n2 = (this.getChild("n2"));
  5229. this.n53 = (this.getChild("n53"));
  5230. this.n54 = (this.getChild("n54"));
  5231. this.n56 = (this.getChild("n56"));
  5232. this.n58 = (this.getChild("n58"));
  5233. this.n59 = (this.getChild("n59"));
  5234. this.n57 = (this.getChild("n57"));
  5235. this.n60 = (this.getChild("n60"));
  5236. this.n62 = (this.getChild("n62"));
  5237. this.awardTxt = (this.getChild("awardTxt"));
  5238. this.n61 = (this.getChild("n61"));
  5239. this.selfHead = (this.getChild("selfHead"));
  5240. this.aiHead = (this.getChild("aiHead"));
  5241. this.n82 = (this.getChild("n82"));
  5242. this.n84 = (this.getChild("n84"));
  5243. this.n83 = (this.getChild("n83"));
  5244. this.t1 = this.getTransition("t1");
  5245. this.t2 = this.getTransition("t2");
  5246. this.t3 = this.getTransition("t3");
  5247. this.t4 = this.getTransition("t4");
  5248. }
  5249. }
  5250. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5251. class UIMatching extends UIBase {
  5252. constructor() {
  5253. super();
  5254. }
  5255. onConstructor() {
  5256. this.ui = ui_UIMatching.createInstance();
  5257. this.contentPane = this.ui;
  5258. this.isEject = false;
  5259. }
  5260. show(callback) {
  5261. super.show();
  5262. PlatMgr.showBanner(true);
  5263. this.callback = callback;
  5264. let user = Moyu.getUserInfo();
  5265. if (!this.selfPot) {
  5266. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5267. }
  5268. if (!this.aiPot) {
  5269. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5270. }
  5271. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5272. this.ui.selfHead.nameTxt.text = user.nickName;
  5273. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5274. this.ui.aiHead.nameTxt.text = "???";
  5275. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5276. this.ui.selfHead.c1.selectedIndex = 0;
  5277. this.ui.aiHead.c1.selectedIndex = 0;
  5278. this.ui.selfHead.x = this.selfPot.x;
  5279. this.ui.selfHead.y = this.selfPot.y;
  5280. this.ui.aiHead.x = this.aiPot.x;
  5281. this.ui.aiHead.y = this.aiPot.y;
  5282. switch (xGame.common.gameMode) {
  5283. case GameMode.classic:
  5284. break;
  5285. case GameMode.bigMove:
  5286. this.initSkillData();
  5287. break;
  5288. default:
  5289. break;
  5290. }
  5291. this.ui.t1.play(Laya.Handler.create(this, () => {
  5292. this.ui.t2.play(Laya.Handler.create(this, () => {
  5293. switch (xGame.common.gameMode) {
  5294. case GameMode.classic:
  5295. this.waitingPeople();
  5296. break;
  5297. case GameMode.bigMove:
  5298. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5299. break;
  5300. default:
  5301. break;
  5302. }
  5303. }));
  5304. }));
  5305. }
  5306. initSkillData() {
  5307. this.skillSelectData = [];
  5308. let skillUrl = xGame.common.skillIconList;
  5309. let skillName = xGame.common.skillNameList;
  5310. let skillLevel = DataMgr.getBigSkillList();
  5311. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5312. for (let index = 0; index < 5; index++) {
  5313. let obj = {};
  5314. obj.skillImg = skillUrl[index];
  5315. obj.skillName = skillName[index];
  5316. obj.skillType = skillType[index];
  5317. obj.skillLevel = skillLevel[index];
  5318. this.skillSelectData.push(obj);
  5319. }
  5320. }
  5321. getAISkillLevel(myLevel) {
  5322. let video = xGame.common.upSkillLevel;
  5323. let aiLevel;
  5324. let temp;
  5325. if (video) {
  5326. temp = xGame.common.randomNum(-2, -1);
  5327. }
  5328. else {
  5329. if (myLevel <= 5) {
  5330. temp = xGame.common.randomNum(1, 3);
  5331. }
  5332. else if (myLevel <= 9) {
  5333. temp = xGame.common.randomNum(-2, 1);
  5334. }
  5335. else {
  5336. temp = xGame.common.randomNum(-4, 0);
  5337. }
  5338. }
  5339. aiLevel = temp + myLevel;
  5340. if (aiLevel <= 1)
  5341. aiLevel = 1;
  5342. if (aiLevel >= 10)
  5343. aiLevel = 10;
  5344. return aiLevel;
  5345. }
  5346. getAISkillType() {
  5347. return xGame.common.randomNum(1, 4);
  5348. let successTimes = DataMgr.getSkillSuccessTimes();
  5349. let info = cfgTable.aiskillData[successTimes];
  5350. if (!info) {
  5351. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5352. info = cfgTable.aiskillData[max];
  5353. }
  5354. let dataArr = info.skillselect;
  5355. let myCfg = {};
  5356. for (let index = 0; index < dataArr.length; index++) {
  5357. let temp = dataArr[index].split('-');
  5358. myCfg[temp[0]] = {};
  5359. myCfg[temp[0]].id = parseInt(temp[0]);
  5360. myCfg[temp[0]].weight = parseInt(temp[1]);
  5361. }
  5362. let aiCfg = xGame.common.initWeight(myCfg);
  5363. let curData = xGame.common.getRandomWeightData(aiCfg);
  5364. return parseInt(curData.id);
  5365. }
  5366. getAISkillData(index) {
  5367. let myLevel = this.skillSelectData[index].skillLevel;
  5368. let aiLevel = this.getAISkillLevel(myLevel);
  5369. let aiType = this.getAISkillType() - 1;
  5370. return { aiLevel, aiType } = { aiLevel, aiType };
  5371. }
  5372. skillSelectFinish(index) {
  5373. let aiInfo = this.getAISkillData(index);
  5374. xGame.common.gameMgr.selfCurSkill = index;
  5375. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5376. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5377. this.ui.selfHead.c1.selectedIndex = 1;
  5378. this.ui.aiHead.c1.selectedIndex = 1;
  5379. let myData = this.skillSelectData[index];
  5380. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5381. let guide = DataMgr.getSkillGuide();
  5382. if (guide == 0) {
  5383. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5384. }
  5385. else {
  5386. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5387. }
  5388. let aiData = this.skillSelectData[aiInfo.aiType];
  5389. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5390. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5391. this.waitingPeople();
  5392. }
  5393. waitingPeople() {
  5394. let time = xGame.common.randomNum(1000, 3000);
  5395. time += 1000;
  5396. Laya.timer.once(time, this, () => {
  5397. this.matchingSuccess();
  5398. });
  5399. }
  5400. matchingSuccess() {
  5401. let gameUI = xGame.common.gameUI;
  5402. let name = gameUI.ui.topNode.aiNameTxt.text;
  5403. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5404. this.ui.aiHead.nameTxt.text = name;
  5405. this.ui.aiHead.headImg.url = url;
  5406. name = gameUI.ui.topNode.selfNameTxt.text;
  5407. url = gameUI.ui.topNode.selfHeadLoader.url;
  5408. this.ui.selfHead.nameTxt.text = name;
  5409. this.ui.selfHead.headImg.url = url;
  5410. this.ui.t3.play(Laya.Handler.create(this, () => {
  5411. this.callback && this.callback();
  5412. this.ui.t4.play(Laya.Handler.create(this, () => {
  5413. this.destroySelf();
  5414. }));
  5415. }));
  5416. }
  5417. destroySelf() {
  5418. this.callback = null;
  5419. this.skillSelectData = null;
  5420. this.selfPot = null;
  5421. this.aiPot = null;
  5422. if (!this.ui.isDisposed) {
  5423. this.ui.removeFromParent();
  5424. this.ui.dispose();
  5425. }
  5426. xGame.uiMgr.destroyUI(this);
  5427. }
  5428. }
  5429. UIMatching.uiName = "UIMatching";
  5430. class ui_UIRanking extends fgui.GComponent {
  5431. static createInstance() {
  5432. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5433. }
  5434. onConstruct() {
  5435. this.n26 = (this.getChild("n26"));
  5436. this.myNode = (this.getChild("myNode"));
  5437. }
  5438. }
  5439. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5440. class UIRanking extends UIBase {
  5441. constructor() {
  5442. super();
  5443. this.showSelf = true;
  5444. this.rankType = 1;
  5445. this.rankList = [];
  5446. this.topX = 10;
  5447. this.myIndex = this.topX + 1;
  5448. this.myStar = 0;
  5449. }
  5450. onConstructor() {
  5451. this.ui = ui_UIRanking.createInstance();
  5452. this.contentPane = this.ui;
  5453. this.isEject = false;
  5454. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5455. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5456. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5457. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5458. this.ui.myNode.myList.setVirtual();
  5459. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5460. }
  5461. show() {
  5462. super.show();
  5463. this.getPaiHangBangDataFormJosnFile();
  5464. this.updateSelf();
  5465. let self = Moyu.getUserInfo();
  5466. if (!self.isAuth) {
  5467. Moyu.initUser(this, () => {
  5468. DataMgr.upRankData();
  5469. });
  5470. }
  5471. }
  5472. getPaiHangBangDataFormJosnFile() {
  5473. const rankingList = cfgTable.paiHangBangData.list;
  5474. this.updateItemData(rankingList);
  5475. }
  5476. updateSelfItem() {
  5477. console.log('zh:Moyu.platType =' + Moyu.platType);
  5478. let self = Moyu.getUserInfo();
  5479. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5480. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5481. if (this.myIndex > this.topX) {
  5482. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5483. }
  5484. else {
  5485. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5486. }
  5487. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5488. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5489. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5490. }
  5491. updateItemData(data) {
  5492. this.myStar = xGame.common.getAllStarNum();
  5493. if (this.rankList.length < 2) {
  5494. this.rankList = data;
  5495. let self = Moyu.getUserInfo();
  5496. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5497. self.headIcon = self.headIcon;
  5498. for (let i = 0; i < data.length; i++) {
  5499. let data = this.rankList[i];
  5500. if (data.userId == self.userId) {
  5501. this.rankList.splice(i, 1);
  5502. break;
  5503. }
  5504. }
  5505. for (let i = 0; i < data.length; i++) {
  5506. let data = this.rankList[i];
  5507. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5508. this.myIndex = i + 1;
  5509. let user = { headIcon: self.headIcon, nickName: "myself" };
  5510. let ud = { user: user, data: {} };
  5511. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5512. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5513. if (Moyu.platType < 11) {
  5514. user.headIcon = self.headIcon;
  5515. user.nickName = self.nickName;
  5516. }
  5517. this.rankList.splice(i, 0, md);
  5518. break;
  5519. }
  5520. }
  5521. }
  5522. this.updateSelfItem();
  5523. this.ui.myNode.myList.numItems = this.rankList.length;
  5524. }
  5525. updateItemUI(index, obj) {
  5526. let data = this.rankList[index];
  5527. let userData = JSON.parse(data.userData).user;
  5528. obj.nameTxt.text = userData.nickName.toString();
  5529. obj.valueTxt.text = data.rankScore;
  5530. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5531. obj.rankTxt.text = index + 1;
  5532. switch (index) {
  5533. case 0:
  5534. this.setImg(obj, 1, 0, 0);
  5535. obj.rankTxt.color = "#FFC047";
  5536. break;
  5537. case 1:
  5538. this.setImg(obj, 0, 1, 0);
  5539. obj.rankTxt.color = "#ACACAC";
  5540. break;
  5541. case 2:
  5542. this.setImg(obj, 0, 0, 1);
  5543. obj.rankTxt.color = "#D09672";
  5544. break;
  5545. default:
  5546. this.setImg(obj, 0, 0, 0);
  5547. obj.rankTxt.color = "#496FAB";
  5548. break;
  5549. }
  5550. }
  5551. setImg(obj, a, b, c) {
  5552. obj.img1.visible = a ? true : false;
  5553. obj.img2.visible = b ? true : false;
  5554. obj.img3.visible = c ? true : false;
  5555. }
  5556. changeList(type) {
  5557. this.rankType = type;
  5558. this.updateSelf();
  5559. }
  5560. changeSelfNode() {
  5561. this.showSelf = !this.showSelf;
  5562. this.updateSelf();
  5563. }
  5564. updateSelf() {
  5565. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5566. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5567. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5568. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5569. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5570. }
  5571. }
  5572. UIRanking.uiName = "UIRanking";
  5573. class ui_UISecretary extends fgui.GComponent {
  5574. static createInstance() {
  5575. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5576. }
  5577. onConstruct() {
  5578. this.n0 = (this.getChild("n0"));
  5579. this.myNode = (this.getChild("myNode"));
  5580. this.closeBtn = (this.getChild("closeBtn"));
  5581. this.t0 = this.getTransition("t0");
  5582. }
  5583. }
  5584. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5585. class UISecretary extends UIBase {
  5586. constructor() {
  5587. super();
  5588. this.curIndex = 1;
  5589. }
  5590. onConstructor() {
  5591. this.ui = ui_UISecretary.createInstance();
  5592. this.contentPane = this.ui;
  5593. this.isEject = false;
  5594. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5595. this.nodeObj = { left: null, right: null, cur: null };
  5596. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5597. }
  5598. show() {
  5599. super.show();
  5600. this.ui.t0.play();
  5601. this.updateData();
  5602. }
  5603. addSecretarySpine(node, spineName) {
  5604. if (spineName == "mishu") {
  5605. if (this.secretarySpine1) {
  5606. node.displayObject.destroyChildren();
  5607. this.playWoman(this.secretarySpine1, node.displayObject);
  5608. }
  5609. else {
  5610. let spine1 = new SpineMgr("mishu", () => {
  5611. this.secretarySpine1 = spine1;
  5612. this.playWoman(this.secretarySpine1, node.displayObject);
  5613. });
  5614. }
  5615. }
  5616. else {
  5617. if (this.secretarySpine2) {
  5618. node.displayObject.destroyChildren();
  5619. this.playWoman(this.secretarySpine2, node.displayObject);
  5620. }
  5621. else {
  5622. let spine2 = new SpineMgr("xiaomishu2", () => {
  5623. this.secretarySpine2 = spine2;
  5624. this.playWoman(this.secretarySpine2, node.displayObject);
  5625. });
  5626. }
  5627. }
  5628. }
  5629. playWoman(node, parent) {
  5630. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5631. let yy = this.ui.myNode.gameNode3.secretary.height;
  5632. let scale = 1.5;
  5633. if (node == this.secretarySpine2) {
  5634. scale = 1.2;
  5635. }
  5636. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5637. node.play(data, 0, true, parent);
  5638. }
  5639. turnLeft() {
  5640. this.curIndex--;
  5641. if (this.curIndex < 1) {
  5642. this.curIndex = 2;
  5643. }
  5644. let left = this.nodeObj.left;
  5645. let right = this.nodeObj.right;
  5646. let cur = this.nodeObj.cur;
  5647. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5648. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5649. Laya.Tween.to(cur, { 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(right, 2);
  5653. this.nodeObj.left = cur;
  5654. this.nodeObj.right = left;
  5655. this.nodeObj.cur = right;
  5656. }
  5657. turnRight() {
  5658. this.curIndex++;
  5659. if (this.curIndex > 2) {
  5660. this.curIndex = 1;
  5661. }
  5662. let left = this.nodeObj.left;
  5663. let right = this.nodeObj.right;
  5664. let cur = this.nodeObj.cur;
  5665. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5666. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5667. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5668. this.updateData();
  5669. }));
  5670. this.ui.myNode.setChildIndex(left, 2);
  5671. this.nodeObj.left = right;
  5672. this.nodeObj.right = cur;
  5673. this.nodeObj.cur = left;
  5674. }
  5675. updateData() {
  5676. console.log('zh: updateData FFFFFFFFFF');
  5677. let data = cfgTable.secretaryshopData;
  5678. let children = this.ui.myNode._children;
  5679. let temp;
  5680. let curData;
  5681. for (let index = 0; index < children.length; index++) {
  5682. temp = children[index];
  5683. curData = data[1];
  5684. temp.heightTxt.text = curData.height;
  5685. temp.foodTxt.text = curData.food;
  5686. temp.historyTxt.text = curData.history;
  5687. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5688. this.addSecretarySpine(temp.secretary, curData.spine);
  5689. let womanIndex = curData.id - 1;
  5690. let getWoman = DataMgr.getSecretary(womanIndex);
  5691. let curUse = DataMgr.getCurSecretary();
  5692. if (getWoman) {
  5693. if (curUse == womanIndex) {
  5694. temp.purchaseBtn.c1.selectedIndex = 1;
  5695. }
  5696. else {
  5697. temp.purchaseBtn.c1.selectedIndex = 2;
  5698. }
  5699. }
  5700. else {
  5701. temp.purchaseBtn.c1.selectedIndex = 0;
  5702. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5703. }
  5704. temp.purchaseBtn.visible = false;
  5705. }
  5706. }
  5707. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5708. console.log('zh: 点击了clickSecretary ');
  5709. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5710. if (getWoman) {
  5711. if (curUse != womanIndex) {
  5712. console.log();
  5713. DataMgr.setCurSecretary(womanIndex);
  5714. this.updateData();
  5715. }
  5716. }
  5717. else {
  5718. console.log('zh:点击购买了');
  5719. let need = needDiamond;
  5720. if (DataMgr.diamondEnough(need)) {
  5721. DataMgr.setDiamond(-need);
  5722. DataMgr.setSecretary(womanIndex, 1);
  5723. DataMgr.setCurSecretary(womanIndex);
  5724. this.updateData();
  5725. }
  5726. else {
  5727. xGame.uiMgr.Show(UIAddProp, 1);
  5728. }
  5729. }
  5730. }
  5731. closeSelf() {
  5732. this.hide();
  5733. }
  5734. }
  5735. UISecretary.uiName = "UISecretary";
  5736. class ui_UIShop extends fgui.GComponent {
  5737. static createInstance() {
  5738. return (fgui.UIPackage.createObject("game", "UIShop"));
  5739. }
  5740. onConstruct() {
  5741. this.n48 = (this.getChild("n48"));
  5742. this.n0 = (this.getChild("n0"));
  5743. this.secretary = (this.getChild("secretary"));
  5744. this.talkNode = (this.getChild("talkNode"));
  5745. this.closeNode = (this.getChild("closeNode"));
  5746. this.moneyNode = (this.getChild("moneyNode"));
  5747. this.myNode = (this.getChild("myNode"));
  5748. }
  5749. }
  5750. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5751. class ui_UIMsg extends fgui.GComponent {
  5752. static createInstance() {
  5753. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5754. }
  5755. onConstruct() {
  5756. this.tipsNode = (this.getChild("tipsNode"));
  5757. }
  5758. }
  5759. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5760. class UIMsg extends UIBase {
  5761. constructor() {
  5762. super();
  5763. }
  5764. onConstructor() {
  5765. this.ui = ui_UIMsg.createInstance();
  5766. this.contentPane = this.ui;
  5767. this.isEject = false;
  5768. this.isMuti = true;
  5769. }
  5770. show(msg, callback) {
  5771. super.show();
  5772. this.ui.tipsNode.msgTxt.text = msg;
  5773. this.ui.alpha = 1;
  5774. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5775. this.hide();
  5776. callback && callback();
  5777. }), 1000);
  5778. }
  5779. }
  5780. UIMsg.uiName = "UIMsg";
  5781. class BallRodDisplay {
  5782. constructor(ui, index) {
  5783. this.index = 0;
  5784. this.uiIndex = 0;
  5785. this.ui = ui;
  5786. this.index = index;
  5787. this.initData();
  5788. }
  5789. initData() {
  5790. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5791. let data = cfgTable.ballrodData[this.index + 1];
  5792. this.ui.nameTxt.text = data.name;
  5793. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5794. this.ui.levelNode.c1.selectedIndex = data.quality;
  5795. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5796. if (data.spine) {
  5797. this.mySpine = new SpineMgr(data.spine, () => {
  5798. let xx = 150;
  5799. let yy = 70;
  5800. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5801. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5802. });
  5803. }
  5804. }
  5805. updateSelf() {
  5806. console.log('zh:updateSelf -------------- ');
  5807. let get = DataMgr.getBallRod(this.index);
  5808. if (get == null)
  5809. get = 1;
  5810. let curUse = DataMgr.getCurBallRod();
  5811. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5812. if (get) {
  5813. if (curUse == this.index) {
  5814. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5815. }
  5816. else {
  5817. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5818. }
  5819. }
  5820. else {
  5821. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5822. }
  5823. }
  5824. buyBallRod() {
  5825. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5826. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5827. switch (selectedIndex) {
  5828. case 0:
  5829. break;
  5830. case 1:
  5831. console.log('zh:点击了 USE THIS');
  5832. DataMgr.setCurBallRod(this.index);
  5833. let curUse = DataMgr.getCurBallRod();
  5834. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5835. let ui = xGame.uiMgr.getUI(UIShop);
  5836. ui.updateBallRod();
  5837. break;
  5838. case 2:
  5839. let data = cfgTable.ballrodData[this.index + 1];
  5840. let need = data.price;
  5841. if (DataMgr.diamondEnough(need)) {
  5842. this.buyQiuGan(data);
  5843. DataMgr.setDiamond(-need);
  5844. DataMgr.setBallRod(this.index, 1);
  5845. DataMgr.setCurBallRod(this.index);
  5846. let ui = xGame.uiMgr.getUI(UIShop);
  5847. ui.updateBallRod();
  5848. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5849. }
  5850. else {
  5851. xGame.uiMgr.Show(UIAddProp, 1);
  5852. }
  5853. break;
  5854. default:
  5855. break;
  5856. }
  5857. }
  5858. buyQiuGan(qgItem) {
  5859. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5860. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5861. if (userInfo == null) {
  5862. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5863. return;
  5864. }
  5865. let reqData = xGame.httpMgr.getReqData();
  5866. let pd = JSON.parse(reqData);
  5867. pd.qiuGanData = qgItem;
  5868. reqData = JSON.stringify(pd);
  5869. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5870. try {
  5871. console.log('zh:buySp res = ' + JSON.stringify(res));
  5872. let code = res.code;
  5873. let msg = res.msg;
  5874. if (code == 401) {
  5875. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5876. alert(TIP_MSG_key.loginTimeOut);
  5877. xGame.uiMgr.Show(UIMsg, msg);
  5878. return;
  5879. }
  5880. if (code == 200) {
  5881. xGame.uiMgr.Show(UIMsg, msg);
  5882. DataMgr.getUserZiChanInfo();
  5883. }
  5884. else {
  5885. xGame.uiMgr.Show(UIMsg, msg);
  5886. }
  5887. }
  5888. catch (error) {
  5889. console.log('error=' + error);
  5890. alert(error);
  5891. }
  5892. finally {
  5893. }
  5894. });
  5895. }
  5896. logEventForGouMaiGan(qiuGanName) {
  5897. const ev = {
  5898. value: qiuGanName
  5899. };
  5900. const jsonStr = JSON.stringify(ev);
  5901. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5902. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5903. }
  5904. }
  5905. class DaoJuDisplay {
  5906. constructor(ui, index) {
  5907. this.index = 0;
  5908. this.uiIndex = 0;
  5909. this.ggSpid = "";
  5910. this.ui = ui;
  5911. this.index = index;
  5912. this.initData();
  5913. }
  5914. initData() {
  5915. this.ui.btn_buy.onClick(this, this.gotoBuy);
  5916. let data = cfgTable.daoJuData[this.index + 1];
  5917. console.log('zh:' + JSON.stringify(data));
  5918. this.ui.nameTxt.text = data.spbt;
  5919. this.ui.n_jiaGe.text = data.spjg + "";
  5920. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5921. this.ggSpid = data.ggSpid;
  5922. let baseUrl = "asset/sound/ogg/";
  5923. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5924. }
  5925. gotoBuy() {
  5926. let userInfo = LocalStorageManager.getItem('userInfo');
  5927. if (userInfo != null) {
  5928. let token = userInfo.token;
  5929. let ggSpid = this.ggSpid;
  5930. JSBridgeUtils.instance.startGgPay(token, ggSpid);
  5931. return;
  5932. }
  5933. else {
  5934. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5935. }
  5936. }
  5937. gotoBuy1() {
  5938. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5939. let djItem = cfgTable.daoJuData[this.index + 1];
  5940. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  5941. let userInfo = LocalStorageManager.getItem('userInfo');
  5942. if (userInfo == null) {
  5943. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5944. return;
  5945. }
  5946. let reqData = xGame.httpMgr.getReqData();
  5947. let pd = JSON.parse(reqData);
  5948. pd.spItem = djItem;
  5949. reqData = JSON.stringify(pd);
  5950. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  5951. try {
  5952. console.log('zh:buySp res = ' + JSON.stringify(res));
  5953. let code = res.code;
  5954. let msg = res.msg;
  5955. if (code == 401) {
  5956. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5957. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5958. return;
  5959. }
  5960. if (code == 200) {
  5961. xGame.uiMgr.Show(UIMsg, msg);
  5962. DataMgr.getUserZiChanInfo();
  5963. }
  5964. else {
  5965. xGame.uiMgr.Show(UIMsg, msg);
  5966. }
  5967. }
  5968. catch (error) {
  5969. console.log('error=' + error);
  5970. alert(error);
  5971. }
  5972. finally {
  5973. }
  5974. });
  5975. }
  5976. }
  5977. class UIShop extends UIBase {
  5978. constructor() {
  5979. super();
  5980. this.itemNums = 0;
  5981. this.itemNumsForDj = 0;
  5982. this.curType = "";
  5983. }
  5984. onConstructor() {
  5985. this.ui = ui_UIShop.createInstance();
  5986. this.contentPane = this.ui;
  5987. this.isEject = false;
  5988. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5989. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5990. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  5991. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  5992. this.addUIClick(this.ui, this.interuptSecretary);
  5993. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5994. this.ballRodArr = [];
  5995. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5996. this.ui.myNode.myList.numItems = this.itemNums;
  5997. this.loadDjdata_old();
  5998. }
  5999. loadDjdata_old() {
  6000. let fff = cfgTable.daoJuData;
  6001. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6002. this.daoJuArr = [];
  6003. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6004. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6005. }
  6006. getProductList() {
  6007. let reqData = xGame.httpMgr.getReqData();
  6008. let pd = JSON.parse(reqData);
  6009. pd.splx = "Consumable";
  6010. reqData = JSON.stringify(pd);
  6011. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6012. try {
  6013. let code = res.code;
  6014. let msg = res.msg;
  6015. if (code == 401) {
  6016. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6017. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6018. return;
  6019. }
  6020. if (code == 200) {
  6021. let data = res.data;
  6022. for (let index = 0; index < data.length; index++) {
  6023. let element = data[index];
  6024. cfgTable.daoJuData[element.spid] = element;
  6025. }
  6026. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6027. }
  6028. else {
  6029. xGame.uiMgr.Show(UIMsg, msg);
  6030. }
  6031. }
  6032. catch (error) {
  6033. console.log('error=' + error);
  6034. alert(error);
  6035. }
  6036. finally {
  6037. }
  6038. });
  6039. }
  6040. show(type) {
  6041. super.show();
  6042. this.curType = type == 0 ? "qiugan" : "daoju";
  6043. this.switchBtn("qiugan");
  6044. this.playSecretaryIdle();
  6045. this.updateBallRod();
  6046. }
  6047. test123() {
  6048. console.log('zh:test123 ');
  6049. }
  6050. switchBtn(type) {
  6051. console.log('zh:1111切換 sel type=' + type);
  6052. if (type == "") {
  6053. type = this.curType;
  6054. }
  6055. else {
  6056. if (this.curType == type) {
  6057. return;
  6058. }
  6059. else {
  6060. this.curType = type;
  6061. }
  6062. }
  6063. if (type == "qiugan") {
  6064. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6065. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6066. this.ui.myNode.c1.selectedIndex = 0;
  6067. this.ui.myNode.myList.visible = true;
  6068. this.ui.myNode.djList.visible = false;
  6069. }
  6070. else {
  6071. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6072. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6073. this.ui.myNode.c1.selectedIndex = 1;
  6074. this.ui.myNode.myList.visible = false;
  6075. this.ui.myNode.djList.visible = true;
  6076. }
  6077. }
  6078. updateBallRod() {
  6079. for (let index = 0; index < this.ballRodArr.length; index++) {
  6080. this.ballRodArr[index].updateSelf();
  6081. }
  6082. }
  6083. renderBallRod(sort, obj) {
  6084. let index = this.getIndexBySort(sort + 1) - 1;
  6085. let ballRod = new BallRodDisplay(obj, index);
  6086. this.ballRodArr.push(ballRod);
  6087. }
  6088. renderDaoJu(idx, obj) {
  6089. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6090. let b = new DaoJuDisplay(obj, index);
  6091. this.daoJuArr.push(b);
  6092. }
  6093. getIndexBySort(sort) {
  6094. let object = cfgTable.ballrodData;
  6095. for (const key in object) {
  6096. if (object[key].sort == sort) {
  6097. return parseInt(key);
  6098. }
  6099. }
  6100. }
  6101. getIndexBySortForDj(idx) {
  6102. let object = cfgTable.daoJuData;
  6103. for (const key in object) {
  6104. if (object[key].idx == idx) {
  6105. return parseInt(key);
  6106. }
  6107. }
  6108. }
  6109. playSecretaryIdle() {
  6110. let parent = this.ui.secretary.displayObject;
  6111. parent.destroyChildren();
  6112. let xx = this.ui.secretary.width / 2;
  6113. let yy = this.ui.secretary.height;
  6114. let scale = xGame.common.getSecretaryScale();
  6115. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6116. xGame.common.secretary.play(data, 0, true, parent);
  6117. }
  6118. interuptSecretary() {
  6119. Laya.timer.clearAll(this);
  6120. this.playSecretaryRandomSound();
  6121. }
  6122. playSecretaryRandomSound() {
  6123. if (this.isHide)
  6124. return;
  6125. let time = xGame.common.randomNum(45000, 60000);
  6126. Laya.timer.once(time, this, () => {
  6127. if (this.isHide)
  6128. return;
  6129. let index = xGame.common.randomNum(4, 7);
  6130. xGame.soundMgr.playSound("s_main0" + index);
  6131. let words = 1;
  6132. switch (index) {
  6133. case 4:
  6134. words = 5;
  6135. break;
  6136. case 5:
  6137. words = 3;
  6138. break;
  6139. case 6:
  6140. words = 6;
  6141. break;
  6142. case 7:
  6143. words = 7;
  6144. break;
  6145. default:
  6146. break;
  6147. }
  6148. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6149. this.playSecretaryRandomSound();
  6150. });
  6151. }
  6152. closeSelf() {
  6153. this.hide();
  6154. }
  6155. }
  6156. UIShop.uiName = "UIShop";
  6157. class ui_UISign extends fgui.GComponent {
  6158. static createInstance() {
  6159. return (fgui.UIPackage.createObject("game", "UISign"));
  6160. }
  6161. onConstruct() {
  6162. this.n6 = (this.getChild("n6"));
  6163. this.closeNode = (this.getChild("closeNode"));
  6164. this.myNode = (this.getChild("myNode"));
  6165. this.moneyNode = (this.getChild("moneyNode"));
  6166. this.secretary = (this.getChild("secretary"));
  6167. this.talkNode = (this.getChild("talkNode"));
  6168. this.tripleBtn = (this.getChild("tripleBtn"));
  6169. this.normalBtn = (this.getChild("normalBtn"));
  6170. this.tipsNode = (this.getChild("tipsNode"));
  6171. this.againBtn = (this.getChild("againBtn"));
  6172. this.t0 = this.getTransition("t0");
  6173. }
  6174. }
  6175. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6176. class SignMax {
  6177. constructor(ui) {
  6178. this.ui = ui;
  6179. }
  6180. updateSelf(index, sameDay, curDayIndex) {
  6181. let data = cfgTable.signData[index + 1];
  6182. this.ui.titleTxt.text = data.title;
  6183. let arr1 = data.award[0].split('-');
  6184. let arr2 = data.award[1].split('-');
  6185. let num1 = parseInt(arr1[1]);
  6186. let num2 = parseInt(arr2[1]);
  6187. this.ui.numTxt1.text = num1 + "";
  6188. this.ui.numTxt2.text = num2 + "";
  6189. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6190. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6191. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6192. this.ui.numTxt1.visible = false;
  6193. }
  6194. else {
  6195. this.ui.numTxt1.visible = true;
  6196. }
  6197. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6198. this.ui.numTxt2.visible = false;
  6199. }
  6200. else {
  6201. this.ui.numTxt2.visible = true;
  6202. }
  6203. if (index < curDayIndex) {
  6204. this.ui.c1.selectedIndex = 1;
  6205. }
  6206. else if (index == curDayIndex) {
  6207. if (sameDay) {
  6208. this.ui.c1.selectedIndex = 2;
  6209. }
  6210. else {
  6211. this.ui.c1.selectedIndex = 2;
  6212. }
  6213. }
  6214. else {
  6215. this.ui.c1.selectedIndex = 0;
  6216. }
  6217. }
  6218. }
  6219. class SignNormal {
  6220. constructor(ui) {
  6221. this.ui = ui;
  6222. }
  6223. updateSelf(index, sameDay, curDayIndex) {
  6224. let data = cfgTable.signData[index + 1];
  6225. this.ui.titleTxt.text = data.title;
  6226. let arr = data.award[0].split('-');
  6227. let type = parseInt(arr[0]);
  6228. let num = parseInt(arr[1]);
  6229. this.ui.numTxt.text = num + "";
  6230. if (type > 2) {
  6231. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6232. this.ui.myIcon.rotation = 0;
  6233. }
  6234. else {
  6235. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6236. this.ui.myIcon.rotation = 0;
  6237. }
  6238. if (xGame.common.signAwardContainsRod(data.award)) {
  6239. this.ui.numTxt.visible = false;
  6240. }
  6241. else {
  6242. this.ui.numTxt.visible = true;
  6243. }
  6244. if (index < curDayIndex) {
  6245. this.ui.c1.selectedIndex = 1;
  6246. }
  6247. else if (index == curDayIndex) {
  6248. if (sameDay) {
  6249. this.ui.c1.selectedIndex = 2;
  6250. }
  6251. else {
  6252. this.ui.c1.selectedIndex = 2;
  6253. }
  6254. }
  6255. else {
  6256. this.ui.c1.selectedIndex = 0;
  6257. }
  6258. }
  6259. }
  6260. class UISign extends UIBase {
  6261. constructor() {
  6262. super();
  6263. this.curDayIndex = 0;
  6264. this.starX = 0;
  6265. }
  6266. onConstructor() {
  6267. this.ui = ui_UISign.createInstance();
  6268. this.contentPane = this.ui;
  6269. this.isEject = false;
  6270. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6271. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6272. this.initSignItem();
  6273. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6274. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6275. }
  6276. show() {
  6277. super.show();
  6278. this.ui.t0.play();
  6279. this.playSecretaryIdle();
  6280. this.updateSign();
  6281. }
  6282. initSignItem() {
  6283. this.signArr = [];
  6284. for (let index = 0; index < 6; index++) {
  6285. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6286. this.signArr.push(temp);
  6287. }
  6288. this.signMax = new SignMax(this.ui.myNode.day7);
  6289. if (Moyu.isKs)
  6290. this.ui.closeNode.closeBtn.x += 100;
  6291. }
  6292. updateSign() {
  6293. let sameDay = xGame.common.judgeSameDay();
  6294. let max = 7;
  6295. this.curDayIndex = DataMgr.getSignData();
  6296. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6297. this.curDayIndex = 0;
  6298. if (!sameDay) {
  6299. this.ui.normalBtn.visible = true;
  6300. this.ui.tipsNode.visible = false;
  6301. this.ui.againBtn.visible = false;
  6302. }
  6303. else {
  6304. this.ui.normalBtn.visible = false;
  6305. let again = DataMgr.getExtraSign();
  6306. let isCurrency = false;
  6307. let index = this.curDayIndex;
  6308. if (index == 0)
  6309. index = 7;
  6310. let award = cfgTable.signData[index].award;
  6311. let num = award[0].split("-")[0];
  6312. if (num == "1" || num == "2")
  6313. isCurrency = true;
  6314. let showAgain = again == 0 && isCurrency;
  6315. this.ui.againBtn.visible = showAgain;
  6316. this.ui.tipsNode.visible = !showAgain;
  6317. }
  6318. for (let index = 0; index < this.signArr.length; index++) {
  6319. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6320. }
  6321. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6322. }
  6323. playSecretaryIdle() {
  6324. let parent = this.ui.secretary.displayObject;
  6325. parent.destroyChildren();
  6326. let xx = this.ui.secretary.width / 2;
  6327. let yy = this.ui.secretary.height;
  6328. let scale = xGame.common.getSecretaryScale();
  6329. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6330. xGame.common.secretary.play(data, 0, true, parent);
  6331. }
  6332. closeSelf() {
  6333. this.hide();
  6334. }
  6335. normalGetAward() {
  6336. let sameDay = xGame.common.judgeSameDay();
  6337. if (!sameDay) {
  6338. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6339. let temp;
  6340. let type;
  6341. let num;
  6342. let arr = [];
  6343. for (let index = 0; index < award.length; index++) {
  6344. temp = award[index].split("-");
  6345. type = parseInt(temp[0]);
  6346. num = parseInt(temp[1]);
  6347. let awardType = new AwardType();
  6348. awardType.num = num;
  6349. awardType.type = type;
  6350. arr.push(awardType);
  6351. }
  6352. xGame.common.getAward(arr, (watchVideo) => {
  6353. this.curDayIndex++;
  6354. if (this.curDayIndex > 7)
  6355. this.curDayIndex = 0;
  6356. DataMgr.setSignData(this.curDayIndex);
  6357. DataMgr.setSignTime(new Date().getTime());
  6358. if (watchVideo) {
  6359. DataMgr.setExtraSign(1);
  6360. Moyu.sendDataEvent("signIn1");
  6361. }
  6362. this.updateSign();
  6363. });
  6364. }
  6365. }
  6366. againGetAward() {
  6367. Moyu.sendDataEvent("signIn2");
  6368. console.log('zh:qjff_AD_for_uisign');
  6369. if (Laya.Browser.onAndroid) {
  6370. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6371. if (!boo) {
  6372. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6373. return;
  6374. }
  6375. }
  6376. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6377. }
  6378. else {
  6379. console.log('zh:AD 失败,直接发放奖励');
  6380. this.qjff_AD_for_uisign();
  6381. }
  6382. }
  6383. qjff_AD_for_uisign() {
  6384. let index = this.curDayIndex;
  6385. if (index == 0)
  6386. index = 7;
  6387. let award = cfgTable.signData[index].award;
  6388. let temp;
  6389. let type;
  6390. let num;
  6391. for (let index = 0; index < award.length; index++) {
  6392. temp = award[index].split("-");
  6393. type = parseInt(temp[0]);
  6394. num = parseInt(temp[1]) * 3;
  6395. xGame.common.playObjFlyAnim(num, type);
  6396. }
  6397. DataMgr.setExtraSign(1);
  6398. this.updateSign();
  6399. }
  6400. }
  6401. UISign.uiName = "UISign";
  6402. class ui_UISkill extends fgui.GComponent {
  6403. static createInstance() {
  6404. return (fgui.UIPackage.createObject("game", "UISkill"));
  6405. }
  6406. onConstruct() {
  6407. this.n48 = (this.getChild("n48"));
  6408. this.n0 = (this.getChild("n0"));
  6409. this.secretary = (this.getChild("secretary"));
  6410. this.talkNode = (this.getChild("talkNode"));
  6411. this.closeNode = (this.getChild("closeNode"));
  6412. this.moneyNode = (this.getChild("moneyNode"));
  6413. this.skillNode = (this.getChild("skillNode"));
  6414. this.guideNode = (this.getChild("guideNode"));
  6415. }
  6416. }
  6417. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6418. class SkillDisplay {
  6419. constructor(ui, data, uiIndex) {
  6420. this.starX = 0;
  6421. this.starY = 0;
  6422. this.index = 0;
  6423. this.ui = ui;
  6424. this.data = data;
  6425. this.index = uiIndex;
  6426. this.initSelf();
  6427. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6428. }
  6429. initSelf() {
  6430. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6431. this.ui.nameTxt.text = this.data.name;
  6432. this.ui.describeTxt.text = this.data.describe;
  6433. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6434. this.ui.startBtn.onClick(this, this.startGame);
  6435. this.updateSelf();
  6436. }
  6437. updateSelf() {
  6438. this.checkTry();
  6439. let level = DataMgr.getBigSkillByIndex(this.index);
  6440. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6441. }
  6442. checkTry() {
  6443. let index = this.index;
  6444. let level = DataMgr.getBigSkillByIndex(index);
  6445. if (level == null) {
  6446. DataMgr.setBigSkill(index, 1, false);
  6447. level = 1;
  6448. }
  6449. this.ui.levelTxt.text = "LV." + level;
  6450. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6451. this.ui.tryNode.visible = true;
  6452. else
  6453. this.ui.tryNode.visible = false;
  6454. }
  6455. clickAddLevel() {
  6456. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6457. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6458. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6459. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6460. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6461. }
  6462. else {
  6463. console.log('zh:AD 失败,直接发放奖励');
  6464. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6465. }
  6466. }
  6467. qjff_AD_for_skilldisplay_clickAddLevel() {
  6468. DataMgr.setBigSkill(this.data.index, 1);
  6469. this.updateSelf();
  6470. xGame.common.upSkillLevel = true;
  6471. }
  6472. startGame() {
  6473. console.log('zh:rod skill startgame');
  6474. if (this.data.index == 3) {
  6475. alert('Coming soon!');
  6476. return;
  6477. }
  6478. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6479. let needCoin = xGame.common.bigMoveNeedCoin;
  6480. xGame.common.passAwardCoin = 2000;
  6481. let guide = DataMgr.getSkillGuide();
  6482. console.log('zh:startGame guide=' + guide);
  6483. xGame.common.temSelfLevel = 0;
  6484. if (guide == 0) {
  6485. needCoin = 0;
  6486. xGame.common.temSelfLevel = 100;
  6487. }
  6488. if (DataMgr.coinEnough(needCoin)) {
  6489. DataMgr.setCoin(-needCoin);
  6490. xGame.common.curPlayerSkillType = this.index;
  6491. if (guide == 0)
  6492. xGame.common.curPlayerSkillType = 0;
  6493. console.log('zh: skilldisplay 1');
  6494. xGame.uiMgr.Show(UIGame);
  6495. xGame.uiMgr.Hide(UIMain);
  6496. xGame.uiMgr.Show(UIMatching, () => {
  6497. xGame.common.gameUI.ui.alpha = 1;
  6498. xGame.common.gameUI.startGame();
  6499. xGame.uiMgr.Hide(UISkill);
  6500. });
  6501. this.logEventForRod_start();
  6502. }
  6503. else {
  6504. console.log('zh: skilldisplay 2');
  6505. xGame.uiMgr.Show(UIAddProp, 0);
  6506. Moyu.sendDataEvent("AddCoinVideo");
  6507. }
  6508. }
  6509. logEventForRod_start() {
  6510. let gfmsIdx = xGame.common.curPlayerSkillType;
  6511. console.log('zh:选择的技能=' + gfmsIdx);
  6512. let gfmc = 'Skyfall Shot';
  6513. if (gfmsIdx == 0) {
  6514. gfmc = 'Skyfall Shot';
  6515. }
  6516. if (gfmsIdx == 1) {
  6517. gfmc = 'Surging break';
  6518. }
  6519. if (gfmsIdx == 2) {
  6520. gfmc = 'Frost Lock';
  6521. }
  6522. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6523. let jsonStr = {
  6524. "count": 0,
  6525. "name": gfmc
  6526. };
  6527. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6528. const d = LocalStorageManager.getItem(keyStr);
  6529. jsonStr.count = d.count + 1;
  6530. LocalStorageManager.setItem(keyStr, jsonStr);
  6531. }
  6532. else {
  6533. LocalStorageManager.setItem(keyStr, jsonStr);
  6534. }
  6535. const reqStr = JSON.stringify(jsonStr);
  6536. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6537. }
  6538. }
  6539. class UISkill extends UIBase {
  6540. constructor() {
  6541. super();
  6542. this.skillData = [];
  6543. }
  6544. onConstructor() {
  6545. this.ui = ui_UISkill.createInstance();
  6546. this.contentPane = this.ui;
  6547. this.isEject = false;
  6548. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6549. this.initSkillData();
  6550. console.log('zh:aaaaaa1111111111');
  6551. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6552. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6553. console.log('zh:aaaaaa22222222');
  6554. this.displayList = [];
  6555. this.ui.skillNode.skillList.numItems = 3;
  6556. this.addUIClick(this.ui, this.interuptSecretary);
  6557. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6558. this.ui.talkNode.visible = false;
  6559. if (Moyu.isKs)
  6560. this.ui.closeNode.closeBtn.x += 100;
  6561. }
  6562. show() {
  6563. super.show();
  6564. this.playSecretaryIdle();
  6565. this.moneyNode.ui.c1.selectedIndex = 1;
  6566. Laya.timer.clearAll(this);
  6567. xGame.soundMgr.playSound("s_start");
  6568. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6569. let guide = DataMgr.getSkillGuide();
  6570. this.ui.guideNode.visible = guide == 0;
  6571. let item = this.getSkillItemByUIIndex(0);
  6572. if (guide == 0) {
  6573. item.ui.c1.selectedIndex = 1;
  6574. }
  6575. else {
  6576. item.ui.c1.selectedIndex = 0;
  6577. }
  6578. this.ui.guideNode.guideBtn.visible = guide == 0;
  6579. for (let index = 0; index < this.displayList.length; index++) {
  6580. this.displayList[index].checkTry();
  6581. }
  6582. }
  6583. getSkillItemByUIIndex(cur) {
  6584. for (let index = 0; index < this.displayList.length; index++) {
  6585. if (this.displayList[index].index == cur) {
  6586. return this.displayList[index];
  6587. }
  6588. }
  6589. }
  6590. enterGuideLevel() {
  6591. let item = this.getSkillItemByUIIndex(0);
  6592. item.startGame();
  6593. if (DataMgr.getNewUser())
  6594. Moyu.sendDataEvent("gameStart1");
  6595. }
  6596. initSkillData() {
  6597. this.skillData = [];
  6598. let nameList = xGame.common.skillNameList;
  6599. let iconList = xGame.common.skillIconList;
  6600. let describeList = [
  6601. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6602. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6603. "The power of frost descends—freezing the flow and taking full control of the game!"
  6604. ];
  6605. console.log('zh:initSkillData 111111111');
  6606. let data;
  6607. for (let index = 0; index < nameList.length; index++) {
  6608. data = {};
  6609. data.name = nameList[index];
  6610. data.icon = iconList[index];
  6611. data.describe = describeList[index];
  6612. data.index = index;
  6613. this.skillData.push(data);
  6614. }
  6615. }
  6616. updateSkillItem(index, target) {
  6617. if (this.displayList[index] == null) {
  6618. let uiIndex;
  6619. switch (index) {
  6620. case 0:
  6621. uiIndex = 1;
  6622. break;
  6623. case 1:
  6624. uiIndex = 0;
  6625. break;
  6626. case 2:
  6627. uiIndex = 2;
  6628. break;
  6629. case 3:
  6630. uiIndex = 3;
  6631. break;
  6632. default:
  6633. break;
  6634. }
  6635. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6636. this.displayList.push(temp);
  6637. }
  6638. }
  6639. playSecretaryIdle() {
  6640. let parent = this.ui.secretary.displayObject;
  6641. parent.destroyChildren();
  6642. let xx = this.ui.secretary.width / 2;
  6643. let yy = this.ui.secretary.height;
  6644. let scale = xGame.common.getSecretaryScale();
  6645. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6646. xGame.common.secretary.play(data, 0, true, parent);
  6647. }
  6648. returnUIMain() {
  6649. this.hide();
  6650. xGame.common.stopGirlPop(this.ui.talkNode);
  6651. xGame.uiMgr.Show(UIMain);
  6652. }
  6653. interuptSecretary() {
  6654. Laya.timer.clearAll(this);
  6655. this.playSecretaryRandomSound();
  6656. }
  6657. playSecretaryRandomSound() {
  6658. if (this.isHide)
  6659. return;
  6660. let time = xGame.common.randomNum(45000, 60000);
  6661. Laya.timer.once(time, this, () => {
  6662. if (this.isHide)
  6663. return;
  6664. let index = xGame.common.randomNum(4, 7);
  6665. xGame.soundMgr.playSound("s_main0" + index);
  6666. let words = 1;
  6667. switch (index) {
  6668. case 4:
  6669. words = 5;
  6670. break;
  6671. case 5:
  6672. words = 3;
  6673. break;
  6674. case 6:
  6675. words = 6;
  6676. break;
  6677. case 7:
  6678. words = 7;
  6679. break;
  6680. default:
  6681. break;
  6682. }
  6683. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6684. this.playSecretaryRandomSound();
  6685. });
  6686. }
  6687. }
  6688. UISkill.uiName = "UISkill";
  6689. class ui_UIModeSelection extends fgui.GComponent {
  6690. static createInstance() {
  6691. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6692. }
  6693. onConstruct() {
  6694. this.n19 = (this.getChild("n19"));
  6695. this.closeBtn = (this.getChild("closeBtn"));
  6696. this.myNode = (this.getChild("myNode"));
  6697. this.t0 = this.getTransition("t0");
  6698. }
  6699. }
  6700. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6701. class UIModeSelection extends UIBase {
  6702. constructor() {
  6703. super();
  6704. }
  6705. onConstructor() {
  6706. this.ui = ui_UIModeSelection.createInstance();
  6707. this.contentPane = this.ui;
  6708. this.isEject = false;
  6709. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6710. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6711. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6712. this.addUIClick(this.ui.closeBtn, this.hide);
  6713. this.peopleArr = [65, 990, 580];
  6714. this.peopleOffest = [5, 10, 10];
  6715. }
  6716. show(callback) {
  6717. this.updateSelf();
  6718. super.show();
  6719. this.ui.t0.play();
  6720. this.callback = callback;
  6721. }
  6722. updateSelf() {
  6723. let cfg = cfgTable.modeselectData;
  6724. for (let index = 1; index <= 3; index++) {
  6725. let node = this.ui.myNode["type" + index];
  6726. node.need.text = cfg[index].need;
  6727. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6728. node.peopleTxt.text = this.getRandPeople(index - 1);
  6729. }
  6730. }
  6731. enterGame(type) {
  6732. console.log('zh: 进入经典模式 type: ' + type);
  6733. xGame.common.classicRoomType = type;
  6734. let cfg = cfgTable.modeselectData[type];
  6735. let need = cfg.need;
  6736. xGame.common.passAwardCoin = cfg.award;
  6737. if (DataMgr.coinEnough(need)) {
  6738. DataMgr.setCoin(-need);
  6739. this.ui.myNode["type" + type].t0.play();
  6740. Laya.timer.once(200, this, () => {
  6741. this.callback && this.callback();
  6742. });
  6743. this.logEventForClassic_start();
  6744. }
  6745. else {
  6746. Moyu.sendDataEvent("AddCoinVideo");
  6747. xGame.uiMgr.Show(UIAddProp, 0);
  6748. }
  6749. }
  6750. getRandPeople(index) {
  6751. let rand = this.peopleOffest[index];
  6752. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6753. }
  6754. logEventForClassic_start() {
  6755. let rtype = xGame.common.classicRoomType;
  6756. let msmc = '';
  6757. if (rtype == 1) {
  6758. msmc = 'beginner';
  6759. }
  6760. if (rtype == 2) {
  6761. msmc = 'expert';
  6762. }
  6763. if (rtype == 3) {
  6764. msmc = 'master';
  6765. }
  6766. let keyStr = 'sjmd_classic_start_' + rtype;
  6767. let jsonStr = {
  6768. "difficulty": msmc,
  6769. "classic_count": 1,
  6770. "difficulty_count": 1
  6771. };
  6772. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6773. const d = LocalStorageManager.getItem(keyStr);
  6774. jsonStr.classic_count = d.classic_count + 1;
  6775. jsonStr.difficulty_count = d.difficulty_count + 1;
  6776. LocalStorageManager.setItem(keyStr, jsonStr);
  6777. }
  6778. else {
  6779. LocalStorageManager.setItem(keyStr, jsonStr);
  6780. }
  6781. const reqStr = JSON.stringify(jsonStr);
  6782. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6783. }
  6784. }
  6785. UIModeSelection.uiName = "UIModeSelection";
  6786. class ui_UIReg extends fgui.GComponent {
  6787. static createInstance() {
  6788. return (fgui.UIPackage.createObject("game", "UIReg"));
  6789. }
  6790. onConstruct() {
  6791. this.n38 = (this.getChild("n38"));
  6792. this.n9 = (this.getChild("n9"));
  6793. this.n14 = (this.getChild("n14"));
  6794. this.n15 = (this.getChild("n15"));
  6795. this.n34 = (this.getChild("n34"));
  6796. this.closeBtn = (this.getChild("closeBtn"));
  6797. this.lab_tip = (this.getChild("lab_tip"));
  6798. this.n43 = (this.getChild("n43"));
  6799. this.txt_ua = (this.getChild("txt_ua"));
  6800. this.n44 = (this.getChild("n44"));
  6801. this.txt_up1 = (this.getChild("txt_up1"));
  6802. this.n45 = (this.getChild("n45"));
  6803. this.txt_up2 = (this.getChild("txt_up2"));
  6804. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6805. this.btn_reg = (this.getChild("btn_reg"));
  6806. this.n50 = (this.getChild("n50"));
  6807. }
  6808. }
  6809. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6810. class ui_UILogin extends fgui.GComponent {
  6811. static createInstance() {
  6812. return (fgui.UIPackage.createObject("game", "UILogin"));
  6813. }
  6814. onConstruct() {
  6815. this.c1 = this.getController("c1");
  6816. this.n18 = (this.getChild("n18"));
  6817. this.n7 = (this.getChild("n7"));
  6818. this.n5 = (this.getChild("n5"));
  6819. this.n6 = (this.getChild("n6"));
  6820. this.closeBtn = (this.getChild("closeBtn"));
  6821. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6822. this.btn_login = (this.getChild("btn_login"));
  6823. this.n30 = (this.getChild("n30"));
  6824. this.n31 = (this.getChild("n31"));
  6825. this.txt_up = (this.getChild("txt_up"));
  6826. this.n32 = (this.getChild("n32"));
  6827. this.txt_ua = (this.getChild("txt_ua"));
  6828. }
  6829. }
  6830. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6831. class UILogin extends UIBase {
  6832. constructor() {
  6833. super();
  6834. }
  6835. onConstructor() {
  6836. this.ui = ui_UILogin.createInstance();
  6837. this.contentPane = this.ui;
  6838. this.isEject = false;
  6839. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6840. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6841. this.addUIClick(this.ui.btn_login, this.userLogin);
  6842. }
  6843. show() {
  6844. super.show();
  6845. this.x = (Laya.stage.width - this.width) / 2;
  6846. this.y = (Laya.stage.height - this.height) / 2;
  6847. }
  6848. closeSelf() {
  6849. this.hide();
  6850. }
  6851. userLogin() {
  6852. let ua = this.ui.txt_ua.text;
  6853. let up = this.ui.txt_up.text;
  6854. if (ua && up) {
  6855. let reqData = JSON.stringify({
  6856. username: ua.trim(),
  6857. password: up.trim(),
  6858. fromMark: 'app_game'
  6859. });
  6860. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6861. try {
  6862. console.log('zh:res = ' + JSON.stringify(res));
  6863. let code = res.code;
  6864. let msg = res.msg;
  6865. if (code == 200) {
  6866. let keyStr = 'userInfo';
  6867. let jsonStr = {
  6868. "username": res.username,
  6869. "token": res.token
  6870. };
  6871. LocalStorageManager.setItem(keyStr, jsonStr);
  6872. xGame.uiMgr.Show(UIMsg, msg);
  6873. DataMgr.getUserZiChanInfo();
  6874. this.closeSelf();
  6875. }
  6876. else {
  6877. xGame.uiMgr.Show(UIMsg, msg);
  6878. }
  6879. }
  6880. catch (error) {
  6881. console.log('error=' + error);
  6882. alert(error);
  6883. }
  6884. finally {
  6885. }
  6886. });
  6887. }
  6888. else {
  6889. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6890. }
  6891. }
  6892. gotoRegPage() {
  6893. this.closeSelf();
  6894. xGame.uiMgr.Show(UIReg);
  6895. }
  6896. }
  6897. UILogin.uiName = "UILogin";
  6898. class UIReg extends UIBase {
  6899. constructor() {
  6900. super();
  6901. }
  6902. onConstructor() {
  6903. this.ui = ui_UIReg.createInstance();
  6904. this.contentPane = this.ui;
  6905. this.isEject = false;
  6906. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6907. this.addUIClick(this.ui.btn_reg, this.regUser);
  6908. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6909. }
  6910. show() {
  6911. super.show();
  6912. this.x = (Laya.stage.width - this.width) / 2;
  6913. this.y = (Laya.stage.height - this.height) / 2;
  6914. }
  6915. closeSelf() {
  6916. this.hide();
  6917. }
  6918. regUser() {
  6919. this.ui.lab_tip.visible = false;
  6920. let ua = this.ui.txt_ua.text;
  6921. let up1 = this.ui.txt_up1.text;
  6922. let up2 = this.ui.txt_up2.text;
  6923. if (ua && up1 && up2 && up1 == up2) {
  6924. let reqData = JSON.stringify({
  6925. username: ua.trim(),
  6926. password: up1.trim(),
  6927. fromMark: 'app_game'
  6928. });
  6929. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6930. try {
  6931. console.log('zh:res = ' + JSON.stringify(res));
  6932. let code = res.code;
  6933. let msg = res.msg;
  6934. xGame.uiMgr.Show(UIMsg, msg);
  6935. if (code == 200) {
  6936. this.ui.lab_tip.color = "#FFFFFF";
  6937. xGame.uiMgr.Show(UIMsg, msg);
  6938. this.closeSelf();
  6939. }
  6940. else {
  6941. this.ui.lab_tip.color = "#FF0000";
  6942. xGame.uiMgr.Show(UIMsg, msg);
  6943. }
  6944. }
  6945. catch (error) {
  6946. console.log('error=' + error);
  6947. alert(error);
  6948. }
  6949. finally {
  6950. }
  6951. });
  6952. }
  6953. else {
  6954. if (up1 != up2) {
  6955. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6956. }
  6957. else {
  6958. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6959. }
  6960. }
  6961. }
  6962. gotoLogin() {
  6963. this.closeSelf();
  6964. xGame.uiMgr.Show(UILogin);
  6965. }
  6966. }
  6967. UIReg.uiName = "UIReg";
  6968. class ui_UIFuli1 extends fgui.GComponent {
  6969. static createInstance() {
  6970. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  6971. }
  6972. onConstruct() {
  6973. this.n1 = (this.getChild("n1"));
  6974. this.n2 = (this.getChild("n2"));
  6975. }
  6976. }
  6977. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  6978. class UIFuli1 extends UIBase {
  6979. constructor() {
  6980. super();
  6981. }
  6982. onConstructor() {
  6983. this.ui = ui_UIFuli1.createInstance();
  6984. this.contentPane = this.ui;
  6985. this.isEject = false;
  6986. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  6987. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  6988. }
  6989. show() {
  6990. super.show();
  6991. this.x = (Laya.stage.width - this.width) / 2;
  6992. this.y = (Laya.stage.height - this.height) / 2;
  6993. }
  6994. closeSelf() {
  6995. this.hide();
  6996. }
  6997. gotoBuy() {
  6998. let userInfo = LocalStorageManager.getItem('userInfo');
  6999. if (userInfo != null) {
  7000. let token = userInfo.token;
  7001. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  7002. JSBridgeUtils.instance.startGgPay(token, ggSpid);
  7003. return;
  7004. }
  7005. else {
  7006. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7007. }
  7008. }
  7009. gotoBuy2() {
  7010. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7011. if (userInfo == null) {
  7012. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7013. return;
  7014. }
  7015. let reqData = xGame.httpMgr.getReqData();
  7016. let pd = JSON.parse(reqData);
  7017. pd.productId = 1;
  7018. reqData = JSON.stringify(pd);
  7019. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7020. try {
  7021. console.log('zh:buySp res = ' + JSON.stringify(res));
  7022. let code = res.code;
  7023. let msg = res.msg;
  7024. if (code == 401) {
  7025. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7026. alert(TIP_MSG_key.loginTimeOut);
  7027. xGame.uiMgr.Show(UIMsg, msg);
  7028. return;
  7029. }
  7030. if (code == 200) {
  7031. xGame.uiMgr.Show(UIMsg, msg);
  7032. DataMgr.getUserZiChanInfo();
  7033. this.closeSelf();
  7034. }
  7035. else {
  7036. xGame.uiMgr.Show(UIMsg, msg);
  7037. }
  7038. }
  7039. catch (error) {
  7040. console.log('error=' + error);
  7041. alert(error);
  7042. }
  7043. finally {
  7044. }
  7045. });
  7046. }
  7047. }
  7048. UIFuli1.uiName = "UIFuli1";
  7049. class ui_UIFuli2 extends fgui.GComponent {
  7050. static createInstance() {
  7051. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  7052. }
  7053. onConstruct() {
  7054. this.n1 = (this.getChild("n1"));
  7055. this.n0 = (this.getChild("n0"));
  7056. }
  7057. }
  7058. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  7059. class UIFuli2 extends UIBase {
  7060. constructor() {
  7061. super();
  7062. }
  7063. onConstructor() {
  7064. this.ui = ui_UIFuli2.createInstance();
  7065. this.contentPane = this.ui;
  7066. this.isEject = false;
  7067. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  7068. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  7069. }
  7070. show() {
  7071. super.show();
  7072. this.x = (Laya.stage.width - this.width) / 2;
  7073. this.y = (Laya.stage.height - this.height) / 2;
  7074. }
  7075. closeSelf() {
  7076. this.hide();
  7077. }
  7078. gotoBuy() {
  7079. let userInfo = LocalStorageManager.getItem('userInfo');
  7080. if (userInfo != null) {
  7081. let token = userInfo.token;
  7082. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  7083. JSBridgeUtils.instance.startGgPay(token, ggSpid);
  7084. return;
  7085. }
  7086. else {
  7087. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7088. }
  7089. }
  7090. gotoBuy1() {
  7091. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7092. if (userInfo == null) {
  7093. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7094. return;
  7095. }
  7096. let reqData = xGame.httpMgr.getReqData();
  7097. let pd = JSON.parse(reqData);
  7098. pd.productId = 2;
  7099. reqData = JSON.stringify(pd);
  7100. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7101. try {
  7102. console.log('zh:buySp res = ' + JSON.stringify(res));
  7103. let code = res.code;
  7104. let msg = res.msg;
  7105. if (code == 401) {
  7106. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7107. alert(TIP_MSG_key.loginTimeOut);
  7108. xGame.uiMgr.Show(UIMsg, msg);
  7109. return;
  7110. }
  7111. if (code == 200) {
  7112. xGame.uiMgr.Show(UIMsg, msg);
  7113. DataMgr.getUserZiChanInfo();
  7114. this.closeSelf();
  7115. }
  7116. else {
  7117. xGame.uiMgr.Show(UIMsg, msg);
  7118. }
  7119. }
  7120. catch (error) {
  7121. console.log('error=' + error);
  7122. alert(error);
  7123. }
  7124. finally {
  7125. }
  7126. });
  7127. }
  7128. }
  7129. UIFuli2.uiName = "UIFuli2";
  7130. class ui_UIGetAward extends fgui.GComponent {
  7131. static createInstance() {
  7132. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7133. }
  7134. onConstruct() {
  7135. this.n4 = (this.getChild("n4"));
  7136. this.n0 = (this.getChild("n0"));
  7137. this.myList = (this.getChild("myList"));
  7138. this.n1 = (this.getChild("n1"));
  7139. this.eftNode = (this.getChild("eftNode"));
  7140. this.btnNode = (this.getChild("btnNode"));
  7141. this.t0 = this.getTransition("t0");
  7142. }
  7143. }
  7144. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7145. class UIGetAward extends UIBase {
  7146. constructor() {
  7147. super();
  7148. this.showTriple = true;
  7149. }
  7150. onConstructor() {
  7151. this.ui = ui_UIGetAward.createInstance();
  7152. this.contentPane = this.ui;
  7153. this.isEject = false;
  7154. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7155. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7156. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7157. }
  7158. show(arr, showTriple, callback) {
  7159. super.show();
  7160. this.ui.t0.play();
  7161. this.ui.eftNode.visible = true;
  7162. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7163. this.ui.eftNode.visible = false;
  7164. }), 1, 0, 0, 0.9);
  7165. this.awardArr = arr;
  7166. this.showTriple = showTriple;
  7167. this.callback = callback;
  7168. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7169. this.ui.myList.numItems = arr.length;
  7170. xGame.soundMgr.playSound("getaward");
  7171. }
  7172. updateSelf(index, obj) {
  7173. let temp = this.awardArr[index];
  7174. let icon = this.getIcon(temp.type);
  7175. let str = icon;
  7176. if (temp.type > 2) {
  7177. str = "s" + icon;
  7178. }
  7179. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7180. obj.myIcon.rotation = 0;
  7181. obj.numTxt.text = temp.num + "";
  7182. obj.numTxt.visible = temp.type > 2 ? false : true;
  7183. obj.nameTxt.text = this.getNameStr(temp.type);
  7184. }
  7185. renderItem(index, obj) {
  7186. this.updateSelf(index, obj);
  7187. }
  7188. tripleGetAward() {
  7189. console.log('zh:qjff_AD_for_uigetAward');
  7190. if (Laya.Browser.onAndroid) {
  7191. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7192. if (!boo) {
  7193. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7194. return;
  7195. }
  7196. }
  7197. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7198. }
  7199. else {
  7200. console.log('zh:AD 失败,直接发放奖励');
  7201. this.qjff_AD_for_uigetAward();
  7202. }
  7203. }
  7204. qjff_AD_for_uigetAward() {
  7205. this.getAward(3);
  7206. }
  7207. normalGetAward() {
  7208. if (PlatMgr.isMisVideo())
  7209. this.tripleGetAward();
  7210. else
  7211. this.getAward();
  7212. }
  7213. getAward(times = 1) {
  7214. this.hide();
  7215. for (let index = 0; index < this.awardArr.length; index++) {
  7216. this.awardArr[index].num *= times;
  7217. }
  7218. this.callback && this.callback(times != 1);
  7219. }
  7220. getIcon(type) {
  7221. switch (type) {
  7222. case Prop.diamond:
  7223. return "ty_zs";
  7224. case Prop.coin:
  7225. return "ty_jb";
  7226. case Prop.gan1:
  7227. return "qg1";
  7228. case Prop.gan2:
  7229. return "qg2";
  7230. case Prop.gan3:
  7231. return "qg3";
  7232. case Prop.gan4:
  7233. return "qg4";
  7234. default:
  7235. break;
  7236. }
  7237. }
  7238. getNameStr(type) {
  7239. switch (type) {
  7240. case Prop.diamond:
  7241. return "Diamond";
  7242. case Prop.coin:
  7243. return "Coins";
  7244. case Prop.gan1:
  7245. case Prop.gan2:
  7246. case Prop.gan3:
  7247. case Prop.gan4:
  7248. return cfgTable.ballrodData[type - 1].name;
  7249. default:
  7250. break;
  7251. }
  7252. }
  7253. }
  7254. UIGetAward.uiName = "UIGetAward";
  7255. class ui_UIRepentProp extends fgui.GComponent {
  7256. static createInstance() {
  7257. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7258. }
  7259. onConstruct() {
  7260. this.c1 = this.getController("c1");
  7261. this.n11 = (this.getChild("n11"));
  7262. this.regretNode = (this.getChild("regretNode"));
  7263. this.helpLineNode = (this.getChild("helpLineNode"));
  7264. this.t0 = this.getTransition("t0");
  7265. }
  7266. }
  7267. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7268. class UIRepentProp extends UIBase {
  7269. constructor() {
  7270. super();
  7271. this.viewType = 0;
  7272. this.regretType = 0;
  7273. }
  7274. onConstructor() {
  7275. this.ui = ui_UIRepentProp.createInstance();
  7276. this.contentPane = this.ui;
  7277. this.isEject = false;
  7278. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7279. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7280. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7281. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7282. }
  7283. show(viewType, regretType, callback) {
  7284. PlatMgr.showInsert(true);
  7285. this.viewType = viewType;
  7286. this.regretType = regretType;
  7287. this.callback = callback;
  7288. super.show();
  7289. this.ui.t0.play();
  7290. this.ui.c1.selectedIndex = this.viewType;
  7291. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7292. if (this.viewType == 0) {
  7293. let guide = DataMgr.getGuideHelpLine();
  7294. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7295. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7296. }
  7297. xGame.common.gameMgr.gamePause = true;
  7298. }
  7299. hideSelf() {
  7300. xGame.common.gameMgr.gamePause = false;
  7301. this.callback && this.callback(false);
  7302. this.hide();
  7303. }
  7304. videoRegret() {
  7305. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7306. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7307. }
  7308. else {
  7309. console.log('zh:AD 失败,直接发放奖励');
  7310. this.qjff_AD_for_UIrepentProp_videoRegret();
  7311. }
  7312. }
  7313. qjff_AD_for_UIrepentProp_videoRegret() {
  7314. this.callback && this.callback(true);
  7315. this.hideSelf();
  7316. }
  7317. videoAddHelpLine() {
  7318. let guide = DataMgr.getGuideHelpLine();
  7319. if (guide == 0) {
  7320. this.callback && this.callback(true);
  7321. this.hideSelf();
  7322. DataMgr.setGuideHelpLine();
  7323. xGame.common.gameUI.ui.guideNode.visible = false;
  7324. }
  7325. else {
  7326. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7327. if (Laya.Browser.onAndroid) {
  7328. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7329. if (!boo) {
  7330. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7331. return;
  7332. }
  7333. }
  7334. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7335. }
  7336. else {
  7337. console.log('zh:AD 失败,直接发放奖励');
  7338. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7339. }
  7340. }
  7341. }
  7342. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7343. this.callback && this.callback(true);
  7344. this.hideSelf();
  7345. }
  7346. }
  7347. UIRepentProp.uiName = "UIRepentProp";
  7348. class UIMain extends UIBase {
  7349. constructor() {
  7350. super();
  7351. this.firstEnter = true;
  7352. }
  7353. nativeCallJs(msg) {
  7354. let t = msg;
  7355. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7356. switch (t) {
  7357. case 'qjff_chouJiang':
  7358. let dui = xGame.uiMgr.getUI(UIDraw);
  7359. dui.qjff_chouJiang();
  7360. break;
  7361. case 'qjff_AD_for_uisign':
  7362. let dui2 = xGame.uiMgr.getUI(UISign);
  7363. dui2.qjff_AD_for_uisign();
  7364. break;
  7365. case 'qjff_AD_for_uitry':
  7366. let dui3 = xGame.uiMgr.getUI(UITry);
  7367. dui3.qjff_AD_for_uitry();
  7368. break;
  7369. case 'qjff_AD_for_uipower':
  7370. let dui4 = xGame.uiMgr.getUI(UIPower);
  7371. dui4.qjff_AD_for_uipower();
  7372. break;
  7373. case 'qjff_AD_for_uigetAward':
  7374. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7375. dui5.qjff_AD_for_uigetAward();
  7376. break;
  7377. case 'qjff_AD_for_uiGameEnd':
  7378. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7379. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7380. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7381. break;
  7382. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7383. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7384. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7385. break;
  7386. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7387. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7388. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7389. break;
  7390. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7391. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7392. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7393. break;
  7394. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7395. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7396. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7397. break;
  7398. case 'qjff_AD_for_UIBOX_onOpenBox':
  7399. let dui11 = xGame.uiMgr.getUI(UIBox);
  7400. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7401. break;
  7402. case 'qjff_AD_for_UIAddCoin':
  7403. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7404. dui12.qjff_AD_for_UIAddCoin();
  7405. break;
  7406. case '111a':
  7407. let dui14 = xGame.uiMgr.getUI(UISign);
  7408. dui14.qjff_AD_for_uisign();
  7409. break;
  7410. case '222a':
  7411. let dui15 = xGame.uiMgr.getUI(UISign);
  7412. dui15.qjff_AD_for_uisign();
  7413. break;
  7414. case '333a':
  7415. let dui16 = xGame.uiMgr.getUI(UISign);
  7416. dui16.qjff_AD_for_uisign();
  7417. break;
  7418. default:
  7419. console.log('zh:未知的方法名字' + t);
  7420. break;
  7421. }
  7422. }
  7423. onConstructor() {
  7424. console.log('zh: UIMain onConstructor');
  7425. this.ui = ui_UIMain.createInstance();
  7426. this.contentPane = this.ui;
  7427. this.isEject = false;
  7428. this.addEvent();
  7429. this.addClickSpine();
  7430. this.settingNode = new SettingNode(this.ui.settingNode);
  7431. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7432. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7433. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7434. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7435. let curUse = DataMgr.getCurSecretary();
  7436. this.changeSecretary(curUse);
  7437. this.ui.talkNode.visible = false;
  7438. let guide = DataMgr.getSkillGuide();
  7439. if (xGame.common.isNewDay && guide == 1) {
  7440. xGame.common.isNewDay = false;
  7441. xGame.soundMgr.playSound("s_main01");
  7442. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7443. console.log("zh:播放小秘书每天语音");
  7444. }
  7445. this.onGetUserInfo();
  7446. DataMgr.getUserZiChanInfo();
  7447. this.ui.n83.visible = false;
  7448. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7449. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7450. let ua = d.username;
  7451. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7452. }
  7453. this.c_btn_for_user();
  7454. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7455. }
  7456. Logout() {
  7457. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7458. LocalStorageManager.removeItem(keyForLoginInfo);
  7459. this.freshUser();
  7460. }
  7461. JSBridgeUtils.instance.loginOutForApp();
  7462. }
  7463. gotoLogin() {
  7464. xGame.uiMgr.Show(UILogin);
  7465. }
  7466. gotoRegUser() {
  7467. xGame.uiMgr.Show(UIReg);
  7468. }
  7469. showFuLi1() {
  7470. console.log('zh:福利1');
  7471. xGame.uiMgr.Show(UIFuli1);
  7472. }
  7473. showFuLi2() {
  7474. console.log('zh:福利2');
  7475. xGame.uiMgr.Show(UIFuli2);
  7476. }
  7477. c_btn_for_user() {
  7478. this.ui.n_Logout.visible = false;
  7479. this.ui.n_dengLu.visible = false;
  7480. this.ui.n_zhuCe.visible = false;
  7481. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7482. this.ui.n_Logout.visible = true;
  7483. }
  7484. else {
  7485. this.ui.n_dengLu.visible = true;
  7486. }
  7487. }
  7488. changeSecretary(curUse) {
  7489. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7490. xGame.common.secretary && xGame.common.secretary.dispose();
  7491. this.addSecretarySpine(name);
  7492. }
  7493. addSecretarySpine(name) {
  7494. let spine = new SpineMgr(name, () => {
  7495. this.playSecretaryIdle();
  7496. });
  7497. xGame.common.secretary = spine;
  7498. }
  7499. addClickSpine() {
  7500. let clickSpine = new SpineMgr("dianji", () => {
  7501. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7502. let parent = Laya.stage;
  7503. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7504. clickSpine.play(data, 0, false, parent, (spine) => {
  7505. spine.destroy(true);
  7506. });
  7507. });
  7508. });
  7509. }
  7510. addEvent() {
  7511. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7512. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7513. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7514. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7515. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7516. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7517. this.addUIClick(this.ui, this.interuptSecretary);
  7518. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7519. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7520. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7521. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7522. this.addUIClick(this.ui.signBtn, this.openSignView);
  7523. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7524. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7525. this.addUIClick(this.ui.n_Logout, this.Logout);
  7526. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7527. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7528. this.addUIClick(this.ui.n_fuli, this.showFuLi2);
  7529. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7530. }
  7531. show(showFailWords) {
  7532. super.show();
  7533. this.moneyNode.ui.c1.selectedIndex = 1;
  7534. this.playSecretaryIdle();
  7535. xGame.soundMgr.playMusic("caromhall01", 0);
  7536. Laya.timer.clearAll(this);
  7537. this.playSecretaryRandomSound();
  7538. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7539. if (showFailWords) {
  7540. console.log('zh:uimain.ts ');
  7541. setTimeout(() => {
  7542. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7543. let words = -1;
  7544. if (str == "s_main02") {
  7545. words = 2;
  7546. }
  7547. else {
  7548. words = 3;
  7549. }
  7550. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7551. xGame.soundMgr.playSound(str);
  7552. }, 300);
  7553. }
  7554. this.showGuide();
  7555. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7556. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7557. let guide = DataMgr.getSkillGuide();
  7558. if (guide == 1) {
  7559. let randTime = xGame.common.randomNum(300, 800);
  7560. if (this.firstEnter) {
  7561. console.log("zh: firstEnter");
  7562. this.firstEnter = false;
  7563. randTime += 900;
  7564. }
  7565. else {
  7566. console.log("zh: no firstEnter");
  7567. }
  7568. Laya.timer.once(randTime, this, () => {
  7569. });
  7570. Laya.timer.once(1000, this, () => {
  7571. console.log('zh: 1秒后 showFuLi1');
  7572. this.showFuLi1();
  7573. });
  7574. }
  7575. }
  7576. checkActive(show) {
  7577. }
  7578. showGuide() {
  7579. let guide = DataMgr.getSkillGuide();
  7580. this.ui.guideBtn.visible = guide == 0;
  7581. this.ui.enterGuide.visible = false;
  7582. this.ui.secretaryGuide.visible = guide == 0;
  7583. if (guide == 0) {
  7584. console.log("zh:显示引导");
  7585. xGame.soundMgr.playSound("s_guide");
  7586. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7587. }
  7588. else {
  7589. console.log("zh:不需要显示引导");
  7590. }
  7591. }
  7592. ensureSecretary() {
  7593. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7594. this.ui.secretaryGuide.visible = false;
  7595. this.ui.enterGuide.visible = true;
  7596. this.ui.wordsNode.t0.play();
  7597. if (DataMgr.getNewUser())
  7598. Moyu.sendDataEvent("gameReady");
  7599. }
  7600. playSecretaryIdle() {
  7601. let parent = this.ui.secretary.displayObject;
  7602. parent.destroyChildren();
  7603. let xx = this.ui.secretary.width / 2;
  7604. let yy = this.ui.secretary.height;
  7605. let scale = xGame.common.getSecretaryScale();
  7606. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7607. xGame.common.secretary.play(data, 0, true, parent);
  7608. }
  7609. startGame(type) {
  7610. if (!this.isReadyForLoadNetSource()) {
  7611. return;
  7612. }
  7613. xGame.common.gameMode = type;
  7614. Moyu.sendDataEvent("PlayGame", { type: type });
  7615. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7616. switch (xGame.common.gameMode) {
  7617. case GameMode.classic:
  7618. console.log('zh:进入经典模式111111111');
  7619. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7620. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7621. console.log('zh:classic db_over_lev=', db_over_lev);
  7622. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7623. console.log('zh:判断是否可以玩该模式classic =NO');
  7624. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7625. xGame.uiMgr.Show(UIMsg, tipStr);
  7626. return;
  7627. }
  7628. else {
  7629. console.log('zh:可以玩该模式classic 66666666666666');
  7630. this.beginGame();
  7631. }
  7632. }
  7633. else {
  7634. console.log('zh:不需要判断是否可以玩该classic');
  7635. let challengeTimes = DataMgr.getChallengeTimes();
  7636. if (challengeTimes == 0) {
  7637. xGame.uiMgr.Show(UIInvitation);
  7638. }
  7639. else {
  7640. this.beginGame();
  7641. }
  7642. break;
  7643. }
  7644. case GameMode.bigMove:
  7645. console.error('zh:bigMove check');
  7646. let guide = DataMgr.getSkillGuide();
  7647. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7648. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7649. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7650. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7651. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7652. xGame.uiMgr.Show(UIMsg, tipStr);
  7653. return;
  7654. }
  7655. else {
  7656. console.log('zh:可以玩该模式 bigMove');
  7657. this.beginGame();
  7658. if (DataMgr.getNewUser())
  7659. Moyu.sendDataEvent("gameStart0");
  7660. }
  7661. }
  7662. else {
  7663. this.beginGame();
  7664. if (DataMgr.getNewUser())
  7665. Moyu.sendDataEvent("gameStart0");
  7666. }
  7667. break;
  7668. default:
  7669. console.error('zh:未知错误!!!!');
  7670. break;
  7671. }
  7672. }
  7673. beginGame(isNice = false) {
  7674. console.log('zh:beginGame ');
  7675. let guide = DataMgr.getSkillGuide();
  7676. if (guide == 1) {
  7677. console.log('zh:非新手引导,showInternAd ');
  7678. JSBridgeUtils.instance.showInternAd('beginGame');
  7679. }
  7680. else {
  7681. console.log('zh:新手引导,不显示AD ');
  7682. }
  7683. console.log('zh:beginGame 2 go');
  7684. if (xGame.common.gameMode == GameMode.classic) {
  7685. if (isNice) {
  7686. this.enterClassic();
  7687. }
  7688. else {
  7689. xGame.uiMgr.Show(UIModeSelection, () => {
  7690. console.log('zh:BBBBBBBBBBBBBBB');
  7691. this.enterClassic();
  7692. });
  7693. }
  7694. }
  7695. else if (xGame.common.gameMode == GameMode.bigMove) {
  7696. this.ui.enterGuide.visible = false;
  7697. xGame.uiMgr.Show(UISkill);
  7698. }
  7699. }
  7700. enterClassic() {
  7701. xGame.uiMgr.Show(UIGame);
  7702. xGame.uiMgr.Show(UIMatching, () => {
  7703. if (!this.isHide)
  7704. this.hide();
  7705. xGame.common.gameUI.ui.alpha = 1;
  7706. xGame.common.gameUI.startGame();
  7707. xGame.uiMgr.Hide(UIGameEnd);
  7708. });
  7709. }
  7710. start_debug_for_moni_payOk() {
  7711. console.log('zh:start_debug_for_moni_payOk 111');
  7712. let userInfo = LocalStorageManager.getItem('userInfo');
  7713. if (userInfo != null) {
  7714. let token = userInfo.token;
  7715. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7716. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid);
  7717. return;
  7718. }
  7719. else {
  7720. alert(TIP_MSG_key.pleaseLoginIn);
  7721. }
  7722. }
  7723. startGlobal() {
  7724. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7725. }
  7726. startWeekly() {
  7727. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7728. }
  7729. zhouSaiMonth() {
  7730. console.log('zh: zhouSaiMonth 被调用');
  7731. }
  7732. isReadyForLoadNetSource() {
  7733. let reqCount = xGame.cfgMgr.httpReqCount;
  7734. let ok = xGame.cfgMgr.httpReqOkCount;
  7735. if (reqCount > ok) {
  7736. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7737. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7738. Laya.timer.once(5000, this, () => {
  7739. let retryCount = 0;
  7740. const maxRetries = 3;
  7741. const tryFetchConfig = () => {
  7742. try {
  7743. xGame.cfgMgr.getConfigFromServer();
  7744. }
  7745. catch (error) {
  7746. if (retryCount < maxRetries) {
  7747. retryCount++;
  7748. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7749. Laya.timer.once(5000, this, tryFetchConfig);
  7750. }
  7751. else {
  7752. console.error("❌ 达到最大重试次数,配置获取失败");
  7753. }
  7754. }
  7755. };
  7756. tryFetchConfig();
  7757. });
  7758. return false;
  7759. }
  7760. return true;
  7761. }
  7762. startPlaceBall() {
  7763. if (!this.isReadyForLoadNetSource()) {
  7764. return;
  7765. }
  7766. xGame.uiMgr.Show(UILevelDisplay);
  7767. }
  7768. hide() {
  7769. console.log('zh:uimain hide ...');
  7770. super.hide();
  7771. xGame.common.stopGirlPop(this.ui.talkNode);
  7772. }
  7773. onGetUserInfo(force = false) {
  7774. if (Moyu.isWx) {
  7775. let info = Moyu.getSystemInfo();
  7776. if (info)
  7777. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7778. }
  7779. else {
  7780. Moyu.initUser(this, this.freshUser, force);
  7781. }
  7782. this.freshUser();
  7783. }
  7784. freshUser() {
  7785. let user = Moyu.getUserInfo();
  7786. if (!user.isAuth) {
  7787. user.headIcon = 'res/ty_touxiang.png';
  7788. }
  7789. else {
  7790. DataMgr.upRankData();
  7791. }
  7792. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7793. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7794. let keyStr = keyForLoginInfo;
  7795. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7796. const d = LocalStorageManager.getItem(keyStr);
  7797. let ua = d.username;
  7798. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7799. }
  7800. else {
  7801. }
  7802. this.c_btn_for_user();
  7803. }
  7804. interuptSecretary() {
  7805. Laya.timer.clearAll(this);
  7806. this.playSecretaryRandomSound();
  7807. }
  7808. playSecretaryRandomSound() {
  7809. if (this.isHide)
  7810. return;
  7811. let time = xGame.common.randomNum(45000, 60000);
  7812. Laya.timer.once(time, this, () => {
  7813. if (this.isHide)
  7814. return;
  7815. let index = xGame.common.randomNum(4, 7);
  7816. xGame.soundMgr.playSound("s_main0" + index);
  7817. let words = 1;
  7818. switch (index) {
  7819. case 4:
  7820. words = 5;
  7821. break;
  7822. case 5:
  7823. words = 3;
  7824. break;
  7825. case 6:
  7826. words = 6;
  7827. break;
  7828. case 7:
  7829. words = 7;
  7830. break;
  7831. default:
  7832. break;
  7833. }
  7834. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7835. this.playSecretaryRandomSound();
  7836. });
  7837. }
  7838. openSecretaryView() {
  7839. xGame.uiMgr.Show(UISecretary);
  7840. Moyu.sendDataEvent("secretary");
  7841. }
  7842. openShopView() {
  7843. xGame.uiMgr.Show(UIShop, 0);
  7844. }
  7845. openSignView() {
  7846. xGame.uiMgr.Show(UISign);
  7847. }
  7848. openDrawView() {
  7849. xGame.uiMgr.Show(UIDraw);
  7850. }
  7851. openRanking() {
  7852. console.log('zh:phb openRanking');
  7853. xGame.uiMgr.Show(UIRanking);
  7854. Moyu.sendDataEvent("rankingList");
  7855. }
  7856. }
  7857. UIMain.uiName = "UIMain";
  7858. class UIGameEnd extends UIBase {
  7859. constructor() {
  7860. super();
  7861. this.success = false;
  7862. this.awardCoinNum = 1000;
  7863. this.awardDiamondNum = 10;
  7864. }
  7865. onConstructor() {
  7866. this.ui = ui_UIGameEnd.createInstance();
  7867. this.contentPane = this.ui;
  7868. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7869. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7870. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7871. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7872. this.ui.talkNode.visible = false;
  7873. if (Moyu.isKs)
  7874. this.ui.closeNode.closeBtn.x += 100;
  7875. }
  7876. updateType() {
  7877. switch (xGame.common.gameMode) {
  7878. case GameMode.classic:
  7879. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7880. this.ui.coinNode.visible = this.success;
  7881. if (!this.success) {
  7882. Laya.timer.once(500, this, () => {
  7883. xGame.uiMgr.Show(UIAddCoin);
  7884. });
  7885. }
  7886. else {
  7887. this.logEventForClassic_win();
  7888. }
  7889. this.logEventForClassic_complete();
  7890. this.ui.isGetAward.visible = false;
  7891. this.ui.leftBtn.c1.selectedIndex = 3;
  7892. this.ui.rightBtn.c1.selectedIndex = 0;
  7893. this.moneyNode.ui.c1.selectedIndex = 1;
  7894. break;
  7895. case GameMode.bigMove:
  7896. console.log('zh:招法模式 aaaaaa bigMove');
  7897. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7898. this.ui.coinNode.visible = this.success;
  7899. if (xGame.common.gameMode == GameMode.bigMove) {
  7900. if (this.success) {
  7901. DataMgr.setSkillSuccessTimes(1, true);
  7902. DataMgr.setSkillAccTimes(1);
  7903. }
  7904. else {
  7905. DataMgr.setSkillSuccessTimes(0, false);
  7906. }
  7907. }
  7908. this.logEventForRod_complete_N();
  7909. if (!this.success) {
  7910. Laya.timer.once(500, this, () => {
  7911. xGame.uiMgr.Show(UIAddCoin);
  7912. });
  7913. }
  7914. else {
  7915. this.logEventForRod_win();
  7916. }
  7917. this.ui.isGetAward.visible = false;
  7918. this.ui.leftBtn.c1.selectedIndex = 3;
  7919. this.ui.rightBtn.c1.selectedIndex = 0;
  7920. this.moneyNode.ui.c1.selectedIndex = 1;
  7921. break;
  7922. case GameMode.placeBall:
  7923. this.ui.coinNode.visible = false;
  7924. if (this.success) {
  7925. if (xGame.common.placeBallStarNum == 3) {
  7926. this.ui.c1.selectedIndex = 2;
  7927. }
  7928. else {
  7929. this.ui.c1.selectedIndex = 3;
  7930. }
  7931. let level = xGame.common.placeBallCurLevel;
  7932. if (level > 59) {
  7933. this.logEventForChallenge_level_complete(level);
  7934. }
  7935. else {
  7936. this.logEventForChallenge_level_N(level);
  7937. }
  7938. }
  7939. else {
  7940. this.ui.c1.selectedIndex = 4;
  7941. }
  7942. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7943. if (cfg.type == PlaceBallType.challenge) {
  7944. this.ui.c1.selectedIndex = 2;
  7945. }
  7946. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7947. this.updatePlaceBallBtn();
  7948. this.updatePlaceBallStarNum();
  7949. this.updatePlaceBallAwardState();
  7950. this.moneyNode.ui.c1.selectedIndex = 2;
  7951. this.moneyNode.checkPowerTime();
  7952. this.moneyNode.powerChange();
  7953. DataMgr.upRankData();
  7954. break;
  7955. default:
  7956. break;
  7957. }
  7958. }
  7959. logEventForRod_complete_N() {
  7960. let gfmsIdx = xGame.common.curPlayerSkillType;
  7961. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7962. let gfmc = 'Skyfall Shot';
  7963. if (gfmsIdx == 0) {
  7964. gfmc = 'Skyfall Shot';
  7965. }
  7966. if (gfmsIdx == 1) {
  7967. gfmc = 'Surging break';
  7968. }
  7969. if (gfmsIdx == 2) {
  7970. gfmc = 'Frost Lock';
  7971. }
  7972. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7973. console.log('zh:logEventForRod_complete_N level = ' + level);
  7974. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7975. let jsonStr = {
  7976. "count": 0,
  7977. "name": gfmc
  7978. };
  7979. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7980. const d = LocalStorageManager.getItem(keyStr);
  7981. jsonStr.count = d.count + 1;
  7982. LocalStorageManager.setItem(keyStr, jsonStr);
  7983. }
  7984. else {
  7985. LocalStorageManager.setItem(keyStr, jsonStr);
  7986. }
  7987. const d2 = LocalStorageManager.getItem(keyStr);
  7988. let count = d2.count;
  7989. console.log('zh:logEventForRod_complete_N count = ' + count);
  7990. if (count % 5 == 0) {
  7991. const reqStr = JSON.stringify(jsonStr);
  7992. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7993. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7994. }
  7995. }
  7996. logEventForRod_win() {
  7997. console.log('zh:logEventForRod_win,胜利');
  7998. let gfmsIdx = xGame.common.curPlayerSkillType;
  7999. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8000. let gfmc = 'Skyfall Shot';
  8001. if (gfmsIdx == 0) {
  8002. gfmc = 'Skyfall Shot';
  8003. }
  8004. if (gfmsIdx == 1) {
  8005. gfmc = 'Surging break';
  8006. }
  8007. if (gfmsIdx == 2) {
  8008. gfmc = 'Frost Lock';
  8009. }
  8010. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8011. console.log('zh:logEventForRod_win level = ' + level);
  8012. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8013. let jsonStr = {
  8014. "count": 1,
  8015. "name": gfmc + ' Lev' + level
  8016. };
  8017. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8018. const d = LocalStorageManager.getItem(keyStr);
  8019. jsonStr.count = d.count + 1;
  8020. LocalStorageManager.setItem(keyStr, jsonStr);
  8021. }
  8022. else {
  8023. LocalStorageManager.setItem(keyStr, jsonStr);
  8024. }
  8025. const reqStr = JSON.stringify(jsonStr);
  8026. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8027. }
  8028. logEventForClassic_win() {
  8029. console.log('zh:logEventForClassic_win,胜利');
  8030. let rtype = xGame.common.classicRoomType;
  8031. let msmc = '';
  8032. if (rtype == 1) {
  8033. msmc = 'beginner';
  8034. }
  8035. if (rtype == 2) {
  8036. msmc = 'expert';
  8037. }
  8038. if (rtype == 3) {
  8039. msmc = 'master';
  8040. }
  8041. let keyStr = 'sjmd_classic_win_' + rtype;
  8042. let jsonStr = {
  8043. "difficulty": msmc,
  8044. "classic_count": 1,
  8045. "difficulty_count": 1
  8046. };
  8047. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8048. const d = LocalStorageManager.getItem(keyStr);
  8049. jsonStr.classic_count = d.classic_count + 1;
  8050. jsonStr.difficulty_count = d.difficulty_count + 1;
  8051. LocalStorageManager.setItem(keyStr, jsonStr);
  8052. }
  8053. else {
  8054. LocalStorageManager.setItem(keyStr, jsonStr);
  8055. }
  8056. const reqStr = JSON.stringify(jsonStr);
  8057. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8058. }
  8059. logEventForClassic_complete() {
  8060. console.log('zh:logEventForClassic_complete,胜利');
  8061. let rtype = xGame.common.classicRoomType;
  8062. let msmc = '';
  8063. if (rtype == 1) {
  8064. msmc = 'beginner';
  8065. }
  8066. if (rtype == 2) {
  8067. msmc = 'expert';
  8068. }
  8069. if (rtype == 3) {
  8070. msmc = 'master';
  8071. }
  8072. let keyStr = 'sjmd_classic_complete_' + rtype;
  8073. let jsonStr = {
  8074. "msmc": msmc,
  8075. "count": 0
  8076. };
  8077. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8078. const d = LocalStorageManager.getItem(keyStr);
  8079. jsonStr.count = d.count + 1;
  8080. LocalStorageManager.setItem(keyStr, jsonStr);
  8081. }
  8082. else {
  8083. LocalStorageManager.setItem(keyStr, jsonStr);
  8084. }
  8085. if (jsonStr.count % 5 == 0) {
  8086. const reqStr = JSON.stringify(jsonStr);
  8087. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8088. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8089. }
  8090. }
  8091. updatePlaceBallBtn() {
  8092. this.ui.leftBtn.c1.selectedIndex = 5;
  8093. if (this.success) {
  8094. this.ui.rightBtn.c1.selectedIndex = 14;
  8095. }
  8096. else {
  8097. if (xGame.common.placeBallStarNum == 3) {
  8098. this.ui.rightBtn.c1.selectedIndex = 14;
  8099. }
  8100. else {
  8101. this.ui.rightBtn.c1.selectedIndex = 1;
  8102. }
  8103. }
  8104. }
  8105. updatePlaceBallStarNum() {
  8106. let starNum = xGame.common.placeBallStarNum;
  8107. if (starNum == 0)
  8108. this.ui.starNumNode.c1.selectedIndex = 3;
  8109. else {
  8110. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8111. }
  8112. }
  8113. updatePlaceBallAwardState() {
  8114. let level = xGame.common.placeBallCurLevel;
  8115. let starNum = xGame.common.placeBallStarNum;
  8116. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8117. let data = cfgTable.placeballData[level].award;
  8118. let cfg = cfgTable.placeballData[level];
  8119. this.awardDiamondNum = data[1];
  8120. this.awardCoinNum = data[0];
  8121. if (cfg.type == PlaceBallType.challenge) {
  8122. this.awardDiamondNum = 0;
  8123. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8124. }
  8125. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8126. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8127. if (cfg.type == PlaceBallType.challenge) {
  8128. this.ui.awardNode.coinNode.visible = true;
  8129. }
  8130. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8131. this.ui.awardNode.diamondNode.x = 265;
  8132. this.ui.awardNode.coinNode.x = 354;
  8133. }
  8134. else {
  8135. this.ui.awardNode.diamondNode.x = 291;
  8136. this.ui.awardNode.coinNode.x = 291;
  8137. }
  8138. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8139. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8140. if (this.awardCoinNum == 0) {
  8141. this.ui.awardNode.coinNode.numTxt.text = "";
  8142. }
  8143. if (getAward) {
  8144. this.ui.isGetAward.visible = true;
  8145. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8146. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8147. }
  8148. else {
  8149. this.ui.isGetAward.visible = false;
  8150. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8151. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8152. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8153. }
  8154. else {
  8155. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8156. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8157. }
  8158. }
  8159. }
  8160. show(success) {
  8161. super.show();
  8162. xGame.eventMgr.event(RESET_GAME);
  8163. this.success = success;
  8164. Laya.timer.clearAll(this);
  8165. this.playSecretaryAni();
  8166. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8167. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8168. offsetTime = Math.floor(offsetTime / 1000);
  8169. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8170. this.updateType();
  8171. Laya.timer.once(200, this, () => {
  8172. this.addAward(() => {
  8173. this.updateType();
  8174. Laya.timer.once(500, this, () => {
  8175. this.showChallengeLevel();
  8176. });
  8177. });
  8178. });
  8179. if (this.success) {
  8180. JSBridgeUtils.instance.showInternAd('gameend_success');
  8181. console.log('zh:game end 成功');
  8182. xGame.soundMgr.playSound('slots_roll01');
  8183. xGame.soundMgr.playSound("s_win");
  8184. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8185. this.diyGameDataUtilForGameWin();
  8186. }
  8187. else {
  8188. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8189. console.log('zh:game end失败');
  8190. xGame.soundMgr.playSound('matchwin01');
  8191. xGame.soundMgr.playSound("s_lose");
  8192. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8193. }
  8194. let challengeNum = DataMgr.getChallengeTimes();
  8195. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8196. DataMgr.setChallengeTimes(1);
  8197. }
  8198. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8199. DataMgr.setClassicTimes();
  8200. }
  8201. }
  8202. diyGameDataUtilForGameWin() {
  8203. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8204. switch (xGame.common.gameMode) {
  8205. case GameMode.classic:
  8206. console.log('zh:DiyGameDataUtilForGameWin 111');
  8207. case GameMode.bigMove:
  8208. console.log('zh:DiyGameDataUtilForGameWin 222');
  8209. this.restartGame();
  8210. break;
  8211. case GameMode.placeBall:
  8212. console.log('zh:DiyGameDataUtilForGameWin 333');
  8213. var level = xGame.common.placeBallCurLevel;
  8214. console.log('zh:练习模式 联系了多少LEV=' + level);
  8215. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8216. if (level > db_over_lev) {
  8217. DataMgr.setChallengeMode_overLev(level);
  8218. }
  8219. break;
  8220. default:
  8221. console.log('zh:DiyGameDataUtilForGameWin 444');
  8222. break;
  8223. }
  8224. }
  8225. showChallengeLevel() {
  8226. if (DataMgr.getChallengeTimes() != 0)
  8227. return;
  8228. let skill = DataMgr.getSkillAccTimes();
  8229. let put = DataMgr.getPlaceBallLevelList().length;
  8230. if (skill >= 3 || put >= 5) {
  8231. xGame.uiMgr.Show(UIInvitation);
  8232. this.hide();
  8233. }
  8234. }
  8235. addAward(callback) {
  8236. if (!this.success) {
  8237. callback && callback();
  8238. return;
  8239. }
  8240. switch (xGame.common.gameMode) {
  8241. case GameMode.classic:
  8242. this.awardCoinNum = xGame.common.passAwardCoin;
  8243. this.awardDiamondNum = 0;
  8244. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8245. break;
  8246. case GameMode.bigMove:
  8247. this.awardCoinNum = xGame.common.passAwardCoin;
  8248. this.awardDiamondNum = 0;
  8249. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8250. callback && callback();
  8251. break;
  8252. case GameMode.placeBall:
  8253. let level = xGame.common.placeBallCurLevel;
  8254. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8255. if (xGame.common.placeBallStarNum != 3) {
  8256. callback && callback();
  8257. return;
  8258. }
  8259. else {
  8260. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8261. if (getAward) {
  8262. callback && callback();
  8263. return;
  8264. }
  8265. }
  8266. let cfg = cfgTable.placeballData[level];
  8267. let data = cfgTable.placeballData[level].award;
  8268. this.awardCoinNum = data[0];
  8269. this.awardDiamondNum = data[1];
  8270. if (cfg.type == PlaceBallType.challenge) {
  8271. this.awardDiamondNum = 0;
  8272. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8273. }
  8274. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8275. let diamondAward;
  8276. if (this.awardDiamondNum > 0) {
  8277. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8278. xGame.common.getAward([diamondAward, coinAward], callback);
  8279. }
  8280. else {
  8281. xGame.common.getAward([coinAward], callback);
  8282. }
  8283. if (cfg.type == PlaceBallType.normal) {
  8284. DataMgr.setPlaceBallAward(level);
  8285. }
  8286. break;
  8287. default:
  8288. break;
  8289. }
  8290. }
  8291. playSecretaryAni_old() {
  8292. let parent = this.ui.secretary.displayObject;
  8293. parent.destroyChildren();
  8294. let xx = this.ui.secretary.width / 2;
  8295. let yy = this.ui.secretary.height;
  8296. let scale = xGame.common.getSecretaryScale();
  8297. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8298. if (this.success) {
  8299. let rand = Math.random() <= 0.5 ? 2 : 3;
  8300. xGame.common.secretary.play(data, rand, false, parent, () => {
  8301. xGame.common.secretary.play(data, 1, true, parent);
  8302. });
  8303. }
  8304. else {
  8305. xGame.common.secretary.play(data, 0, true, parent);
  8306. }
  8307. }
  8308. playSecretaryAni() {
  8309. let parent = this.ui.secretary.displayObject;
  8310. parent.destroyChildren();
  8311. let xx = this.ui.secretary.width / 2;
  8312. let yy = this.ui.secretary.height;
  8313. let scale = xGame.common.getSecretaryScale();
  8314. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8315. if (this.success) {
  8316. let rand = 0;
  8317. xGame.common.secretary.play(data, 0, true, parent);
  8318. }
  8319. else {
  8320. xGame.common.secretary.play(data, 0, true, parent);
  8321. }
  8322. }
  8323. restartGame() {
  8324. switch (xGame.common.gameMode) {
  8325. case GameMode.classic:
  8326. xGame.eventMgr.event(RESTART_GAME);
  8327. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8328. break;
  8329. case GameMode.bigMove:
  8330. this.hide();
  8331. xGame.eventMgr.event(RESTART_GAME);
  8332. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8333. break;
  8334. default:
  8335. break;
  8336. }
  8337. }
  8338. hide() {
  8339. super.hide();
  8340. xGame.common.stopGirlPop(this.ui.talkNode);
  8341. PlatMgr.showBanner(false);
  8342. }
  8343. returnHome() {
  8344. this.hide();
  8345. let showFailWords = !this.success;
  8346. xGame.uiMgr.Show(UIMain, showFailWords);
  8347. }
  8348. clickLeftBtn() {
  8349. switch (xGame.common.gameMode) {
  8350. case GameMode.classic:
  8351. case GameMode.bigMove:
  8352. this.returnHome();
  8353. break;
  8354. case GameMode.placeBall:
  8355. let level = xGame.common.placeBallCurLevel;
  8356. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8357. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8358. break;
  8359. default:
  8360. break;
  8361. }
  8362. }
  8363. powerStartPlaceBallLevel(level, btn) {
  8364. if (DataMgr.powerEnough()) {
  8365. btn.touchable = false;
  8366. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8367. btn.touchable = true;
  8368. DataMgr.setPower(-1);
  8369. xGame.eventMgr.event(POWER_TIME);
  8370. this.startPlaceBallLevel(level);
  8371. this.logEventForChallenge_level_start(level);
  8372. }));
  8373. }
  8374. else {
  8375. xGame.uiMgr.Show(UIPower, 0);
  8376. }
  8377. }
  8378. clickRightBtn() {
  8379. switch (xGame.common.gameMode) {
  8380. case GameMode.classic:
  8381. console.log('zh:clickRightBtn 111');
  8382. case GameMode.bigMove:
  8383. console.log('zh:clickRightBtn 222');
  8384. this.restartGame();
  8385. break;
  8386. case GameMode.placeBall:
  8387. console.log('zh:clickRightBtn 333');
  8388. let level = xGame.common.placeBallCurLevel;
  8389. let data = DataMgr.getPlaceBallLevel(level);
  8390. let curPss = data.play && !data.isCur;
  8391. if (curPss) {
  8392. console.log('zh:clickRightBtn 333-111');
  8393. console.log('zh:当前LV=' + level);
  8394. if (level == 60) {
  8395. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8396. Laya.timer.once(3000, this, () => {
  8397. this.returnHome();
  8398. });
  8399. }
  8400. else {
  8401. let lev = level + 1;
  8402. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8403. }
  8404. }
  8405. else {
  8406. console.log('zh:clickRightBtn 333-000');
  8407. Moyu.sendDataEvent("placeBallNextLevel");
  8408. console.log('zh:qjff_AD_for_uiGameEnd');
  8409. if (Laya.Browser.onAndroid) {
  8410. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8411. if (!boo) {
  8412. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8413. return;
  8414. }
  8415. }
  8416. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8417. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8418. }
  8419. else {
  8420. console.log('zh:AD 失败,直接发放奖励');
  8421. this.qjff_AD_for_uiGameEnd(level);
  8422. }
  8423. }
  8424. break;
  8425. default:
  8426. console.log('zh:clickRightBtn 444');
  8427. break;
  8428. }
  8429. }
  8430. logEventForChallenge_level_start(level) {
  8431. let keyStr = 'sjmd_challenge_level_start';
  8432. let jsonStr = {
  8433. "count": 0,
  8434. "gold_balance ": DataMgr.getCoin(),
  8435. "level": level,
  8436. "diamond_balance ": DataMgr.getDiamond()
  8437. };
  8438. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8439. const d = LocalStorageManager.getItem(keyStr);
  8440. if (level > d.level) {
  8441. jsonStr.count = d.count + 1;
  8442. LocalStorageManager.setItem(keyStr, jsonStr);
  8443. }
  8444. else {
  8445. }
  8446. }
  8447. else {
  8448. LocalStorageManager.setItem(keyStr, jsonStr);
  8449. }
  8450. const reqStr = JSON.stringify(jsonStr);
  8451. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8452. }
  8453. qjff_AD_for_uiGameEnd(level) {
  8454. DataMgr.setPlaceBallLevel(level, 1);
  8455. this.startPlaceBallLevel(level + 1);
  8456. }
  8457. startPlaceBallLevel(level) {
  8458. xGame.common.gameMode = GameMode.placeBall;
  8459. xGame.common.placeBallCurLevel = level;
  8460. xGame.uiMgr.Show(UIGame);
  8461. this.hide();
  8462. }
  8463. logEventForChallenge_level_complete(level) {
  8464. let keyStr = 'sjmd_challenge_level_complete';
  8465. let jsonStr = {
  8466. "count": 1,
  8467. "gold_balance ": DataMgr.getCoin(),
  8468. "level": level,
  8469. "diamond_balance ": DataMgr.getDiamond()
  8470. };
  8471. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8472. const d = LocalStorageManager.getItem(keyStr);
  8473. jsonStr.count = d.count + 1;
  8474. LocalStorageManager.setItem(keyStr, jsonStr);
  8475. }
  8476. else {
  8477. LocalStorageManager.setItem(keyStr, jsonStr);
  8478. }
  8479. const reqStr = JSON.stringify(jsonStr);
  8480. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8481. }
  8482. logEventForChallenge_level_N(level) {
  8483. console.log('zh:logEventForChallenge_level_N ' + level);
  8484. let keyStr = 'sjmd_challenge_level_N';
  8485. if (LocalStorageManager.hasKey(keyStr)) {
  8486. let lev = LocalStorageManager.getItem(keyStr);
  8487. if (level > lev) {
  8488. LocalStorageManager.setItem(keyStr, level);
  8489. }
  8490. if ((level) % 5 == 0) {
  8491. console.log('zh:每5关上报1次');
  8492. let sjmc = 'challenge_level_' + level;
  8493. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8494. let sjmcForFirebase = 'challenge_level_' + level;
  8495. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8496. }
  8497. else {
  8498. console.log('zh:5 no 上报');
  8499. }
  8500. }
  8501. else {
  8502. LocalStorageManager.setItem(keyStr, level);
  8503. }
  8504. }
  8505. }
  8506. UIGameEnd.uiName = "UIGameEnd";
  8507. class ui_UIVideoShare extends fgui.GComponent {
  8508. static createInstance() {
  8509. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8510. }
  8511. onConstruct() {
  8512. this.n10 = (this.getChild("n10"));
  8513. this.myNode = (this.getChild("myNode"));
  8514. this.t0 = this.getTransition("t0");
  8515. }
  8516. }
  8517. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8518. class UIVideoShare extends UIBase {
  8519. constructor() {
  8520. super();
  8521. this.success = false;
  8522. this.awardNum = 0;
  8523. this.isShared = true;
  8524. }
  8525. onConstructor() {
  8526. this.ui = ui_UIVideoShare.createInstance();
  8527. this.contentPane = this.ui;
  8528. this.isEject = false;
  8529. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8530. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8531. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8532. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8533. }
  8534. show(success) {
  8535. super.show();
  8536. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8537. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8538. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8539. this.success = success;
  8540. let time = xGame.common.randomNum(600, 1500);
  8541. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8542. if (success)
  8543. xGame.soundMgr.playSound("applause");
  8544. this.ui.t0.play();
  8545. this.checkShareState();
  8546. let times = DataMgr.getDailyVideoShareTimes();
  8547. this.awardNum = times == 0 ? 2000 : 200;
  8548. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8549. }
  8550. checkShareState() {
  8551. if (PlatMgr.forceShare == 0) {
  8552. this.ui.myNode.closeBtn.visible = true;
  8553. this.ui.myNode.tipsNode.visible = false;
  8554. this.ui.myNode.closeBtn.x = 90;
  8555. this.ui.myNode.shareBtn.x = 342;
  8556. }
  8557. else if (PlatMgr.forceShare == 1) {
  8558. this.ui.myNode.closeBtn.visible = false;
  8559. this.ui.myNode.tipsNode.visible = true;
  8560. this.ui.myNode.shareBtn.x = 218;
  8561. this.isShared = true;
  8562. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8563. }
  8564. }
  8565. checkForceShare() {
  8566. this.isShared = !this.isShared;
  8567. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8568. }
  8569. videoShare() {
  8570. if (PlatMgr.forceShare == 1) {
  8571. if (this.isShared) {
  8572. this.shareGame();
  8573. }
  8574. else {
  8575. this.hideSelf();
  8576. }
  8577. }
  8578. else {
  8579. this.shareGame();
  8580. }
  8581. }
  8582. shareGame() {
  8583. Moyu.sendDataEvent("VideoShare");
  8584. if (Moyu.canShare() > 100) {
  8585. Moyu.shareGame((success) => {
  8586. if (success) {
  8587. DataMgr.setDailyVideoShareTimes(1);
  8588. DataMgr.setCoin(this.awardNum);
  8589. }
  8590. this.hideSelf();
  8591. }, this);
  8592. }
  8593. else {
  8594. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8595. this.hideSelf();
  8596. }
  8597. }
  8598. hideSelf() {
  8599. this.hide();
  8600. xGame.uiMgr.Show(UIGameEnd, this.success);
  8601. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8602. xGame.common.screenImg.destroy();
  8603. xGame.common.screenImg = null;
  8604. }
  8605. }
  8606. }
  8607. UIVideoShare.uiName = "UIVideoShare";
  8608. class ui_UITips extends fgui.GComponent {
  8609. static createInstance() {
  8610. return (fgui.UIPackage.createObject("game", "UITips"));
  8611. }
  8612. onConstruct() {
  8613. this.n0 = (this.getChild("n0"));
  8614. this.myNode = (this.getChild("myNode"));
  8615. this.t0 = this.getTransition("t0");
  8616. }
  8617. }
  8618. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8619. class UITips extends UIBase {
  8620. constructor() {
  8621. super();
  8622. this.type = 0;
  8623. }
  8624. onConstructor() {
  8625. this.ui = ui_UITips.createInstance();
  8626. this.contentPane = this.ui;
  8627. this.isEject = false;
  8628. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8629. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8630. }
  8631. show(tipsTxt, womanTxt, type) {
  8632. super.show();
  8633. this.ui.t0.play();
  8634. this.ui.myNode.tipsTxt.text = tipsTxt;
  8635. this.ui.myNode.womanTxt.text = womanTxt;
  8636. PlatMgr.showInsert(true);
  8637. this.ui.myNode.c1.selectedIndex = type;
  8638. this.type = type;
  8639. switch (this.type) {
  8640. case TipsType.exitGame:
  8641. xGame.common.gameMgr.gamePause = true;
  8642. break;
  8643. case TipsType.foul:
  8644. Laya.timer.once(200, this, () => {
  8645. xGame.common.gameMgr.gamePause = true;
  8646. });
  8647. break;
  8648. default:
  8649. break;
  8650. }
  8651. }
  8652. clickLeftBtn() {
  8653. this.hide();
  8654. xGame.common.gameMgr.gamePause = false;
  8655. switch (this.type) {
  8656. case TipsType.exitGame:
  8657. break;
  8658. case TipsType.foul:
  8659. break;
  8660. default:
  8661. break;
  8662. }
  8663. }
  8664. clickRightBtn() {
  8665. this.hide();
  8666. switch (this.type) {
  8667. case TipsType.exitGame:
  8668. xGame.eventMgr.event(RESET_GAME);
  8669. xGame.uiMgr.Show(UIMain);
  8670. Moyu.recordEnd(this, null);
  8671. xGame.common.longHelpLine = false;
  8672. break;
  8673. case TipsType.foul:
  8674. xGame.common.gameMgr.gamePause = false;
  8675. Laya.timer.clearAll(this);
  8676. break;
  8677. default:
  8678. break;
  8679. }
  8680. }
  8681. }
  8682. UITips.uiName = "UITips";
  8683. class GameMgr {
  8684. constructor() {
  8685. this.selfCamp = "";
  8686. this.selfFoulNum = 0;
  8687. this.selfBallArr = [];
  8688. this.selfTimer = 0;
  8689. this.selfScore = 0;
  8690. this.aiCamp = "";
  8691. this.aiFoulNum = 0;
  8692. this.aiBallArr = [];
  8693. this.aiTimer = 0;
  8694. this.aiScore = 0;
  8695. this.aiSkillLevelNum = 1;
  8696. this.targertScore = 0;
  8697. this.setTime = 30;
  8698. this.selfTurnRate = 0.5;
  8699. this.accTime = 0;
  8700. this.curFoul = "";
  8701. this.maxFoulTimes = 3;
  8702. this.isFirstInGame = true;
  8703. this.firstColliObj = null;
  8704. this.inHoleBalls = [];
  8705. this.blackNum = 8;
  8706. this.success = false;
  8707. this.holePosList = [];
  8708. this.posObj = {};
  8709. this._selfTurn = false;
  8710. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8711. this.ensureBallType = false;
  8712. this.isOpenBall = true;
  8713. this.finishOneShoot = true;
  8714. this.isEnd = false;
  8715. this.isChangeTurn = false;
  8716. this.isInterrupt = false;
  8717. this.aiPlayedBreakArmy = false;
  8718. this.isTouchedBall = false;
  8719. this.finishBalls = 0;
  8720. this.needBalls = 0;
  8721. this.allBallNum = 0;
  8722. this.placeBallPosData = {};
  8723. this.curHP = 0;
  8724. this.showLongView = false;
  8725. this.firstShoot = true;
  8726. this._gamePause = false;
  8727. this.trunCount = 0;
  8728. this.isBlackInHole = false;
  8729. this.isEnter = true;
  8730. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8731. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8732. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8733. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8734. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8735. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8736. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8737. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8738. }
  8739. get gamePause() {
  8740. return this._gamePause;
  8741. }
  8742. set gamePause(v) {
  8743. if (v) {
  8744. Laya.physicsTimer.pause();
  8745. }
  8746. else {
  8747. Laya.physicsTimer.resume();
  8748. }
  8749. this._gamePause = v;
  8750. }
  8751. get selfTurn() {
  8752. return this._selfTurn;
  8753. }
  8754. set selfTurn(val) {
  8755. this.trunCount++;
  8756. this._selfTurn = val;
  8757. if (val) {
  8758. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8759. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8760. }
  8761. else {
  8762. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8763. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8764. if (this.trunCount > 1)
  8765. PlatMgr.openBox();
  8766. }
  8767. }
  8768. resetGame() {
  8769. this.inHoleBalls = [];
  8770. this.isFirstInGame = true;
  8771. this.firstColliObj = null;
  8772. this.aiCamp = "";
  8773. this.selfCamp = "";
  8774. this.aiFoulNum = 0;
  8775. this.selfFoulNum = 0;
  8776. this.selfBallArr = [];
  8777. this.aiBallArr = [];
  8778. this.gamePause = false;
  8779. this.ensureBallType = false;
  8780. this.isInterrupt = false;
  8781. this.updateLeftBall();
  8782. this.clearTime();
  8783. this.aiPlayedBreakArmy = false;
  8784. this.isBlackInHole = false;
  8785. this.placeBallPosData = {};
  8786. if (xGame.common.d3World.knifeRoot) {
  8787. xGame.common.d3World.knifeRoot.destroyChildren();
  8788. }
  8789. }
  8790. gameReady() {
  8791. this.trunCount = 0;
  8792. this.firstColliObj = null;
  8793. this.isFirstInGame = true;
  8794. this.selfTurn = Math.random() <= this.selfTurnRate;
  8795. let challengeNum = DataMgr.getChallengeTimes();
  8796. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8797. this.selfTurn = true;
  8798. }
  8799. if (xGame.common.gameMode == GameMode.placeBall)
  8800. this.selfTurn = true;
  8801. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8802. this.selfTurn = true;
  8803. }
  8804. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8805. this.checkGuide();
  8806. if (xGame.common.uiRodMethod)
  8807. xGame.common.uiRodMethod.resetRod();
  8808. xGame.common.d2World.getHelpLine();
  8809. this.isOpenBall = true;
  8810. this.isTouchedBall = false;
  8811. xGame.common.aiPlayer.stopRun();
  8812. this.setTime = 30;
  8813. let ui = xGame.common.gameUI.ui;
  8814. switch (xGame.common.gameMode) {
  8815. case GameMode.classic:
  8816. xGame.common.aiPlayer.init();
  8817. this.blackNum = 8;
  8818. this.placeRootBall();
  8819. this.peoplePlay(9, 10);
  8820. ui.wordsBtn.visible = true;
  8821. ui.aiWordsBtn.visible = true;
  8822. xGame.common.talkMgr.changeAIState(true);
  8823. DataMgr.gameData.gameCount++;
  8824. DataMgr.saveGameData();
  8825. break;
  8826. case GameMode.bigMove:
  8827. this.blackNum = -1;
  8828. this.selfScore = 0;
  8829. this.aiScore = 0;
  8830. xGame.common.aiPlayer.init();
  8831. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8832. this.updateSelfScore();
  8833. this.updateAIScore();
  8834. this.updateTargetSroce();
  8835. this.placeRootBall();
  8836. this.peoplePlay(9, 10);
  8837. ui.wordsBtn.visible = true;
  8838. ui.aiWordsBtn.visible = true;
  8839. xGame.common.talkMgr.changeAIState(true);
  8840. if (DataMgr.getSkillGuide() < 1)
  8841. DataMgr.gameData.gameCount = 0;
  8842. else {
  8843. DataMgr.gameData.gameCount++;
  8844. DataMgr.saveGameData();
  8845. PlatMgr.openTry();
  8846. }
  8847. if (xGame.common.d3World.knifeRoot) {
  8848. xGame.common.d3World.knifeRoot.destroyChildren();
  8849. }
  8850. break;
  8851. case GameMode.placeBall:
  8852. this.blackNum = -1;
  8853. this.selfTurn = true;
  8854. this.setTime = 10000;
  8855. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8856. this.curHP = this.placeBallData.hp;
  8857. if (this.placeBallData.ball == -1)
  8858. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8859. else
  8860. this.needBalls = this.placeBallData.ball;
  8861. console.log("需要的进球数目", this.needBalls);
  8862. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8863. this.finishBalls = 0;
  8864. this.placeBallPosData = {};
  8865. this.updatePlaceBallPos();
  8866. this.updatePlaceBallState();
  8867. this.finishOneShoot = true;
  8868. xGame.common.gameUI.ui.moveNode.visible = false;
  8869. this.isOpenBall = false;
  8870. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8871. ui.wordsBtn.visible = false;
  8872. ui.aiWordsBtn.visible = false;
  8873. xGame.common.talkMgr.changeAIState(false);
  8874. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8875. PlatMgr.openBox();
  8876. });
  8877. break;
  8878. default:
  8879. break;
  8880. }
  8881. this.showLongView = false;
  8882. xGame.common.wordsMgr.comboTimes = 1;
  8883. let guide = DataMgr.getSkillGuide();
  8884. if (guide)
  8885. xGame.eventMgr.event(WAIT_SHOOT);
  8886. xGame.common.upSkillLevel = false;
  8887. xGame.common.gameStartTime = new Date().getTime();
  8888. this.firstShoot = true;
  8889. }
  8890. checkGuide() {
  8891. let guide = DataMgr.getSkillGuide();
  8892. let gameUI = xGame.common.gameUI.ui;
  8893. gameUI.guide1.visible = false;
  8894. gameUI.guide2.visible = false;
  8895. gameUI.guide3.visible = false;
  8896. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8897. this.selfTurn = true;
  8898. }
  8899. else {
  8900. return;
  8901. }
  8902. let oneBall = this.getOneBall();
  8903. gameUI.guide1.visible = true;
  8904. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8905. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8906. }
  8907. getOneBall() {
  8908. let arr = xGame.common.d2World.ballArr;
  8909. for (let index = 0; index < arr.length; index++) {
  8910. if (arr[index].number == 0)
  8911. continue;
  8912. return arr[index];
  8913. }
  8914. }
  8915. updateSelfScore() {
  8916. let ui = xGame.common.gameUI.ui.topNode;
  8917. ui.selfScoreTxt.text = this.selfScore + "";
  8918. }
  8919. updateAIScore() {
  8920. let ui = xGame.common.gameUI.ui.topNode;
  8921. ui.aiScoreTxt.text = this.aiScore + "";
  8922. }
  8923. updateTargetSroce() {
  8924. let ui = xGame.common.gameUI.ui.topNode;
  8925. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8926. }
  8927. updateLeftBall() {
  8928. let topUI = xGame.common.gameUI.ui.topNode;
  8929. topUI.selfBallList.numItems = this.selfBallArr.length;
  8930. topUI.aiBallList.numItems = this.aiBallArr.length;
  8931. }
  8932. ballShoot() {
  8933. this.clearTime();
  8934. this.finishOneShoot = false;
  8935. xGame.common.gameUI.ui.moveNode.visible = false;
  8936. if (xGame.common.gameUI.ui.guideNode.visible) {
  8937. xGame.common.gameUI.ui.guideNode.visible = false;
  8938. }
  8939. if (this.firstShoot) {
  8940. this.firstShoot = false;
  8941. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8942. }
  8943. }
  8944. ensureCamp(number) {
  8945. this.ensureBallType = true;
  8946. this.isOpenBall = false;
  8947. if (xGame.common.gameMode != GameMode.classic)
  8948. return;
  8949. let full = [1, 2, 3, 4, 5, 6, 7];
  8950. let flower = [9, 10, 11, 12, 13, 14, 15];
  8951. let sayWords = "";
  8952. if (this.selfTurn) {
  8953. if (number <= 7) {
  8954. this.selfCamp = ballCamp.full;
  8955. this.selfBallArr = full;
  8956. this.aiCamp = ballCamp.flower;
  8957. this.aiBallArr = flower;
  8958. sayWords = cfgTable.wordsData[3].msg;
  8959. }
  8960. else {
  8961. this.selfCamp = ballCamp.flower;
  8962. this.selfBallArr = flower;
  8963. this.aiCamp = ballCamp.full;
  8964. this.aiBallArr = full;
  8965. sayWords = cfgTable.wordsData[4].msg;
  8966. }
  8967. }
  8968. else {
  8969. if (number <= 7) {
  8970. this.selfCamp = ballCamp.flower;
  8971. this.selfBallArr = flower;
  8972. this.aiCamp = ballCamp.full;
  8973. this.aiBallArr = full;
  8974. sayWords = cfgTable.wordsData[2].msg;
  8975. }
  8976. else {
  8977. this.selfCamp = ballCamp.full;
  8978. this.selfBallArr = full;
  8979. this.aiCamp = ballCamp.flower;
  8980. this.aiBallArr = flower;
  8981. sayWords = cfgTable.wordsData[1].msg;
  8982. }
  8983. }
  8984. this.updateLeftBall();
  8985. xGame.uiMgr.Show(UIMsg, sayWords);
  8986. }
  8987. updatePlaceBallState() {
  8988. let ui = xGame.common.gameUI.ui;
  8989. switch (this.placeBallData.type) {
  8990. case PlaceBallType.normal:
  8991. let normal = ui.placeNormalNode;
  8992. normal.hpTxt.text = this.curHP + "";
  8993. this.updatePlaceBallStar(normal);
  8994. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8995. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8996. break;
  8997. case PlaceBallType.challenge:
  8998. let challenge = ui.placeChallengeNode;
  8999. challenge.hpTxt.text = "Shots:" + this.curHP;
  9000. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9001. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9002. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9003. break;
  9004. default:
  9005. break;
  9006. }
  9007. }
  9008. playSubHpAni() {
  9009. let ui = xGame.common.gameUI.ui;
  9010. switch (this.placeBallData.type) {
  9011. case PlaceBallType.normal:
  9012. let normal = ui.placeNormalNode;
  9013. normal.hpTxt.visible = false;
  9014. normal.starAni.c1.selectedIndex = 1;
  9015. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9016. normal.hpTxt.visible = true;
  9017. normal.starAni.c1.selectedIndex = 0;
  9018. }));
  9019. break;
  9020. default:
  9021. break;
  9022. }
  9023. }
  9024. getEndStarNum() {
  9025. let num;
  9026. let level = xGame.common.placeBallCurLevel;
  9027. if (this.curHP == this.placeBallData.hp) {
  9028. num = 3;
  9029. }
  9030. else if (this.curHP <= 1) {
  9031. num = 1;
  9032. }
  9033. else {
  9034. num = 2;
  9035. }
  9036. if (!this.success) {
  9037. num = 0;
  9038. }
  9039. else {
  9040. DataMgr.setPlaceBallLevel(level, num);
  9041. }
  9042. let myType = cfgTable.placeballData[level].type;
  9043. if (this.success && myType == 1) {
  9044. num = 3;
  9045. }
  9046. xGame.common.placeBallStarNum = num;
  9047. }
  9048. updatePlaceBallStar(node) {
  9049. let star = 0;
  9050. if (this.curHP == this.placeBallData.hp) {
  9051. star = 3;
  9052. }
  9053. else if (this.curHP >= 2) {
  9054. star = 2;
  9055. }
  9056. else if (this.curHP == 1) {
  9057. star = 1;
  9058. }
  9059. else {
  9060. star = 0;
  9061. }
  9062. let temp;
  9063. for (let index = 1; index <= 3; index++) {
  9064. temp = node["star" + index];
  9065. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9066. }
  9067. node.myProgress.value = (star / 3) * 100;
  9068. }
  9069. openRegretView(isFoul, GoalNum, challenge = false) {
  9070. let regretType = -1;
  9071. if (isFoul) {
  9072. regretType = 1;
  9073. }
  9074. else {
  9075. if (GoalNum <= 0) {
  9076. regretType = 0;
  9077. }
  9078. }
  9079. if (challenge) {
  9080. regretType = 1;
  9081. }
  9082. if (regretType != -1) {
  9083. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9084. if (success) {
  9085. this.curHP++;
  9086. this.updatePlaceBallState();
  9087. this.setPlaceBallAllPos();
  9088. xGame.common.gameUI.ui.moveNode.visible = false;
  9089. }
  9090. else {
  9091. if (this.curHP <= 0) {
  9092. this.success = false;
  9093. this.gameEnd();
  9094. }
  9095. this.playSubHpAni();
  9096. }
  9097. this.updatePlaceBallState();
  9098. this.updatePlaceBallPos();
  9099. });
  9100. }
  9101. }
  9102. setPlaceBallAllPos() {
  9103. let allBall = xGame.common.d2World.ballArr;
  9104. let cfgArr = this.placeBallPosData;
  9105. let temp;
  9106. let obj;
  9107. for (let index = 0; index < allBall.length; index++) {
  9108. temp = allBall[index];
  9109. if (temp.destroyed)
  9110. continue;
  9111. obj = cfgArr[temp.myUNID];
  9112. if (obj && obj.src && !obj.src.destroyed) {
  9113. temp.gameObj.x = obj.posX;
  9114. temp.gameObj.y = obj.posY;
  9115. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9116. }
  9117. }
  9118. xGame.common.d2World.getHelpLine();
  9119. }
  9120. updatePlaceBallPos() {
  9121. let arr = xGame.common.d2World.ballArr;
  9122. let temp;
  9123. for (let index = 0; index < arr.length; index++) {
  9124. temp = arr[index];
  9125. if (!this.placeBallPosData[temp.myUNID]) {
  9126. this.placeBallPosData[temp.myUNID] = {
  9127. src: temp,
  9128. posX: temp.gameObj.x,
  9129. posY: temp.gameObj.y
  9130. };
  9131. }
  9132. else {
  9133. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9134. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9135. }
  9136. }
  9137. let check;
  9138. for (const key in this.placeBallPosData) {
  9139. check = this.placeBallPosData[key];
  9140. if (check.src.destroyed) {
  9141. delete this.placeBallPosData[key];
  9142. }
  9143. }
  9144. }
  9145. gameRun(type) {
  9146. if (this.gamePause)
  9147. return;
  9148. this.curFoul = this.getFoulType();
  9149. if (type) {
  9150. xGame.common.d2World.d2Gan.shoot();
  9151. xGame.common.gameUI.forceCancel();
  9152. this.curFoul = type;
  9153. }
  9154. this.isEnd = false;
  9155. this.isChangeTurn = true;
  9156. if (xGame.common.gameMode == GameMode.classic) {
  9157. this.judgeClassic(this.curFoul);
  9158. this.checkClassicWords(() => {
  9159. xGame.common.destroyClassicEmotion();
  9160. if (this.isEnd) {
  9161. if (this.isBlackInHole) {
  9162. xGame.common.gameUI.ui.blackAni.visible = true;
  9163. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9164. xGame.common.gameUI.ui.blackAni.visible = false;
  9165. this.gameEnd();
  9166. }));
  9167. }
  9168. else {
  9169. this.gameEnd();
  9170. }
  9171. }
  9172. else {
  9173. this.waitShoot();
  9174. xGame.eventMgr.event(WAIT_SHOOT);
  9175. }
  9176. });
  9177. }
  9178. else if (xGame.common.gameMode == GameMode.bigMove) {
  9179. xGame.common.aiPlayer.stopRun();
  9180. let scoreArr = this.getScore(this.curFoul);
  9181. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9182. this.isEnd = true;
  9183. }
  9184. this.checkBigSkillWords(() => {
  9185. if (this.isEnd) {
  9186. this.gameEnd();
  9187. }
  9188. else {
  9189. this.waitShoot();
  9190. xGame.eventMgr.event(WAIT_SHOOT);
  9191. }
  9192. });
  9193. }
  9194. else if (xGame.common.gameMode == GameMode.placeBall) {
  9195. xGame.common.destroyAwardSpine();
  9196. let isFoul = this.curFoul == FoulType.rootHole;
  9197. let GoalNum = this.inHoleBalls.length;
  9198. if (this.inHoleBalls.indexOf(0) > -1)
  9199. GoalNum -= 1;
  9200. if (isFoul) {
  9201. this.placeRootBall();
  9202. }
  9203. console.log("neeballs", this.needBalls);
  9204. console.log("当前完成的goalNum", GoalNum);
  9205. this.finishBalls += GoalNum;
  9206. console.log("当前完成的finishballs", this.finishBalls);
  9207. let need = this.needBalls;
  9208. if (this.placeBallData.type == PlaceBallType.challenge) {
  9209. need += 100;
  9210. }
  9211. if (this.finishBalls >= need) {
  9212. this.success = true;
  9213. this.gameEnd();
  9214. }
  9215. else {
  9216. switch (this.placeBallData.type) {
  9217. case PlaceBallType.normal:
  9218. if (!isFoul && GoalNum > 0) {
  9219. this.updatePlaceBallPos();
  9220. this.updatePlaceBallState();
  9221. }
  9222. else {
  9223. this.curHP--;
  9224. this.openRegretView(isFoul, GoalNum);
  9225. }
  9226. this.waitShoot();
  9227. xGame.eventMgr.event(WAIT_SHOOT);
  9228. break;
  9229. case PlaceBallType.challenge:
  9230. this.curHP--;
  9231. this.updatePlaceBallState();
  9232. if (isFoul) {
  9233. this.openRegretView(isFoul, GoalNum, true);
  9234. }
  9235. else {
  9236. this.updatePlaceBallPos();
  9237. if (this.curHP <= 0) {
  9238. this.success = true;
  9239. this.gameEnd();
  9240. }
  9241. }
  9242. this.waitShoot();
  9243. xGame.eventMgr.event(WAIT_SHOOT);
  9244. break;
  9245. default:
  9246. break;
  9247. }
  9248. }
  9249. }
  9250. }
  9251. checkClassicWords(callback) {
  9252. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9253. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9254. let type = this.getClassicWordsType();
  9255. if (condition && type != -1) {
  9256. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9257. xGame.soundMgr.playSound(str);
  9258. xGame.common.wordsMgr.playClassicWords(type, callback);
  9259. }
  9260. else {
  9261. Laya.timer.once(300, this, () => {
  9262. callback && callback();
  9263. });
  9264. }
  9265. }
  9266. getClassicWordsType() {
  9267. let d2world = xGame.common.d2World;
  9268. let type = -1;
  9269. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9270. type = ClassicWordsType.perfectShow;
  9271. return type;
  9272. }
  9273. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9274. type = ClassicWordsType.directShoot;
  9275. return type;
  9276. }
  9277. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9278. type = ClassicWordsType.anotherShoot;
  9279. return type;
  9280. }
  9281. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9282. type = ClassicWordsType.bigPower;
  9283. return type;
  9284. }
  9285. let minSpeed = 1;
  9286. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9287. type = ClassicWordsType.hardShoot;
  9288. return type;
  9289. }
  9290. if (this.inHoleBalls.length > 0) {
  9291. type = ClassicWordsType.directShoot;
  9292. return type;
  9293. }
  9294. return type;
  9295. }
  9296. checkBigSkillWords(callback) {
  9297. if (this.curFoul == FoulType.timeOut) {
  9298. callback && callback();
  9299. }
  9300. else {
  9301. let playSkill = false;
  9302. if (this.selfTurn) {
  9303. playSkill = true;
  9304. }
  9305. else {
  9306. if (!this.aiPlayedBreakArmy) {
  9307. this.aiPlayedBreakArmy = true;
  9308. playSkill = true;
  9309. }
  9310. if (this.aiCurSkill != SkillType.breakArmy) {
  9311. playSkill = true;
  9312. }
  9313. }
  9314. if (xGame.common.skillMgr.playedLastSkill) {
  9315. xGame.common.skillMgr.playedLastSkill = false;
  9316. playSkill = false;
  9317. }
  9318. if (playSkill) {
  9319. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9320. let selfExtra = 0;
  9321. let aiExtra = 0;
  9322. if (this.selfTurn)
  9323. selfExtra += extraScore;
  9324. else
  9325. aiExtra += extraScore;
  9326. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9327. this.isEnd = true;
  9328. }
  9329. this.playBigSkillTimes(callback);
  9330. });
  9331. }
  9332. else {
  9333. this.playBigSkillTimes(callback);
  9334. }
  9335. }
  9336. }
  9337. playBigSkillTimes(callback) {
  9338. let length = this.inHoleBalls.length;
  9339. if (this.inHoleBalls.indexOf(0) > -1) {
  9340. length = this.inHoleBalls.length - 1;
  9341. }
  9342. if (length <= 0) {
  9343. callback && callback();
  9344. return;
  9345. }
  9346. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9347. callback && callback();
  9348. });
  9349. }
  9350. playSkillTips() {
  9351. let levelNum = 0;
  9352. let curType;
  9353. if (this.selfTurn) {
  9354. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9355. curType = this.selfCurSkill;
  9356. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9357. levelNum += 5;
  9358. }
  9359. }
  9360. else {
  9361. levelNum = this.aiSkillLevelNum;
  9362. curType = this.aiCurSkill;
  9363. }
  9364. let str = ``;
  9365. switch (curType) {
  9366. case SkillType.highSpace:
  9367. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9368. break;
  9369. case SkillType.breakArmy:
  9370. str = `You pocketed ${levelNum} extra balls`;
  9371. break;
  9372. case SkillType.ice:
  9373. str = `${levelNum * 2} extra balls were frozen`;
  9374. break;
  9375. case SkillType.fireworks:
  9376. str = `${levelNum} extra balls exploded `;
  9377. break;
  9378. case SkillType.GuanYu:
  9379. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9380. break;
  9381. default:
  9382. break;
  9383. }
  9384. xGame.uiMgr.Show(UIMsg, str);
  9385. }
  9386. getFoulType() {
  9387. let foulType = "";
  9388. if (this.firstColliObj == null) {
  9389. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9390. return FoulType.rootHole;
  9391. }
  9392. return FoulType.notTouch;
  9393. }
  9394. else {
  9395. if (this.selfTurn) {
  9396. if (this.selfBallArr.length > 0) {
  9397. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9398. foulType = FoulType.wrongTouch;
  9399. }
  9400. }
  9401. else {
  9402. if (this.ensureBallType) {
  9403. }
  9404. else {
  9405. if (this.firstColliObj == this.blackNum) {
  9406. foulType = FoulType.wrongTouch;
  9407. }
  9408. }
  9409. }
  9410. }
  9411. else {
  9412. if (this.aiBallArr.length > 0) {
  9413. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9414. foulType = FoulType.wrongTouch;
  9415. }
  9416. }
  9417. else {
  9418. if (this.ensureBallType) {
  9419. }
  9420. else {
  9421. if (this.firstColliObj == this.blackNum) {
  9422. foulType = FoulType.wrongTouch;
  9423. }
  9424. }
  9425. }
  9426. }
  9427. if (this.inHoleBalls.length <= 0) {
  9428. return foulType;
  9429. }
  9430. let temp;
  9431. if (this.inHoleBalls.indexOf(0) > -1) {
  9432. foulType = FoulType.rootHole;
  9433. }
  9434. else {
  9435. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9436. temp = this.inHoleBalls[index];
  9437. if (this.selfTurn) {
  9438. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9439. foulType = FoulType.wrongHole;
  9440. break;
  9441. }
  9442. }
  9443. else {
  9444. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9445. foulType = FoulType.wrongHole;
  9446. break;
  9447. }
  9448. }
  9449. }
  9450. }
  9451. let foo;
  9452. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9453. temp = this.inHoleBalls[index];
  9454. foo = this.selfBallArr.indexOf(temp);
  9455. if (foo > -1) {
  9456. this.selfBallArr.splice(foo, 1);
  9457. }
  9458. foo = this.aiBallArr.indexOf(temp);
  9459. if (foo > -1) {
  9460. this.aiBallArr.splice(foo, 1);
  9461. }
  9462. }
  9463. this.updateLeftBall();
  9464. }
  9465. return foulType;
  9466. }
  9467. judgeGameEndByBlack(arr) {
  9468. if (this.selfTurn) {
  9469. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9470. this.selfFoulNum = this.maxFoulTimes;
  9471. return true;
  9472. }
  9473. }
  9474. else {
  9475. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9476. this.aiFoulNum = this.maxFoulTimes;
  9477. return true;
  9478. }
  9479. }
  9480. }
  9481. judgeClassic(type) {
  9482. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9483. xGame.common.aiPlayer.stopRun();
  9484. if (this.judgeNormalSuccess()) {
  9485. this.isEnd = true;
  9486. return;
  9487. }
  9488. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9489. if (this.selfTurn) {
  9490. if (isFoul) {
  9491. this.selfFoulNum++;
  9492. }
  9493. if (this.selfFoulNum >= this.maxFoulTimes) {
  9494. this.success = false;
  9495. this.isEnd = true;
  9496. return;
  9497. }
  9498. }
  9499. else {
  9500. if (isFoul)
  9501. this.aiFoulNum++;
  9502. if (this.aiFoulNum >= this.maxFoulTimes) {
  9503. this.success = true;
  9504. this.isEnd = true;
  9505. return;
  9506. }
  9507. }
  9508. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9509. this.isChangeTurn = false;
  9510. }
  9511. else {
  9512. this.isInterrupt = true;
  9513. }
  9514. }
  9515. waitShoot() {
  9516. if (xGame.common.gameMode == GameMode.classic) {
  9517. switch (this.curFoul) {
  9518. case FoulType.timeOut:
  9519. case FoulType.rootHole:
  9520. this.selfTurn = !this.selfTurn;
  9521. this.peoplePlay(5, 6, true);
  9522. break;
  9523. case FoulType.notTouch:
  9524. this.selfTurn = !this.selfTurn;
  9525. this.peoplePlay(7, 7);
  9526. break;
  9527. case FoulType.wrongHole:
  9528. this.selfTurn = !this.selfTurn;
  9529. this.peoplePlay(11, 11);
  9530. break;
  9531. default:
  9532. if (this.inHoleBalls.length > 0) {
  9533. this.peoplePlay(0, 0, false, false);
  9534. }
  9535. else {
  9536. this.selfTurn = !this.selfTurn;
  9537. this.peoplePlay(7, 7);
  9538. }
  9539. break;
  9540. }
  9541. }
  9542. else if (xGame.common.gameMode == GameMode.bigMove) {
  9543. if (this.curFoul == FoulType.timeOut) {
  9544. this.selfTurn = !this.selfTurn;
  9545. this.peoplePlay(14, 15);
  9546. this.placeRootBall();
  9547. }
  9548. else {
  9549. this.selfTurn = !this.selfTurn;
  9550. if (this.curFoul == FoulType.rootHole) {
  9551. this.peoplePlay(12, 13);
  9552. this.placeRootBall();
  9553. }
  9554. else {
  9555. this.peoplePlay(0, 0, false, false);
  9556. }
  9557. }
  9558. }
  9559. else if (xGame.common.gameMode == GameMode.placeBall) {
  9560. this.finishOneShoot = true;
  9561. }
  9562. this.gameResult();
  9563. }
  9564. gameResult() {
  9565. this.firstColliObj = null;
  9566. this.inHoleBalls = [];
  9567. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9568. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9569. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9570. if (xGame.common.uiRodMethod)
  9571. xGame.common.uiRodMethod.resetRod();
  9572. xGame.common.d2World.rootBall.showSelf();
  9573. this.clearIceSkill();
  9574. if (this.selfTurn) {
  9575. PlatMgr.gameInsert();
  9576. }
  9577. xGame.common.d3World.knifeRoot.destroyChildren();
  9578. if (this.selfTurn) {
  9579. xGame.common.gameUI.showHelpLineGuide();
  9580. xGame.common.gameUI.setTurnAlpha(true);
  9581. }
  9582. else {
  9583. xGame.common.gameUI.setTurnAlpha(false);
  9584. }
  9585. }
  9586. getScore(type) {
  9587. let selfAdd = 0;
  9588. let aiAdd = 0;
  9589. if (type == FoulType.timeOut) {
  9590. if (this.selfTurn)
  9591. aiAdd += 3;
  9592. else
  9593. selfAdd += 3;
  9594. }
  9595. else {
  9596. if (this.inHoleBalls.length > 0) {
  9597. if (this.selfTurn) {
  9598. if (type == FoulType.rootHole) {
  9599. aiAdd += 3;
  9600. if (this.inHoleBalls.length - 1 > 0) {
  9601. selfAdd += this.inHoleBalls.length - 1;
  9602. }
  9603. }
  9604. else {
  9605. selfAdd += this.inHoleBalls.length;
  9606. }
  9607. }
  9608. else {
  9609. if (type == FoulType.rootHole) {
  9610. selfAdd += 3;
  9611. if (this.inHoleBalls.length - 1 > 0) {
  9612. aiAdd += this.inHoleBalls.length - 1;
  9613. }
  9614. }
  9615. else {
  9616. aiAdd += this.inHoleBalls.length;
  9617. }
  9618. }
  9619. }
  9620. }
  9621. return [selfAdd, aiAdd];
  9622. }
  9623. judgeScoreEnd(selfAdd, aiAdd) {
  9624. this.selfScore += selfAdd;
  9625. this.aiScore += aiAdd;
  9626. this.updateAIScore();
  9627. this.updateSelfScore();
  9628. if (this.selfScore >= this.targertScore) {
  9629. this.success = true;
  9630. return true;
  9631. }
  9632. if (this.aiScore >= this.targertScore) {
  9633. this.success = false;
  9634. return true;
  9635. }
  9636. let ballArr = xGame.common.d2World.ballArr;
  9637. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9638. if (this.selfScore > this.aiScore) {
  9639. this.success = true;
  9640. return true;
  9641. }
  9642. else if (this.selfScore < this.aiScore) {
  9643. this.success = false;
  9644. return true;
  9645. }
  9646. else {
  9647. if (this.selfTurn) {
  9648. this.success = false;
  9649. }
  9650. else {
  9651. this.success = true;
  9652. }
  9653. return true;
  9654. }
  9655. }
  9656. }
  9657. clearIceSkill() {
  9658. let arr = xGame.common.d2World.ballArr;
  9659. let temp;
  9660. if (this.selfTurn) {
  9661. if (this.selfCurSkill == SkillType.ice) {
  9662. for (let index = 0; index < arr.length; index++) {
  9663. temp = arr[index];
  9664. if (temp.ballFunc == "ice") {
  9665. temp.setBallFunc("normal", "self");
  9666. }
  9667. }
  9668. }
  9669. }
  9670. else {
  9671. if (this.aiCurSkill == SkillType.ice) {
  9672. for (let index = 0; index < arr.length; index++) {
  9673. temp = arr[index];
  9674. if (temp.ballFunc == "ice") {
  9675. temp.setBallFunc("normal", "ai");
  9676. }
  9677. }
  9678. }
  9679. }
  9680. }
  9681. judgeNormalSuccess() {
  9682. if (this.selfTurn) {
  9683. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9684. this.success = true;
  9685. return true;
  9686. }
  9687. }
  9688. else {
  9689. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9690. this.success = false;
  9691. return true;
  9692. }
  9693. }
  9694. }
  9695. gameEnd() {
  9696. if (Moyu.isTT) {
  9697. xGame.common.screenImg = getScreenImg();
  9698. }
  9699. console.log("游戏结束", this.success);
  9700. xGame.common.aiPlayer.stopRun();
  9701. if (xGame.common.gameMode == GameMode.placeBall) {
  9702. this.getEndStarNum();
  9703. this.updatePlaceBallState();
  9704. }
  9705. this.isEnter = false;
  9706. Moyu.recordEnd(this, () => {
  9707. if (this.isEnter)
  9708. return;
  9709. this.isEnter = true;
  9710. console.log("进入录结束回调");
  9711. this.enterNext();
  9712. });
  9713. Laya.timer.once(1000, this, () => {
  9714. if (this.isEnter)
  9715. return;
  9716. this.isEnter = true;
  9717. this.enterNext();
  9718. });
  9719. xGame.common.longHelpLine = false;
  9720. }
  9721. enterNext() {
  9722. Laya.timer.clearAll(this);
  9723. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9724. xGame.uiMgr.Show(UIVideoShare, this.success);
  9725. }
  9726. else {
  9727. xGame.uiMgr.Show(UIGameEnd, this.success);
  9728. }
  9729. }
  9730. aiLeave() {
  9731. let ui = xGame.common.gameUI.ui;
  9732. ui.topNode.aiNameTxt.text = "offline";
  9733. }
  9734. aiGameEnd(suc) {
  9735. this.success = suc;
  9736. xGame.common.aiPlayer.stopRun();
  9737. if (this.success) {
  9738. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9739. Laya.timer.once(1000, this, () => {
  9740. this.clearTime();
  9741. this.gameEnd();
  9742. });
  9743. }
  9744. }
  9745. openTimer() {
  9746. let src = xGame.common.gameUI;
  9747. if (this.selfTurn) {
  9748. src.ui.topNode.selfProgress.visible = true;
  9749. src.ui.topNode.aiProgress.visible = false;
  9750. this.curTimer = src.ui.topNode.selfProgress;
  9751. }
  9752. else {
  9753. src.ui.topNode.selfProgress.visible = false;
  9754. src.ui.topNode.aiProgress.visible = true;
  9755. this.curTimer = src.ui.topNode.aiProgress;
  9756. }
  9757. this.accTime = 0;
  9758. Laya.timer.clearAll(this);
  9759. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9760. this.curTimer.value = 100;
  9761. }
  9762. updateTime(dt) {
  9763. if (this.gamePause)
  9764. return;
  9765. this.accTime += dt;
  9766. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9767. if (this.accTime >= this.setTime) {
  9768. this.clearTime();
  9769. console.log("时钟进入了gameRun");
  9770. this.gameRun(FoulType.timeOut);
  9771. }
  9772. }
  9773. clearTime() {
  9774. let src = xGame.common.gameUI;
  9775. src.ui.topNode.selfProgress.visible = false;
  9776. src.ui.topNode.aiProgress.visible = false;
  9777. Laya.timer.clearAll(this);
  9778. }
  9779. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9780. let ui = xGame.common.gameUI.ui;
  9781. let selfMsg, aiMsg;
  9782. if (sayWords) {
  9783. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9784. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9785. if (Foul) {
  9786. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9787. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9788. this.placeRootBall();
  9789. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9790. if (this.curFoul == FoulType.rootHole) {
  9791. if (!DataMgr.getRootBallFoul()) {
  9792. DataMgr.setRootBallFoul();
  9793. aiMsg = "";
  9794. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9795. let woman = "Boss, pay attention next time~";
  9796. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9797. }
  9798. }
  9799. else if (this.curFoul == FoulType.timeOut) {
  9800. if (!DataMgr.getTimeoutFoul()) {
  9801. DataMgr.setTimeoutFoul();
  9802. aiMsg = "";
  9803. let tips = "Game timeout, 3 fouls, this game failed.";
  9804. let woman = "Boss, pay attention to the timeline~";
  9805. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9806. }
  9807. }
  9808. }
  9809. }
  9810. }
  9811. if (this.selfTurn) {
  9812. if (sayWords) {
  9813. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9814. ui.selfTurn.visible = true;
  9815. ui.aiTurn.visible = false;
  9816. ui.selfTurn.t0.play();
  9817. Moyu.vibration();
  9818. });
  9819. }
  9820. }
  9821. else {
  9822. let aiNum = xGame.tools.random(1, 11);
  9823. let challengeNum = DataMgr.getChallengeTimes();
  9824. let delay = false;
  9825. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9826. aiNum = 9;
  9827. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9828. aiNum = 3;
  9829. if (challengeNum == 3) {
  9830. if (!this.showLongView) {
  9831. this.showLongView = true;
  9832. delay = true;
  9833. }
  9834. }
  9835. }
  9836. }
  9837. if (delay) {
  9838. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9839. if (success) {
  9840. xGame.common.longHelpLine = true;
  9841. xGame.common.d2World.getHelpLine();
  9842. }
  9843. else {
  9844. aiNum = 10;
  9845. }
  9846. xGame.common.aiPlayer.setAiLevel(aiNum);
  9847. if (sayWords) {
  9848. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9849. xGame.common.aiPlayer.runAI();
  9850. ui.selfTurn.visible = false;
  9851. ui.aiTurn.visible = true;
  9852. ui.aiTurn.t0.play();
  9853. });
  9854. }
  9855. else {
  9856. xGame.common.aiPlayer.runAI();
  9857. }
  9858. this.openTimer();
  9859. this.finishOneShoot = true;
  9860. if (this.selfTurn) {
  9861. ui.topNode.selfKuang.visible = true;
  9862. ui.topNode.aiKuang.visible = false;
  9863. ui.topNode.selfTips.visible = true;
  9864. ui.topNode.aiTips.visible = false;
  9865. }
  9866. else {
  9867. ui.topNode.selfKuang.visible = false;
  9868. ui.topNode.aiKuang.visible = true;
  9869. ui.topNode.selfTips.visible = false;
  9870. ui.topNode.aiTips.visible = true;
  9871. }
  9872. });
  9873. return;
  9874. }
  9875. if (xGame.common.gameMode == GameMode.classic) {
  9876. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9877. if (cfg) {
  9878. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9879. aiNum = aiLevel;
  9880. }
  9881. }
  9882. xGame.common.aiPlayer.setAiLevel(aiNum);
  9883. if (sayWords) {
  9884. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9885. xGame.common.aiPlayer.runAI();
  9886. ui.selfTurn.visible = false;
  9887. ui.aiTurn.visible = true;
  9888. ui.aiTurn.t0.play();
  9889. });
  9890. }
  9891. else {
  9892. xGame.common.aiPlayer.runAI();
  9893. }
  9894. }
  9895. this.openTimer();
  9896. this.finishOneShoot = true;
  9897. if (this.selfTurn) {
  9898. ui.topNode.selfKuang.visible = true;
  9899. ui.topNode.aiKuang.visible = false;
  9900. ui.topNode.selfTips.visible = true;
  9901. ui.topNode.aiTips.visible = false;
  9902. }
  9903. else {
  9904. ui.topNode.selfKuang.visible = false;
  9905. ui.topNode.aiKuang.visible = true;
  9906. ui.topNode.selfTips.visible = false;
  9907. ui.topNode.aiTips.visible = true;
  9908. }
  9909. }
  9910. placeRootBall() {
  9911. let rootBall = xGame.common.d2World.rootBall;
  9912. if (!rootBall)
  9913. return;
  9914. rootBall.gameObj.x = this.lastRootBallPos.x;
  9915. rootBall.gameObj.y = this.lastRootBallPos.y;
  9916. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9917. let moveNode = xGame.common.gameUI.ui.moveNode;
  9918. moveNode.visible = true;
  9919. moveNode.x = this.lastRootBallPos.x;
  9920. moveNode.y = this.lastRootBallPos.y;
  9921. if (!this.selfTurn) {
  9922. xGame.common.aiPlayer.resetRoot();
  9923. }
  9924. }
  9925. }
  9926. class ui_guanyuAni extends fgui.GComponent {
  9927. static createInstance() {
  9928. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9929. }
  9930. onConstruct() {
  9931. this.n0 = (this.getChild("n0"));
  9932. }
  9933. }
  9934. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9935. class UIFireworks extends UIBase {
  9936. constructor() {
  9937. super();
  9938. }
  9939. onConstructor() {
  9940. this.isEject = false;
  9941. }
  9942. show(callback) {
  9943. super.show();
  9944. }
  9945. }
  9946. UIFireworks.uiName = "UIFireworks";
  9947. class ui_UIGuanYu extends fgui.GComponent {
  9948. static createInstance() {
  9949. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9950. }
  9951. onConstruct() {
  9952. this.n2 = (this.getChild("n2"));
  9953. this.n1 = (this.getChild("n1"));
  9954. this.n3 = (this.getChild("n3"));
  9955. this.n4 = (this.getChild("n4"));
  9956. this.n5 = (this.getChild("n5"));
  9957. this.n6 = (this.getChild("n6"));
  9958. this.n8 = (this.getChild("n8"));
  9959. this.n7 = (this.getChild("n7"));
  9960. this.t0 = this.getTransition("t0");
  9961. }
  9962. }
  9963. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9964. class UIGuanYu extends UIBase {
  9965. constructor() {
  9966. super();
  9967. }
  9968. onConstructor() {
  9969. this.ui = ui_UIGuanYu.createInstance();
  9970. this.contentPane = this.ui;
  9971. this.isEject = false;
  9972. }
  9973. show(callback) {
  9974. super.show();
  9975. this.ui.t0.play(Laya.Handler.create(this, () => {
  9976. callback && callback();
  9977. this.hide();
  9978. }));
  9979. }
  9980. }
  9981. UIGuanYu.uiName = "UIGuanYu";
  9982. class SkillMgr {
  9983. constructor() {
  9984. this.leveNum = 0;
  9985. this.extraScore = 0;
  9986. this.selfTurn = false;
  9987. this.playedLastSkill = false;
  9988. this.tweenArr = [];
  9989. this._finishNum = 0;
  9990. this._curFinish = 0;
  9991. this._rootX = 0;
  9992. this._rootY = 0;
  9993. this.knifeTimes = 0;
  9994. this.knifeV2 = new Laya.Vector2();
  9995. this.knifeV3 = new Laya.Vector3();
  9996. this.rtStarX = 0;
  9997. this.rtStarY = 0;
  9998. this.addBigSkillSpine();
  9999. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10000. }
  10001. addBigSkillSpine() {
  10002. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10003. console.log("extra2 success");
  10004. });
  10005. }
  10006. runBigSkill(callback) {
  10007. this.tweenArr = [];
  10008. this.callback = callback;
  10009. this.judgeSkill();
  10010. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10011. let guide = DataMgr.getSkillGuide();
  10012. if (!xGame.common.gameMgr.selfTurn) {
  10013. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10014. }
  10015. else {
  10016. if (xGame.common.temSelfLevel != 0) {
  10017. this.leveNum = xGame.common.temSelfLevel;
  10018. }
  10019. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10020. this.leveNum += 5;
  10021. }
  10022. }
  10023. if (guide == 0) {
  10024. DataMgr.setSkillGuide(1);
  10025. if (DataMgr.getNewUser()) {
  10026. Moyu.sendDataEvent("gameFirstPlay");
  10027. DataMgr.setNewUser();
  10028. }
  10029. }
  10030. this.playSpineAni(() => {
  10031. switch (this.curSkill) {
  10032. case SkillType.highSpace:
  10033. this.runHighSpace();
  10034. break;
  10035. case SkillType.breakArmy:
  10036. this.runBreakArmy();
  10037. break;
  10038. case SkillType.ice:
  10039. this.runIce();
  10040. break;
  10041. case SkillType.fireworks:
  10042. this.runFireworks();
  10043. break;
  10044. case SkillType.GuanYu:
  10045. this.runGuanYu();
  10046. break;
  10047. default:
  10048. break;
  10049. }
  10050. });
  10051. }
  10052. judgeSkill() {
  10053. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10054. let gameMgr = xGame.common.gameMgr;
  10055. let type;
  10056. for (let index = 0; index < typeArr.length; index++) {
  10057. type = typeArr[index];
  10058. if (gameMgr.selfTurn) {
  10059. if (gameMgr.selfCurSkill == type) {
  10060. this.selfTurn = true;
  10061. this.curSkill = type;
  10062. return;
  10063. }
  10064. }
  10065. else {
  10066. if (gameMgr.aiCurSkill == type) {
  10067. this.selfTurn = false;
  10068. this.curSkill = type;
  10069. return;
  10070. }
  10071. }
  10072. }
  10073. }
  10074. playSpineAni(callback) {
  10075. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10076. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10077. parent.destroyChildren();
  10078. let aniIndex = 0;
  10079. let skillSpine;
  10080. switch (this.curSkill) {
  10081. case SkillType.highSpace:
  10082. aniIndex = 1;
  10083. xGame.soundMgr.playSound("skill01");
  10084. skillSpine = this.skillSpine2;
  10085. data.scaleX = 0.5;
  10086. data.scaleY = 0.5;
  10087. skillSpine.play(data, 1, false, parent, () => {
  10088. callback && callback();
  10089. });
  10090. break;
  10091. case SkillType.breakArmy:
  10092. aniIndex = 2;
  10093. xGame.soundMgr.playSound("skill02");
  10094. skillSpine = this.skillSpine2;
  10095. data.scaleX = 0.5;
  10096. data.scaleY = 0.5;
  10097. skillSpine.play(data, 2, false, parent, () => {
  10098. callback && callback();
  10099. });
  10100. break;
  10101. case SkillType.ice:
  10102. aniIndex = 0;
  10103. xGame.soundMgr.playSound("skill03");
  10104. skillSpine = this.skillSpine2;
  10105. data.scaleX = 0.5;
  10106. data.scaleY = 0.5;
  10107. skillSpine.play(data, 0, false, parent, () => {
  10108. callback && callback();
  10109. });
  10110. break;
  10111. case SkillType.fireworks:
  10112. xGame.soundMgr.playSound("skill_04_01");
  10113. xGame.soundMgr.playSound("skill04");
  10114. xGame.uiMgr.Show(UIFireworks, callback);
  10115. break;
  10116. case SkillType.GuanYu:
  10117. xGame.soundMgr.playSound("skill05_1");
  10118. xGame.soundMgr.playSound("skill05");
  10119. xGame.uiMgr.Show(UIGuanYu, callback);
  10120. break;
  10121. default:
  10122. break;
  10123. }
  10124. }
  10125. getAllBallArr() {
  10126. let arr = xGame.common.d2World.ballArr;
  10127. let outArr = [];
  10128. for (let index = 0; index < arr.length; index++) {
  10129. if (arr[index] instanceof D2RootBallSrc)
  10130. continue;
  10131. if (arr[index].ballFunc == "ice")
  10132. continue;
  10133. if (arr[index].destroyed)
  10134. continue;
  10135. outArr.push(arr[index]);
  10136. }
  10137. return outArr;
  10138. }
  10139. getOneArr(deletObj) {
  10140. let allArr = this.getAllBallArr();
  10141. let temp;
  10142. for (let index = 0; index < allArr.length; index++) {
  10143. temp = allArr[index];
  10144. if (temp.id == deletObj.id) {
  10145. allArr.splice(index, 1);
  10146. break;
  10147. }
  10148. }
  10149. return allArr;
  10150. }
  10151. getNearBallBag(ball) {
  10152. let ui = xGame.common.gameUI.ui;
  10153. let circleArr = [];
  10154. for (let index = 1; index <= 6; index++) {
  10155. circleArr.push(ui.border["circle" + index]);
  10156. }
  10157. let outIndex = 0;
  10158. let temp;
  10159. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10160. ;
  10161. let dis = 0;
  10162. for (let index = 1; index < circleArr.length; index++) {
  10163. temp = circleArr[index];
  10164. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10165. if (dis < min) {
  10166. min = dis;
  10167. outIndex = index;
  10168. }
  10169. }
  10170. return [circleArr[outIndex], outIndex];
  10171. }
  10172. ballFlyToBag(ballArr, time = 300) {
  10173. let temp;
  10174. let hole;
  10175. this._finishNum = ballArr.length;
  10176. this._curFinish = 0;
  10177. let holeObj = {};
  10178. let holeCfg = {
  10179. "1": 0,
  10180. "2": 0,
  10181. "3": 0,
  10182. "4": 0,
  10183. "5": 0,
  10184. "6": 0
  10185. };
  10186. for (let index = 0; index < ballArr.length; index++) {
  10187. temp = ballArr[index];
  10188. temp.outColli.isSensor = true;
  10189. temp.innerColli.isSensor = true;
  10190. temp.isRunSkillAni = true;
  10191. let holeArr = this.getNearBallBag(temp);
  10192. hole = holeArr[0];
  10193. holeObj[index] = holeArr[1];
  10194. temp.d3BallSrc.scaleXYZ = 0.5;
  10195. this.tweenArr.push(temp.d3BallSrc, temp);
  10196. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10197. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10198. }));
  10199. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10200. let mIndex = holeObj[this._curFinish];
  10201. let isDone = holeCfg[mIndex];
  10202. if (isDone) {
  10203. ballArr[this._curFinish].checkWrongBall(false);
  10204. }
  10205. else {
  10206. holeCfg[mIndex] = 1;
  10207. ballArr[this._curFinish].checkWrongBall();
  10208. }
  10209. this._curFinish++;
  10210. if (this._curFinish >= this._finishNum) {
  10211. if (this.curSkill == SkillType.highSpace) {
  10212. }
  10213. else if (this.curSkill == SkillType.breakArmy) {
  10214. let rootBall = xGame.common.d2World.rootBall;
  10215. rootBall.gameObj.x = this._rootX;
  10216. rootBall.gameObj.y = this._rootY;
  10217. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10218. xGame.common.d2World.d2Gan.ui.visible = true;
  10219. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10220. xGame.common.d2World.getHelpLine();
  10221. this.callback && this.callback(this.extraScore);
  10222. }
  10223. }
  10224. }));
  10225. }
  10226. }
  10227. runHighSpace() {
  10228. let rootBall = xGame.common.d2World.rootBall;
  10229. rootBall.showSelf();
  10230. let d3Src = rootBall.d3BallSrc;
  10231. let allArr = this.getAllBallArr();
  10232. if (allArr.length <= 0) {
  10233. this.callback && this.callback(0);
  10234. return;
  10235. }
  10236. let selectBall = xGame.common.d2World.targetBall;
  10237. let wrong = selectBall && selectBall.destroyed;
  10238. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10239. selectBall = xGame.common.getRandArrEle(allArr);
  10240. }
  10241. let targetD3Src = selectBall.d3BallSrc;
  10242. xGame.common.d2World.d2Gan.ui.visible = false;
  10243. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10244. d3Src.scaleXYZ = 0.5;
  10245. this.tweenArr.push(d3Src);
  10246. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10247. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10248. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10249. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10250. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10251. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10252. let outArr = [selectBall];
  10253. let other = this.leveNum - 1;
  10254. if (other > 0) {
  10255. let nearArr = this.getOneArr(selectBall);
  10256. if (nearArr.length > 0) {
  10257. xGame.common.botherArr(nearArr);
  10258. if (other >= nearArr.length)
  10259. other = nearArr.length;
  10260. for (let index = 0; index < other; index++) {
  10261. outArr.push(nearArr[index]);
  10262. }
  10263. }
  10264. }
  10265. xGame.common.extraMoveNum = other + 1;
  10266. this.extraScore = other + 1;
  10267. this._rootX = selectBall.gameObj.x;
  10268. this._rootY = selectBall.gameObj.y;
  10269. rootBall.gameObj.x = this._rootX;
  10270. rootBall.gameObj.y = this._rootY;
  10271. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10272. Laya.Tween.clearAll(d3Src);
  10273. this.addRandomForce(outArr);
  10274. }));
  10275. }));
  10276. }
  10277. addRandomForce(outArr) {
  10278. if (outArr.length > 0) {
  10279. xGame.common.d2World.openCheckStill = true;
  10280. this.playedLastSkill = true;
  10281. }
  10282. let temp;
  10283. for (let index = 0; index < outArr.length; index++) {
  10284. let angle = xGame.common.randomNum(0, 360);
  10285. let linearPercent = xGame.common.randomNum(65, 100);
  10286. temp = outArr[index];
  10287. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10288. }
  10289. }
  10290. setLinearSpeed(angle, rigy, linearPercent) {
  10291. let sin = Math.sin(angle * Math.PI / 180);
  10292. let cos = Math.cos(angle * Math.PI / 180);
  10293. let maxSpeed = 4;
  10294. let speed = new Laya.Vector2();
  10295. speed.x = maxSpeed * linearPercent * sin;
  10296. speed.y = -maxSpeed * linearPercent * cos;
  10297. rigy.applyLinearImpulseToCenter(speed);
  10298. }
  10299. runBreakArmy() {
  10300. xGame.common.d2World.d2Gan.ui.visible = false;
  10301. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10302. let gameUI = xGame.common.gameUI.ui;
  10303. gameUI.skillRod.visible = true;
  10304. gameUI.skillRod.rotation = 110;
  10305. let outArr = this.getAllBallArr();
  10306. if (outArr.length <= 0) {
  10307. gameUI.skillRod.visible = false;
  10308. this.callback && this.callback(0);
  10309. return;
  10310. }
  10311. xGame.common.botherArr(outArr);
  10312. if (this.leveNum >= outArr.length)
  10313. this.leveNum = outArr.length;
  10314. let deleteNum = outArr.length - this.leveNum;
  10315. outArr.splice(0, deleteNum);
  10316. this.extraScore = this.leveNum;
  10317. let potX = gameUI.skillRod.x;
  10318. let potY = gameUI.skillRod.y;
  10319. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10320. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10321. let disArr = [];
  10322. for (let index = 0; index < outArr.length; index++) {
  10323. let obj = outArr[index];
  10324. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10325. dis = Math.pow(dis, 0.5);
  10326. disArr.push(dis);
  10327. }
  10328. this.tweenArr.push(gameUI.skillRod);
  10329. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10330. })).update = Laya.Handler.create(this, (e, t, c) => {
  10331. let angle = gameUI.skillRod.rotation;
  10332. let xx;
  10333. let yy;
  10334. let temp;
  10335. for (let index = 0; index < outArr.length; index++) {
  10336. temp = outArr[index];
  10337. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10338. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10339. yy -= 20;
  10340. temp.gameObj.x = xx;
  10341. temp.gameObj.y = yy;
  10342. temp.d3BallSrc.setTransPos(xx, yy);
  10343. }
  10344. if (angle <= 60) {
  10345. Laya.Tween.clearAll(gameUI.skillRod);
  10346. this.ballFlyToBag(outArr, 150);
  10347. gameUI.skillRod.visible = false;
  10348. }
  10349. }, null, false);
  10350. }
  10351. runIce() {
  10352. let ballArr = xGame.common.d2World.ballArr;
  10353. this.leveNum *= 2;
  10354. if (this.leveNum >= ballArr.length - 1)
  10355. this.leveNum = ballArr.length - 1;
  10356. let tempArr = [];
  10357. let outArr = [];
  10358. for (let index = 0; index < ballArr.length; index++) {
  10359. if (ballArr[index] instanceof D2RootBallSrc)
  10360. continue;
  10361. tempArr.push(ballArr[index]);
  10362. }
  10363. if (tempArr.length <= 0) {
  10364. this.callback && this.callback(0);
  10365. return;
  10366. }
  10367. xGame.common.botherArr(tempArr);
  10368. for (let index = 0; index < this.leveNum; index++) {
  10369. outArr.push(tempArr[index]);
  10370. }
  10371. this.extraScore = this.leveNum;
  10372. let temp;
  10373. for (let index = 0; index < outArr.length; index++) {
  10374. temp = outArr[index];
  10375. temp.d3BallSrc.playIceEft();
  10376. }
  10377. Laya.timer.once(2000, this, () => {
  10378. for (let index = 0; index < outArr.length; index++) {
  10379. temp = outArr[index];
  10380. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10381. temp.setBallFunc("ice", str);
  10382. }
  10383. this.callback && this.callback(0);
  10384. });
  10385. }
  10386. runFireworks() {
  10387. let allArr = this.getAllBallArr();
  10388. if (allArr.length <= 0) {
  10389. this.callback && this.callback(0);
  10390. return;
  10391. }
  10392. xGame.common.d2World.d2Gan.ui.visible = false;
  10393. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10394. let outArr = [];
  10395. let other = this.leveNum;
  10396. if (other > 0) {
  10397. if (allArr.length > 0) {
  10398. xGame.common.botherArr(allArr);
  10399. if (other >= allArr.length)
  10400. other = allArr.length;
  10401. for (let index = 0; index < other; index++) {
  10402. outArr.push(allArr[index]);
  10403. }
  10404. }
  10405. }
  10406. xGame.common.extraMoveNum = other;
  10407. this.extraScore = other;
  10408. this.addRandmomFireworks(outArr);
  10409. }
  10410. addRandmomFireworks(outArr) {
  10411. Laya.timer.once(1100, this, () => {
  10412. if (outArr.length > 0) {
  10413. xGame.common.d2World.openCheckStill = true;
  10414. this.playedLastSkill = true;
  10415. }
  10416. });
  10417. xGame.soundMgr.playSound("skill_04_02");
  10418. let temp;
  10419. let delay = -200;
  10420. for (let index = 0; index < outArr.length; index++) {
  10421. temp = outArr[index];
  10422. delay += 200;
  10423. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10424. let angle = xGame.common.randomNum(0, 360);
  10425. angle = this.getFireworksAngle(obj);
  10426. let linearPercent = xGame.common.randomNum(45, 80);
  10427. if (!obj.destroyed)
  10428. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10429. });
  10430. }
  10431. }
  10432. getFireworksAngle(obj) {
  10433. let rootBall = xGame.common.d2World.rootBall;
  10434. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10435. }
  10436. resetGame() {
  10437. Laya.timer.clearAll(this);
  10438. if (this.tweenArr) {
  10439. for (let index = 0; index < this.tweenArr.length; index++) {
  10440. Laya.Tween.clearAll(this.tweenArr[index]);
  10441. }
  10442. }
  10443. this.tweenArr = null;
  10444. }
  10445. runGuanYu() {
  10446. xGame.common.d2World.d2Gan.ui.visible = false;
  10447. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10448. let rootBall = xGame.common.d2World.rootBall;
  10449. if (rootBall.isInHole) {
  10450. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10451. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10452. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10453. rootBall.showSelf();
  10454. }
  10455. this.rtStarX = rootBall.gameObj.x;
  10456. this.rtStarY = rootBall.gameObj.y;
  10457. this.knifeTimes = 0;
  10458. this.playedLastSkill = true;
  10459. rootBall.forceRun = true;
  10460. rootBall.rigy.type = "static";
  10461. xGame.common.d2World.openCheckStill = true;
  10462. this.guanyuRandomKnife();
  10463. }
  10464. guanyuRandomKnife() {
  10465. let rootBall = xGame.common.d2World.rootBall;
  10466. let dir = this.getRandDir();
  10467. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10468. console.log("当前angle", angle);
  10469. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10470. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10471. let dis = 324;
  10472. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10473. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10474. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10475. this.rtStarX = rootBall.gameObj.x;
  10476. this.rtStarY = rootBall.gameObj.y;
  10477. this.knifeTimes++;
  10478. let skillLevel;
  10479. if (xGame.common.gameMgr.selfTurn) {
  10480. skillLevel = DataMgr.getBigSkillByIndex(4);
  10481. }
  10482. else {
  10483. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10484. }
  10485. if (!skillLevel)
  10486. skillLevel = 1;
  10487. skillLevel += 2;
  10488. if (this.knifeTimes < skillLevel) {
  10489. Laya.timer.once(400, this, () => {
  10490. this.guanyuRandomKnife();
  10491. });
  10492. }
  10493. else {
  10494. rootBall.forceRun = false;
  10495. rootBall.rigy.type = "dynamic";
  10496. xGame.common.extraMoveNum = skillLevel;
  10497. }
  10498. }));
  10499. }
  10500. getRandDir() {
  10501. let rootBall = xGame.common.d2World.rootBall;
  10502. let allBall = this.getAllBallArr();
  10503. let target = xGame.common.getRandArrEle(allBall);
  10504. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10505. return this.knifeV2;
  10506. }
  10507. cloneKnife(x, y, rotation) {
  10508. let parent = xGame.common.d3World.knifeRoot;
  10509. let prefab = xGame.common.d3World.knife;
  10510. let clone = prefab.clone();
  10511. parent.addChild(clone);
  10512. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10513. clone.transform.localPositionX = this.knifeV3.x;
  10514. clone.transform.localPositionY = 0;
  10515. clone.transform.localPositionZ = this.knifeV3.z;
  10516. clone.transform.localRotationEulerX = 0;
  10517. clone.transform.localRotationEulerY = rotation;
  10518. clone.transform.localRotationEulerZ = 0;
  10519. clone.active = true;
  10520. return clone;
  10521. }
  10522. cloneGuanYuEft(x, y, angle) {
  10523. return;
  10524. let parent = xGame.common.gameUI.ui.guanyuNode;
  10525. let eft = new ui_guanyuAni();
  10526. eft.parent = parent;
  10527. eft.x = x;
  10528. eft.y = y;
  10529. eft.rotation = angle;
  10530. }
  10531. }
  10532. class ui_UIWordsList extends fgui.GComponent {
  10533. static createInstance() {
  10534. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10535. }
  10536. onConstruct() {
  10537. this.c1 = this.getController("c1");
  10538. this.n74 = (this.getChild("n74"));
  10539. this.clickNode = (this.getChild("clickNode"));
  10540. this.myNode = (this.getChild("myNode"));
  10541. this.n68 = (this.getChild("n68"));
  10542. this.n66 = (this.getChild("n66"));
  10543. this.n55 = (this.getChild("n55"));
  10544. this.wordsBtn = (this.getChild("wordsBtn"));
  10545. this.emotionBtn = (this.getChild("emotionBtn"));
  10546. this.mybggg = (this.getChild("mybggg"));
  10547. this.wordsList = (this.getChild("wordsList"));
  10548. this.emotionList = (this.getChild("emotionList"));
  10549. this.myRoot = (this.getChild("myRoot"));
  10550. }
  10551. }
  10552. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10553. class EmotionDisplay {
  10554. constructor(index, ui) {
  10555. this.ui = ui;
  10556. this.index = index;
  10557. this.ui.onClick(this, this.clickSelf);
  10558. this.updateSelf();
  10559. }
  10560. updateSelf() {
  10561. let data = cfgTable.emotionData[this.index + 1];
  10562. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10563. }
  10564. clickSelf() {
  10565. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10566. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10567. xGame.common.talkMgr.closeTalkView();
  10568. }
  10569. }
  10570. class WordsDisplay {
  10571. constructor(index, ui) {
  10572. this.ui = ui;
  10573. this.index = index;
  10574. this.ui.onClick(this, this.clickSelf);
  10575. this.updateSelf();
  10576. }
  10577. updateSelf() {
  10578. let data = cfgTable.talkwordsData[this.index + 1];
  10579. this.ui.txt.text = data.msg;
  10580. }
  10581. clickSelf() {
  10582. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10583. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10584. xGame.common.talkMgr.closeTalkView();
  10585. }
  10586. }
  10587. class UIWordsList extends UIBase {
  10588. constructor() {
  10589. super();
  10590. }
  10591. onConstructor() {
  10592. this.ui = ui_UIWordsList.createInstance();
  10593. this.contentPane = this.ui;
  10594. this.isEject = false;
  10595. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10596. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10597. this.addUIClick(this.ui.clickNode, this.hide);
  10598. this.initTalkList();
  10599. this.initEmotionList();
  10600. }
  10601. show() {
  10602. super.show();
  10603. }
  10604. initTalkList() {
  10605. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10606. let data = cfgTable.talkwordsData;
  10607. let length = Object.keys(data).length;
  10608. this.ui.wordsList.numItems = length;
  10609. }
  10610. initEmotionList() {
  10611. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10612. let data = cfgTable.emotionData;
  10613. let length = Object.keys(data).length;
  10614. this.ui.emotionList.numItems = length;
  10615. }
  10616. renderTalkItem(index, obj) {
  10617. let temp = new WordsDisplay(index, obj);
  10618. }
  10619. renderEmotionItem(index, obj) {
  10620. let temp = new EmotionDisplay(index, obj);
  10621. }
  10622. openTalkList() {
  10623. this.ui.c1.selectedIndex = 0;
  10624. }
  10625. openEmotionList() {
  10626. this.ui.c1.selectedIndex = 1;
  10627. }
  10628. }
  10629. UIWordsList.uiName = "UIWordsList";
  10630. class TalkMgr {
  10631. constructor() {
  10632. this.aiSpeak = true;
  10633. this.emotionList = [];
  10634. this.talkList = [];
  10635. this.addEvent();
  10636. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10637. this.emotionList = [];
  10638. this.talkList = [];
  10639. for (let k in cfgTable.emotionData) {
  10640. this.emotionList.push(cfgTable.emotionData[k].id);
  10641. }
  10642. for (let k in cfgTable.talkwordsData) {
  10643. this.talkList.push(cfgTable.talkwordsData[k].id);
  10644. }
  10645. }
  10646. addEvent() {
  10647. let ui = xGame.common.gameUI.ui;
  10648. ui.wordsBtn.visible = true;
  10649. ui.wordsBtn.onClick(this, this.openTalkView);
  10650. ui.aiWordsBtn.visible = true;
  10651. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10652. }
  10653. openTalkView() {
  10654. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10655. xGame.uiMgr.Show(UIWordsList);
  10656. }
  10657. closeTalkView() {
  10658. xGame.uiMgr.Hide(UIWordsList);
  10659. }
  10660. clickAIState() {
  10661. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10662. this.aiSpeak = !this.aiSpeak;
  10663. this.changeAIState(this.aiSpeak);
  10664. }
  10665. changeAIState(speak) {
  10666. this.aiSpeak = speak;
  10667. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10668. if (speak) {
  10669. btn.c1.selectedIndex = 0;
  10670. }
  10671. else {
  10672. btn.c1.selectedIndex = 1;
  10673. }
  10674. }
  10675. showSelfTalk(wordsId) {
  10676. let ui = xGame.common.gameUI.ui;
  10677. ui.selfTalk.visible = true;
  10678. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10679. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10680. ui.selfTalk.t0.play();
  10681. }
  10682. showSelfEmotion(emotionId) {
  10683. let ui = xGame.common.gameUI.ui;
  10684. ui.selfTalk.visible = true;
  10685. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10686. this.selfSpine && this.selfSpine.dispose();
  10687. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10688. let spineData = cfgTable.emotionData[emotionId].spine;
  10689. this.selfSpine = new SpineMgr(spineData, () => {
  10690. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10691. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10692. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10693. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10694. });
  10695. ui.selfTalk.t0.play();
  10696. }
  10697. showAITalk(wordsId) {
  10698. if (!this.aiSpeak)
  10699. return;
  10700. if (DataMgr.gameData.gameCount < 2)
  10701. return;
  10702. if (wordsId < 1)
  10703. wordsId = this.getRandTalk();
  10704. let ui = xGame.common.gameUI.ui;
  10705. ui.aiTalk.visible = true;
  10706. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10707. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10708. ui.aiTalk.t0.play();
  10709. }
  10710. getRandTalk() {
  10711. let rand = xGame.tools.random(0, this.talkList.length);
  10712. return this.emotionList[rand];
  10713. }
  10714. getRandEmotion() {
  10715. let rand = xGame.tools.random(0, this.emotionList.length);
  10716. return this.emotionList[rand];
  10717. }
  10718. showAIEmotion(emotionId) {
  10719. if (!this.aiSpeak)
  10720. return;
  10721. if (DataMgr.gameData.gameCount < 2)
  10722. return;
  10723. if (emotionId < 1)
  10724. emotionId = this.getRandEmotion();
  10725. let ui = xGame.common.gameUI.ui;
  10726. ui.aiTalk.visible = true;
  10727. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10728. this.aiSpine && this.aiSpine.dispose();
  10729. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10730. let spineData = cfgTable.emotionData[emotionId].spine;
  10731. this.aiSpine = new SpineMgr(spineData, () => {
  10732. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10733. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10734. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10735. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10736. });
  10737. ui.aiTalk.t0.play();
  10738. }
  10739. resetGame() {
  10740. let ui = xGame.common.gameUI.ui;
  10741. ui.aiTalk.visible = false;
  10742. ui.selfTalk.visible = false;
  10743. this.aiSpine && this.aiSpine.dispose();
  10744. this.selfSpine && this.selfSpine.dispose();
  10745. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10746. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10747. this.closeTalkView();
  10748. }
  10749. }
  10750. class WordsMgr {
  10751. constructor() {
  10752. this.comboTimes = 1;
  10753. this.skillTimes = 0;
  10754. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10755. this.comboSpine = new SpineMgr("yxz_liangan");
  10756. this.skillSpine = new SpineMgr("yiganxqiu");
  10757. this.scoreSpine = new SpineMgr("defen");
  10758. }
  10759. setClassicCombo(isInterrupt) {
  10760. if (isInterrupt) {
  10761. this.comboTimes = 0;
  10762. }
  10763. }
  10764. playClassicWords(type, callback) {
  10765. this.callback = callback;
  10766. let aniIndex = type;
  10767. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10768. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10769. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10770. mySpine.destroy(true);
  10771. this.playClassicTimes();
  10772. });
  10773. }
  10774. playClassicTimes() {
  10775. this.comboTimes++;
  10776. if (this.comboTimes <= 1) {
  10777. this.callback && this.callback();
  10778. }
  10779. else {
  10780. let aniIndex = this.comboTimes - 1;
  10781. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10782. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10783. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10784. mySpine.destroy(true);
  10785. this.callback && this.callback();
  10786. });
  10787. }
  10788. }
  10789. playBigSkillTimes(times, callback) {
  10790. if (times <= 0) {
  10791. callback && callback();
  10792. return;
  10793. }
  10794. this.callback = callback;
  10795. let pre = "sz_0";
  10796. let aniIndex = 0;
  10797. this.getWordsImg(times, pre, () => {
  10798. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10799. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10800. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10801. let r1 = ``;
  10802. let r2 = ``;
  10803. if (times <= 9) {
  10804. r1 = `res/d2Res/${pre}${times}.png`;
  10805. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10806. aniIndex = 0;
  10807. }
  10808. else {
  10809. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10810. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10811. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10812. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10813. aniIndex = 1;
  10814. }
  10815. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10816. mySpine.destroy(true);
  10817. xGame.common.gameMgr.playSkillTips();
  10818. this.playScore(times);
  10819. xGame.common.playRandomMutiBallBigSkillSound();
  10820. }, mySpine);
  10821. });
  10822. }
  10823. playScore(score) {
  10824. let pre = "sz_";
  10825. let aniIndex = 0;
  10826. this.getWordsImg(score, pre, () => {
  10827. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10828. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10829. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10830. let r1 = ``;
  10831. let r2 = ``;
  10832. if (score <= 9) {
  10833. r1 = `res/d2Res/${pre}${score}.png`;
  10834. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10835. aniIndex = 0;
  10836. }
  10837. else {
  10838. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10839. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10840. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10841. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10842. aniIndex = 1;
  10843. }
  10844. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10845. mySpine.destroy(true);
  10846. this.callback && this.callback();
  10847. }, mySpine);
  10848. });
  10849. }
  10850. getWordsImg(number, pre = "", callback) {
  10851. let arr = [];
  10852. if (number <= 9) {
  10853. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10854. }
  10855. else {
  10856. 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 });
  10857. }
  10858. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10859. callback && callback();
  10860. }));
  10861. }
  10862. }
  10863. class ui_UIRodMethod extends fgui.GComponent {
  10864. static createInstance() {
  10865. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10866. }
  10867. onConstruct() {
  10868. this.n24 = (this.getChild("n24"));
  10869. this.white = (this.getChild("white"));
  10870. this.dot = (this.getChild("dot"));
  10871. this.sureBtn = (this.getChild("sureBtn"));
  10872. this.n20 = (this.getChild("n20"));
  10873. this.n21 = (this.getChild("n21"));
  10874. this.n22 = (this.getChild("n22"));
  10875. this.n23 = (this.getChild("n23"));
  10876. this.n5 = (this.getChild("n5"));
  10877. this.n14 = (this.getChild("n14"));
  10878. this.t0 = this.getTransition("t0");
  10879. }
  10880. }
  10881. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10882. class UIRodMethod extends UIBase {
  10883. constructor() {
  10884. super();
  10885. this.isPressd = false;
  10886. }
  10887. onConstructor() {
  10888. this.ui = ui_UIRodMethod.createInstance();
  10889. this.contentPane = this.ui;
  10890. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10891. this.moveDir = new Laya.Vector2();
  10892. this.moveDest = new Laya.Vector2();
  10893. this.centerPos = new Laya.Vector2();
  10894. xGame.common.uiRodMethod = this;
  10895. }
  10896. show() {
  10897. super.show();
  10898. xGame.common.gameMgr.gamePause = true;
  10899. this.openPressDotEvent();
  10900. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10901. this.centerPos.x = this.ui.white.x;
  10902. this.centerPos.y = this.ui.white.y;
  10903. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10904. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10905. this.setDot();
  10906. }
  10907. setDot() {
  10908. this.ui.dot.x = this.moveDest.x;
  10909. this.ui.dot.y = this.moveDest.y;
  10910. }
  10911. closeSelf() {
  10912. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10913. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10914. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10915. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10916. xGame.common.gameMgr.gamePause = false;
  10917. this.hide();
  10918. }
  10919. openPressDotEvent() {
  10920. this.closePressDotEvent();
  10921. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10922. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10923. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10924. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10925. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10926. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10927. }
  10928. closePressDotEvent() {
  10929. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10930. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10931. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10932. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10933. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10934. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10935. }
  10936. onDown(e) {
  10937. if (e.type == Laya.Event.MOUSE_DOWN)
  10938. this.isPressd = true;
  10939. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10940. this.isPressd = false;
  10941. if (!this.isPressd)
  10942. return;
  10943. this.moveDest.x = e.stageX;
  10944. this.moveDest.y = e.stageY;
  10945. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10946. if (dis > 6724) {
  10947. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10948. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10949. }
  10950. this.setDot();
  10951. }
  10952. resetRod() {
  10953. this.ui.dot.x = this.ui.white.x;
  10954. this.ui.dot.y = this.ui.white.y;
  10955. this.gameRod.dot.x = this.gameRod.bg.x;
  10956. this.gameRod.dot.y = this.gameRod.bg.y;
  10957. xGame.common.rodOffest.x = 0;
  10958. xGame.common.rodOffest.y = 0;
  10959. }
  10960. }
  10961. UIRodMethod.uiName = "UIRodMethod";
  10962. class UIGame extends UIBase {
  10963. constructor() {
  10964. super();
  10965. this.powerNum = 0;
  10966. this.isD3Inited = false;
  10967. this.isPrePlay = false;
  10968. this.isMoveRod = false;
  10969. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10970. this.rulerDis = 20;
  10971. this.rulerOffset = 0;
  10972. }
  10973. onConstructor() {
  10974. this.ui = ui_UIGame.createInstance();
  10975. this.contentPane = this.ui;
  10976. this.ui.x += xGame.common.sysOffestNum;
  10977. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10978. this.isEject = false;
  10979. xGame.common.gameUI = this;
  10980. this.initSelf();
  10981. }
  10982. isTurnSelf() {
  10983. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10984. return true;
  10985. }
  10986. }
  10987. initSelf() {
  10988. let topUI = this.ui.topNode;
  10989. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10990. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10991. this.barInfo = {};
  10992. this.barInfo.curY = 0;
  10993. this.barInfo.height = this.ui.powerNode.height;
  10994. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10995. this.barInfo.powerStartY = this.ui.powerNode.y;
  10996. xGame.common.aiPlayer = new AIPlayer();
  10997. xGame.common.gameMgr = new GameMgr();
  10998. xGame.common.skillMgr = new SkillMgr();
  10999. xGame.common.wordsMgr = new WordsMgr();
  11000. xGame.common.talkMgr = new TalkMgr();
  11001. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11002. console.log("加载经典模式表情文件chenggon !");
  11003. });
  11004. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11005. console.log("挑战模式奖励模式spine加载成功!");
  11006. });
  11007. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11008. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11009. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11010. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11011. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11012. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11013. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11014. }
  11015. getGanZiImg() {
  11016. let index = DataMgr.getCurBallRod();
  11017. let data = cfgTable.ballrodData[index + 1];
  11018. let gan_url = xGame.common.getGameIconUrl(data.img);
  11019. console.log('zh:getGanZiImg gan_url==' + gan_url);
  11020. this.ui.powerNode.showImg.url = gan_url;
  11021. console.log('zh:修改杆子图标O K');
  11022. }
  11023. returnHome() {
  11024. let tips = "Are you sure to exit the game?";
  11025. let woman = "Boss, why don't you play for a while longer?";
  11026. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11027. }
  11028. addRodMethodClick() {
  11029. if (this.isTurnSelf()) {
  11030. xGame.uiMgr.Show(UIRodMethod);
  11031. }
  11032. }
  11033. clickHelpLineBtn(force = false) {
  11034. if (!this.isTurnSelf())
  11035. return;
  11036. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11037. if (success) {
  11038. xGame.common.longHelpLine = true;
  11039. xGame.common.d2World.getHelpLine();
  11040. Moyu.sendDataEvent("guideNum");
  11041. }
  11042. else {
  11043. }
  11044. });
  11045. }
  11046. renderSelfDisplayBalls(index, target) {
  11047. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11048. target.myImg.url = xGame.common.getGameIconUrl(str);
  11049. }
  11050. renderAIDisplayBalls(index, target) {
  11051. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11052. target.myImg.url = xGame.common.getGameIconUrl(str);
  11053. ;
  11054. }
  11055. updateMode() {
  11056. if (xGame.common.gameMode == GameMode.classic) {
  11057. this.ui.topNode.scoreNode.visible = false;
  11058. }
  11059. else if (xGame.common.gameMode == GameMode.bigMove) {
  11060. this.ui.topNode.scoreNode.visible = true;
  11061. }
  11062. }
  11063. show() {
  11064. super.show();
  11065. console.log("zh:uigame show AADD");
  11066. this.ui.alpha = 0;
  11067. this.updateSelf();
  11068. xGame.common.gameMgr.gamePause = false;
  11069. xGame.common.gameUI.ui.blackAni.visible = false;
  11070. xGame.common.gameUI.ui.whiteAni.visible = false;
  11071. this.ui.powerEft.visible = false;
  11072. this.ui.colorNode.visible = false;
  11073. this.updateHead();
  11074. let curUse = DataMgr.getCurBallRod();
  11075. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  11076. this.getGanZiImg();
  11077. }
  11078. updateSelf() {
  11079. if (xGame.common.gameMode == GameMode.classic) {
  11080. this.ui.c1.selectedIndex = 0;
  11081. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11082. this.ui.topNode.middleNode.visible = true;
  11083. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11084. }
  11085. else if (xGame.common.gameMode == GameMode.bigMove) {
  11086. this.ui.c1.selectedIndex = 0;
  11087. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11088. this.ui.topNode.middleNode.visible = false;
  11089. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11090. let rand = xGame.common.randomNum(1, max);
  11091. let guide = DataMgr.getSkillGuide();
  11092. if (guide == 0)
  11093. rand = 1;
  11094. xGame.common.bigMoveLevelIndex = rand;
  11095. }
  11096. else if (xGame.common.gameMode == GameMode.placeBall) {
  11097. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11098. this.ui.c1.selectedIndex = 1 + data.type;
  11099. this.ui.alpha = 1;
  11100. this.startGame();
  11101. }
  11102. this.updateMode();
  11103. this.initD3world();
  11104. this.initD2world();
  11105. }
  11106. startGame() {
  11107. this.ui.snowNode.visible = Math.random() <= 0.1;
  11108. this.ui.d2Node.visible = false;
  11109. xGame.common.d3World.d3Hand.gameObj.active = false;
  11110. xGame.common.d3World.tableSrc.init();
  11111. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11112. this.cameraViewChange(() => {
  11113. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11114. switch (xGame.common.gameMode) {
  11115. case GameMode.classic:
  11116. xGame.common.d3World.d3Hand.gameObj.active = true;
  11117. this.playPutBallD3Ani();
  11118. break;
  11119. case GameMode.bigMove:
  11120. this.enterGame();
  11121. Laya.timer.once(500, this, () => {
  11122. this.ui.topNode.middleNode.visible = true;
  11123. this.ui.topNode.middleNode.t0.play();
  11124. });
  11125. break;
  11126. case GameMode.placeBall:
  11127. this.enterGame();
  11128. break;
  11129. default:
  11130. break;
  11131. }
  11132. });
  11133. PlatMgr.showBanner(false);
  11134. }
  11135. enterGame() {
  11136. this.ui.d2Node.visible = true;
  11137. xGame.common.d3World.d3Hand.gameObj.active = false;
  11138. xGame.common.showOneCamera("mainCamera");
  11139. Moyu.recordGame(30, true);
  11140. if (!this.isPrePlay) {
  11141. this.isPrePlay = true;
  11142. xGame.common.d3World.prePlayEft();
  11143. }
  11144. xGame.common.gameMgr.gameReady();
  11145. this.openAllEvent();
  11146. this.ui.snowNode.visible = false;
  11147. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11148. this.ui.helpBtn.visible = condition;
  11149. }
  11150. showHelpLineGuide() {
  11151. let longGuide = DataMgr.getGuideHelpLine();
  11152. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11153. this.ui.helpBtn.visible = true;
  11154. this.ui.guideNode.visible = true;
  11155. }
  11156. }
  11157. setTurnAlpha(alpha) {
  11158. this.ui.keduNode.alpha = alpha;
  11159. this.ui.ganNode.alpha = alpha;
  11160. this.ui.rodMethodNode.alpha = alpha;
  11161. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11162. }
  11163. cameraViewChange(callback) {
  11164. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11165. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11166. xGame.common.showOneCamera("visitAngle");
  11167. cameraSrc.localRotationEulerY = 180;
  11168. cameraSrc.localRotationEulerZ = 0;
  11169. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11170. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11171. callback && callback();
  11172. }));
  11173. }));
  11174. }
  11175. playPutBallD3Ani() {
  11176. xGame.common.showOneCamera("mainCamera");
  11177. let handSrc = xGame.common.d3World.d3Hand;
  11178. handSrc.gameObj.active = true;
  11179. handSrc.transform.localPositionZ = 3;
  11180. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11181. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11182. handSrc.gameObj.active = false;
  11183. this.enterGame();
  11184. }), 400);
  11185. }));
  11186. }
  11187. updateHead() {
  11188. let user = Moyu.getUserInfo();
  11189. this.ui.topNode.selfNameTxt.text = user.nickName;
  11190. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11191. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11192. if (DataMgr.getSkillGuide() < 1) {
  11193. this.ui.topNode.aiNameTxt.text = 'billiards';
  11194. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11195. }
  11196. else {
  11197. this.ui.topNode.aiNameTxt.text = aiData.name;
  11198. let randNo = Math.floor(Math.random() * 10) + 1;
  11199. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11200. }
  11201. }
  11202. initD2world() {
  11203. let node = this.ui.d2Root.displayObject;
  11204. let src = node.getComponent(D2World);
  11205. if (!src) {
  11206. xGame.common.d2World = node.addComponent(D2World);
  11207. }
  11208. xGame.common.d2World.initSelf();
  11209. }
  11210. initD3world() {
  11211. if (this.isD3Inited)
  11212. return;
  11213. this.isD3Inited = true;
  11214. let scene3D = xGame.common.d3Scene;
  11215. this.ui.d3Root.displayObject.addChild(scene3D);
  11216. scene3D.active = true;
  11217. xGame.common.d3World.tableSrc.setBorderPos();
  11218. }
  11219. onRootMove(e) {
  11220. let rootBall = xGame.common.d2World.rootBall;
  11221. this.ui.moveNode.x = e.x;
  11222. this.ui.moveNode.y = e.y;
  11223. rootBall.gameObj.x = e.x;
  11224. rootBall.gameObj.y = e.y;
  11225. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11226. }
  11227. aiRootMove(move) {
  11228. if (move)
  11229. this.hideBallUI();
  11230. else {
  11231. this.showBallUI();
  11232. xGame.common.d2World.getHelpLine();
  11233. }
  11234. }
  11235. aiForce(type, force = 0) {
  11236. this.pressTarget = PressType.powerNode;
  11237. if (type == 1)
  11238. this.onEventUp({ force: true });
  11239. else if (type == 2)
  11240. this.onEventMove({ stageY: force, force: true });
  11241. }
  11242. onEventPress(e) {
  11243. if (e.stopPropagation)
  11244. e.stopPropagation();
  11245. if (!this.isTurnSelf())
  11246. return;
  11247. let target = e.target;
  11248. switch (target) {
  11249. case this.ui.myPowerNode.displayObject:
  11250. this.pressTarget = PressType.powerNode;
  11251. this.barInfo.curY = e.stageY;
  11252. this.updateBarInfo();
  11253. break;
  11254. case this.ui.moveNode.displayObject:
  11255. this.pressTarget = PressType.moveNode;
  11256. this.hideBallUI();
  11257. this.eventObj.curX = this.ui.moveNode.x;
  11258. this.eventObj.curY = this.ui.moveNode.y;
  11259. this.ui.moveNode.finger.visible = false;
  11260. this.eventObj.lastX = e.stageX;
  11261. this.eventObj.lastY = e.stageY;
  11262. break;
  11263. case this.ui.rulerClickNode.displayObject:
  11264. this.pressTarget = PressType.rulerNode;
  11265. this.eventObj.lastY = e.stageY;
  11266. break;
  11267. case this.ui.d2Root.displayObject:
  11268. this.pressTarget = PressType.d2Root;
  11269. this.eventObj.lastX = e.stageX;
  11270. this.eventObj.lastY = e.stageY;
  11271. this.eventObj.starX = e.stageX;
  11272. this.eventObj.starY = e.stageY;
  11273. this.eventObj.curX = 0;
  11274. this.eventObj.curY = 0;
  11275. xGame.common.d2World.d2Gan.setGanLastInfo();
  11276. this.rulerOffset = 0;
  11277. break;
  11278. default:
  11279. break;
  11280. }
  11281. }
  11282. onEventMove(e) {
  11283. if (e.stopPropagation)
  11284. e.stopPropagation();
  11285. if (e && e.force) {
  11286. }
  11287. else {
  11288. if (!this.isTurnSelf())
  11289. return;
  11290. }
  11291. switch (this.pressTarget) {
  11292. case PressType.powerNode:
  11293. this.barInfo.curY = e.stageY;
  11294. this.updateBarInfo();
  11295. this.isMoveRod = true;
  11296. break;
  11297. case PressType.moveNode:
  11298. let rootBall = xGame.common.d2World.rootBall;
  11299. let radius = rootBall.gameObj.width / 2;
  11300. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11301. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11302. let border = xGame.common.d2World.borderRect;
  11303. if (curX <= border.x + radius)
  11304. curX = border.x + radius;
  11305. else if (curX >= border.x + border.width - radius)
  11306. curX = border.x + border.width - radius;
  11307. if (curY <= border.y + radius)
  11308. curY = border.y + radius;
  11309. else if (curY >= border.y + border.height - radius)
  11310. curY = border.y + border.height - radius;
  11311. if (xGame.common.gameMgr.isOpenBall) {
  11312. if (curX >= border.x + border.openBallW - radius)
  11313. curX = border.x + border.openBallW - radius;
  11314. }
  11315. this.ui.moveNode.x = curX;
  11316. this.ui.moveNode.y = curY;
  11317. rootBall.gameObj.x = curX;
  11318. rootBall.gameObj.y = curY;
  11319. rootBall.d3BallSrc.setTransPos(curX, curY);
  11320. this.isMoveRod = true;
  11321. break;
  11322. case PressType.rulerNode:
  11323. let yy = e.stageY - this.eventObj.lastY;
  11324. this.eventObj.lastY = e.stageY;
  11325. let ruler1 = this.ui.rulerNode.img1;
  11326. let ruler2 = this.ui.rulerNode.img2;
  11327. ruler1.y += yy;
  11328. ruler2.y += yy;
  11329. this.rulerOffset += yy;
  11330. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11331. this.rulerOffset = 0;
  11332. xGame.soundMgr.playSound("inch", 1, 10);
  11333. }
  11334. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11335. let h = ruler1.height;
  11336. this.checkGuide();
  11337. this.isMoveRod = true;
  11338. if (ruler1.y >= h) {
  11339. ruler1.y = -h;
  11340. ruler2.y = 0;
  11341. return;
  11342. }
  11343. else if (ruler1.y <= -h) {
  11344. ruler1.y = h;
  11345. ruler2.y = 0;
  11346. return;
  11347. }
  11348. if (ruler2.y >= h) {
  11349. ruler2.y = -h;
  11350. ruler1.y = 0;
  11351. return;
  11352. }
  11353. else if (ruler2.y <= -h) {
  11354. ruler2.y = h;
  11355. ruler1.y = 0;
  11356. return;
  11357. }
  11358. break;
  11359. case PressType.d2Root:
  11360. this.eventObj.curX = e.stageX;
  11361. this.eventObj.curY = e.stageY;
  11362. let offset = this.checkRodMoveDir();
  11363. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11364. this.eventObj.lastX = e.stageX;
  11365. this.eventObj.lastY = e.stageY;
  11366. break;
  11367. default:
  11368. break;
  11369. }
  11370. }
  11371. onEventUp(e) {
  11372. if (e.stopPropagation)
  11373. e.stopPropagation();
  11374. if (e && e.force) {
  11375. }
  11376. else {
  11377. if (!this.isTurnSelf())
  11378. return;
  11379. }
  11380. switch (this.pressTarget) {
  11381. case PressType.powerNode:
  11382. this.ui.powerNode.value = 0;
  11383. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11384. this.ui.powerTxt.text = "";
  11385. if (this.powerNum > 0) {
  11386. xGame.eventMgr.event(BALL_SHOOT);
  11387. xGame.common.d2World.shoot(this.powerNum);
  11388. xGame.common.d2World.d2Gan.shoot();
  11389. xGame.common.d2World.d2HelpLine.shoot();
  11390. this.finishGuide();
  11391. this.ui.powerEft.visible = false;
  11392. this.ui.colorNode.visible = false;
  11393. let ganStr = "";
  11394. if (this.powerNum <= 30) {
  11395. ganStr = "gan_30";
  11396. }
  11397. else if (this.powerNum <= 60) {
  11398. ganStr = "gan_50";
  11399. }
  11400. else {
  11401. ganStr = "gan_80";
  11402. }
  11403. xGame.soundMgr.playSound(ganStr);
  11404. }
  11405. break;
  11406. case PressType.moveNode:
  11407. let rootBall = xGame.common.d2World.rootBall;
  11408. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11409. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11410. let isIntersect = this.judgeBallIntersect();
  11411. if (isIntersect) {
  11412. this.ui.moveNode.x = lastX;
  11413. this.ui.moveNode.y = lastY;
  11414. rootBall.gameObj.x = lastX;
  11415. rootBall.gameObj.y = lastY;
  11416. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11417. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11418. }
  11419. else {
  11420. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11421. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11422. }
  11423. this.showBallUI();
  11424. this.ui.moveNode.finger.visible = true;
  11425. xGame.common.d2World.getHelpLine();
  11426. break;
  11427. case PressType.rulerNode:
  11428. break;
  11429. case PressType.d2Root:
  11430. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11431. if (dis <= 25) {
  11432. this.moveToClickDot(e);
  11433. }
  11434. break;
  11435. default:
  11436. break;
  11437. }
  11438. this.pressTarget = -1;
  11439. }
  11440. checkGuide() {
  11441. let guide = DataMgr.getSkillGuide();
  11442. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11443. xGame.common.guideStep++;
  11444. xGame.common.gameUI.ui.guide2.visible = false;
  11445. xGame.common.gameUI.ui.guide3.visible = true;
  11446. }
  11447. }
  11448. finishGuide() {
  11449. let guide = DataMgr.getSkillGuide();
  11450. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11451. xGame.common.guideStep = 10;
  11452. this.closeAllGuide();
  11453. console.log('zh: 新手引导完毕');
  11454. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11455. }
  11456. }
  11457. closeAllGuide() {
  11458. xGame.common.gameUI.ui.guide1.visible = false;
  11459. xGame.common.gameUI.ui.guide2.visible = false;
  11460. xGame.common.gameUI.ui.guide3.visible = false;
  11461. }
  11462. updateBarInfo() {
  11463. let star = this.ui.powerNode.y;
  11464. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11465. if (rate >= 1)
  11466. rate = 1;
  11467. if (rate <= 0)
  11468. rate = 0;
  11469. this.powerNum = Math.ceil(rate * 100);
  11470. this.ui.powerNode.value = this.powerNum;
  11471. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11472. this.ui.colorNode.value = this.powerNum;
  11473. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11474. this.ui.powerEft.visible = this.powerNum != 0;
  11475. this.ui.colorNode.visible = this.powerNum != 0;
  11476. this.ui.powerTxt.text = this.powerNum + "";
  11477. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11478. }
  11479. forceCancel() {
  11480. this.ui.powerNode.value = 0;
  11481. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11482. this.ui.powerTxt.text = "";
  11483. }
  11484. checkRodMoveDir() {
  11485. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11486. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11487. if (tempX >= 0 && tempY <= 0) {
  11488. return this.checkDir();
  11489. }
  11490. else if (tempX < 0 && tempY < 0) {
  11491. return this.checkDir(1, -1);
  11492. }
  11493. else if (tempX < 0 && tempY > 0) {
  11494. return this.checkDir(-1, -1);
  11495. }
  11496. else {
  11497. return this.checkDir(-1, 1);
  11498. }
  11499. }
  11500. checkDir(flagX = 1, flagY = 1) {
  11501. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11502. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11503. if (offsetY == 0) {
  11504. return offsetX * flagX;
  11505. }
  11506. if (offsetX == 0) {
  11507. return offsetY * flagY;
  11508. }
  11509. let angle = offsetY / offsetX;
  11510. if (Math.abs(angle) >= 1) {
  11511. return offsetY * flagY;
  11512. }
  11513. else {
  11514. return offsetX * flagX;
  11515. }
  11516. }
  11517. judgeBallIntersect() {
  11518. let rootBall = xGame.common.d2World.rootBall;
  11519. let ballArr = xGame.common.d2World.ballArr;
  11520. let radius = rootBall.gameObj.width / 2;
  11521. let temp;
  11522. let isIntersect = false;
  11523. for (let index = 0; index < ballArr.length; index++) {
  11524. temp = ballArr[index];
  11525. if (temp.number == rootBall.number)
  11526. continue;
  11527. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11528. if (isIntersect) {
  11529. break;
  11530. }
  11531. }
  11532. return isIntersect;
  11533. }
  11534. hideBallUI() {
  11535. let d2Gan = xGame.common.d2World.d2Gan;
  11536. if (!d2Gan.ui.isDisposed)
  11537. d2Gan.ui.visible = false;
  11538. let d2Help = xGame.common.d2World.d2HelpLine;
  11539. if (!d2Help.ui.isDisposed)
  11540. d2Help.ui.visible = false;
  11541. let rootBall = xGame.common.d2World.rootBall;
  11542. if (!rootBall.destroyed) {
  11543. rootBall.gameObj.active = false;
  11544. }
  11545. }
  11546. showBallUI() {
  11547. let d2Gan = xGame.common.d2World.d2Gan;
  11548. if (!d2Gan.ui.isDisposed)
  11549. d2Gan.ui.visible = true;
  11550. let d2Help = xGame.common.d2World.d2HelpLine;
  11551. if (!d2Help.ui.isDisposed)
  11552. d2Help.ui.visible = true;
  11553. let rootBall = xGame.common.d2World.rootBall;
  11554. if (!rootBall.destroyed) {
  11555. rootBall.gameObj.active = true;
  11556. }
  11557. }
  11558. moveToClickDot(e) {
  11559. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11560. let root = xGame.common.d2World.rootBall.gameObj;
  11561. let xx = e.stageX - xGame.common.sysOffestNum;
  11562. let yy = e.stageY;
  11563. let x = xx - root.x;
  11564. let y = yy - root.y;
  11565. let angle = xGame.common.getfguiRotation(x, y);
  11566. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11567. xGame.common.d2World.getHelpLine();
  11568. }
  11569. this.isMoveRod = false;
  11570. xGame.common.clickedBall = false;
  11571. }
  11572. openAllEvent() {
  11573. this.closeAllEvent();
  11574. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11575. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11576. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11577. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11578. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11579. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11580. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11581. }
  11582. closeAllEvent() {
  11583. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11584. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11585. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11586. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11587. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11588. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11589. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11590. }
  11591. resetGame() {
  11592. this.closeAllEvent();
  11593. this.hideBallUI();
  11594. xGame.common.gameMgr.gamePause = true;
  11595. }
  11596. }
  11597. UIGame.uiName = "UIGame";
  11598. class UIAddProp extends UIBase {
  11599. constructor() {
  11600. super();
  11601. this.curType = "";
  11602. }
  11603. onConstructor() {
  11604. this.ui = ui_UIAddProp.createInstance();
  11605. this.contentPane = this.ui;
  11606. this.isEject = false;
  11607. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11608. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11609. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11610. this.updateUI();
  11611. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11612. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11613. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11614. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11615. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11616. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11617. }
  11618. show(type) {
  11619. super.show();
  11620. this.curType = type == 0 ? "coin" : "diamond";
  11621. this.switchBtn("");
  11622. this.ui.t0.play();
  11623. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11624. PlatMgr.showInsert(true);
  11625. }
  11626. closeSelf() {
  11627. this.hide();
  11628. }
  11629. updateUI() {
  11630. let data = cfgTable.moneyData;
  11631. let temp;
  11632. let obj;
  11633. for (const key in data) {
  11634. temp = data[key];
  11635. obj = this.ui.myNode["node" + key];
  11636. if (parseInt(key) <= 2) {
  11637. obj.diamondTxt.text = "+" + temp.num;
  11638. }
  11639. else {
  11640. obj.coinTxt.text = temp.num;
  11641. obj.diamondTxt.text = temp.get.split('_')[1];
  11642. }
  11643. }
  11644. this.updateDiamondShare();
  11645. }
  11646. updateDiamondShare() {
  11647. let data = DataMgr.getShareDiamondTimes();
  11648. if (data >= xGame.common.maxShareDiamondTimes) {
  11649. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11650. this.ui.myNode.node1.touchable = false;
  11651. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11652. }
  11653. else {
  11654. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11655. this.ui.myNode.node1.touchable = true;
  11656. }
  11657. }
  11658. switchBtn(type) {
  11659. if (type == "")
  11660. type = this.curType;
  11661. else {
  11662. if (this.curType == type) {
  11663. return;
  11664. }
  11665. else {
  11666. this.curType = type;
  11667. }
  11668. }
  11669. if (type == "coin") {
  11670. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11671. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11672. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11673. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11674. this.ui.myNode.c1.selectedIndex = 0;
  11675. }
  11676. else {
  11677. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11678. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11679. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11680. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11681. this.ui.myNode.c1.selectedIndex = 1;
  11682. }
  11683. }
  11684. convertCoin(index) {
  11685. let data = cfgTable.moneyData[index];
  11686. let coinNum = data.num;
  11687. let str = data.get.split('_')[1];
  11688. let needDiamond = parseInt(str);
  11689. if (DataMgr.diamondEnough(needDiamond)) {
  11690. DataMgr.setDiamond(-needDiamond);
  11691. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11692. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11693. }
  11694. else {
  11695. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11696. this.switchBtn("diamond");
  11697. }
  11698. }
  11699. videoGetDiamond() {
  11700. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11701. if (Laya.Browser.onAndroid) {
  11702. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11703. if (!boo) {
  11704. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11705. return;
  11706. }
  11707. }
  11708. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11709. }
  11710. else {
  11711. console.log('zh:AD 失败,直接发放奖励');
  11712. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11713. }
  11714. }
  11715. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11716. let num = cfgTable.moneyData[2].num;
  11717. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11718. this.closeSelf();
  11719. }
  11720. videoGetCoin() {
  11721. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11722. if (Laya.Browser.onAndroid) {
  11723. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11724. if (!boo) {
  11725. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11726. return;
  11727. }
  11728. }
  11729. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11730. }
  11731. else {
  11732. console.log('zh:AD 失败,直接发放奖励');
  11733. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11734. }
  11735. }
  11736. qjff_AD_for_uiAddProp_videoGetCoin() {
  11737. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11738. this.closeSelf();
  11739. }
  11740. shareGetDiamond() {
  11741. let times = DataMgr.getShareDiamondTimes();
  11742. if (times >= xGame.common.maxShareDiamondTimes) {
  11743. console.log('zh: 233333333333 maxShareDiamondTimes');
  11744. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11745. }
  11746. else {
  11747. console.log('zh:33333333333333ad');
  11748. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11749. if (Laya.Browser.onAndroid) {
  11750. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11751. if (!boo) {
  11752. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11753. return;
  11754. }
  11755. }
  11756. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11757. }
  11758. else {
  11759. console.log('zh:AD 失败,直接发放奖励');
  11760. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11761. }
  11762. }
  11763. }
  11764. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11765. let diamond = xGame.common.randomNum(50, 100);
  11766. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11767. DataMgr.setShareDiamondTimes(1);
  11768. this.updateDiamondShare();
  11769. }
  11770. openPutBallView() {
  11771. let end = xGame.uiMgr.getUI(UIGameEnd);
  11772. let skill = xGame.uiMgr.getUI(UISkill);
  11773. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11774. let uigame = xGame.uiMgr.getUI(UIGame);
  11775. if (end && !end.isHide) {
  11776. xGame.uiMgr.Hide(UIGameEnd);
  11777. xGame.uiMgr.Show(UIMain);
  11778. }
  11779. if (skill && !skill.isHide)
  11780. xGame.uiMgr.Hide(UISkill);
  11781. if (uigame && !uigame.isHide)
  11782. xGame.uiMgr.Hide(UIGame);
  11783. if (level && !level.isHide) {
  11784. }
  11785. else {
  11786. xGame.uiMgr.Show(UILevelDisplay);
  11787. }
  11788. this.closeSelf();
  11789. }
  11790. }
  11791. UIAddProp.uiName = "UIAddProp";
  11792. class MoneyNode {
  11793. constructor(ui) {
  11794. this.leftTime = 0;
  11795. this.ui = ui;
  11796. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11797. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11798. this.ui.addPowerBtn.onClick(this, this.addPower);
  11799. this.ui.c1.selectedIndex = 1;
  11800. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11801. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11802. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11803. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11804. this.coinChange();
  11805. this.diamondChange();
  11806. this.powerChange();
  11807. }
  11808. addPower() {
  11809. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11810. xGame.uiMgr.Show(UIPower);
  11811. }
  11812. powerChange() {
  11813. let powerNum = DataMgr.getPower();
  11814. this.ui.powerTxt.text = powerNum + "";
  11815. }
  11816. checkPowerTime() {
  11817. let cur = new Date().getTime();
  11818. let last = DataMgr.getPowerTime();
  11819. if (last == 0) {
  11820. last = cur;
  11821. DataMgr.setPowerTime(cur);
  11822. }
  11823. let power = DataMgr.getPower();
  11824. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11825. Laya.timer.clearAll(this);
  11826. if (power >= xGame.common.natureMaxPower) {
  11827. this.ui.powerTimeTxt.text = "";
  11828. DataMgr.setPowerTime(cur);
  11829. return;
  11830. }
  11831. if (power + offset >= xGame.common.natureMaxPower) {
  11832. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11833. this.ui.powerTimeTxt.text = "";
  11834. DataMgr.setPowerTime(cur);
  11835. }
  11836. else {
  11837. if (offset > 0) {
  11838. DataMgr.setPower(offset);
  11839. DataMgr.setPowerTime(cur);
  11840. }
  11841. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11842. this.leftTime = xGame.common.powerRecoverNum - time;
  11843. if (this.leftTime <= 0)
  11844. this.leftTime = 0;
  11845. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11846. Laya.timer.loop(1000, this, this.updatePowerTime);
  11847. }
  11848. }
  11849. updatePowerTime() {
  11850. this.leftTime -= 1;
  11851. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11852. if (this.leftTime <= 0) {
  11853. this.checkPowerTime();
  11854. }
  11855. }
  11856. coinChange() {
  11857. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11858. }
  11859. diamondChange() {
  11860. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11861. }
  11862. addCoin() {
  11863. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11864. Moyu.sendDataEvent("AddCoinBtn");
  11865. xGame.uiMgr.Show(UIAddProp, 0);
  11866. }
  11867. addDiamond() {
  11868. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11869. Moyu.sendDataEvent("AddDiamondBtn");
  11870. xGame.uiMgr.Show(UIAddProp, 1);
  11871. }
  11872. }
  11873. class UIDraw extends UIBase {
  11874. constructor() {
  11875. super();
  11876. this.curKey = 0;
  11877. }
  11878. onConstructor() {
  11879. this.ui = ui_UIDraw.createInstance();
  11880. this.contentPane = this.ui;
  11881. this.isEject = false;
  11882. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11883. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11884. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11885. this.initDraw();
  11886. this.initUI();
  11887. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11888. if (Moyu.isKs)
  11889. this.ui.closeNode.closeBtn.x += 100;
  11890. }
  11891. show() {
  11892. super.show();
  11893. this.ui.t0.play();
  11894. this.playSecretaryIdle();
  11895. this.updateDraw();
  11896. this.checkFree();
  11897. if (PlatMgr.bannerDelay > 0) {
  11898. this.ui.closeNode.closeBtn.visible = false;
  11899. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11900. this.ui.closeNode.closeBtn.visible = true;
  11901. });
  11902. }
  11903. PlatMgr.showRateBanner();
  11904. }
  11905. hide() {
  11906. Laya.timer.clearAll(this);
  11907. super.hide();
  11908. }
  11909. checkFree() {
  11910. let isFree = DataMgr.getDailyfreeDrawTimes();
  11911. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11912. }
  11913. initDraw() {
  11914. this.drawObj = [];
  11915. let data = cfgTable.drawData;
  11916. let temp;
  11917. let weight = 0;
  11918. for (const key in data) {
  11919. temp = data[key];
  11920. weight += temp.weight;
  11921. this.drawObj.push(weight);
  11922. }
  11923. this.allWeight = weight;
  11924. }
  11925. initUI() {
  11926. let data = cfgTable.drawData;
  11927. let temp;
  11928. let img;
  11929. let txt;
  11930. for (const key in data) {
  11931. temp = data[key];
  11932. img = this.ui.myNode.rotNode["img" + key];
  11933. txt = this.ui.myNode.rotNode["txt" + key];
  11934. img.url = xGame.common.getGameIconUrl(temp.icon);
  11935. txt.visible = true;
  11936. if (temp.award > 2) {
  11937. img.rotation = 0;
  11938. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11939. }
  11940. else {
  11941. img.rotation = temp.rotation;
  11942. txt.text = temp.num;
  11943. }
  11944. }
  11945. }
  11946. getCurkey() {
  11947. let rand = Math.random() * this.allWeight;
  11948. let temp;
  11949. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11950. temp = this.drawObj[index];
  11951. if (index == 0) {
  11952. if (rand < temp) {
  11953. return index + 1;
  11954. }
  11955. }
  11956. else {
  11957. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11958. return index + 1;
  11959. }
  11960. }
  11961. }
  11962. return 2;
  11963. }
  11964. startDraw() {
  11965. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11966. if (freeTimes > 0) {
  11967. this.beginDraw();
  11968. DataMgr.setDailyfreeDrawTimes(0);
  11969. this.checkFree();
  11970. }
  11971. else {
  11972. if (Laya.Browser.onAndroid) {
  11973. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11974. if (!boo) {
  11975. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11976. return;
  11977. }
  11978. }
  11979. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11980. }
  11981. else {
  11982. console.log('zh:AD 失败,直接发放奖励');
  11983. this.qjff_chouJiang();
  11984. }
  11985. }
  11986. }
  11987. qjff_chouJiang() {
  11988. this.beginDraw();
  11989. }
  11990. beginDraw() {
  11991. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11992. this.ui.drawBtn.touchable = false;
  11993. this.curKey = this.getCurkey();
  11994. console.log("当前key", this.curKey);
  11995. let cell = 60;
  11996. let lap = 3;
  11997. let angle = cell * (this.curKey - 1) + lap * 360;
  11998. let target = this.ui.myNode.rotNode;
  11999. target.rotation = 0;
  12000. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12001. console.log("旋转完成");
  12002. this.ui.drawBtn.touchable = true;
  12003. this.getAward();
  12004. }));
  12005. }
  12006. getAward() {
  12007. let data = cfgTable.drawData[this.curKey];
  12008. let temp = new AwardType();
  12009. temp.type = data.award;
  12010. temp.num = data.num;
  12011. xGame.common.getAward([temp], () => {
  12012. DataMgr.setDrawTimes(1);
  12013. this.updateDraw();
  12014. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12015. });
  12016. }
  12017. updateDraw() {
  12018. let drawTimes = DataMgr.getDrawTimes();
  12019. let awardTimes = DataMgr.getDrawAwardTimes();
  12020. if (Math.floor(drawTimes / 3) > awardTimes) {
  12021. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12022. this.ui.extraNode.boxBtn.touchable = true;
  12023. this.ui.extraNode.tipsTxt.text = "3/3";
  12024. this.ui.extraNode.barNode.width = 265;
  12025. this.getExtraAward();
  12026. }
  12027. else {
  12028. this.ui.extraNode.boxBtn.t0.stop();
  12029. this.ui.extraNode.boxBtn.touchable = false;
  12030. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12031. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12032. }
  12033. let data = cfgTable.drawData[1];
  12034. if (awardTimes == 0) {
  12035. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12036. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12037. this.ui.myNode.rotNode.img1.rotation = 0;
  12038. }
  12039. else {
  12040. let award = data.nextid;
  12041. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12042. this.ui.myNode.rotNode.txt1.text = award[1];
  12043. this.ui.myNode.rotNode.img1.rotation = 0;
  12044. }
  12045. }
  12046. getExtraAward() {
  12047. let drawTimes = DataMgr.getDrawTimes();
  12048. let awardTimes = DataMgr.getDrawAwardTimes();
  12049. let data = cfgTable.drawData[1];
  12050. let award = new AwardType();
  12051. if (awardTimes == 0) {
  12052. award.num = data.num;
  12053. award.type = data.award;
  12054. xGame.common.getAward([award], () => {
  12055. let all = Math.floor(drawTimes / 3);
  12056. DataMgr.setDrawAwardTimes(all);
  12057. this.updateDraw();
  12058. });
  12059. }
  12060. else {
  12061. award.num = parseInt(data.nextid[1]);
  12062. award.type = parseInt(data.nextid[0]);
  12063. xGame.common.getAward([award], () => {
  12064. let all = Math.floor(drawTimes / 3);
  12065. DataMgr.setDrawAwardTimes(all);
  12066. this.updateDraw();
  12067. });
  12068. }
  12069. }
  12070. closeSelf() {
  12071. this.hide();
  12072. }
  12073. playSecretaryIdle() {
  12074. let parent = this.ui.secretary.displayObject;
  12075. parent.destroyChildren();
  12076. let xx = this.ui.secretary.width / 2;
  12077. let yy = this.ui.secretary.height;
  12078. let scale = xGame.common.getSecretaryScale();
  12079. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12080. xGame.common.secretary.play(data, 0, true, parent);
  12081. }
  12082. }
  12083. UIDraw.uiName = "UIDraw";
  12084. class ui_UIFlyEft extends fgui.GComponent {
  12085. static createInstance() {
  12086. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12087. }
  12088. onConstruct() {
  12089. this.n0 = (this.getChild("n0"));
  12090. this.n1 = (this.getChild("n1"));
  12091. this.n2 = (this.getChild("n2"));
  12092. this.n3 = (this.getChild("n3"));
  12093. this.n4 = (this.getChild("n4"));
  12094. this.n5 = (this.getChild("n5"));
  12095. this.n6 = (this.getChild("n6"));
  12096. this.n7 = (this.getChild("n7"));
  12097. this.iconNode = (this.getChild("iconNode"));
  12098. this.txt = (this.getChild("txt"));
  12099. this.txtNode = (this.getChild("txtNode"));
  12100. }
  12101. }
  12102. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12103. class UIFlyEft extends UIBase {
  12104. constructor() {
  12105. super();
  12106. this.max = 8;
  12107. this.delay = 0;
  12108. }
  12109. onConstructor() {
  12110. this.ui = ui_UIFlyEft.createInstance();
  12111. this.contentPane = this.ui;
  12112. this.isEject = false;
  12113. this.isMuti = true;
  12114. this.ui.x += xGame.common.sysOffestNum;
  12115. }
  12116. getArrPos() {
  12117. if (this.iconPos && this.iconPos.length > 0)
  12118. return;
  12119. this.iconPos = [];
  12120. let temp;
  12121. for (let index = 0; index < this.max; index++) {
  12122. temp = this.ui["n" + index];
  12123. this.iconPos.push([temp.x, temp.y]);
  12124. }
  12125. }
  12126. show(stPos, edPos, num, type, callback) {
  12127. super.show();
  12128. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12129. this.getArrPos();
  12130. this.updateUI(type);
  12131. this.updatePos();
  12132. this.runFly(edPos, callback);
  12133. this.runWorlds(stPos, num);
  12134. }
  12135. updateUI(type) {
  12136. let temp;
  12137. let str;
  12138. for (let index = 0; index < this.max; index++) {
  12139. temp = this.ui["n" + index];
  12140. str = this.getIconStr(type);
  12141. temp.url = xGame.common.getGameIconUrl(str);
  12142. }
  12143. }
  12144. getIconStr(type) {
  12145. switch (type) {
  12146. case Prop.diamond:
  12147. return "ty_zs";
  12148. case Prop.coin:
  12149. return "ty_jb";
  12150. default:
  12151. break;
  12152. }
  12153. }
  12154. updatePos() {
  12155. let temp;
  12156. for (let index = 0; index < this.max; index++) {
  12157. temp = this.ui["n" + index];
  12158. temp.x = this.iconPos[index][0];
  12159. temp.y = this.iconPos[index][1];
  12160. }
  12161. }
  12162. runFly(endPos, callback) {
  12163. let all = 0;
  12164. let temp;
  12165. for (let index = 0; index < this.max; index++) {
  12166. temp = this.ui["n" + index];
  12167. temp.visible = true;
  12168. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12169. temp.visible = false;
  12170. all++;
  12171. if (all >= this.max) {
  12172. callback && callback();
  12173. }
  12174. }), 20 * index);
  12175. }
  12176. }
  12177. runWorlds(stPos, num) {
  12178. let str = "+" + num;
  12179. this.ui.txt.text = str;
  12180. let starX = stPos.x;
  12181. let starY = stPos.y + 50;
  12182. this.ui.txt.x = starX;
  12183. this.ui.txt.y = starY;
  12184. this.ui.txt.visible = true;
  12185. this.ui.txt.alpha = 1;
  12186. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12187. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12188. this.ui.txt.visible = false;
  12189. this.hide();
  12190. }));
  12191. }));
  12192. }
  12193. }
  12194. UIFlyEft.uiName = "UIFlyEft";
  12195. class Common {
  12196. constructor() {
  12197. this.convertNum = 0.025;
  12198. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12199. this.scaleV3One = new Laya.Vector3();
  12200. this.scaleV3Two = new Laya.Vector3();
  12201. this.posV4 = new Laya.Vector4();
  12202. this.showDebug = false;
  12203. this.openGuide = true;
  12204. this.rodOffest = new Laya.Vector2(0, 0);
  12205. this.rodAngle = 0;
  12206. this.gameMode = GameMode.classic;
  12207. this.bigMoveLevelIndex = 1;
  12208. this.bigMoveNeedCoin = 1000;
  12209. this.classicNiceNeddCoin = 1000;
  12210. this.passAwardCoin = 2000;
  12211. this.classicRoomType = 1;
  12212. this.maxPower = 20;
  12213. this.natureMaxPower = 5;
  12214. this.videoPower = 2;
  12215. this.powerRecoverNum = 900;
  12216. this.curPlayerSkillType = 0;
  12217. this.isNewDay = false;
  12218. this.clickedBall = false;
  12219. this.placeBallCurLevel = 0;
  12220. this.placeBallStarNum = 0;
  12221. this.longHelpLine = false;
  12222. this.maxShareDiamondTimes = 3;
  12223. this.guideStep = 0;
  12224. this.temSelfLevel = 0;
  12225. this.extraMoveNum = 0;
  12226. this.curRankID = 0;
  12227. this.rankID = {
  12228. normalStar: 12000,
  12229. wxStar: 12001
  12230. };
  12231. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  12232. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12233. this.btnClickStr = "buttonclick";
  12234. this.maxSkillLevel = 10;
  12235. this.upSkillLevel = false;
  12236. this.gameStartTime = 0;
  12237. this._sysOffestNum = 0;
  12238. this.angleV2 = new Laya.Vector2();
  12239. this.rootV = new Laya.Vector2(0, 1);
  12240. this.tempDir1 = new Laya.Vector2();
  12241. this.tempDir2 = new Laya.Vector2();
  12242. this.ballSize = 33;
  12243. this.stPos = new Laya.Point();
  12244. this.edPos = new Laya.Point();
  12245. Common._instance = this;
  12246. window["common"] = this;
  12247. }
  12248. static getInstance() {
  12249. if (!this._instance) {
  12250. this._instance = new Common();
  12251. }
  12252. return this._instance;
  12253. }
  12254. get sysOffestNum() {
  12255. if (this._sysOffestNum == 0) {
  12256. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12257. }
  12258. return this._sysOffestNum;
  12259. }
  12260. testShader() {
  12261. let test = new LightShader();
  12262. test.texture = "res/d3Res/ballTexture/ball1.png";
  12263. Laya.stage.addChild(test);
  12264. }
  12265. playScale(node) {
  12266. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12267. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12268. }));
  12269. }));
  12270. }
  12271. setGroup(colli, ...group) {
  12272. let out = 0;
  12273. for (let index = 0; index < group.length; index++) {
  12274. if (index == 0) {
  12275. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12276. }
  12277. else {
  12278. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12279. }
  12280. }
  12281. colli.collisionGroup = out;
  12282. }
  12283. setCanGroupWith(colli, ...group) {
  12284. let out = 0;
  12285. for (let index = 0; index < group.length; index++) {
  12286. if (index == 0) {
  12287. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12288. }
  12289. else {
  12290. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12291. }
  12292. }
  12293. colli.canCollideWith = out;
  12294. }
  12295. loadPrefab(name, callback) {
  12296. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12297. let prefab = new Laya.Prefab();
  12298. prefab.json = obj;
  12299. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12300. callback && callback(img);
  12301. }));
  12302. }
  12303. pos2to3Convert(x, y, d3Pos) {
  12304. x = x + this.sysOffestNum;
  12305. d3Pos.setValue(x, y, 0);
  12306. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12307. if (success) {
  12308. }
  12309. else {
  12310. console.error("转换出错了。。。。。。。。");
  12311. }
  12312. }
  12313. scale2to3Convert(num) {
  12314. this.scaleV3One.setValue(0, 0, 0);
  12315. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12316. this.scaleV3Two.setValue(0, num, 0);
  12317. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12318. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12319. return outNum;
  12320. }
  12321. pos3to2Convert(d3Pos) {
  12322. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12323. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12324. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12325. d3Pos.x -= this.sysOffestNum;
  12326. }
  12327. scale3to2Convert(num) {
  12328. let scale = this.scale2to3Convert(1);
  12329. let d2Out = num / scale;
  12330. return d2Out;
  12331. }
  12332. getCollider(type, restitution = 0.9, density = 10) {
  12333. let colli;
  12334. if (type == "box")
  12335. colli = new Laya.BoxCollider();
  12336. else
  12337. colli = new Laya.CircleCollider();
  12338. colli.friction = 0;
  12339. colli.restitution = restitution;
  12340. colli.density = density;
  12341. return colli;
  12342. }
  12343. getRigbody() {
  12344. let rigy = new Laya.RigidBody();
  12345. rigy.bullet = true;
  12346. rigy.allowRotation = false;
  12347. rigy.allowSleep = false;
  12348. rigy.gravityScale = 0;
  12349. return rigy;
  12350. }
  12351. getfguiRotation(x, y) {
  12352. this.angleV2.setValue(x, y);
  12353. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12354. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12355. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12356. angle = -angle;
  12357. }
  12358. return 180 + angle;
  12359. }
  12360. getAngle(x, y) {
  12361. this.angleV2.setValue(x, y);
  12362. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12363. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12364. return angle;
  12365. }
  12366. randomNum(a, b) {
  12367. return a + Math.floor((b - a + 1) * Math.random());
  12368. }
  12369. getRandArrEle(arr) {
  12370. return arr[Math.floor(arr.length * Math.random())];
  12371. }
  12372. getSign(val) {
  12373. return val >= 0 ? 1 : -1;
  12374. }
  12375. botherArr(arr) {
  12376. let times = arr.length + 2;
  12377. let length = arr.length;
  12378. let a;
  12379. let b;
  12380. let temp;
  12381. for (let index = 0; index < times; index++) {
  12382. a = Math.floor(Math.random() * length);
  12383. b = Math.floor(Math.random() * length);
  12384. temp = arr[a];
  12385. arr[a] = arr[b];
  12386. arr[b] = temp;
  12387. }
  12388. }
  12389. getGameIconUrl(id) {
  12390. return "ui://game/" + id;
  12391. }
  12392. getComponentUrl(id) {
  12393. return "ui://game/" + id;
  12394. }
  12395. getAnimation() {
  12396. }
  12397. judgeSkillType(type = SkillType.highSpace) {
  12398. if (this.gameMode == GameMode.classic)
  12399. return;
  12400. let gameMgr = this.gameMgr;
  12401. if (gameMgr.selfTurn) {
  12402. if (gameMgr.selfCurSkill == type) {
  12403. return true;
  12404. }
  12405. }
  12406. else {
  12407. if (gameMgr.aiCurSkill == type) {
  12408. return true;
  12409. }
  12410. }
  12411. }
  12412. ballColliHole(collider) {
  12413. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12414. xGame.common.gameMgr.isFirstInGame = false;
  12415. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12416. }
  12417. collider.owner.mySrc.checkWrongBall();
  12418. }
  12419. getArrMaxEle(arr) {
  12420. let max = -Infinity;
  12421. for (let index = 0; index < arr.length; index++) {
  12422. max = Math.max(arr[index], max);
  12423. }
  12424. return max;
  12425. }
  12426. getArrMinEle(arr) {
  12427. let min = Infinity;
  12428. for (let index = 0; index < arr.length; index++) {
  12429. min = Math.min(arr[index], min);
  12430. }
  12431. return min;
  12432. }
  12433. playRandomMutiBallBigSkillSound() {
  12434. if (Math.random() <= 0.5)
  12435. return;
  12436. let rand = this.randomNum(1, 6);
  12437. let str = "ganfa0" + rand;
  12438. xGame.soundMgr.playSound(str);
  12439. }
  12440. showOneCamera(type) {
  12441. let object = xGame.common.d3World.cameraObj;
  12442. for (const key in object) {
  12443. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12444. object[key].init();
  12445. object[key].owner.active = key == type;
  12446. }
  12447. }
  12448. }
  12449. checkBallOverBorder(x, y) {
  12450. let radius = 17;
  12451. let condition = this._checkBorder(x + radius, y) ||
  12452. this._checkBorder(x - radius, y) ||
  12453. this._checkBorder(x, y + radius) ||
  12454. this._checkBorder(x, y - radius);
  12455. if (condition) {
  12456. return true;
  12457. }
  12458. }
  12459. _checkBorder(x, y) {
  12460. let borderRect = this.d2World.borderRect;
  12461. let xOffest = 20;
  12462. let yOffest = 20;
  12463. if (y <= borderRect.y - yOffest) {
  12464. return true;
  12465. }
  12466. if (y >= borderRect.y + borderRect.height + yOffest) {
  12467. return true;
  12468. }
  12469. if (x <= borderRect.x - xOffest) {
  12470. return true;
  12471. }
  12472. if (x >= borderRect.x + borderRect.width + xOffest) {
  12473. return true;
  12474. }
  12475. }
  12476. initWeight(cfg) {
  12477. let allCfgData = { data: {}, allWeightNum: 0 };
  12478. let weightCfg = allCfgData.data;
  12479. let weight = 0;
  12480. for (const key in cfg) {
  12481. weightCfg[key] = {};
  12482. weightCfg[key].id = cfg[key].id;
  12483. weightCfg[key].minWeight = weight;
  12484. weight += cfg[key].weight;
  12485. weightCfg[key].maxWeight = weight;
  12486. }
  12487. allCfgData.allWeightNum = weight;
  12488. return allCfgData;
  12489. }
  12490. getRandomWeightData(cfg) {
  12491. let weightCfg = cfg.data;
  12492. let allWeightNum = cfg.allWeightNum;
  12493. let rand = Math.floor(Math.random() * allWeightNum);
  12494. for (const key in weightCfg) {
  12495. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12496. return weightCfg[key];
  12497. }
  12498. }
  12499. return weightCfg[1];
  12500. }
  12501. showGirlTalkPop(wordsIndex, node, msgNode) {
  12502. node.visible = true;
  12503. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12504. node.t0.play(Laya.Handler.create(this, () => {
  12505. node.visible = false;
  12506. }));
  12507. }
  12508. stopGirlPop(node) {
  12509. node.t0.stop();
  12510. node.visible = false;
  12511. }
  12512. createHead(loader, url, size = 107) {
  12513. if (Laya.Browser.name == "Browser") {
  12514. loader.url = url;
  12515. return;
  12516. }
  12517. else {
  12518. console.log('zh:url=', url);
  12519. loader.url = url;
  12520. }
  12521. }
  12522. addTestCoin(num) {
  12523. DataMgr.setCoin(num);
  12524. }
  12525. addTestDiamond(num) {
  12526. DataMgr.setDiamond(num);
  12527. }
  12528. addTestSkill() {
  12529. DataMgr.setBigSkill(0, 99);
  12530. DataMgr.setBigSkill(1, 99);
  12531. DataMgr.setBigSkill(2, 99);
  12532. }
  12533. playClassicEmotion(number, x, y) {
  12534. if (this.gameMode == GameMode.bigMove)
  12535. return;
  12536. let randIndex = this.randomNum(0, 2);
  12537. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12538. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12539. if (this.gameMgr.selfTurn) {
  12540. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12541. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12542. }
  12543. else {
  12544. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12545. }
  12546. else {
  12547. if (number == this.gameMgr.blackNum) {
  12548. if (this.gameMgr.selfBallArr.length == 0) {
  12549. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12550. }
  12551. else {
  12552. }
  12553. }
  12554. else {
  12555. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12556. }
  12557. }
  12558. }
  12559. }
  12560. else {
  12561. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12562. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12563. }
  12564. else {
  12565. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12566. }
  12567. else {
  12568. if (number == this.gameMgr.blackNum) {
  12569. if (this.gameMgr.aiBallArr.length == 0) {
  12570. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12571. }
  12572. else {
  12573. }
  12574. }
  12575. else {
  12576. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12577. }
  12578. }
  12579. }
  12580. }
  12581. }
  12582. playHappySound(number) {
  12583. if (this.gameMode != GameMode.classic)
  12584. return;
  12585. if (number == 8)
  12586. return;
  12587. let play = false;
  12588. if (this.gameMgr.selfTurn) {
  12589. if (this.gameMgr.ensureBallType) {
  12590. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12591. play = true;
  12592. }
  12593. }
  12594. else {
  12595. play = true;
  12596. }
  12597. }
  12598. else {
  12599. if (this.gameMgr.ensureBallType) {
  12600. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12601. play = true;
  12602. }
  12603. }
  12604. else {
  12605. play = true;
  12606. }
  12607. }
  12608. if (play)
  12609. xGame.soundMgr.playSound("applause");
  12610. }
  12611. destroyClassicEmotion() {
  12612. if (this.gameMode == GameMode.bigMove)
  12613. return;
  12614. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12615. parent.destroyChildren();
  12616. }
  12617. playAwardSpine(x, y) {
  12618. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12619. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12620. this.awardSpine.play(data, 0, false, parent);
  12621. }
  12622. destroyAwardSpine() {
  12623. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12624. parent.destroyChildren();
  12625. }
  12626. isBlock(bx, by, hx, hy, except = null) {
  12627. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12628. let balls = xGame.common.d2World.ballArr;
  12629. let outArr = [];
  12630. for (let index = 0; index < balls.length; index++) {
  12631. let obj = balls[index];
  12632. if (obj.number == 0)
  12633. continue;
  12634. if (obj == except)
  12635. continue;
  12636. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12637. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12638. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12639. if (num >= 1)
  12640. num = 1;
  12641. if (num < 0)
  12642. continue;
  12643. let gap = Math.sin(Math.acos(num)) * dis;
  12644. if (gap < this.ballSize) {
  12645. outArr.push({
  12646. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12647. disHon: Math.cos(Math.acos(num)) * dis,
  12648. disVer: Math.sin(Math.acos(num)) * dis,
  12649. src: balls[index],
  12650. dir: this.tempDir1
  12651. });
  12652. }
  12653. }
  12654. if (outArr.length > 0) {
  12655. outArr.sort((a, b) => { return a.dis - b.dis; });
  12656. return outArr[0];
  12657. }
  12658. }
  12659. AngleBetween(vector1, vector2) {
  12660. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12661. return rad * (180 / Math.PI);
  12662. }
  12663. getSecretaryScale() {
  12664. if (this.secretary.spineName == "mishu") {
  12665. return 1.28;
  12666. }
  12667. else {
  12668. return 1.024;
  12669. }
  12670. }
  12671. signAwardContainsRod(arr) {
  12672. let temp;
  12673. for (let index = 0; index < arr.length; index++) {
  12674. temp = arr[index].split('-')[0];
  12675. if (parseInt(temp) > 2) {
  12676. return true;
  12677. }
  12678. }
  12679. }
  12680. judgeSameDay() {
  12681. let lastTime = DataMgr.getSignTime();
  12682. let curTime = new Date().getTime();
  12683. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12684. return true;
  12685. }
  12686. return false;
  12687. }
  12688. getAward(arr, callback) {
  12689. let showTriple = arr[0].type <= 2;
  12690. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12691. let temp;
  12692. for (let index = 0; index < arr.length; index++) {
  12693. temp = arr[index];
  12694. switch (temp.type) {
  12695. case 1:
  12696. this.playObjFlyAnim(temp.num, temp.type);
  12697. break;
  12698. case 2:
  12699. this.playObjFlyAnim(temp.num, temp.type);
  12700. break;
  12701. case 3:
  12702. case 4:
  12703. case 5:
  12704. case 6:
  12705. DataMgr.setBallRod(temp.type - 2, 1);
  12706. DataMgr.setCurBallRod(temp.type - 2);
  12707. break;
  12708. default:
  12709. break;
  12710. }
  12711. }
  12712. callback && callback(watchVideo);
  12713. });
  12714. }
  12715. getMoneyNode() {
  12716. let moneyNode;
  12717. let sign = xGame.uiMgr.getUI(UISign);
  12718. let draw = xGame.uiMgr.getUI(UIDraw);
  12719. let end = xGame.uiMgr.getUI(UIGameEnd);
  12720. let skill = xGame.uiMgr.getUI(UISkill);
  12721. if (sign && !sign.isHide)
  12722. moneyNode = sign.ui.moneyNode;
  12723. if (draw && !draw.isHide)
  12724. moneyNode = draw.ui.moneyNode;
  12725. if (end && !end.isHide)
  12726. moneyNode = end.ui.moneyNode;
  12727. if (skill && !skill.isHide)
  12728. moneyNode = skill.ui.moneyNode;
  12729. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12730. let main = xGame.uiMgr.getUI(UIMain);
  12731. if (condition1 && main && !main.isHide) {
  12732. moneyNode = main.ui.moneyNode;
  12733. }
  12734. return moneyNode;
  12735. }
  12736. playObjFlyAnim(num, type, callback = null) {
  12737. this.stPos.x = Laya.stage.width / 2;
  12738. this.stPos.y = Laya.stage.height / 2;
  12739. let moneyNode = this.getMoneyNode();
  12740. switch (type) {
  12741. case Prop.diamond:
  12742. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12743. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12744. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12745. this.edPos.x /= 2;
  12746. this.edPos.y /= 2;
  12747. break;
  12748. case Prop.coin:
  12749. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12750. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12751. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12752. this.edPos.x /= 2;
  12753. this.edPos.y /= 2;
  12754. break;
  12755. default:
  12756. break;
  12757. }
  12758. xGame.soundMgr.playSound("coinbag");
  12759. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12760. switch (type) {
  12761. case Prop.diamond:
  12762. DataMgr.setDiamond(num);
  12763. break;
  12764. case Prop.coin:
  12765. DataMgr.setCoin(num);
  12766. break;
  12767. default:
  12768. break;
  12769. }
  12770. callback && callback();
  12771. });
  12772. }
  12773. autoPopUIView() {
  12774. let arr = [];
  12775. let sign = this.judgeSameDay() ? false : true;
  12776. if (sign)
  12777. arr.push("sign");
  12778. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12779. if (draw)
  12780. arr.push("draw");
  12781. if (arr.length <= 0)
  12782. return;
  12783. let str = this.getRandArrEle(arr);
  12784. switch (str) {
  12785. case "sign":
  12786. xGame.uiMgr.Show(UISign);
  12787. break;
  12788. case "draw":
  12789. xGame.uiMgr.Show(UIDraw);
  12790. break;
  12791. default:
  12792. break;
  12793. }
  12794. }
  12795. getMSTime(time) {
  12796. let min = Math.floor(time / 60);
  12797. let sec = Math.floor((time - min * 60));
  12798. if (sec < 10)
  12799. sec = "0" + sec;
  12800. if (min < 10)
  12801. min = "0" + min;
  12802. return `${min}:${sec}`;
  12803. }
  12804. testPower() {
  12805. DataMgr.setPower(0, false);
  12806. }
  12807. getAllStarNum() {
  12808. let data = DataMgr.getPlaceBallLevelList();
  12809. let out = 0;
  12810. for (let index = 0; index < data.length; index++) {
  12811. out += data[index].star;
  12812. }
  12813. return out;
  12814. }
  12815. recoverCameraView() {
  12816. Laya.timer.once(900, this, () => {
  12817. xGame.common.showOneCamera("mainCamera");
  12818. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12819. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12820. xGame.common.gameUI.ui.border.alpha = 0;
  12821. if (Laya.physicsTimer.scale < 1) {
  12822. Laya.physicsTimer.scale = 1;
  12823. }
  12824. }
  12825. });
  12826. }
  12827. getClassicLevel() {
  12828. let successTimes = DataMgr.getClassicTimes();
  12829. let needKey = "";
  12830. let lastKey = "";
  12831. let cfg = cfgTable.classictimesData;
  12832. let data;
  12833. for (const key in cfg) {
  12834. data = cfg[key];
  12835. if (successTimes <= data.times) {
  12836. needKey = key;
  12837. }
  12838. lastKey = key;
  12839. }
  12840. if (needKey == "")
  12841. needKey = lastKey;
  12842. return cfg[needKey];
  12843. }
  12844. }
  12845. Common._instance = null;
  12846. class ui_Component92 extends fgui.GComponent {
  12847. static createInstance() {
  12848. return (fgui.UIPackage.createObject("game", "Component92"));
  12849. }
  12850. onConstruct() {
  12851. this.n0 = (this.getChild("n0"));
  12852. }
  12853. }
  12854. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12855. class ui_Component129 extends fgui.GProgressBar {
  12856. static createInstance() {
  12857. return (fgui.UIPackage.createObject("game", "Component129"));
  12858. }
  12859. onConstruct() {
  12860. this.bar_v = (this.getChild("bar_v"));
  12861. this.n84 = (this.getChild("n84"));
  12862. }
  12863. }
  12864. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12865. class ui_Component130 extends fgui.GComponent {
  12866. static createInstance() {
  12867. return (fgui.UIPackage.createObject("game", "Component130"));
  12868. }
  12869. onConstruct() {
  12870. this.ani = (this.getChild("ani"));
  12871. this.t0 = this.getTransition("t0");
  12872. }
  12873. }
  12874. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12875. class ui_powerEft extends fgui.GComponent {
  12876. static createInstance() {
  12877. return (fgui.UIPackage.createObject("game", "powerEft"));
  12878. }
  12879. onConstruct() {
  12880. this.ani = (this.getChild("ani"));
  12881. this.n88 = (this.getChild("n88"));
  12882. this.n89 = (this.getChild("n89"));
  12883. }
  12884. }
  12885. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12886. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12887. static createInstance() {
  12888. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12889. }
  12890. onConstruct() {
  12891. this.c1 = this.getController("c1");
  12892. this.n2 = (this.getChild("n2"));
  12893. this.n22 = (this.getChild("n22"));
  12894. this.n23 = (this.getChild("n23"));
  12895. this.n15 = (this.getChild("n15"));
  12896. this.challenge = (this.getChild("challenge"));
  12897. this.n17 = (this.getChild("n17"));
  12898. this.n3 = (this.getChild("n3"));
  12899. this.starNode = (this.getChild("starNode"));
  12900. this.levelTxt = (this.getChild("levelTxt"));
  12901. this.n14 = (this.getChild("n14"));
  12902. this.n19 = (this.getChild("n19"));
  12903. this.n20 = (this.getChild("n20"));
  12904. this.n21 = (this.getChild("n21"));
  12905. this.special = (this.getChild("special"));
  12906. }
  12907. }
  12908. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12909. class ui_Component79 extends fgui.GComponent {
  12910. static createInstance() {
  12911. return (fgui.UIPackage.createObject("game", "Component79"));
  12912. }
  12913. onConstruct() {
  12914. this.c1 = this.getController("c1");
  12915. this.n7 = (this.getChild("n7"));
  12916. this.n8 = (this.getChild("n8"));
  12917. this.n9 = (this.getChild("n9"));
  12918. this.n10 = (this.getChild("n10"));
  12919. this.n11 = (this.getChild("n11"));
  12920. this.n12 = (this.getChild("n12"));
  12921. }
  12922. }
  12923. ui_Component79.URL = "ui://isxx5ak7avag477";
  12924. class ui_Component80 extends fgui.GComponent {
  12925. static createInstance() {
  12926. return (fgui.UIPackage.createObject("game", "Component80"));
  12927. }
  12928. onConstruct() {
  12929. this.n0 = (this.getChild("n0"));
  12930. this.n1 = (this.getChild("n1"));
  12931. this.myList = (this.getChild("myList"));
  12932. this.t0 = this.getTransition("t0");
  12933. }
  12934. }
  12935. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12936. class ui_SignNormal extends fgui.GComponent {
  12937. static createInstance() {
  12938. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12939. }
  12940. onConstruct() {
  12941. this.c1 = this.getController("c1");
  12942. this.n7 = (this.getChild("n7"));
  12943. this.n15 = (this.getChild("n15"));
  12944. this.titleTxt = (this.getChild("titleTxt"));
  12945. this.n8 = (this.getChild("n8"));
  12946. this.myIcon = (this.getChild("myIcon"));
  12947. this.numTxt = (this.getChild("numTxt"));
  12948. this.n12 = (this.getChild("n12"));
  12949. this.n13 = (this.getChild("n13"));
  12950. this.n17 = (this.getChild("n17"));
  12951. this.n14 = (this.getChild("n14"));
  12952. }
  12953. }
  12954. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12955. class ui_Button_reg extends fgui.GButton {
  12956. static createInstance() {
  12957. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12958. }
  12959. onConstruct() {
  12960. this.button = this.getController("button");
  12961. this.n6 = (this.getChild("n6"));
  12962. this.n4 = (this.getChild("n4"));
  12963. }
  12964. }
  12965. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12966. class ui_screenNode extends fgui.GComponent {
  12967. static createInstance() {
  12968. return (fgui.UIPackage.createObject("game", "screenNode"));
  12969. }
  12970. onConstruct() {
  12971. this.n9 = (this.getChild("n9"));
  12972. this.screenImg = (this.getChild("screenImg"));
  12973. }
  12974. }
  12975. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12976. class ui_GetAwrad_com1 extends fgui.GComponent {
  12977. static createInstance() {
  12978. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12979. }
  12980. onConstruct() {
  12981. this.n38 = (this.getChild("n38"));
  12982. this.n39 = (this.getChild("n39"));
  12983. this.n40 = (this.getChild("n40"));
  12984. this.t0 = this.getTransition("t0");
  12985. this.t1 = this.getTransition("t1");
  12986. }
  12987. }
  12988. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12989. class ui_GetAwrad_com2 extends fgui.GComponent {
  12990. static createInstance() {
  12991. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12992. }
  12993. onConstruct() {
  12994. this.n39 = (this.getChild("n39"));
  12995. this.n40 = (this.getChild("n40"));
  12996. this.t0 = this.getTransition("t0");
  12997. }
  12998. }
  12999. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13000. class ui_Component128 extends fgui.GComponent {
  13001. static createInstance() {
  13002. return (fgui.UIPackage.createObject("game", "Component128"));
  13003. }
  13004. onConstruct() {
  13005. this.n38 = (this.getChild("n38"));
  13006. this.n40 = (this.getChild("n40"));
  13007. }
  13008. }
  13009. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13010. class ui_Component100_1 extends fgui.GComponent {
  13011. static createInstance() {
  13012. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13013. }
  13014. onConstruct() {
  13015. this.myNode = (this.getChild("myNode"));
  13016. this.t0 = this.getTransition("t0");
  13017. }
  13018. }
  13019. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13020. class ui_Component142 extends fgui.GComponent {
  13021. static createInstance() {
  13022. return (fgui.UIPackage.createObject("game", "Component142"));
  13023. }
  13024. onConstruct() {
  13025. this.n41 = (this.getChild("n41"));
  13026. this.n42 = (this.getChild("n42"));
  13027. }
  13028. }
  13029. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13030. class ui_main_guang extends fgui.GComponent {
  13031. static createInstance() {
  13032. return (fgui.UIPackage.createObject("game", "main_guang"));
  13033. }
  13034. onConstruct() {
  13035. this.n1 = (this.getChild("n1"));
  13036. this.n2 = (this.getChild("n2"));
  13037. this.n3 = (this.getChild("n3"));
  13038. this.n4 = (this.getChild("n4"));
  13039. this.n5 = (this.getChild("n5"));
  13040. this.n6 = (this.getChild("n6"));
  13041. this.n8 = (this.getChild("n8"));
  13042. this.t0 = this.getTransition("t0");
  13043. }
  13044. }
  13045. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13046. class ui_try_com1 extends fgui.GComponent {
  13047. static createInstance() {
  13048. return (fgui.UIPackage.createObject("game", "try_com1"));
  13049. }
  13050. onConstruct() {
  13051. this.c1 = this.getController("c1");
  13052. this.n0 = (this.getChild("n0"));
  13053. this.n2 = (this.getChild("n2"));
  13054. this.cancelBtn = (this.getChild("cancelBtn"));
  13055. this.videoBtn = (this.getChild("videoBtn"));
  13056. this.n9 = (this.getChild("n9"));
  13057. this.n24 = (this.getChild("n24"));
  13058. this.titleTxt = (this.getChild("titleTxt"));
  13059. this.n32 = (this.getChild("n32"));
  13060. this.n29 = (this.getChild("n29"));
  13061. this.n36 = (this.getChild("n36"));
  13062. this.txtTime = (this.getChild("txtTime"));
  13063. this.t0 = this.getTransition("t0");
  13064. }
  13065. }
  13066. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13067. class ui_try_com2 extends fgui.GComponent {
  13068. static createInstance() {
  13069. return (fgui.UIPackage.createObject("game", "try_com2"));
  13070. }
  13071. onConstruct() {
  13072. this.skillicon = (this.getChild("skillicon"));
  13073. this.n35 = (this.getChild("n35"));
  13074. this.n31 = (this.getChild("n31"));
  13075. this.n32 = (this.getChild("n32"));
  13076. this.n33 = (this.getChild("n33"));
  13077. this.n34 = (this.getChild("n34"));
  13078. }
  13079. }
  13080. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13081. class ui_try_com3 extends fgui.GComponent {
  13082. static createInstance() {
  13083. return (fgui.UIPackage.createObject("game", "try_com3"));
  13084. }
  13085. onConstruct() {
  13086. this.n33 = (this.getChild("n33"));
  13087. this.n34 = (this.getChild("n34"));
  13088. this.n35 = (this.getChild("n35"));
  13089. this.t0 = this.getTransition("t0");
  13090. }
  13091. }
  13092. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13093. class ui_huihe1 extends fgui.GComponent {
  13094. static createInstance() {
  13095. return (fgui.UIPackage.createObject("game", "huihe1"));
  13096. }
  13097. onConstruct() {
  13098. this.n0 = (this.getChild("n0"));
  13099. this.n1 = (this.getChild("n1"));
  13100. this.t0 = this.getTransition("t0");
  13101. }
  13102. }
  13103. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13104. class ui_huihe2 extends fgui.GComponent {
  13105. static createInstance() {
  13106. return (fgui.UIPackage.createObject("game", "huihe2"));
  13107. }
  13108. onConstruct() {
  13109. this.n0 = (this.getChild("n0"));
  13110. this.n1 = (this.getChild("n1"));
  13111. this.t0 = this.getTransition("t0");
  13112. }
  13113. }
  13114. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13115. class ui_Component143 extends fgui.GComponent {
  13116. static createInstance() {
  13117. return (fgui.UIPackage.createObject("game", "Component143"));
  13118. }
  13119. onConstruct() {
  13120. this.n3 = (this.getChild("n3"));
  13121. this.n4 = (this.getChild("n4"));
  13122. this.n5 = (this.getChild("n5"));
  13123. this.n6 = (this.getChild("n6"));
  13124. this.n7 = (this.getChild("n7"));
  13125. this.n8 = (this.getChild("n8"));
  13126. this.n9 = (this.getChild("n9"));
  13127. this.n10 = (this.getChild("n10"));
  13128. this.t0 = this.getTransition("t0");
  13129. }
  13130. }
  13131. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13132. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13133. static createInstance() {
  13134. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13135. }
  13136. onConstruct() {
  13137. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13138. }
  13139. }
  13140. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13141. class ui_dh_jingbi2 extends fgui.GComponent {
  13142. static createInstance() {
  13143. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13144. }
  13145. onConstruct() {
  13146. this.n0 = (this.getChild("n0"));
  13147. this.n1 = (this.getChild("n1"));
  13148. this.n2 = (this.getChild("n2"));
  13149. this.n3 = (this.getChild("n3"));
  13150. this.n4 = (this.getChild("n4"));
  13151. this.n5 = (this.getChild("n5"));
  13152. this.n6 = (this.getChild("n6"));
  13153. this.n8 = (this.getChild("n8"));
  13154. this.n10 = (this.getChild("n10"));
  13155. this.t0 = this.getTransition("t0");
  13156. }
  13157. }
  13158. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13159. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13160. static createInstance() {
  13161. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13162. }
  13163. onConstruct() {
  13164. this.n1 = (this.getChild("n1"));
  13165. this.n4 = (this.getChild("n4"));
  13166. this.t0 = this.getTransition("t0");
  13167. }
  13168. }
  13169. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13170. class ui_dh_jingbi3 extends fgui.GComponent {
  13171. static createInstance() {
  13172. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13173. }
  13174. onConstruct() {
  13175. this.n0 = (this.getChild("n0"));
  13176. this.n1 = (this.getChild("n1"));
  13177. this.n2 = (this.getChild("n2"));
  13178. this.n3 = (this.getChild("n3"));
  13179. this.n4 = (this.getChild("n4"));
  13180. this.n5 = (this.getChild("n5"));
  13181. this.n6 = (this.getChild("n6"));
  13182. this.n8 = (this.getChild("n8"));
  13183. this.n10 = (this.getChild("n10"));
  13184. this.t0 = this.getTransition("t0");
  13185. }
  13186. }
  13187. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13188. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13189. static createInstance() {
  13190. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13191. }
  13192. onConstruct() {
  13193. this.n3 = (this.getChild("n3"));
  13194. this.n1 = (this.getChild("n1"));
  13195. this.t0 = this.getTransition("t0");
  13196. }
  13197. }
  13198. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13199. class ui_hb_jinbi1 extends fgui.GButton {
  13200. static createInstance() {
  13201. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13202. }
  13203. onConstruct() {
  13204. this.n20 = (this.getChild("n20"));
  13205. this.n25 = (this.getChild("n25"));
  13206. this.coinTxt = (this.getChild("coinTxt"));
  13207. this.n28 = (this.getChild("n28"));
  13208. this.n32 = (this.getChild("n32"));
  13209. this.n38 = (this.getChild("n38"));
  13210. this.n45 = (this.getChild("n45"));
  13211. this.getTips = (this.getChild("getTips"));
  13212. this.n39 = (this.getChild("n39"));
  13213. this.diamondTxt = (this.getChild("diamondTxt"));
  13214. this.n41 = (this.getChild("n41"));
  13215. this.n42 = (this.getChild("n42"));
  13216. this.n46 = (this.getChild("n46"));
  13217. this.n47 = (this.getChild("n47"));
  13218. this.n48 = (this.getChild("n48"));
  13219. this.t0 = this.getTransition("t0");
  13220. }
  13221. }
  13222. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13223. class ui_hb_jinbi2 extends fgui.GButton {
  13224. static createInstance() {
  13225. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13226. }
  13227. onConstruct() {
  13228. this.n20 = (this.getChild("n20"));
  13229. this.n25 = (this.getChild("n25"));
  13230. this.coinTxt = (this.getChild("coinTxt"));
  13231. this.n28 = (this.getChild("n28"));
  13232. this.n32 = (this.getChild("n32"));
  13233. this.n38 = (this.getChild("n38"));
  13234. this.n39 = (this.getChild("n39"));
  13235. this.diamondTxt = (this.getChild("diamondTxt"));
  13236. this.n41 = (this.getChild("n41"));
  13237. this.n42 = (this.getChild("n42"));
  13238. this.n43 = (this.getChild("n43"));
  13239. this.n44 = (this.getChild("n44"));
  13240. this.n45 = (this.getChild("n45"));
  13241. this.t0 = this.getTransition("t0");
  13242. }
  13243. }
  13244. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13245. class ui_hb_jinbi3 extends fgui.GButton {
  13246. static createInstance() {
  13247. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13248. }
  13249. onConstruct() {
  13250. this.n20 = (this.getChild("n20"));
  13251. this.n25 = (this.getChild("n25"));
  13252. this.coinTxt = (this.getChild("coinTxt"));
  13253. this.n28 = (this.getChild("n28"));
  13254. this.n32 = (this.getChild("n32"));
  13255. this.n38 = (this.getChild("n38"));
  13256. this.n39 = (this.getChild("n39"));
  13257. this.diamondTxt = (this.getChild("diamondTxt"));
  13258. this.n41 = (this.getChild("n41"));
  13259. this.n42 = (this.getChild("n42"));
  13260. this.n43 = (this.getChild("n43"));
  13261. this.n44 = (this.getChild("n44"));
  13262. this.n45 = (this.getChild("n45"));
  13263. this.t0 = this.getTransition("t0");
  13264. }
  13265. }
  13266. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13267. class ui_Component104 extends fgui.GComponent {
  13268. static createInstance() {
  13269. return (fgui.UIPackage.createObject("game", "Component104"));
  13270. }
  13271. onConstruct() {
  13272. this.c1 = this.getController("c1");
  13273. this.n12 = (this.getChild("n12"));
  13274. this.coinBtn = (this.getChild("coinBtn"));
  13275. this.diamondBtn = (this.getChild("diamondBtn"));
  13276. this.node3 = (this.getChild("node3"));
  13277. this.node4 = (this.getChild("node4"));
  13278. this.node5 = (this.getChild("node5"));
  13279. this.node1 = (this.getChild("node1"));
  13280. this.node2 = (this.getChild("node2"));
  13281. this.node6 = (this.getChild("node6"));
  13282. this.t0 = this.getTransition("t0");
  13283. }
  13284. }
  13285. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13286. class ui_Component105 extends fgui.GButton {
  13287. static createInstance() {
  13288. return (fgui.UIPackage.createObject("game", "Component105"));
  13289. }
  13290. onConstruct() {
  13291. this.c1 = this.getController("c1");
  13292. this.n49 = (this.getChild("n49"));
  13293. this.n18 = (this.getChild("n18"));
  13294. this.n46 = (this.getChild("n46"));
  13295. this.n48 = (this.getChild("n48"));
  13296. }
  13297. }
  13298. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13299. class ui_Component106 extends fgui.GButton {
  13300. static createInstance() {
  13301. return (fgui.UIPackage.createObject("game", "Component106"));
  13302. }
  13303. onConstruct() {
  13304. this.c1 = this.getController("c1");
  13305. this.n49 = (this.getChild("n49"));
  13306. this.n18 = (this.getChild("n18"));
  13307. this.n46 = (this.getChild("n46"));
  13308. this.n48 = (this.getChild("n48"));
  13309. }
  13310. }
  13311. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13312. class ui_hb_zs1 extends fgui.GButton {
  13313. static createInstance() {
  13314. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13315. }
  13316. onConstruct() {
  13317. this.c1 = this.getController("c1");
  13318. this.n20 = (this.getChild("n20"));
  13319. this.n21 = (this.getChild("n21"));
  13320. this.n26 = (this.getChild("n26"));
  13321. this.n27 = (this.getChild("n27"));
  13322. this.shareTxt = (this.getChild("shareTxt"));
  13323. this.n32 = (this.getChild("n32"));
  13324. this.n38 = (this.getChild("n38"));
  13325. this.n39 = (this.getChild("n39"));
  13326. this.n44 = (this.getChild("n44"));
  13327. this.diamondTxt = (this.getChild("diamondTxt"));
  13328. this.n41 = (this.getChild("n41"));
  13329. this.n45 = (this.getChild("n45"));
  13330. this.n47 = (this.getChild("n47"));
  13331. this.n48 = (this.getChild("n48"));
  13332. this.randTxt = (this.getChild("randTxt"));
  13333. this.n50 = (this.getChild("n50"));
  13334. this.t0 = this.getTransition("t0");
  13335. }
  13336. }
  13337. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13338. class ui_dh_zs1 extends fgui.GComponent {
  13339. static createInstance() {
  13340. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13341. }
  13342. onConstruct() {
  13343. this.n10 = (this.getChild("n10"));
  13344. this.n9 = (this.getChild("n9"));
  13345. this.n1 = (this.getChild("n1"));
  13346. this.n2 = (this.getChild("n2"));
  13347. this.n3 = (this.getChild("n3"));
  13348. this.n4 = (this.getChild("n4"));
  13349. this.n5 = (this.getChild("n5"));
  13350. this.n6 = (this.getChild("n6"));
  13351. this.n8 = (this.getChild("n8"));
  13352. this.n11 = (this.getChild("n11"));
  13353. this.t0 = this.getTransition("t0");
  13354. }
  13355. }
  13356. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13357. class ui_dh_zs1_1 extends fgui.GComponent {
  13358. static createInstance() {
  13359. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13360. }
  13361. onConstruct() {
  13362. this.n3 = (this.getChild("n3"));
  13363. this.n1 = (this.getChild("n1"));
  13364. this.t0 = this.getTransition("t0");
  13365. }
  13366. }
  13367. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13368. class ui_hb_zs2 extends fgui.GButton {
  13369. static createInstance() {
  13370. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13371. }
  13372. onConstruct() {
  13373. this.n20 = (this.getChild("n20"));
  13374. this.n21 = (this.getChild("n21"));
  13375. this.n26 = (this.getChild("n26"));
  13376. this.n27 = (this.getChild("n27"));
  13377. this.n32 = (this.getChild("n32"));
  13378. this.n38 = (this.getChild("n38"));
  13379. this.n39 = (this.getChild("n39"));
  13380. this.n44 = (this.getChild("n44"));
  13381. this.diamondTxt = (this.getChild("diamondTxt"));
  13382. this.n41 = (this.getChild("n41"));
  13383. this.n45 = (this.getChild("n45"));
  13384. this.t0 = this.getTransition("t0");
  13385. }
  13386. }
  13387. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13388. class ui_hb_zs3 extends fgui.GButton {
  13389. static createInstance() {
  13390. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13391. }
  13392. onConstruct() {
  13393. this.n20 = (this.getChild("n20"));
  13394. this.n21 = (this.getChild("n21"));
  13395. this.n26 = (this.getChild("n26"));
  13396. this.n27 = (this.getChild("n27"));
  13397. this.n32 = (this.getChild("n32"));
  13398. this.n38 = (this.getChild("n38"));
  13399. this.n47 = (this.getChild("n47"));
  13400. this.t0 = this.getTransition("t0");
  13401. }
  13402. }
  13403. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13404. class ui_dh_zs2 extends fgui.GComponent {
  13405. static createInstance() {
  13406. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13407. }
  13408. onConstruct() {
  13409. this.n10 = (this.getChild("n10"));
  13410. this.n9 = (this.getChild("n9"));
  13411. this.n1 = (this.getChild("n1"));
  13412. this.n2 = (this.getChild("n2"));
  13413. this.n3 = (this.getChild("n3"));
  13414. this.n4 = (this.getChild("n4"));
  13415. this.n5 = (this.getChild("n5"));
  13416. this.n6 = (this.getChild("n6"));
  13417. this.n8 = (this.getChild("n8"));
  13418. this.n11 = (this.getChild("n11"));
  13419. this.t0 = this.getTransition("t0");
  13420. }
  13421. }
  13422. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13423. class ui_dh_zs2_1 extends fgui.GComponent {
  13424. static createInstance() {
  13425. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13426. }
  13427. onConstruct() {
  13428. this.n3 = (this.getChild("n3"));
  13429. this.n1 = (this.getChild("n1"));
  13430. this.t0 = this.getTransition("t0");
  13431. }
  13432. }
  13433. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13434. class ui_dh_zs3 extends fgui.GComponent {
  13435. static createInstance() {
  13436. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13437. }
  13438. onConstruct() {
  13439. this.n10 = (this.getChild("n10"));
  13440. this.n9 = (this.getChild("n9"));
  13441. this.n1 = (this.getChild("n1"));
  13442. this.n2 = (this.getChild("n2"));
  13443. this.n3 = (this.getChild("n3"));
  13444. this.n4 = (this.getChild("n4"));
  13445. this.n5 = (this.getChild("n5"));
  13446. this.n6 = (this.getChild("n6"));
  13447. this.n8 = (this.getChild("n8"));
  13448. this.n11 = (this.getChild("n11"));
  13449. this.t0 = this.getTransition("t0");
  13450. }
  13451. }
  13452. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13453. class ui_dh_zs3_1 extends fgui.GComponent {
  13454. static createInstance() {
  13455. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13456. }
  13457. onConstruct() {
  13458. this.n3 = (this.getChild("n3"));
  13459. this.n1 = (this.getChild("n1"));
  13460. this.t0 = this.getTransition("t0");
  13461. }
  13462. }
  13463. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13464. class ui_Component107 extends fgui.GComponent {
  13465. static createInstance() {
  13466. return (fgui.UIPackage.createObject("game", "Component107"));
  13467. }
  13468. onConstruct() {
  13469. this.n18 = (this.getChild("n18"));
  13470. this.n19 = (this.getChild("n19"));
  13471. this.n20 = (this.getChild("n20"));
  13472. this.n21 = (this.getChild("n21"));
  13473. this.n22 = (this.getChild("n22"));
  13474. this.levelTxt = (this.getChild("levelTxt"));
  13475. this.t0 = this.getTransition("t0");
  13476. }
  13477. }
  13478. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13479. class ui_box_com1 extends fgui.GComponent {
  13480. static createInstance() {
  13481. return (fgui.UIPackage.createObject("game", "box_com1"));
  13482. }
  13483. onConstruct() {
  13484. this.n14 = (this.getChild("n14"));
  13485. this.n6 = (this.getChild("n6"));
  13486. this.t0 = this.getTransition("t0");
  13487. }
  13488. }
  13489. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13490. class ui_box_com2 extends fgui.GProgressBar {
  13491. static createInstance() {
  13492. return (fgui.UIPackage.createObject("game", "box_com2"));
  13493. }
  13494. onConstruct() {
  13495. this.bg0 = (this.getChild("bg0"));
  13496. this.bg = (this.getChild("bg"));
  13497. this.bar = (this.getChild("bar"));
  13498. this.n7 = (this.getChild("n7"));
  13499. this.n8 = (this.getChild("n8"));
  13500. this.n10 = (this.getChild("n10"));
  13501. this.n11 = (this.getChild("n11"));
  13502. this.n12 = (this.getChild("n12"));
  13503. }
  13504. }
  13505. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13506. class ui_box_com4 extends fgui.GComponent {
  13507. static createInstance() {
  13508. return (fgui.UIPackage.createObject("game", "box_com4"));
  13509. }
  13510. onConstruct() {
  13511. this.n8 = (this.getChild("n8"));
  13512. this.t0 = this.getTransition("t0");
  13513. }
  13514. }
  13515. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13516. class ui_box_com3 extends fgui.GComponent {
  13517. static createInstance() {
  13518. return (fgui.UIPackage.createObject("game", "box_com3"));
  13519. }
  13520. onConstruct() {
  13521. this.n2 = (this.getChild("n2"));
  13522. this.n3 = (this.getChild("n3"));
  13523. this.n4 = (this.getChild("n4"));
  13524. this.n5 = (this.getChild("n5"));
  13525. this.t0 = this.getTransition("t0");
  13526. this.t1 = this.getTransition("t1");
  13527. }
  13528. }
  13529. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13530. class ui_Component97 extends fgui.GComponent {
  13531. static createInstance() {
  13532. return (fgui.UIPackage.createObject("game", "Component97"));
  13533. }
  13534. onConstruct() {
  13535. this.c1 = this.getController("c1");
  13536. this.n46 = (this.getChild("n46"));
  13537. this.diamondNode = (this.getChild("diamondNode"));
  13538. this.coinNode = (this.getChild("coinNode"));
  13539. this.t0 = this.getTransition("t0");
  13540. }
  13541. }
  13542. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13543. class ui_Component98 extends fgui.GButton {
  13544. static createInstance() {
  13545. return (fgui.UIPackage.createObject("game", "Component98"));
  13546. }
  13547. onConstruct() {
  13548. this.n8 = (this.getChild("n8"));
  13549. this.n40 = (this.getChild("n40"));
  13550. }
  13551. }
  13552. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13553. class ui_Component28_11 extends fgui.GButton {
  13554. static createInstance() {
  13555. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13556. }
  13557. onConstruct() {
  13558. this.c1 = this.getController("c1");
  13559. this.n12 = (this.getChild("n12"));
  13560. this.n17 = (this.getChild("n17"));
  13561. this.n13 = (this.getChild("n13"));
  13562. this.diamondTxt = (this.getChild("diamondTxt"));
  13563. this.n15 = (this.getChild("n15"));
  13564. this.n16 = (this.getChild("n16"));
  13565. }
  13566. }
  13567. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13568. class ui_Component58_11 extends fgui.GComponent {
  13569. static createInstance() {
  13570. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13571. }
  13572. onConstruct() {
  13573. this.c1 = this.getController("c1");
  13574. this.n23 = (this.getChild("n23"));
  13575. this.n41 = (this.getChild("n41"));
  13576. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13577. this.n_daoju = (this.getChild("n_daoju"));
  13578. this.myList = (this.getChild("myList"));
  13579. this.djList = (this.getChild("djList"));
  13580. this.t0 = this.getTransition("t0");
  13581. }
  13582. }
  13583. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13584. class ui_Component100 extends fgui.GComponent {
  13585. static createInstance() {
  13586. return (fgui.UIPackage.createObject("game", "Component100"));
  13587. }
  13588. onConstruct() {
  13589. this.c1 = this.getController("c1");
  13590. this.n75 = (this.getChild("n75"));
  13591. this.n76 = (this.getChild("n76"));
  13592. this.n80 = (this.getChild("n80"));
  13593. this.txt = (this.getChild("txt"));
  13594. this.spineRoot = (this.getChild("spineRoot"));
  13595. }
  13596. }
  13597. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13598. class ui_Component101 extends fgui.GComponent {
  13599. static createInstance() {
  13600. return (fgui.UIPackage.createObject("game", "Component101"));
  13601. }
  13602. onConstruct() {
  13603. this.c1 = this.getController("c1");
  13604. this.n36 = (this.getChild("n36"));
  13605. this.n35 = (this.getChild("n35"));
  13606. this.n33 = (this.getChild("n33"));
  13607. this.n34 = (this.getChild("n34"));
  13608. }
  13609. }
  13610. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13611. class ui_Component53 extends fgui.GComponent {
  13612. static createInstance() {
  13613. return (fgui.UIPackage.createObject("game", "Component53"));
  13614. }
  13615. onConstruct() {
  13616. this.n0 = (this.getChild("n0"));
  13617. this.n1 = (this.getChild("n1"));
  13618. this.n2 = (this.getChild("n2"));
  13619. this.n3 = (this.getChild("n3"));
  13620. this.n4 = (this.getChild("n4"));
  13621. this.n5 = (this.getChild("n5"));
  13622. this.n6 = (this.getChild("n6"));
  13623. this.n7 = (this.getChild("n7"));
  13624. this.n8 = (this.getChild("n8"));
  13625. this.n9 = (this.getChild("n9"));
  13626. this.n10 = (this.getChild("n10"));
  13627. this.n11 = (this.getChild("n11"));
  13628. this.n12 = (this.getChild("n12"));
  13629. this.n13 = (this.getChild("n13"));
  13630. this.n14 = (this.getChild("n14"));
  13631. this.n15 = (this.getChild("n15"));
  13632. this.n16 = (this.getChild("n16"));
  13633. this.n19 = (this.getChild("n19"));
  13634. this.n20 = (this.getChild("n20"));
  13635. this.n21 = (this.getChild("n21"));
  13636. this.n22 = (this.getChild("n22"));
  13637. this.n23 = (this.getChild("n23"));
  13638. this.n24 = (this.getChild("n24"));
  13639. this.n25 = (this.getChild("n25"));
  13640. this.n26 = (this.getChild("n26"));
  13641. this.n27 = (this.getChild("n27"));
  13642. this.n28 = (this.getChild("n28"));
  13643. this.n29 = (this.getChild("n29"));
  13644. this.n30 = (this.getChild("n30"));
  13645. this.n31 = (this.getChild("n31"));
  13646. this.n32 = (this.getChild("n32"));
  13647. this.n33 = (this.getChild("n33"));
  13648. this.n34 = (this.getChild("n34"));
  13649. this.n35 = (this.getChild("n35"));
  13650. this.t0 = this.getTransition("t0");
  13651. }
  13652. }
  13653. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13654. class ui_Component58 extends fgui.GComponent {
  13655. static createInstance() {
  13656. return (fgui.UIPackage.createObject("game", "Component58"));
  13657. }
  13658. onConstruct() {
  13659. this.n23 = (this.getChild("n23"));
  13660. this.n41 = (this.getChild("n41"));
  13661. this.n8 = (this.getChild("n8"));
  13662. this.skillList = (this.getChild("skillList"));
  13663. this.t0 = this.getTransition("t0");
  13664. }
  13665. }
  13666. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13667. class ui_Component59 extends fgui.GComponent {
  13668. static createInstance() {
  13669. return (fgui.UIPackage.createObject("game", "Component59"));
  13670. }
  13671. onConstruct() {
  13672. this.n3 = (this.getChild("n3"));
  13673. this.msgTxt = (this.getChild("msgTxt"));
  13674. this.t0 = this.getTransition("t0");
  13675. }
  13676. }
  13677. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13678. class ui_RulerNode extends fgui.GComponent {
  13679. static createInstance() {
  13680. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13681. }
  13682. onConstruct() {
  13683. this.n6 = (this.getChild("n6"));
  13684. this.n4 = (this.getChild("n4"));
  13685. this.img1 = (this.getChild("img1"));
  13686. this.img2 = (this.getChild("img2"));
  13687. }
  13688. }
  13689. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13690. class ui_Component108 extends fgui.GComponent {
  13691. static createInstance() {
  13692. return (fgui.UIPackage.createObject("game", "Component108"));
  13693. }
  13694. onConstruct() {
  13695. this.n19 = (this.getChild("n19"));
  13696. this.t0 = this.getTransition("t0");
  13697. }
  13698. }
  13699. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13700. class ui_Component63 extends fgui.GComponent {
  13701. static createInstance() {
  13702. return (fgui.UIPackage.createObject("game", "Component63"));
  13703. }
  13704. onConstruct() {
  13705. this.n66 = (this.getChild("n66"));
  13706. this.n56 = (this.getChild("n56"));
  13707. this.n63 = (this.getChild("n63"));
  13708. this.n65 = (this.getChild("n65"));
  13709. this.t0 = this.getTransition("t0");
  13710. }
  13711. }
  13712. ui_Component63.URL = "ui://isxx5ak7h657452";
  13713. class ui_topNode extends fgui.GComponent {
  13714. static createInstance() {
  13715. return (fgui.UIPackage.createObject("game", "topNode"));
  13716. }
  13717. onConstruct() {
  13718. this.selfProgress = (this.getChild("selfProgress"));
  13719. this.aiProgress = (this.getChild("aiProgress"));
  13720. this.selfKuang = (this.getChild("selfKuang"));
  13721. this.aiKuang = (this.getChild("aiKuang"));
  13722. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13723. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13724. this.n33 = (this.getChild("n33"));
  13725. this.n34 = (this.getChild("n34"));
  13726. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13727. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13728. this.selfBallList = (this.getChild("selfBallList"));
  13729. this.aiBallList = (this.getChild("aiBallList"));
  13730. this.middleNode = (this.getChild("middleNode"));
  13731. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13732. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13733. this.scoreNode = (this.getChild("scoreNode"));
  13734. this.selfTips = (this.getChild("selfTips"));
  13735. this.aiTips = (this.getChild("aiTips"));
  13736. }
  13737. }
  13738. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13739. class ui_selfProgress extends fgui.GProgressBar {
  13740. static createInstance() {
  13741. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13742. }
  13743. onConstruct() {
  13744. this.n3 = (this.getChild("n3"));
  13745. this.bar = (this.getChild("bar"));
  13746. }
  13747. }
  13748. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13749. class ui_aiProgress extends fgui.GProgressBar {
  13750. static createInstance() {
  13751. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13752. }
  13753. onConstruct() {
  13754. this.n3 = (this.getChild("n3"));
  13755. this.bar = (this.getChild("bar"));
  13756. }
  13757. }
  13758. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13759. class ui_ballDisplay extends fgui.GComponent {
  13760. static createInstance() {
  13761. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13762. }
  13763. onConstruct() {
  13764. this.myImg = (this.getChild("myImg"));
  13765. }
  13766. }
  13767. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13768. class ui_moveNode extends fgui.GComponent {
  13769. static createInstance() {
  13770. return (fgui.UIPackage.createObject("game", "moveNode"));
  13771. }
  13772. onConstruct() {
  13773. this.n8 = (this.getChild("n8"));
  13774. this.finger = (this.getChild("finger"));
  13775. }
  13776. }
  13777. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13778. class ui_cancelBtn extends fgui.GButton {
  13779. static createInstance() {
  13780. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13781. }
  13782. onConstruct() {
  13783. this.c1 = this.getController("c1");
  13784. this.n0 = (this.getChild("n0"));
  13785. this.n1 = (this.getChild("n1"));
  13786. }
  13787. }
  13788. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13789. class ui_shareBtn extends fgui.GButton {
  13790. static createInstance() {
  13791. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13792. }
  13793. onConstruct() {
  13794. this.c1 = this.getController("c1");
  13795. this.n2 = (this.getChild("n2"));
  13796. this.n1 = (this.getChild("n1"));
  13797. this.n3 = (this.getChild("n3"));
  13798. this.n4 = (this.getChild("n4"));
  13799. this.n5 = (this.getChild("n5"));
  13800. this.n6 = (this.getChild("n6"));
  13801. }
  13802. }
  13803. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13804. class ui_share2Btn extends fgui.GButton {
  13805. static createInstance() {
  13806. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13807. }
  13808. onConstruct() {
  13809. this.n3 = (this.getChild("n3"));
  13810. }
  13811. }
  13812. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13813. class ui_rodMethodNode extends fgui.GComponent {
  13814. static createInstance() {
  13815. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13816. }
  13817. onConstruct() {
  13818. this.bg = (this.getChild("bg"));
  13819. this.dot = (this.getChild("dot"));
  13820. }
  13821. }
  13822. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13823. class ui_sureBtn extends fgui.GButton {
  13824. static createInstance() {
  13825. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13826. }
  13827. onConstruct() {
  13828. this.n2 = (this.getChild("n2"));
  13829. this.n1 = (this.getChild("n1"));
  13830. }
  13831. }
  13832. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13833. class ui_Component18 extends fgui.GComponent {
  13834. static createInstance() {
  13835. return (fgui.UIPackage.createObject("game", "Component18"));
  13836. }
  13837. onConstruct() {
  13838. this.c1 = this.getController("c1");
  13839. this.nameTxt = (this.getChild("nameTxt"));
  13840. this.headImg = (this.getChild("headImg"));
  13841. this.n24 = (this.getChild("n24"));
  13842. this.skillImg = (this.getChild("skillImg"));
  13843. this.skillTxt = (this.getChild("skillTxt"));
  13844. }
  13845. }
  13846. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13847. class ui_Component45 extends fgui.GComponent {
  13848. static createInstance() {
  13849. return (fgui.UIPackage.createObject("game", "Component45"));
  13850. }
  13851. onConstruct() {
  13852. this.c1 = this.getController("c1");
  13853. this.n40 = (this.getChild("n40"));
  13854. this.n41 = (this.getChild("n41"));
  13855. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13856. this.n42 = (this.getChild("n42"));
  13857. this.awardTxt = (this.getChild("awardTxt"));
  13858. this.n44 = (this.getChild("n44"));
  13859. this.t0 = this.getTransition("t0");
  13860. }
  13861. }
  13862. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13863. class ui_emotionDisplay extends fgui.GButton {
  13864. static createInstance() {
  13865. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13866. }
  13867. onConstruct() {
  13868. this.myIcon = (this.getChild("myIcon"));
  13869. }
  13870. }
  13871. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13872. class ui_Component49 extends fgui.GButton {
  13873. static createInstance() {
  13874. return (fgui.UIPackage.createObject("game", "Component49"));
  13875. }
  13876. onConstruct() {
  13877. this.n69 = (this.getChild("n69"));
  13878. this.n56 = (this.getChild("n56"));
  13879. }
  13880. }
  13881. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13882. class ui_Component50 extends fgui.GButton {
  13883. static createInstance() {
  13884. return (fgui.UIPackage.createObject("game", "Component50"));
  13885. }
  13886. onConstruct() {
  13887. this.n54 = (this.getChild("n54"));
  13888. this.n65 = (this.getChild("n65"));
  13889. }
  13890. }
  13891. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13892. class ui_Component51 extends fgui.GButton {
  13893. static createInstance() {
  13894. return (fgui.UIPackage.createObject("game", "Component51"));
  13895. }
  13896. onConstruct() {
  13897. this.c1 = this.getController("c1");
  13898. this.n51 = (this.getChild("n51"));
  13899. this.n54 = (this.getChild("n54"));
  13900. }
  13901. }
  13902. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13903. class ui_Button5 extends fgui.GButton {
  13904. static createInstance() {
  13905. return (fgui.UIPackage.createObject("game", "Button5"));
  13906. }
  13907. onConstruct() {
  13908. this.c1 = this.getController("c1");
  13909. this.n0 = (this.getChild("n0"));
  13910. this.n2 = (this.getChild("n2"));
  13911. }
  13912. }
  13913. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13914. class ui_Component124 extends fgui.GComponent {
  13915. static createInstance() {
  13916. return (fgui.UIPackage.createObject("game", "Component124"));
  13917. }
  13918. onConstruct() {
  13919. this.n22 = (this.getChild("n22"));
  13920. this.shareNode = (this.getChild("shareNode"));
  13921. }
  13922. }
  13923. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13924. class ui_Component125 extends fgui.GComponent {
  13925. static createInstance() {
  13926. return (fgui.UIPackage.createObject("game", "Component125"));
  13927. }
  13928. onConstruct() {
  13929. this.n29 = (this.getChild("n29"));
  13930. this.coinTxt = (this.getChild("coinTxt"));
  13931. }
  13932. }
  13933. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13934. class ui_Component52 extends fgui.GButton {
  13935. static createInstance() {
  13936. return (fgui.UIPackage.createObject("game", "Component52"));
  13937. }
  13938. onConstruct() {
  13939. this.n35 = (this.getChild("n35"));
  13940. this.n36 = (this.getChild("n36"));
  13941. }
  13942. }
  13943. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13944. class ui_Component_fl_1 extends fgui.GComponent {
  13945. static createInstance() {
  13946. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  13947. }
  13948. onConstruct() {
  13949. this.n0 = (this.getChild("n0"));
  13950. this.n6 = (this.getChild("n6"));
  13951. this.n7 = (this.getChild("n7"));
  13952. this.n8 = (this.getChild("n8"));
  13953. this.n5 = (this.getChild("n5"));
  13954. this.n9 = (this.getChild("n9"));
  13955. this.n10 = (this.getChild("n10"));
  13956. this.txt_price = (this.getChild("txt_price"));
  13957. this.n_no = (this.getChild("n_no"));
  13958. this.n_buy = (this.getChild("n_buy"));
  13959. }
  13960. }
  13961. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  13962. class ui_Component_fl_2 extends fgui.GComponent {
  13963. static createInstance() {
  13964. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  13965. }
  13966. onConstruct() {
  13967. this.n0 = (this.getChild("n0"));
  13968. this.txt_price = (this.getChild("txt_price"));
  13969. this.n4 = (this.getChild("n4"));
  13970. this.n6 = (this.getChild("n6"));
  13971. this.n7 = (this.getChild("n7"));
  13972. this.n5 = (this.getChild("n5"));
  13973. this.n8 = (this.getChild("n8"));
  13974. this.n9 = (this.getChild("n9"));
  13975. this.n_no = (this.getChild("n_no"));
  13976. this.n_buy = (this.getChild("n_buy"));
  13977. }
  13978. }
  13979. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  13980. class ui_drawBtn extends fgui.GButton {
  13981. static createInstance() {
  13982. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13983. }
  13984. onConstruct() {
  13985. this.c1 = this.getController("c1");
  13986. this.n2 = (this.getChild("n2"));
  13987. this.n1 = (this.getChild("n1"));
  13988. this.n5 = (this.getChild("n5"));
  13989. }
  13990. }
  13991. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13992. class ui_Component43 extends fgui.GButton {
  13993. static createInstance() {
  13994. return (fgui.UIPackage.createObject("game", "Component43"));
  13995. }
  13996. onConstruct() {
  13997. this.n49 = (this.getChild("n49"));
  13998. }
  13999. }
  14000. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14001. class ui_wordsDisplay extends fgui.GComponent {
  14002. static createInstance() {
  14003. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14004. }
  14005. onConstruct() {
  14006. this.txt = (this.getChild("txt"));
  14007. this.n63 = (this.getChild("n63"));
  14008. }
  14009. }
  14010. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14011. class ui_Component_phb extends fgui.GComponent {
  14012. static createInstance() {
  14013. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14014. }
  14015. onConstruct() {
  14016. this.n3 = (this.getChild("n3"));
  14017. this.n4 = (this.getChild("n4"));
  14018. }
  14019. }
  14020. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14021. class ui_Component3 extends fgui.GComponent {
  14022. static createInstance() {
  14023. return (fgui.UIPackage.createObject("game", "Component3"));
  14024. }
  14025. onConstruct() {
  14026. this.n26 = (this.getChild("n26"));
  14027. this.n24 = (this.getChild("n24"));
  14028. this.nameTxt = (this.getChild("nameTxt"));
  14029. this.headRoot = (this.getChild("headRoot"));
  14030. }
  14031. }
  14032. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14033. class ui_Component4 extends fgui.GComponent {
  14034. static createInstance() {
  14035. return (fgui.UIPackage.createObject("game", "Component4"));
  14036. }
  14037. onConstruct() {
  14038. this.headImg = (this.getChild("headImg"));
  14039. }
  14040. }
  14041. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14042. class ui_Component7 extends fgui.GButton {
  14043. static createInstance() {
  14044. return (fgui.UIPackage.createObject("game", "Component7"));
  14045. }
  14046. onConstruct() {
  14047. this.n17 = (this.getChild("n17"));
  14048. }
  14049. }
  14050. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14051. class ui_Component8 extends fgui.GButton {
  14052. static createInstance() {
  14053. return (fgui.UIPackage.createObject("game", "Component8"));
  14054. }
  14055. onConstruct() {
  14056. this.n19 = (this.getChild("n19"));
  14057. }
  14058. }
  14059. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14060. class ui_Component10 extends fgui.GButton {
  14061. static createInstance() {
  14062. return (fgui.UIPackage.createObject("game", "Component10"));
  14063. }
  14064. onConstruct() {
  14065. this.c1 = this.getController("c1");
  14066. this.n40 = (this.getChild("n40"));
  14067. }
  14068. }
  14069. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14070. class ui_Component11 extends fgui.GButton {
  14071. static createInstance() {
  14072. return (fgui.UIPackage.createObject("game", "Component11"));
  14073. }
  14074. onConstruct() {
  14075. this.n34 = (this.getChild("n34"));
  14076. }
  14077. }
  14078. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14079. class ui_Component12 extends fgui.GButton {
  14080. static createInstance() {
  14081. return (fgui.UIPackage.createObject("game", "Component12"));
  14082. }
  14083. onConstruct() {
  14084. this.n35 = (this.getChild("n35"));
  14085. }
  14086. }
  14087. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14088. class ui_Component13 extends fgui.GButton {
  14089. static createInstance() {
  14090. return (fgui.UIPackage.createObject("game", "Component13"));
  14091. }
  14092. onConstruct() {
  14093. this.n27 = (this.getChild("n27"));
  14094. this.n36 = (this.getChild("n36"));
  14095. }
  14096. }
  14097. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14098. class ui_dh_js_tuowei extends fgui.GComponent {
  14099. static createInstance() {
  14100. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14101. }
  14102. onConstruct() {
  14103. this.n19 = (this.getChild("n19"));
  14104. this.n18 = (this.getChild("n18"));
  14105. this.n0 = (this.getChild("n0"));
  14106. this.n3 = (this.getChild("n3"));
  14107. this.n4 = (this.getChild("n4"));
  14108. this.n5 = (this.getChild("n5"));
  14109. this.n6 = (this.getChild("n6"));
  14110. this.n8 = (this.getChild("n8"));
  14111. this.n9 = (this.getChild("n9"));
  14112. this.n10 = (this.getChild("n10"));
  14113. this.n11 = (this.getChild("n11"));
  14114. this.n12 = (this.getChild("n12"));
  14115. this.n13 = (this.getChild("n13"));
  14116. this.n14 = (this.getChild("n14"));
  14117. this.n15 = (this.getChild("n15"));
  14118. this.n20 = (this.getChild("n20"));
  14119. this.t0 = this.getTransition("t0");
  14120. this.t1 = this.getTransition("t1");
  14121. }
  14122. }
  14123. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14124. class ui_dh_js_tw_g extends fgui.GComponent {
  14125. static createInstance() {
  14126. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14127. }
  14128. onConstruct() {
  14129. this.n0 = (this.getChild("n0"));
  14130. this.n1 = (this.getChild("n1"));
  14131. this.t0 = this.getTransition("t0");
  14132. }
  14133. }
  14134. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14135. class ui_dh_js_xingxing extends fgui.GComponent {
  14136. static createInstance() {
  14137. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14138. }
  14139. onConstruct() {
  14140. this.n1 = (this.getChild("n1"));
  14141. this.n2 = (this.getChild("n2"));
  14142. this.n3 = (this.getChild("n3"));
  14143. this.n4 = (this.getChild("n4"));
  14144. this.n0 = (this.getChild("n0"));
  14145. this.t2 = this.getTransition("t2");
  14146. this.t1 = this.getTransition("t1");
  14147. }
  14148. }
  14149. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14150. class ui_dh_zy_jiazai extends fgui.GComponent {
  14151. static createInstance() {
  14152. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14153. }
  14154. onConstruct() {
  14155. this.c1 = this.getController("c1");
  14156. this.n0 = (this.getChild("n0"));
  14157. this.n1 = (this.getChild("n1"));
  14158. this.n2 = (this.getChild("n2"));
  14159. this.n4 = (this.getChild("n4"));
  14160. this.n5 = (this.getChild("n5"));
  14161. this.n6 = (this.getChild("n6"));
  14162. this.n8 = (this.getChild("n8"));
  14163. this.n7 = (this.getChild("n7"));
  14164. this.t0 = this.getTransition("t0");
  14165. }
  14166. }
  14167. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14168. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14169. static createInstance() {
  14170. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14171. }
  14172. onConstruct() {
  14173. this.c1 = this.getController("c1");
  14174. this.n3 = (this.getChild("n3"));
  14175. this.n5 = (this.getChild("n5"));
  14176. this.n4 = (this.getChild("n4"));
  14177. this.n0 = (this.getChild("n0"));
  14178. this.n1 = (this.getChild("n1"));
  14179. this.n2 = (this.getChild("n2"));
  14180. }
  14181. }
  14182. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14183. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14184. static createInstance() {
  14185. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14186. }
  14187. onConstruct() {
  14188. this.n19 = (this.getChild("n19"));
  14189. this.n21 = (this.getChild("n21"));
  14190. this.n0 = (this.getChild("n0"));
  14191. this.n3 = (this.getChild("n3"));
  14192. this.n4 = (this.getChild("n4"));
  14193. this.n5 = (this.getChild("n5"));
  14194. this.n6 = (this.getChild("n6"));
  14195. this.n8 = (this.getChild("n8"));
  14196. this.n9 = (this.getChild("n9"));
  14197. this.n10 = (this.getChild("n10"));
  14198. this.n11 = (this.getChild("n11"));
  14199. this.n12 = (this.getChild("n12"));
  14200. this.n13 = (this.getChild("n13"));
  14201. this.n14 = (this.getChild("n14"));
  14202. this.n15 = (this.getChild("n15"));
  14203. this.n23 = (this.getChild("n23"));
  14204. this.t0 = this.getTransition("t0");
  14205. this.t1 = this.getTransition("t1");
  14206. }
  14207. }
  14208. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14209. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14210. static createInstance() {
  14211. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14212. }
  14213. onConstruct() {
  14214. this.n1 = (this.getChild("n1"));
  14215. this.n2 = (this.getChild("n2"));
  14216. this.t0 = this.getTransition("t0");
  14217. }
  14218. }
  14219. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14220. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14221. static createInstance() {
  14222. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14223. }
  14224. onConstruct() {
  14225. this.n4 = (this.getChild("n4"));
  14226. this.n2 = (this.getChild("n2"));
  14227. this.n3 = (this.getChild("n3"));
  14228. this.idle = this.getTransition("idle");
  14229. this.attack = this.getTransition("attack");
  14230. }
  14231. }
  14232. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14233. class ui_special extends fgui.GComponent {
  14234. static createInstance() {
  14235. return (fgui.UIPackage.createObject("game", "special"));
  14236. }
  14237. onConstruct() {
  14238. this.n18 = (this.getChild("n18"));
  14239. this.n19 = (this.getChild("n19"));
  14240. this.n20 = (this.getChild("n20"));
  14241. this.n21 = (this.getChild("n21"));
  14242. this.n22 = (this.getChild("n22"));
  14243. this.levelTxt = (this.getChild("levelTxt"));
  14244. this.n24 = (this.getChild("n24"));
  14245. this.n25 = (this.getChild("n25"));
  14246. this.t0 = this.getTransition("t0");
  14247. }
  14248. }
  14249. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14250. class ui_Component145 extends fgui.GComponent {
  14251. static createInstance() {
  14252. return (fgui.UIPackage.createObject("game", "Component145"));
  14253. }
  14254. onConstruct() {
  14255. this.guanyuNode = (this.getChild("guanyuNode"));
  14256. }
  14257. }
  14258. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14259. class ui_longBtn extends fgui.GButton {
  14260. static createInstance() {
  14261. return (fgui.UIPackage.createObject("game", "longBtn"));
  14262. }
  14263. onConstruct() {
  14264. this.c1 = this.getController("c1");
  14265. this.n2 = (this.getChild("n2"));
  14266. this.n1 = (this.getChild("n1"));
  14267. this.n4 = (this.getChild("n4"));
  14268. }
  14269. }
  14270. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14271. class ui_Component146 extends fgui.GComponent {
  14272. static createInstance() {
  14273. return (fgui.UIPackage.createObject("game", "Component146"));
  14274. }
  14275. onConstruct() {
  14276. this.n89 = (this.getChild("n89"));
  14277. this.n90 = (this.getChild("n90"));
  14278. this.guideBtn = (this.getChild("guideBtn"));
  14279. }
  14280. }
  14281. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14282. class ui_Component146_11 extends fgui.GComponent {
  14283. static createInstance() {
  14284. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14285. }
  14286. onConstruct() {
  14287. this.n89 = (this.getChild("n89"));
  14288. this.n90 = (this.getChild("n90"));
  14289. this.guideBtn = (this.getChild("guideBtn"));
  14290. }
  14291. }
  14292. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14293. class ui_Component111_1 extends fgui.GComponent {
  14294. static createInstance() {
  14295. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14296. }
  14297. onConstruct() {
  14298. this.n68 = (this.getChild("n68"));
  14299. this.myMask = (this.getChild("myMask"));
  14300. }
  14301. }
  14302. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14303. class ui_Component64_1 extends fgui.GComponent {
  14304. static createInstance() {
  14305. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14306. }
  14307. onConstruct() {
  14308. this.n57 = (this.getChild("n57"));
  14309. this.n54 = (this.getChild("n54"));
  14310. this.n55 = (this.getChild("n55"));
  14311. this.n56 = (this.getChild("n56"));
  14312. this.t1 = this.getTransition("t1");
  14313. }
  14314. }
  14315. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14316. class ui_ModeSelection_com123 extends fgui.GComponent {
  14317. static createInstance() {
  14318. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14319. }
  14320. onConstruct() {
  14321. this.type1 = (this.getChild("type1"));
  14322. this.type2 = (this.getChild("type2"));
  14323. this.type3 = (this.getChild("type3"));
  14324. this.n38 = (this.getChild("n38"));
  14325. this.t0 = this.getTransition("t0");
  14326. }
  14327. }
  14328. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14329. class ui_Component132_2 extends fgui.GComponent {
  14330. static createInstance() {
  14331. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14332. }
  14333. onConstruct() {
  14334. this.n25 = (this.getChild("n25"));
  14335. this.n26 = (this.getChild("n26"));
  14336. this.n27 = (this.getChild("n27"));
  14337. this.t0 = this.getTransition("t0");
  14338. }
  14339. }
  14340. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14341. class ui_UIPower$1 extends fgui.GComponent {
  14342. static createInstance() {
  14343. return (fgui.UIPackage.createObject("game", "UIPower"));
  14344. }
  14345. onConstruct() {
  14346. this.n11 = (this.getChild("n11"));
  14347. this.myNode = (this.getChild("myNode"));
  14348. this.t0 = this.getTransition("t0");
  14349. }
  14350. }
  14351. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14352. class ui_Component133 extends fgui.GComponent {
  14353. static createInstance() {
  14354. return (fgui.UIPackage.createObject("game", "Component133"));
  14355. }
  14356. onConstruct() {
  14357. this.n29 = (this.getChild("n29"));
  14358. this.n30 = (this.getChild("n30"));
  14359. }
  14360. }
  14361. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14362. class ui_Component134 extends fgui.GComponent {
  14363. static createInstance() {
  14364. return (fgui.UIPackage.createObject("game", "Component134"));
  14365. }
  14366. onConstruct() {
  14367. this.n30 = (this.getChild("n30"));
  14368. this.n31 = (this.getChild("n31"));
  14369. this.t0 = this.getTransition("t0");
  14370. }
  14371. }
  14372. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14373. class ui_Component135 extends fgui.GComponent {
  14374. static createInstance() {
  14375. return (fgui.UIPackage.createObject("game", "Component135"));
  14376. }
  14377. onConstruct() {
  14378. this.n30 = (this.getChild("n30"));
  14379. this.t0 = this.getTransition("t0");
  14380. }
  14381. }
  14382. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14383. class ui_Component137 extends fgui.GComponent {
  14384. static createInstance() {
  14385. return (fgui.UIPackage.createObject("game", "Component137"));
  14386. }
  14387. onConstruct() {
  14388. this.n28 = (this.getChild("n28"));
  14389. this.n29 = (this.getChild("n29"));
  14390. this.n30 = (this.getChild("n30"));
  14391. this.n32 = (this.getChild("n32"));
  14392. }
  14393. }
  14394. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14395. class ui_dh_zuanshi extends fgui.GButton {
  14396. static createInstance() {
  14397. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14398. }
  14399. onConstruct() {
  14400. this.n1 = (this.getChild("n1"));
  14401. this.n2 = (this.getChild("n2"));
  14402. this.n0 = (this.getChild("n0"));
  14403. this.n3 = (this.getChild("n3"));
  14404. this.n4 = (this.getChild("n4"));
  14405. }
  14406. }
  14407. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14408. class ui_Component138 extends fgui.GComponent {
  14409. static createInstance() {
  14410. return (fgui.UIPackage.createObject("game", "Component138"));
  14411. }
  14412. onConstruct() {
  14413. this.n1 = (this.getChild("n1"));
  14414. this.n2 = (this.getChild("n2"));
  14415. this.t0 = this.getTransition("t0");
  14416. }
  14417. }
  14418. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14419. class ui_Component139 extends fgui.GComponent {
  14420. static createInstance() {
  14421. return (fgui.UIPackage.createObject("game", "Component139"));
  14422. }
  14423. onConstruct() {
  14424. this.n0 = (this.getChild("n0"));
  14425. this.t0 = this.getTransition("t0");
  14426. }
  14427. }
  14428. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14429. class ui_Component140 extends fgui.GComponent {
  14430. static createInstance() {
  14431. return (fgui.UIPackage.createObject("game", "Component140"));
  14432. }
  14433. onConstruct() {
  14434. this.n2 = (this.getChild("n2"));
  14435. this.n3 = (this.getChild("n3"));
  14436. this.t0 = this.getTransition("t0");
  14437. }
  14438. }
  14439. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14440. class ui_Component141 extends fgui.GComponent {
  14441. static createInstance() {
  14442. return (fgui.UIPackage.createObject("game", "Component141"));
  14443. }
  14444. onConstruct() {
  14445. this.n0 = (this.getChild("n0"));
  14446. this.t0 = this.getTransition("t0");
  14447. }
  14448. }
  14449. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14450. class ui_powerNode extends fgui.GProgressBar {
  14451. static createInstance() {
  14452. return (fgui.UIPackage.createObject("game", "powerNode"));
  14453. }
  14454. onConstruct() {
  14455. this.n2 = (this.getChild("n2"));
  14456. this.bar_v = (this.getChild("bar_v"));
  14457. this.showImg = (this.getChild("showImg"));
  14458. this.n12 = (this.getChild("n12"));
  14459. }
  14460. }
  14461. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14462. class ui_dh_jingbi1 extends fgui.GComponent {
  14463. static createInstance() {
  14464. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14465. }
  14466. onConstruct() {
  14467. this.n0 = (this.getChild("n0"));
  14468. this.n1 = (this.getChild("n1"));
  14469. this.n2 = (this.getChild("n2"));
  14470. this.n3 = (this.getChild("n3"));
  14471. this.n4 = (this.getChild("n4"));
  14472. this.n5 = (this.getChild("n5"));
  14473. this.n6 = (this.getChild("n6"));
  14474. this.n8 = (this.getChild("n8"));
  14475. this.t0 = this.getTransition("t0");
  14476. }
  14477. }
  14478. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14479. class ui_Component94 extends fgui.GButton {
  14480. static createInstance() {
  14481. return (fgui.UIPackage.createObject("game", "Component94"));
  14482. }
  14483. onConstruct() {
  14484. this.n77 = (this.getChild("n77"));
  14485. }
  14486. }
  14487. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14488. class ui_Component95 extends fgui.GButton {
  14489. static createInstance() {
  14490. return (fgui.UIPackage.createObject("game", "Component95"));
  14491. }
  14492. onConstruct() {
  14493. this.n77 = (this.getChild("n77"));
  14494. }
  14495. }
  14496. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14497. class ui_Component126 extends fgui.GComponent {
  14498. static createInstance() {
  14499. return (fgui.UIPackage.createObject("game", "Component126"));
  14500. }
  14501. onConstruct() {
  14502. this.c1 = this.getController("c1");
  14503. this.normalBtn = (this.getChild("normalBtn"));
  14504. this.tripleBtn = (this.getChild("tripleBtn"));
  14505. }
  14506. }
  14507. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14508. class ui_Component60 extends fgui.GComponent {
  14509. static createInstance() {
  14510. return (fgui.UIPackage.createObject("game", "Component60"));
  14511. }
  14512. onConstruct() {
  14513. this.c1 = this.getController("c1");
  14514. this.n48 = (this.getChild("n48"));
  14515. this.womanTxt = (this.getChild("womanTxt"));
  14516. this.t0 = this.getTransition("t0");
  14517. }
  14518. }
  14519. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14520. class ui_Component_fuli1 extends fgui.GComponent {
  14521. static createInstance() {
  14522. return (fgui.UIPackage.createObject("game", "Component_fuli1"));
  14523. }
  14524. onConstruct() {
  14525. this.n0 = (this.getChild("n0"));
  14526. }
  14527. }
  14528. ui_Component_fuli1.URL = "ui://isxx5ak7loypv59q";
  14529. class ui_Button_h extends fgui.GButton {
  14530. static createInstance() {
  14531. return (fgui.UIPackage.createObject("game", "Button_h"));
  14532. }
  14533. onConstruct() {
  14534. this.button = this.getController("button");
  14535. this.n0 = (this.getChild("n0"));
  14536. this.n1 = (this.getChild("n1"));
  14537. }
  14538. }
  14539. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14540. class ui_Button_lv extends fgui.GButton {
  14541. static createInstance() {
  14542. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14543. }
  14544. onConstruct() {
  14545. this.button = this.getController("button");
  14546. this.n0 = (this.getChild("n0"));
  14547. this.n1 = (this.getChild("n1"));
  14548. }
  14549. }
  14550. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14551. class ui_Component98_3 extends fgui.GButton {
  14552. static createInstance() {
  14553. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14554. }
  14555. onConstruct() {
  14556. this.c1 = this.getController("c1");
  14557. this.n8 = (this.getChild("n8"));
  14558. this.n41 = (this.getChild("n41"));
  14559. this.n40 = (this.getChild("n40"));
  14560. }
  14561. }
  14562. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14563. class ui_ModeSelection_com1 extends fgui.GButton {
  14564. static createInstance() {
  14565. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14566. }
  14567. onConstruct() {
  14568. this.n34 = (this.getChild("n34"));
  14569. this.n36 = (this.getChild("n36"));
  14570. this.n22 = (this.getChild("n22"));
  14571. this.n20 = (this.getChild("n20"));
  14572. this.n23 = (this.getChild("n23"));
  14573. this.n24 = (this.getChild("n24"));
  14574. this.n26 = (this.getChild("n26"));
  14575. this.n33 = (this.getChild("n33"));
  14576. this.coinImg = (this.getChild("coinImg"));
  14577. this.need = (this.getChild("need"));
  14578. this.n35 = (this.getChild("n35"));
  14579. this.n29 = (this.getChild("n29"));
  14580. this.tipsTxt = (this.getChild("tipsTxt"));
  14581. this.n30 = (this.getChild("n30"));
  14582. this.peopleTxt = (this.getChild("peopleTxt"));
  14583. this.t0 = this.getTransition("t0");
  14584. }
  14585. }
  14586. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14587. class ui_ModeSelection_com2 extends fgui.GButton {
  14588. static createInstance() {
  14589. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14590. }
  14591. onConstruct() {
  14592. this.n36 = (this.getChild("n36"));
  14593. this.n34 = (this.getChild("n34"));
  14594. this.n22 = (this.getChild("n22"));
  14595. this.n20 = (this.getChild("n20"));
  14596. this.n23 = (this.getChild("n23"));
  14597. this.n24 = (this.getChild("n24"));
  14598. this.n26 = (this.getChild("n26"));
  14599. this.n33 = (this.getChild("n33"));
  14600. this.coinImg = (this.getChild("coinImg"));
  14601. this.need = (this.getChild("need"));
  14602. this.n35 = (this.getChild("n35"));
  14603. this.n29 = (this.getChild("n29"));
  14604. this.tipsTxt = (this.getChild("tipsTxt"));
  14605. this.n30 = (this.getChild("n30"));
  14606. this.peopleTxt = (this.getChild("peopleTxt"));
  14607. this.t0 = this.getTransition("t0");
  14608. }
  14609. }
  14610. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14611. class ui_ModeSelection_com3 extends fgui.GButton {
  14612. static createInstance() {
  14613. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14614. }
  14615. onConstruct() {
  14616. this.n34 = (this.getChild("n34"));
  14617. this.n36 = (this.getChild("n36"));
  14618. this.n22 = (this.getChild("n22"));
  14619. this.n20 = (this.getChild("n20"));
  14620. this.n23 = (this.getChild("n23"));
  14621. this.n24 = (this.getChild("n24"));
  14622. this.n26 = (this.getChild("n26"));
  14623. this.n33 = (this.getChild("n33"));
  14624. this.coinImg = (this.getChild("coinImg"));
  14625. this.need = (this.getChild("need"));
  14626. this.n35 = (this.getChild("n35"));
  14627. this.n29 = (this.getChild("n29"));
  14628. this.tipsTxt = (this.getChild("tipsTxt"));
  14629. this.n30 = (this.getChild("n30"));
  14630. this.peopleTxt = (this.getChild("peopleTxt"));
  14631. this.t0 = this.getTransition("t0");
  14632. }
  14633. }
  14634. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14635. class ui_Invitation_com1 extends fgui.GComponent {
  14636. static createInstance() {
  14637. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14638. }
  14639. onConstruct() {
  14640. this.n14 = (this.getChild("n14"));
  14641. this.n13 = (this.getChild("n13"));
  14642. this.n3 = (this.getChild("n3"));
  14643. this.n1 = (this.getChild("n1"));
  14644. this.n6 = (this.getChild("n6"));
  14645. this.n7 = (this.getChild("n7"));
  14646. this.enterBtn = (this.getChild("enterBtn"));
  14647. this.n11 = (this.getChild("n11"));
  14648. this.n12 = (this.getChild("n12"));
  14649. this.n15 = (this.getChild("n15"));
  14650. this.t0 = this.getTransition("t0");
  14651. this.t1 = this.getTransition("t1");
  14652. }
  14653. }
  14654. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14655. class ui_Component87_1 extends fgui.GComponent {
  14656. static createInstance() {
  14657. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14658. }
  14659. onConstruct() {
  14660. this.n74 = (this.getChild("n74"));
  14661. this.n73 = (this.getChild("n73"));
  14662. this.ballTxt = (this.getChild("ballTxt"));
  14663. this.n76 = (this.getChild("n76"));
  14664. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14665. this.levelTxt = (this.getChild("levelTxt"));
  14666. this.n87 = (this.getChild("n87"));
  14667. this.n84 = (this.getChild("n84"));
  14668. this.hpTxt = (this.getChild("hpTxt"));
  14669. this.n89 = (this.getChild("n89"));
  14670. this.tipsTxt = (this.getChild("tipsTxt"));
  14671. }
  14672. }
  14673. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14674. class ui_sqg1 extends fgui.GComponent {
  14675. static createInstance() {
  14676. return (fgui.UIPackage.createObject("game", "sqg1"));
  14677. }
  14678. onConstruct() {
  14679. this.n1 = (this.getChild("n1"));
  14680. this.n0 = (this.getChild("n0"));
  14681. }
  14682. }
  14683. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14684. class ui_sqg2 extends fgui.GComponent {
  14685. static createInstance() {
  14686. return (fgui.UIPackage.createObject("game", "sqg2"));
  14687. }
  14688. onConstruct() {
  14689. this.n1 = (this.getChild("n1"));
  14690. this.n0 = (this.getChild("n0"));
  14691. }
  14692. }
  14693. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14694. class ui_sqg3 extends fgui.GComponent {
  14695. static createInstance() {
  14696. return (fgui.UIPackage.createObject("game", "sqg3"));
  14697. }
  14698. onConstruct() {
  14699. this.n1 = (this.getChild("n1"));
  14700. this.n0 = (this.getChild("n0"));
  14701. }
  14702. }
  14703. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14704. class ui_sqg4 extends fgui.GComponent {
  14705. static createInstance() {
  14706. return (fgui.UIPackage.createObject("game", "sqg4"));
  14707. }
  14708. onConstruct() {
  14709. this.n1 = (this.getChild("n1"));
  14710. this.n0 = (this.getChild("n0"));
  14711. }
  14712. }
  14713. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14714. class ui_Component36 extends fgui.GButton {
  14715. static createInstance() {
  14716. return (fgui.UIPackage.createObject("game", "Component36"));
  14717. }
  14718. onConstruct() {
  14719. this.c1 = this.getController("c1");
  14720. this.n53 = (this.getChild("n53"));
  14721. this.n56 = (this.getChild("n56"));
  14722. }
  14723. }
  14724. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14725. class ui_Component37 extends fgui.GButton {
  14726. static createInstance() {
  14727. return (fgui.UIPackage.createObject("game", "Component37"));
  14728. }
  14729. onConstruct() {
  14730. this.c1 = this.getController("c1");
  14731. this.n52 = (this.getChild("n52"));
  14732. this.n54 = (this.getChild("n54"));
  14733. }
  14734. }
  14735. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14736. class ui_UISetting extends fgui.GComponent {
  14737. static createInstance() {
  14738. return (fgui.UIPackage.createObject("game", "UISetting"));
  14739. }
  14740. onConstruct() {
  14741. this.c1 = this.getController("c1");
  14742. this.n4 = (this.getChild("n4"));
  14743. this.soundBtn = (this.getChild("soundBtn"));
  14744. this.shakeBtn = (this.getChild("shakeBtn"));
  14745. this.clickNode = (this.getChild("clickNode"));
  14746. this.xyBtn = (this.getChild("xyBtn"));
  14747. }
  14748. }
  14749. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14750. class ui_Component39 extends fgui.GComponent {
  14751. static createInstance() {
  14752. return (fgui.UIPackage.createObject("game", "Component39"));
  14753. }
  14754. onConstruct() {
  14755. this.n5 = (this.getChild("n5"));
  14756. this.n6 = (this.getChild("n6"));
  14757. this.n7 = (this.getChild("n7"));
  14758. this.t0 = this.getTransition("t0");
  14759. }
  14760. }
  14761. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14762. class ui_Component40 extends fgui.GButton {
  14763. static createInstance() {
  14764. return (fgui.UIPackage.createObject("game", "Component40"));
  14765. }
  14766. onConstruct() {
  14767. this.n46 = (this.getChild("n46"));
  14768. this.n47 = (this.getChild("n47"));
  14769. }
  14770. }
  14771. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14772. class ui_Component41 extends fgui.GComponent {
  14773. static createInstance() {
  14774. return (fgui.UIPackage.createObject("game", "Component41"));
  14775. }
  14776. onConstruct() {
  14777. this.c1 = this.getController("c1");
  14778. this.n0 = (this.getChild("n0"));
  14779. this.titleTxt = (this.getChild("titleTxt"));
  14780. this.n2 = (this.getChild("n2"));
  14781. this.msgTips = (this.getChild("msgTips"));
  14782. this.numTxt = (this.getChild("numTxt"));
  14783. this.n18 = (this.getChild("n18"));
  14784. this.cancelBtn = (this.getChild("cancelBtn"));
  14785. this.videoBtn = (this.getChild("videoBtn"));
  14786. this.n10 = (this.getChild("n10"));
  14787. }
  14788. }
  14789. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14790. class ui_Component42 extends fgui.GComponent {
  14791. static createInstance() {
  14792. return (fgui.UIPackage.createObject("game", "Component42"));
  14793. }
  14794. onConstruct() {
  14795. this.c1 = this.getController("c1");
  14796. this.n1 = (this.getChild("n1"));
  14797. this.n2 = (this.getChild("n2"));
  14798. this.n3 = (this.getChild("n3"));
  14799. this.tipsTxt = (this.getChild("tipsTxt"));
  14800. this.cancelBtn = (this.getChild("cancelBtn"));
  14801. this.sureBtn = (this.getChild("sureBtn"));
  14802. this.n11 = (this.getChild("n11"));
  14803. this.n13 = (this.getChild("n13"));
  14804. this.n14 = (this.getChild("n14"));
  14805. this.womanTxt = (this.getChild("womanTxt"));
  14806. this.t0 = this.getTransition("t0");
  14807. }
  14808. }
  14809. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14810. class ui_dh_js_shengli extends fgui.GComponent {
  14811. static createInstance() {
  14812. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14813. }
  14814. onConstruct() {
  14815. this.n3 = (this.getChild("n3"));
  14816. this.n4 = (this.getChild("n4"));
  14817. this.n1 = (this.getChild("n1"));
  14818. this.n2 = (this.getChild("n2"));
  14819. this.n5 = (this.getChild("n5"));
  14820. this.n6 = (this.getChild("n6"));
  14821. this.n7 = (this.getChild("n7"));
  14822. this.n8 = (this.getChild("n8"));
  14823. this.attack = this.getTransition("attack");
  14824. this.idle = this.getTransition("idle");
  14825. }
  14826. }
  14827. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14828. class ui_dh_js_shengli_g extends fgui.GComponent {
  14829. static createInstance() {
  14830. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14831. }
  14832. onConstruct() {
  14833. this.n3 = (this.getChild("n3"));
  14834. this.n1 = (this.getChild("n1"));
  14835. this.t0 = this.getTransition("t0");
  14836. }
  14837. }
  14838. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14839. class ui_dh_js_shibai extends fgui.GComponent {
  14840. static createInstance() {
  14841. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14842. }
  14843. onConstruct() {
  14844. this.n0 = (this.getChild("n0"));
  14845. this.n1 = (this.getChild("n1"));
  14846. this.n2 = (this.getChild("n2"));
  14847. this.n3 = (this.getChild("n3"));
  14848. this.idle = this.getTransition("idle");
  14849. this.attack = this.getTransition("attack");
  14850. }
  14851. }
  14852. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14853. class ui_dh_zy_ganfa extends fgui.GButton {
  14854. static createInstance() {
  14855. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14856. }
  14857. onConstruct() {
  14858. this.n0 = (this.getChild("n0"));
  14859. }
  14860. }
  14861. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14862. class ui_dh_zy_sc_guang extends fgui.GButton {
  14863. static createInstance() {
  14864. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14865. }
  14866. onConstruct() {
  14867. this.n0 = (this.getChild("n0"));
  14868. this.n2 = (this.getChild("n2"));
  14869. }
  14870. }
  14871. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14872. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14873. static createInstance() {
  14874. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14875. }
  14876. onConstruct() {
  14877. this.n0 = (this.getChild("n0"));
  14878. this.n3 = (this.getChild("n3"));
  14879. this.t0 = this.getTransition("t0");
  14880. }
  14881. }
  14882. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14883. class ui_dh_zy_wanfa extends fgui.GButton {
  14884. static createInstance() {
  14885. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14886. }
  14887. onConstruct() {
  14888. this.n0 = (this.getChild("n0"));
  14889. }
  14890. }
  14891. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14892. class ui_Button_login extends fgui.GButton {
  14893. static createInstance() {
  14894. return (fgui.UIPackage.createObject("game", "Button_login"));
  14895. }
  14896. onConstruct() {
  14897. this.button = this.getController("button");
  14898. this.n5 = (this.getChild("n5"));
  14899. this.n3 = (this.getChild("n3"));
  14900. }
  14901. }
  14902. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14903. class ui_Component53_1 extends fgui.GComponent {
  14904. static createInstance() {
  14905. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14906. }
  14907. onConstruct() {
  14908. this.n0 = (this.getChild("n0"));
  14909. this.n1 = (this.getChild("n1"));
  14910. this.n2 = (this.getChild("n2"));
  14911. this.n3 = (this.getChild("n3"));
  14912. this.n4 = (this.getChild("n4"));
  14913. this.n5 = (this.getChild("n5"));
  14914. this.n6 = (this.getChild("n6"));
  14915. this.n7 = (this.getChild("n7"));
  14916. this.n8 = (this.getChild("n8"));
  14917. this.n9 = (this.getChild("n9"));
  14918. this.n10 = (this.getChild("n10"));
  14919. this.n11 = (this.getChild("n11"));
  14920. this.n12 = (this.getChild("n12"));
  14921. this.n13 = (this.getChild("n13"));
  14922. this.n14 = (this.getChild("n14"));
  14923. this.n15 = (this.getChild("n15"));
  14924. this.n16 = (this.getChild("n16"));
  14925. this.n19 = (this.getChild("n19"));
  14926. this.n20 = (this.getChild("n20"));
  14927. this.n21 = (this.getChild("n21"));
  14928. this.n22 = (this.getChild("n22"));
  14929. this.n23 = (this.getChild("n23"));
  14930. this.n24 = (this.getChild("n24"));
  14931. this.n25 = (this.getChild("n25"));
  14932. this.n26 = (this.getChild("n26"));
  14933. this.n27 = (this.getChild("n27"));
  14934. this.n28 = (this.getChild("n28"));
  14935. this.n29 = (this.getChild("n29"));
  14936. this.n30 = (this.getChild("n30"));
  14937. this.n31 = (this.getChild("n31"));
  14938. this.n32 = (this.getChild("n32"));
  14939. this.n33 = (this.getChild("n33"));
  14940. this.n34 = (this.getChild("n34"));
  14941. this.n35 = (this.getChild("n35"));
  14942. this.t0 = this.getTransition("t0");
  14943. }
  14944. }
  14945. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14946. class ui_Component30 extends fgui.GComponent {
  14947. static createInstance() {
  14948. return (fgui.UIPackage.createObject("game", "Component30"));
  14949. }
  14950. onConstruct() {
  14951. this.c1 = this.getController("c1");
  14952. this.n46 = (this.getChild("n46"));
  14953. this.n47 = (this.getChild("n47"));
  14954. this.numTxt = (this.getChild("numTxt"));
  14955. this.n50 = (this.getChild("n50"));
  14956. this.n53 = (this.getChild("n53"));
  14957. this.n54 = (this.getChild("n54"));
  14958. this.n55 = (this.getChild("n55"));
  14959. this.n56 = (this.getChild("n56"));
  14960. }
  14961. }
  14962. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14963. class ui_Component30_1 extends fgui.GComponent {
  14964. static createInstance() {
  14965. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14966. }
  14967. onConstruct() {
  14968. this.c1 = this.getController("c1");
  14969. this.n46 = (this.getChild("n46"));
  14970. this.n47 = (this.getChild("n47"));
  14971. this.numTxt = (this.getChild("numTxt"));
  14972. this.n50 = (this.getChild("n50"));
  14973. this.n51 = (this.getChild("n51"));
  14974. this.n52 = (this.getChild("n52"));
  14975. this.n53 = (this.getChild("n53"));
  14976. this.n54 = (this.getChild("n54"));
  14977. }
  14978. }
  14979. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14980. class ui_Component31 extends fgui.GComponent {
  14981. static createInstance() {
  14982. return (fgui.UIPackage.createObject("game", "Component31"));
  14983. }
  14984. onConstruct() {
  14985. this.n55 = (this.getChild("n55"));
  14986. this.n54 = (this.getChild("n54"));
  14987. this.conditionTxt = (this.getChild("conditionTxt"));
  14988. this.n57 = (this.getChild("n57"));
  14989. this.t0 = this.getTransition("t0");
  14990. }
  14991. }
  14992. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14993. class ui_Component32 extends fgui.GComponent {
  14994. static createInstance() {
  14995. return (fgui.UIPackage.createObject("game", "Component32"));
  14996. }
  14997. onConstruct() {
  14998. this.n5 = (this.getChild("n5"));
  14999. this.n6 = (this.getChild("n6"));
  15000. this.n7 = (this.getChild("n7"));
  15001. this.t0 = this.getTransition("t0");
  15002. }
  15003. }
  15004. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15005. class ui_AwardItem extends fgui.GComponent {
  15006. static createInstance() {
  15007. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15008. }
  15009. onConstruct() {
  15010. this.n9 = (this.getChild("n9"));
  15011. this.myIcon = (this.getChild("myIcon"));
  15012. this.numTxt = (this.getChild("numTxt"));
  15013. this.nameTxt = (this.getChild("nameTxt"));
  15014. this.n16 = (this.getChild("n16"));
  15015. this.n17 = (this.getChild("n17"));
  15016. }
  15017. }
  15018. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15019. class ui_ranking_com1 extends fgui.GButton {
  15020. static createInstance() {
  15021. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15022. }
  15023. onConstruct() {
  15024. this.c1 = this.getController("c1");
  15025. this.n49 = (this.getChild("n49"));
  15026. this.n18 = (this.getChild("n18"));
  15027. this.n46 = (this.getChild("n46"));
  15028. this.n48 = (this.getChild("n48"));
  15029. this.n50 = (this.getChild("n50"));
  15030. }
  15031. }
  15032. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15033. class ui_ranking_com2 extends fgui.GButton {
  15034. static createInstance() {
  15035. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15036. }
  15037. onConstruct() {
  15038. this.c1 = this.getController("c1");
  15039. this.n49 = (this.getChild("n49"));
  15040. this.n18 = (this.getChild("n18"));
  15041. this.n46 = (this.getChild("n46"));
  15042. this.n48 = (this.getChild("n48"));
  15043. this.n50 = (this.getChild("n50"));
  15044. }
  15045. }
  15046. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15047. class ui_ranking_com3 extends fgui.GComponent {
  15048. static createInstance() {
  15049. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15050. }
  15051. onConstruct() {
  15052. this.n17 = (this.getChild("n17"));
  15053. this.myIcon = (this.getChild("myIcon"));
  15054. }
  15055. }
  15056. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15057. class ui_ranking_com4 extends fgui.GComponent {
  15058. static createInstance() {
  15059. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15060. }
  15061. onConstruct() {
  15062. this.n16 = (this.getChild("n16"));
  15063. this.head = (this.getChild("head"));
  15064. }
  15065. }
  15066. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15067. class ui_ranking_com5 extends fgui.GComponent {
  15068. static createInstance() {
  15069. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15070. }
  15071. onConstruct() {
  15072. this.c1 = this.getController("c1");
  15073. this.c2 = this.getController("c2");
  15074. this.n2 = (this.getChild("n2"));
  15075. this.n3 = (this.getChild("n3"));
  15076. this.levelBtn = (this.getChild("levelBtn"));
  15077. this.starBtn = (this.getChild("starBtn"));
  15078. this.n23 = (this.getChild("n23"));
  15079. this.n24 = (this.getChild("n24"));
  15080. this.n25 = (this.getChild("n25"));
  15081. this.myList = (this.getChild("myList"));
  15082. this.selfNode = (this.getChild("selfNode"));
  15083. this.n9 = (this.getChild("n9"));
  15084. this.n12 = (this.getChild("n12"));
  15085. this.n13 = (this.getChild("n13"));
  15086. this.n14 = (this.getChild("n14"));
  15087. this.n39 = (this.getChild("n39"));
  15088. this.n41 = (this.getChild("n41"));
  15089. this.n42 = (this.getChild("n42"));
  15090. this.n45 = (this.getChild("n45"));
  15091. this.changeBtn = (this.getChild("changeBtn"));
  15092. this.closeBtn = (this.getChild("closeBtn"));
  15093. this.t0 = this.getTransition("t0");
  15094. }
  15095. }
  15096. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15097. class ui_RankItem extends fgui.GComponent {
  15098. static createInstance() {
  15099. return (fgui.UIPackage.createObject("game", "RankItem"));
  15100. }
  15101. onConstruct() {
  15102. this.n10 = (this.getChild("n10"));
  15103. this.n11 = (this.getChild("n11"));
  15104. this.rankTxt = (this.getChild("rankTxt"));
  15105. this.headNode = (this.getChild("headNode"));
  15106. this.nameTxt = (this.getChild("nameTxt"));
  15107. this.n19 = (this.getChild("n19"));
  15108. this.valueTxt = (this.getChild("valueTxt"));
  15109. this.img1 = (this.getChild("img1"));
  15110. this.img2 = (this.getChild("img2"));
  15111. this.img3 = (this.getChild("img3"));
  15112. }
  15113. }
  15114. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15115. class ui_ranking_com9 extends fgui.GComponent {
  15116. static createInstance() {
  15117. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15118. }
  15119. onConstruct() {
  15120. this.c1 = this.getController("c1");
  15121. this.n27 = (this.getChild("n27"));
  15122. this.n28 = (this.getChild("n28"));
  15123. this.headNode = (this.getChild("headNode"));
  15124. this.rankTxt = (this.getChild("rankTxt"));
  15125. this.nameTxt = (this.getChild("nameTxt"));
  15126. this.n34 = (this.getChild("n34"));
  15127. this.valueTxt = (this.getChild("valueTxt"));
  15128. this.n36 = (this.getChild("n36"));
  15129. this.n37 = (this.getChild("n37"));
  15130. this.n38 = (this.getChild("n38"));
  15131. this.n39 = (this.getChild("n39"));
  15132. this.n40 = (this.getChild("n40"));
  15133. }
  15134. }
  15135. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15136. class ui_ranking_com10 extends fgui.GComponent {
  15137. static createInstance() {
  15138. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15139. }
  15140. onConstruct() {
  15141. this.n23 = (this.getChild("n23"));
  15142. this.n24 = (this.getChild("n24"));
  15143. }
  15144. }
  15145. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15146. class ui_ranking_com11 extends fgui.GComponent {
  15147. static createInstance() {
  15148. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15149. }
  15150. onConstruct() {
  15151. this.n24 = (this.getChild("n24"));
  15152. this.n25 = (this.getChild("n25"));
  15153. this.t0 = this.getTransition("t0");
  15154. }
  15155. }
  15156. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15157. class ui_ranking_com13 extends fgui.GButton {
  15158. static createInstance() {
  15159. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15160. }
  15161. onConstruct() {
  15162. this.c1 = this.getController("c1");
  15163. this.n44 = (this.getChild("n44"));
  15164. this.n45 = (this.getChild("n45"));
  15165. this.n46 = (this.getChild("n46"));
  15166. }
  15167. }
  15168. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15169. class ui_Component_dl_zc extends fgui.GButton {
  15170. static createInstance() {
  15171. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  15172. }
  15173. onConstruct() {
  15174. this.c1 = this.getController("c1");
  15175. this.n0 = (this.getChild("n0"));
  15176. }
  15177. }
  15178. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  15179. class ui_Component122 extends fgui.GComponent {
  15180. static createInstance() {
  15181. return (fgui.UIPackage.createObject("game", "Component122"));
  15182. }
  15183. onConstruct() {
  15184. this.gameNode3 = (this.getChild("gameNode3"));
  15185. }
  15186. }
  15187. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15188. class ui_skillItem extends fgui.GComponent {
  15189. static createInstance() {
  15190. return (fgui.UIPackage.createObject("game", "skillItem"));
  15191. }
  15192. onConstruct() {
  15193. this.c1 = this.getController("c1");
  15194. this.n31 = (this.getChild("n31"));
  15195. this.n6 = (this.getChild("n6"));
  15196. this.skillImg = (this.getChild("skillImg"));
  15197. this.nameTxt = (this.getChild("nameTxt"));
  15198. this.levelTxt = (this.getChild("levelTxt"));
  15199. this.n28 = (this.getChild("n28"));
  15200. this.describeTxt = (this.getChild("describeTxt"));
  15201. this.n32 = (this.getChild("n32"));
  15202. this.mutiBtn = (this.getChild("mutiBtn"));
  15203. this.tryNode = (this.getChild("tryNode"));
  15204. this.normalBtn = (this.getChild("normalBtn"));
  15205. this.startBtn = (this.getChild("startBtn"));
  15206. this.n42 = (this.getChild("n42"));
  15207. this.n43 = (this.getChild("n43"));
  15208. this.n44 = (this.getChild("n44"));
  15209. }
  15210. }
  15211. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15212. class ui_Component26 extends fgui.GButton {
  15213. static createInstance() {
  15214. return (fgui.UIPackage.createObject("game", "Component26"));
  15215. }
  15216. onConstruct() {
  15217. this.n11 = (this.getChild("n11"));
  15218. this.n30 = (this.getChild("n30"));
  15219. this.n34 = (this.getChild("n34"));
  15220. }
  15221. }
  15222. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15223. class ui_Component28 extends fgui.GButton {
  15224. static createInstance() {
  15225. return (fgui.UIPackage.createObject("game", "Component28"));
  15226. }
  15227. onConstruct() {
  15228. this.n12 = (this.getChild("n12"));
  15229. this.n31 = (this.getChild("n31"));
  15230. this.curTxt = (this.getChild("curTxt"));
  15231. this.n33 = (this.getChild("n33"));
  15232. }
  15233. }
  15234. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15235. class ui_Component1302 extends fgui.GComponent {
  15236. static createInstance() {
  15237. return (fgui.UIPackage.createObject("game", "Component1302"));
  15238. }
  15239. onConstruct() {
  15240. this.n2 = (this.getChild("n2"));
  15241. this.n3 = (this.getChild("n3"));
  15242. }
  15243. }
  15244. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15245. class ui_Component113 extends fgui.GComponent {
  15246. static createInstance() {
  15247. return (fgui.UIPackage.createObject("game", "Component113"));
  15248. }
  15249. onConstruct() {
  15250. this.n85 = (this.getChild("n85"));
  15251. this.n86 = (this.getChild("n86"));
  15252. this.n77 = (this.getChild("n77"));
  15253. this.n79 = (this.getChild("n79"));
  15254. this.n80 = (this.getChild("n80"));
  15255. this.n81 = (this.getChild("n81"));
  15256. this.n82 = (this.getChild("n82"));
  15257. this.n84 = (this.getChild("n84"));
  15258. this.n87 = (this.getChild("n87"));
  15259. this.t0 = this.getTransition("t0");
  15260. }
  15261. }
  15262. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15263. class ui_Component114 extends fgui.GComponent {
  15264. static createInstance() {
  15265. return (fgui.UIPackage.createObject("game", "Component114"));
  15266. }
  15267. onConstruct() {
  15268. this.n77 = (this.getChild("n77"));
  15269. this.t0 = this.getTransition("t0");
  15270. }
  15271. }
  15272. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15273. class ui_Component115 extends fgui.GComponent {
  15274. static createInstance() {
  15275. return (fgui.UIPackage.createObject("game", "Component115"));
  15276. }
  15277. onConstruct() {
  15278. this.n83 = (this.getChild("n83"));
  15279. this.fingerNode = (this.getChild("fingerNode"));
  15280. this.n84 = (this.getChild("n84"));
  15281. }
  15282. }
  15283. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15284. class ui_Component117 extends fgui.GComponent {
  15285. static createInstance() {
  15286. return (fgui.UIPackage.createObject("game", "Component117"));
  15287. }
  15288. onConstruct() {
  15289. this.n87 = (this.getChild("n87"));
  15290. this.n88 = (this.getChild("n88"));
  15291. this.n84 = (this.getChild("n84"));
  15292. this.n85 = (this.getChild("n85"));
  15293. this.n86 = (this.getChild("n86"));
  15294. this.t0 = this.getTransition("t0");
  15295. }
  15296. }
  15297. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15298. class ui_Component98_1 extends fgui.GButton {
  15299. static createInstance() {
  15300. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15301. }
  15302. onConstruct() {
  15303. this.c1 = this.getController("c1");
  15304. this.n8 = (this.getChild("n8"));
  15305. this.n41 = (this.getChild("n41"));
  15306. this.n40 = (this.getChild("n40"));
  15307. }
  15308. }
  15309. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15310. class ui_Component61 extends fgui.GComponent {
  15311. static createInstance() {
  15312. return (fgui.UIPackage.createObject("game", "Component61"));
  15313. }
  15314. onConstruct() {
  15315. this.n14 = (this.getChild("n14"));
  15316. this.n6 = (this.getChild("n6"));
  15317. this.t0 = this.getTransition("t0");
  15318. }
  15319. }
  15320. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15321. class ui_Component62 extends fgui.GComponent {
  15322. static createInstance() {
  15323. return (fgui.UIPackage.createObject("game", "Component62"));
  15324. }
  15325. onConstruct() {
  15326. this.n66 = (this.getChild("n66"));
  15327. this.n56 = (this.getChild("n56"));
  15328. this.n63 = (this.getChild("n63"));
  15329. this.n65 = (this.getChild("n65"));
  15330. this.t0 = this.getTransition("t0");
  15331. }
  15332. }
  15333. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15334. class ui_d3Root extends fgui.GComponent {
  15335. static createInstance() {
  15336. return (fgui.UIPackage.createObject("game", "d3Root"));
  15337. }
  15338. onConstruct() {
  15339. }
  15340. }
  15341. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15342. class ui_d2Root extends fgui.GComponent {
  15343. static createInstance() {
  15344. return (fgui.UIPackage.createObject("game", "d2Root"));
  15345. }
  15346. onConstruct() {
  15347. }
  15348. }
  15349. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15350. class ui_ballNode extends fgui.GComponent {
  15351. static createInstance() {
  15352. return (fgui.UIPackage.createObject("game", "ballNode"));
  15353. }
  15354. onConstruct() {
  15355. }
  15356. }
  15357. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15358. class ui_border extends fgui.GComponent {
  15359. static createInstance() {
  15360. return (fgui.UIPackage.createObject("game", "border"));
  15361. }
  15362. onConstruct() {
  15363. this.bar1 = (this.getChild("bar1"));
  15364. this.bar2 = (this.getChild("bar2"));
  15365. this.bar3 = (this.getChild("bar3"));
  15366. this.bar4 = (this.getChild("bar4"));
  15367. this.bar5 = (this.getChild("bar5"));
  15368. this.bar6 = (this.getChild("bar6"));
  15369. this.circle1 = (this.getChild("circle1"));
  15370. this.circle2 = (this.getChild("circle2"));
  15371. this.circle3 = (this.getChild("circle3"));
  15372. this.circle4 = (this.getChild("circle4"));
  15373. this.circle5 = (this.getChild("circle5"));
  15374. this.circle6 = (this.getChild("circle6"));
  15375. this.n28 = (this.getChild("n28"));
  15376. }
  15377. }
  15378. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15379. class ui_btn_buy extends fgui.GButton {
  15380. static createInstance() {
  15381. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15382. }
  15383. onConstruct() {
  15384. this.button = this.getController("button");
  15385. this.n0 = (this.getChild("n0"));
  15386. this.n1 = (this.getChild("n1"));
  15387. this.n2 = (this.getChild("n2"));
  15388. }
  15389. }
  15390. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15391. class ui_Component41_2 extends fgui.GComponent {
  15392. static createInstance() {
  15393. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15394. }
  15395. onConstruct() {
  15396. this.c1 = this.getController("c1");
  15397. this.n0 = (this.getChild("n0"));
  15398. this.n2 = (this.getChild("n2"));
  15399. this.n19 = (this.getChild("n19"));
  15400. this.cancelBtn = (this.getChild("cancelBtn"));
  15401. this.videoBtn = (this.getChild("videoBtn"));
  15402. this.n9 = (this.getChild("n9"));
  15403. this.n22 = (this.getChild("n22"));
  15404. this.tipsTxt = (this.getChild("tipsTxt"));
  15405. this.n23 = (this.getChild("n23"));
  15406. this.n24 = (this.getChild("n24"));
  15407. this.n26 = (this.getChild("n26"));
  15408. this.n27 = (this.getChild("n27"));
  15409. this.titleTxt = (this.getChild("titleTxt"));
  15410. }
  15411. }
  15412. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15413. class ui_Component41_1 extends fgui.GComponent {
  15414. static createInstance() {
  15415. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15416. }
  15417. onConstruct() {
  15418. this.c1 = this.getController("c1");
  15419. this.n0 = (this.getChild("n0"));
  15420. this.n2 = (this.getChild("n2"));
  15421. this.cancelBtn = (this.getChild("cancelBtn"));
  15422. this.videoBtn = (this.getChild("videoBtn"));
  15423. this.n27 = (this.getChild("n27"));
  15424. this.n30 = (this.getChild("n30"));
  15425. this.n31 = (this.getChild("n31"));
  15426. this.n32 = (this.getChild("n32"));
  15427. this.n33 = (this.getChild("n33"));
  15428. this.n34 = (this.getChild("n34"));
  15429. this.n35 = (this.getChild("n35"));
  15430. this.n36 = (this.getChild("n36"));
  15431. this.n1 = (this.getChild("n1"));
  15432. this.n37 = (this.getChild("n37"));
  15433. this.t0 = this.getTransition("t0");
  15434. this.t1 = this.getTransition("t1");
  15435. this.t2 = this.getTransition("t2");
  15436. this.t3 = this.getTransition("t3");
  15437. }
  15438. }
  15439. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15440. class ui_againBtn extends fgui.GButton {
  15441. static createInstance() {
  15442. return (fgui.UIPackage.createObject("game", "againBtn"));
  15443. }
  15444. onConstruct() {
  15445. this.n2 = (this.getChild("n2"));
  15446. this.n1 = (this.getChild("n1"));
  15447. this.n5 = (this.getChild("n5"));
  15448. }
  15449. }
  15450. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15451. class ui_Component118 extends fgui.GButton {
  15452. static createInstance() {
  15453. return (fgui.UIPackage.createObject("game", "Component118"));
  15454. }
  15455. onConstruct() {
  15456. this.c1 = this.getController("c1");
  15457. this.n14 = (this.getChild("n14"));
  15458. this.n9 = (this.getChild("n9"));
  15459. this.n10 = (this.getChild("n10"));
  15460. this.diamondTxt = (this.getChild("diamondTxt"));
  15461. this.n13 = (this.getChild("n13"));
  15462. this.n15 = (this.getChild("n15"));
  15463. }
  15464. }
  15465. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15466. class ui_Component119 extends fgui.GComponent {
  15467. static createInstance() {
  15468. return (fgui.UIPackage.createObject("game", "Component119"));
  15469. }
  15470. onConstruct() {
  15471. this.n1 = (this.getChild("n1"));
  15472. this.n2 = (this.getChild("n2"));
  15473. this.n13 = (this.getChild("n13"));
  15474. this.n6 = (this.getChild("n6"));
  15475. this.screenNode = (this.getChild("screenNode"));
  15476. this.n15 = (this.getChild("n15"));
  15477. this.closeBtn = (this.getChild("closeBtn"));
  15478. this.share2Btn = (this.getChild("share2Btn"));
  15479. this.shareBtn = (this.getChild("shareBtn"));
  15480. this.tipsNode = (this.getChild("tipsNode"));
  15481. this.awardNode = (this.getChild("awardNode"));
  15482. }
  15483. }
  15484. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15485. class ui_daoJuDisplay extends fgui.GComponent {
  15486. static createInstance() {
  15487. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15488. }
  15489. onConstruct() {
  15490. this.n6 = (this.getChild("n6"));
  15491. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15492. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15493. this.btn_buy = (this.getChild("btn_buy"));
  15494. this.nameTxt = (this.getChild("nameTxt"));
  15495. this.zsImg = (this.getChild("zsImg"));
  15496. }
  15497. }
  15498. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15499. class ui_Component132_1 extends fgui.GComponent {
  15500. static createInstance() {
  15501. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15502. }
  15503. onConstruct() {
  15504. this.n25 = (this.getChild("n25"));
  15505. this.n26 = (this.getChild("n26"));
  15506. this.n27 = (this.getChild("n27"));
  15507. this.t0 = this.getTransition("t0");
  15508. }
  15509. }
  15510. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15511. class ui_SecretaryDisplay extends fgui.GComponent {
  15512. static createInstance() {
  15513. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15514. }
  15515. onConstruct() {
  15516. this.n2 = (this.getChild("n2"));
  15517. this.levelTxt = (this.getChild("levelTxt"));
  15518. this.n4 = (this.getChild("n4"));
  15519. this.secretary = (this.getChild("secretary"));
  15520. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15521. this.n16 = (this.getChild("n16"));
  15522. this.n37 = (this.getChild("n37"));
  15523. this.n41 = (this.getChild("n41"));
  15524. this.n14 = (this.getChild("n14"));
  15525. this.n17 = (this.getChild("n17"));
  15526. this.heightTxt = (this.getChild("heightTxt"));
  15527. this.n46 = (this.getChild("n46"));
  15528. this.n36 = (this.getChild("n36"));
  15529. this.n38 = (this.getChild("n38"));
  15530. this.foodTxt = (this.getChild("foodTxt"));
  15531. this.n47 = (this.getChild("n47"));
  15532. this.n40 = (this.getChild("n40"));
  15533. this.n42 = (this.getChild("n42"));
  15534. this.historyTxt = (this.getChild("historyTxt"));
  15535. this.n48 = (this.getChild("n48"));
  15536. this.nameImg = (this.getChild("nameImg"));
  15537. this.n12 = (this.getChild("n12"));
  15538. this.n49 = (this.getChild("n49"));
  15539. this.t0 = this.getTransition("t0");
  15540. }
  15541. }
  15542. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15543. class ui_BallRodDisplay extends fgui.GComponent {
  15544. static createInstance() {
  15545. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15546. }
  15547. onConstruct() {
  15548. this.c1 = this.getController("c1");
  15549. this.n31 = (this.getChild("n31"));
  15550. this.n6 = (this.getChild("n6"));
  15551. this.nameTxt = (this.getChild("nameTxt"));
  15552. this.rodImg = (this.getChild("rodImg"));
  15553. this.eftRod = (this.getChild("eftRod"));
  15554. this.levelNode = (this.getChild("levelNode"));
  15555. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15556. }
  15557. }
  15558. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15559. class ui_Component111_11 extends fgui.GComponent {
  15560. static createInstance() {
  15561. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15562. }
  15563. onConstruct() {
  15564. this.n68 = (this.getChild("n68"));
  15565. this.n69 = (this.getChild("n69"));
  15566. }
  15567. }
  15568. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15569. class ui_Component112 extends fgui.GComponent {
  15570. static createInstance() {
  15571. return (fgui.UIPackage.createObject("game", "Component112"));
  15572. }
  15573. onConstruct() {
  15574. this.n68 = (this.getChild("n68"));
  15575. this.n70 = (this.getChild("n70"));
  15576. this.myMask = (this.getChild("myMask"));
  15577. }
  15578. }
  15579. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15580. class ui_Component111 extends fgui.GComponent {
  15581. static createInstance() {
  15582. return (fgui.UIPackage.createObject("game", "Component111"));
  15583. }
  15584. onConstruct() {
  15585. this.n68 = (this.getChild("n68"));
  15586. this.myMask = (this.getChild("myMask"));
  15587. }
  15588. }
  15589. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15590. class ui_Component144 extends fgui.GButton {
  15591. static createInstance() {
  15592. return (fgui.UIPackage.createObject("game", "Component144"));
  15593. }
  15594. onConstruct() {
  15595. this.n8 = (this.getChild("n8"));
  15596. }
  15597. }
  15598. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15599. class ui_Sign_com2 extends fgui.GComponent {
  15600. static createInstance() {
  15601. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15602. }
  15603. onConstruct() {
  15604. this.n0 = (this.getChild("n0"));
  15605. this.n1 = (this.getChild("n1"));
  15606. this.t0 = this.getTransition("t0");
  15607. }
  15608. }
  15609. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15610. class ui_Sign_guang extends fgui.GComponent {
  15611. static createInstance() {
  15612. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15613. }
  15614. onConstruct() {
  15615. this.n1 = (this.getChild("n1"));
  15616. this.n2 = (this.getChild("n2"));
  15617. this.n3 = (this.getChild("n3"));
  15618. this.n4 = (this.getChild("n4"));
  15619. this.n5 = (this.getChild("n5"));
  15620. this.n6 = (this.getChild("n6"));
  15621. this.n8 = (this.getChild("n8"));
  15622. }
  15623. }
  15624. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15625. class ui_SignMax extends fgui.GComponent {
  15626. static createInstance() {
  15627. return (fgui.UIPackage.createObject("game", "SignMax"));
  15628. }
  15629. onConstruct() {
  15630. this.c1 = this.getController("c1");
  15631. this.n7 = (this.getChild("n7"));
  15632. this.n15 = (this.getChild("n15"));
  15633. this.n8 = (this.getChild("n8"));
  15634. this.titleTxt = (this.getChild("titleTxt"));
  15635. this.myIcon1 = (this.getChild("myIcon1"));
  15636. this.numTxt1 = (this.getChild("numTxt1"));
  15637. this.myIcon2 = (this.getChild("myIcon2"));
  15638. this.n20 = (this.getChild("n20"));
  15639. this.n17 = (this.getChild("n17"));
  15640. this.numTxt2 = (this.getChild("numTxt2"));
  15641. this.n12 = (this.getChild("n12"));
  15642. this.n13 = (this.getChild("n13"));
  15643. this.n21 = (this.getChild("n21"));
  15644. this.n14 = (this.getChild("n14"));
  15645. }
  15646. }
  15647. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15648. class ui_Sign_com2_1 extends fgui.GComponent {
  15649. static createInstance() {
  15650. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15651. }
  15652. onConstruct() {
  15653. this.n0 = (this.getChild("n0"));
  15654. this.n1 = (this.getChild("n1"));
  15655. this.t0 = this.getTransition("t0");
  15656. }
  15657. }
  15658. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15659. class ui_Sign_com5 extends fgui.GComponent {
  15660. static createInstance() {
  15661. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15662. }
  15663. onConstruct() {
  15664. this.n3 = (this.getChild("n3"));
  15665. this.n29 = (this.getChild("n29"));
  15666. this.n4 = (this.getChild("n4"));
  15667. this.day1 = (this.getChild("day1"));
  15668. this.day2 = (this.getChild("day2"));
  15669. this.day3 = (this.getChild("day3"));
  15670. this.day4 = (this.getChild("day4"));
  15671. this.day5 = (this.getChild("day5"));
  15672. this.day6 = (this.getChild("day6"));
  15673. this.day7 = (this.getChild("day7"));
  15674. this.t0 = this.getTransition("t0");
  15675. }
  15676. }
  15677. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15678. class ui_Sign_com8 extends fgui.GComponent {
  15679. static createInstance() {
  15680. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15681. }
  15682. onConstruct() {
  15683. this.n48 = (this.getChild("n48"));
  15684. this.womanTxt = (this.getChild("womanTxt"));
  15685. this.t0 = this.getTransition("t0");
  15686. }
  15687. }
  15688. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15689. class ui_Sign_com6 extends fgui.GComponent {
  15690. static createInstance() {
  15691. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15692. }
  15693. onConstruct() {
  15694. this.n2 = (this.getChild("n2"));
  15695. this.n3 = (this.getChild("n3"));
  15696. this.t0 = this.getTransition("t0");
  15697. }
  15698. }
  15699. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15700. class ui_Sign_com7 extends fgui.GComponent {
  15701. static createInstance() {
  15702. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15703. }
  15704. onConstruct() {
  15705. this.n29 = (this.getChild("n29"));
  15706. this.n2 = (this.getChild("n2"));
  15707. }
  15708. }
  15709. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15710. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15711. static createInstance() {
  15712. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15713. }
  15714. onConstruct() {
  15715. this.n5 = (this.getChild("n5"));
  15716. this.n4 = (this.getChild("n4"));
  15717. this.t0 = this.getTransition("t0");
  15718. }
  15719. }
  15720. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15721. class ui_UITurntable_com2 extends fgui.GComponent {
  15722. static createInstance() {
  15723. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15724. }
  15725. onConstruct() {
  15726. this.c1 = this.getController("c1");
  15727. this.n4 = (this.getChild("n4"));
  15728. this.n6 = (this.getChild("n6"));
  15729. this.n10 = (this.getChild("n10"));
  15730. this.n11 = (this.getChild("n11"));
  15731. this.n12 = (this.getChild("n12"));
  15732. this.n13 = (this.getChild("n13"));
  15733. this.n14 = (this.getChild("n14"));
  15734. this.n15 = (this.getChild("n15"));
  15735. this.n16 = (this.getChild("n16"));
  15736. this.n17 = (this.getChild("n17"));
  15737. this.n18 = (this.getChild("n18"));
  15738. this.n19 = (this.getChild("n19"));
  15739. this.n20 = (this.getChild("n20"));
  15740. this.n21 = (this.getChild("n21"));
  15741. this.n22 = (this.getChild("n22"));
  15742. this.n23 = (this.getChild("n23"));
  15743. this.n24 = (this.getChild("n24"));
  15744. this.n25 = (this.getChild("n25"));
  15745. this.n26 = (this.getChild("n26"));
  15746. this.n27 = (this.getChild("n27"));
  15747. this.n28 = (this.getChild("n28"));
  15748. this.n29 = (this.getChild("n29"));
  15749. this.n30 = (this.getChild("n30"));
  15750. this.n31 = (this.getChild("n31"));
  15751. this.n32 = (this.getChild("n32"));
  15752. this.n33 = (this.getChild("n33"));
  15753. }
  15754. }
  15755. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15756. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15757. static createInstance() {
  15758. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15759. }
  15760. onConstruct() {
  15761. this.n5 = (this.getChild("n5"));
  15762. this.n4 = (this.getChild("n4"));
  15763. this.t0 = this.getTransition("t0");
  15764. }
  15765. }
  15766. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15767. class ui_UITurntable_com5 extends fgui.GComponent {
  15768. static createInstance() {
  15769. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15770. }
  15771. onConstruct() {
  15772. this.flashNode = (this.getChild("flashNode"));
  15773. this.rotNode = (this.getChild("rotNode"));
  15774. this.n3 = (this.getChild("n3"));
  15775. this.n21 = (this.getChild("n21"));
  15776. this.t0 = this.getTransition("t0");
  15777. }
  15778. }
  15779. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15780. class ui_UITurntable_com7 extends fgui.GComponent {
  15781. static createInstance() {
  15782. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15783. }
  15784. onConstruct() {
  15785. this.n2 = (this.getChild("n2"));
  15786. this.n35 = (this.getChild("n35"));
  15787. this.img1 = (this.getChild("img1"));
  15788. this.img2 = (this.getChild("img2"));
  15789. this.img3 = (this.getChild("img3"));
  15790. this.img4 = (this.getChild("img4"));
  15791. this.img6 = (this.getChild("img6"));
  15792. this.img5 = (this.getChild("img5"));
  15793. this.txt1 = (this.getChild("txt1"));
  15794. this.txt2 = (this.getChild("txt2"));
  15795. this.txt3 = (this.getChild("txt3"));
  15796. this.txt4 = (this.getChild("txt4"));
  15797. this.txt5 = (this.getChild("txt5"));
  15798. this.txt6 = (this.getChild("txt6"));
  15799. }
  15800. }
  15801. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15802. class ui_UITurntable_com9 extends fgui.GComponent {
  15803. static createInstance() {
  15804. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15805. }
  15806. onConstruct() {
  15807. this.n38 = (this.getChild("n38"));
  15808. this.n39 = (this.getChild("n39"));
  15809. }
  15810. }
  15811. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15812. class ui_UITurntable_com10 extends fgui.GComponent {
  15813. static createInstance() {
  15814. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15815. }
  15816. onConstruct() {
  15817. this.n39 = (this.getChild("n39"));
  15818. this.n40 = (this.getChild("n40"));
  15819. this.t0 = this.getTransition("t0");
  15820. }
  15821. }
  15822. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15823. class ui_UITurntable_com11 extends fgui.GComponent {
  15824. static createInstance() {
  15825. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15826. }
  15827. onConstruct() {
  15828. this.n38 = (this.getChild("n38"));
  15829. this.n39 = (this.getChild("n39"));
  15830. this.n40 = (this.getChild("n40"));
  15831. this.t0 = this.getTransition("t0");
  15832. }
  15833. }
  15834. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15835. class ui_UITurntable_com12 extends fgui.GComponent {
  15836. static createInstance() {
  15837. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15838. }
  15839. onConstruct() {
  15840. this.n43 = (this.getChild("n43"));
  15841. this.barNode = (this.getChild("barNode"));
  15842. this.tipsTxt = (this.getChild("tipsTxt"));
  15843. this.n45 = (this.getChild("n45"));
  15844. this.boxBtn = (this.getChild("boxBtn"));
  15845. }
  15846. }
  15847. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15848. class ui_UITurntable_com1 extends fgui.GButton {
  15849. static createInstance() {
  15850. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15851. }
  15852. onConstruct() {
  15853. this.n41 = (this.getChild("n41"));
  15854. this.n42 = (this.getChild("n42"));
  15855. this.t0 = this.getTransition("t0");
  15856. }
  15857. }
  15858. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15859. class ui_UITurntable_com3 extends fgui.GComponent {
  15860. static createInstance() {
  15861. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15862. }
  15863. onConstruct() {
  15864. this.n48 = (this.getChild("n48"));
  15865. this.womanTxt = (this.getChild("womanTxt"));
  15866. this.t0 = this.getTransition("t0");
  15867. }
  15868. }
  15869. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15870. class ui_cancelBtn2 extends fgui.GButton {
  15871. static createInstance() {
  15872. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15873. }
  15874. onConstruct() {
  15875. this.c1 = this.getController("c1");
  15876. this.n0 = (this.getChild("n0"));
  15877. this.n1 = (this.getChild("n1"));
  15878. this.n2 = (this.getChild("n2"));
  15879. this.n3 = (this.getChild("n3"));
  15880. this.n4 = (this.getChild("n4"));
  15881. this.n5 = (this.getChild("n5"));
  15882. this.n6 = (this.getChild("n6"));
  15883. this.n7 = (this.getChild("n7"));
  15884. this.n8 = (this.getChild("n8"));
  15885. this.powerEft = (this.getChild("powerEft"));
  15886. }
  15887. }
  15888. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15889. class ui_shareBtn2 extends fgui.GButton {
  15890. static createInstance() {
  15891. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15892. }
  15893. onConstruct() {
  15894. this.c1 = this.getController("c1");
  15895. this.n2 = (this.getChild("n2"));
  15896. this.n24 = (this.getChild("n24"));
  15897. this.n1 = (this.getChild("n1"));
  15898. this.n3 = (this.getChild("n3"));
  15899. this.n23 = (this.getChild("n23"));
  15900. this.n4 = (this.getChild("n4"));
  15901. this.n5 = (this.getChild("n5"));
  15902. this.n6 = (this.getChild("n6"));
  15903. this.n20 = (this.getChild("n20"));
  15904. this.n21 = (this.getChild("n21"));
  15905. this.n22 = (this.getChild("n22"));
  15906. this.powerEft = (this.getChild("powerEft"));
  15907. }
  15908. }
  15909. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15910. class ui_UIMoney extends fgui.GComponent {
  15911. static createInstance() {
  15912. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15913. }
  15914. onConstruct() {
  15915. this.c1 = this.getController("c1");
  15916. this.n4 = (this.getChild("n4"));
  15917. this.coinImg = (this.getChild("coinImg"));
  15918. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15919. this.coinTxt = (this.getChild("coinTxt"));
  15920. this.n7 = (this.getChild("n7"));
  15921. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15922. this.diamondTxt = (this.getChild("diamondTxt"));
  15923. this.diamondImg = (this.getChild("diamondImg"));
  15924. this.n12 = (this.getChild("n12"));
  15925. this.powerImg = (this.getChild("powerImg"));
  15926. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15927. this.powerTxt = (this.getChild("powerTxt"));
  15928. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15929. }
  15930. }
  15931. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15932. class ui_backBtn extends fgui.GButton {
  15933. static createInstance() {
  15934. return (fgui.UIPackage.createObject("game", "backBtn"));
  15935. }
  15936. onConstruct() {
  15937. this.n0 = (this.getChild("n0"));
  15938. this.t0 = this.getTransition("t0");
  15939. this.t1 = this.getTransition("t1");
  15940. }
  15941. }
  15942. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15943. class ui_MoneyBtn extends fgui.GButton {
  15944. static createInstance() {
  15945. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15946. }
  15947. onConstruct() {
  15948. this.button = this.getController("button");
  15949. this.n0 = (this.getChild("n0"));
  15950. }
  15951. }
  15952. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15953. class ui_UIMoneyBtn extends fgui.GComponent {
  15954. static createInstance() {
  15955. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15956. }
  15957. onConstruct() {
  15958. this.n1 = (this.getChild("n1"));
  15959. this.closeBtn = (this.getChild("closeBtn"));
  15960. }
  15961. }
  15962. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15963. class ui_Component64 extends fgui.GComponent {
  15964. static createInstance() {
  15965. return (fgui.UIPackage.createObject("game", "Component64"));
  15966. }
  15967. onConstruct() {
  15968. this.n57 = (this.getChild("n57"));
  15969. this.n54 = (this.getChild("n54"));
  15970. this.n55 = (this.getChild("n55"));
  15971. this.n56 = (this.getChild("n56"));
  15972. this.t1 = this.getTransition("t1");
  15973. }
  15974. }
  15975. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15976. class ui_Component41_3 extends fgui.GComponent {
  15977. static createInstance() {
  15978. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15979. }
  15980. onConstruct() {
  15981. this.c1 = this.getController("c1");
  15982. this.n0 = (this.getChild("n0"));
  15983. this.n2 = (this.getChild("n2"));
  15984. this.cancelBtn = (this.getChild("cancelBtn"));
  15985. this.videoBtn = (this.getChild("videoBtn"));
  15986. this.n9 = (this.getChild("n9"));
  15987. this.n24 = (this.getChild("n24"));
  15988. this.n27 = (this.getChild("n27"));
  15989. this.titleTxt = (this.getChild("titleTxt"));
  15990. this.n28 = (this.getChild("n28"));
  15991. this.t0 = this.getTransition("t0");
  15992. }
  15993. }
  15994. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15995. class ui_dh_zs_4 extends fgui.GComponent {
  15996. static createInstance() {
  15997. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15998. }
  15999. onConstruct() {
  16000. this.n1 = (this.getChild("n1"));
  16001. this.n2 = (this.getChild("n2"));
  16002. this.n3 = (this.getChild("n3"));
  16003. this.n4 = (this.getChild("n4"));
  16004. this.n5 = (this.getChild("n5"));
  16005. this.n6 = (this.getChild("n6"));
  16006. this.n8 = (this.getChild("n8"));
  16007. this.t0 = this.getTransition("t0");
  16008. }
  16009. }
  16010. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16011. class ui_Component71_1 extends fgui.GButton {
  16012. static createInstance() {
  16013. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16014. }
  16015. onConstruct() {
  16016. this.n17 = (this.getChild("n17"));
  16017. this.t0 = this.getTransition("t0");
  16018. }
  16019. }
  16020. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16021. class ui_Component83 extends fgui.GComponent {
  16022. static createInstance() {
  16023. return (fgui.UIPackage.createObject("game", "Component83"));
  16024. }
  16025. onConstruct() {
  16026. this.c1 = this.getController("c1");
  16027. this.n17 = (this.getChild("n17"));
  16028. this.n19 = (this.getChild("n19"));
  16029. this.n20 = (this.getChild("n20"));
  16030. }
  16031. }
  16032. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16033. class ui_Component84 extends fgui.GComponent {
  16034. static createInstance() {
  16035. return (fgui.UIPackage.createObject("game", "Component84"));
  16036. }
  16037. onConstruct() {
  16038. this.c1 = this.getController("c1");
  16039. this.n4 = (this.getChild("n4"));
  16040. this.n22 = (this.getChild("n22"));
  16041. this.n23 = (this.getChild("n23"));
  16042. this.numTxt = (this.getChild("numTxt"));
  16043. this.n25 = (this.getChild("n25"));
  16044. this.n26 = (this.getChild("n26"));
  16045. }
  16046. }
  16047. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16048. class ui_Component84_1 extends fgui.GComponent {
  16049. static createInstance() {
  16050. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16051. }
  16052. onConstruct() {
  16053. this.c1 = this.getController("c1");
  16054. this.n4 = (this.getChild("n4"));
  16055. this.n22 = (this.getChild("n22"));
  16056. this.n23 = (this.getChild("n23"));
  16057. this.numTxt = (this.getChild("numTxt"));
  16058. this.n25 = (this.getChild("n25"));
  16059. this.n26 = (this.getChild("n26"));
  16060. }
  16061. }
  16062. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16063. class ui_Component85 extends fgui.GComponent {
  16064. static createInstance() {
  16065. return (fgui.UIPackage.createObject("game", "Component85"));
  16066. }
  16067. onConstruct() {
  16068. this.n1 = (this.getChild("n1"));
  16069. this.n6 = (this.getChild("n6"));
  16070. this.n2 = (this.getChild("n2"));
  16071. this.n3 = (this.getChild("n3"));
  16072. this.levelTxt = (this.getChild("levelTxt"));
  16073. this.n10 = (this.getChild("n10"));
  16074. this.n11 = (this.getChild("n11"));
  16075. this.n12 = (this.getChild("n12"));
  16076. this.n13 = (this.getChild("n13"));
  16077. this.n14 = (this.getChild("n14"));
  16078. this.modeNode = (this.getChild("modeNode"));
  16079. this.n18 = (this.getChild("n18"));
  16080. this.conditionTxt = (this.getChild("conditionTxt"));
  16081. this.diamondNode = (this.getChild("diamondNode"));
  16082. this.coinNode = (this.getChild("coinNode"));
  16083. this.startBtn = (this.getChild("startBtn"));
  16084. this.n28 = (this.getChild("n28"));
  16085. this.displayRoot = (this.getChild("displayRoot"));
  16086. this.t0 = this.getTransition("t0");
  16087. }
  16088. }
  16089. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16090. class ui_Component86 extends fgui.GButton {
  16091. static createInstance() {
  16092. return (fgui.UIPackage.createObject("game", "Component86"));
  16093. }
  16094. onConstruct() {
  16095. this.n15 = (this.getChild("n15"));
  16096. this.t0 = this.getTransition("t0");
  16097. }
  16098. }
  16099. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16100. class ui_Component87 extends fgui.GComponent {
  16101. static createInstance() {
  16102. return (fgui.UIPackage.createObject("game", "Component87"));
  16103. }
  16104. onConstruct() {
  16105. this.n66 = (this.getChild("n66"));
  16106. this.myProgress = (this.getChild("myProgress"));
  16107. this.starAni = (this.getChild("starAni"));
  16108. this.hpTxt = (this.getChild("hpTxt"));
  16109. this.n74 = (this.getChild("n74"));
  16110. this.n73 = (this.getChild("n73"));
  16111. this.ballTxt = (this.getChild("ballTxt"));
  16112. this.n76 = (this.getChild("n76"));
  16113. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16114. this.levelTxt = (this.getChild("levelTxt"));
  16115. this.star1 = (this.getChild("star1"));
  16116. this.star2 = (this.getChild("star2"));
  16117. this.star3 = (this.getChild("star3"));
  16118. }
  16119. }
  16120. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16121. class ui_Component88 extends fgui.GProgressBar {
  16122. static createInstance() {
  16123. return (fgui.UIPackage.createObject("game", "Component88"));
  16124. }
  16125. onConstruct() {
  16126. this.n68 = (this.getChild("n68"));
  16127. this.bar = (this.getChild("bar"));
  16128. }
  16129. }
  16130. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16131. class ui_Component89 extends fgui.GComponent {
  16132. static createInstance() {
  16133. return (fgui.UIPackage.createObject("game", "Component89"));
  16134. }
  16135. onConstruct() {
  16136. this.c1 = this.getController("c1");
  16137. this.n71 = (this.getChild("n71"));
  16138. this.n72 = (this.getChild("n72"));
  16139. }
  16140. }
  16141. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16142. class ui_Component90 extends fgui.GComponent {
  16143. static createInstance() {
  16144. return (fgui.UIPackage.createObject("game", "Component90"));
  16145. }
  16146. onConstruct() {
  16147. this.c1 = this.getController("c1");
  16148. this.n64 = (this.getChild("n64"));
  16149. this.n65 = (this.getChild("n65"));
  16150. this.n66 = (this.getChild("n66"));
  16151. this.t0 = this.getTransition("t0");
  16152. }
  16153. }
  16154. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16155. class ui_Component127 extends fgui.GButton {
  16156. static createInstance() {
  16157. return (fgui.UIPackage.createObject("game", "Component127"));
  16158. }
  16159. onConstruct() {
  16160. this.n5 = (this.getChild("n5"));
  16161. }
  16162. }
  16163. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16164. class gameBinder {
  16165. static bindAll() {
  16166. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16167. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16168. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16169. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16170. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16171. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16172. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16173. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16174. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16175. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16176. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16177. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16178. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16179. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16180. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16181. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16182. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16183. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16184. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16185. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16186. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16187. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16188. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16189. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16190. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16191. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16192. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16193. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16194. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16195. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16196. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16197. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16198. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16199. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16200. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16201. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16202. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16203. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16204. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16205. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16206. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16207. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16208. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16209. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16210. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16211. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16212. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16213. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16214. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16215. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16216. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16217. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16218. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16219. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16220. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16221. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16222. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16223. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16224. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16225. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16226. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16227. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16228. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16229. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16230. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16231. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16232. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16233. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16234. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16235. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16236. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16237. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16238. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16239. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16240. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16241. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16242. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16243. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16244. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16245. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16246. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16247. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16248. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16249. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16250. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16251. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16252. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16253. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16254. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16255. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16256. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16257. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16258. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16259. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16260. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16261. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16262. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16263. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16264. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16265. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16266. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16267. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16268. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16269. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16270. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16271. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16272. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16273. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16274. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16275. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16276. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16277. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16278. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16279. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16280. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16281. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16282. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16283. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16284. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16285. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16286. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16287. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16288. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16289. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16290. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16291. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16292. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16293. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16294. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16295. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16296. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16297. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16298. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16299. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16300. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16301. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16302. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16303. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16304. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16305. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16306. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16307. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16308. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16309. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16310. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16311. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16312. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16313. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16314. fgui.UIObjectFactory.setExtension(ui_Component_fuli1.URL, ui_Component_fuli1);
  16315. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16316. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16317. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16318. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16319. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16320. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16321. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16322. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16323. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16324. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16325. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16326. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16327. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16328. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16329. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16330. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16331. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16332. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16333. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16334. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16335. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16336. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16337. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16338. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16339. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16340. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16341. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16342. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16343. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16344. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16345. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16346. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16347. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16348. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16349. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16350. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16351. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16352. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16353. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16354. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16355. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16356. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16357. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16358. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16359. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16360. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16361. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16362. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16363. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16364. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  16365. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16366. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16367. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16368. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16369. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16370. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16371. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16372. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16373. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16374. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16375. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16376. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16377. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16378. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16379. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16380. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16381. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16382. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16383. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16384. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16385. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16386. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16387. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16388. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16389. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16390. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16391. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16392. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16393. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16394. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16395. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16396. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16397. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16398. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16399. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16400. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16401. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16402. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16403. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16404. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16405. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16406. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16407. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16408. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16409. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16410. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16411. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16412. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16413. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16414. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16415. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16416. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16417. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16418. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16419. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16420. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16421. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16422. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16423. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16424. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16425. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16426. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16427. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16428. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16429. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16430. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16431. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16432. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16433. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16434. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16435. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16436. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16437. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16438. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16439. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16440. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16441. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16442. }
  16443. }
  16444. class ui_btn6 extends fgui.GButton {
  16445. static createInstance() {
  16446. return (fgui.UIPackage.createObject("loading", "btn6"));
  16447. }
  16448. onConstruct() {
  16449. this.n6 = (this.getChild("n6"));
  16450. this.n1 = (this.getChild("n1"));
  16451. }
  16452. }
  16453. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16454. class ui_xyItem extends fgui.GComponent {
  16455. static createInstance() {
  16456. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16457. }
  16458. onConstruct() {
  16459. this.xyItem = (this.getChild("xyItem"));
  16460. }
  16461. }
  16462. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16463. class ui_loadinfo extends fgui.GProgressBar {
  16464. static createInstance() {
  16465. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16466. }
  16467. onConstruct() {
  16468. this.bg = (this.getChild("bg"));
  16469. this.bar = (this.getChild("bar"));
  16470. this.title = (this.getChild("title"));
  16471. this.ani = (this.getChild("ani"));
  16472. }
  16473. }
  16474. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16475. class ui_xyNode extends fgui.GComponent {
  16476. static createInstance() {
  16477. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16478. }
  16479. onConstruct() {
  16480. this.n0 = (this.getChild("n0"));
  16481. this.btnYes = (this.getChild("btnYes"));
  16482. this.btnNo = (this.getChild("btnNo"));
  16483. this.btnKnown = (this.getChild("btnKnown"));
  16484. this.btnSure = (this.getChild("btnSure"));
  16485. this.txtWelcom = (this.getChild("txtWelcom"));
  16486. this.txtXy = (this.getChild("txtXy"));
  16487. this.n75 = (this.getChild("n75"));
  16488. this.btnXy1 = (this.getChild("btnXy1"));
  16489. this.btnXy3 = (this.getChild("btnXy3"));
  16490. this.btnXy2 = (this.getChild("btnXy2"));
  16491. this.n74 = (this.getChild("n74"));
  16492. this.xy1 = (this.getChild("xy1"));
  16493. this.txtTitle = (this.getChild("txtTitle"));
  16494. this.btnBack = (this.getChild("btnBack"));
  16495. this.xyList = (this.getChild("xyList"));
  16496. this.xy2 = (this.getChild("xy2"));
  16497. this.xyNode = (this.getChild("xyNode"));
  16498. }
  16499. }
  16500. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16501. class ui_ageNode extends fgui.GComponent {
  16502. static createInstance() {
  16503. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16504. }
  16505. onConstruct() {
  16506. this.n3 = (this.getChild("n3"));
  16507. this.n7 = (this.getChild("n7"));
  16508. this.n4 = (this.getChild("n4"));
  16509. this.btnAge = (this.getChild("btnAge"));
  16510. this.ageNode = (this.getChild("ageNode"));
  16511. }
  16512. }
  16513. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16514. class ui_rnNode extends fgui.GComponent {
  16515. static createInstance() {
  16516. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16517. }
  16518. onConstruct() {
  16519. this.n28 = (this.getChild("n28"));
  16520. this.n30 = (this.getChild("n30"));
  16521. this.n33 = (this.getChild("n33"));
  16522. this.rn1 = (this.getChild("rn1"));
  16523. this.n40 = (this.getChild("n40"));
  16524. this.n41 = (this.getChild("n41"));
  16525. this.rn3 = (this.getChild("rn3"));
  16526. this.n37 = (this.getChild("n37"));
  16527. this.n39 = (this.getChild("n39"));
  16528. this.rn2 = (this.getChild("rn2"));
  16529. this.n47 = (this.getChild("n47"));
  16530. this.n49 = (this.getChild("n49"));
  16531. this.n44 = (this.getChild("n44"));
  16532. this.inputCode = (this.getChild("inputCode"));
  16533. this.inputName = (this.getChild("inputName"));
  16534. this.n48 = (this.getChild("n48"));
  16535. this.n50 = (this.getChild("n50"));
  16536. this.rn4 = (this.getChild("rn4"));
  16537. this.btnCheck = (this.getChild("btnCheck"));
  16538. this.btnExit = (this.getChild("btnExit"));
  16539. this.btnDone = (this.getChild("btnDone"));
  16540. this.rnNode = (this.getChild("rnNode"));
  16541. }
  16542. }
  16543. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16544. class ui_tipNode extends fgui.GComponent {
  16545. static createInstance() {
  16546. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16547. }
  16548. onConstruct() {
  16549. this.bg = (this.getChild("bg"));
  16550. this.n55 = (this.getChild("n55"));
  16551. this.n56 = (this.getChild("n56"));
  16552. this.tipNode = (this.getChild("tipNode"));
  16553. }
  16554. }
  16555. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16556. class ui_fcmNode extends fgui.GComponent {
  16557. static createInstance() {
  16558. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16559. }
  16560. onConstruct() {
  16561. this.n63 = (this.getChild("n63"));
  16562. this.n62 = (this.getChild("n62"));
  16563. this.btnRn = (this.getChild("btnRn"));
  16564. this.n61 = (this.getChild("n61"));
  16565. this.n58 = (this.getChild("n58"));
  16566. this.fcmNode = (this.getChild("fcmNode"));
  16567. }
  16568. }
  16569. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16570. class ui_msgNode extends fgui.GComponent {
  16571. static createInstance() {
  16572. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16573. }
  16574. onConstruct() {
  16575. this.n69 = (this.getChild("n69"));
  16576. this.txtMsg = (this.getChild("txtMsg"));
  16577. this.msgNode = (this.getChild("msgNode"));
  16578. }
  16579. }
  16580. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16581. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16582. static createInstance() {
  16583. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16584. }
  16585. onConstruct() {
  16586. this.n1 = (this.getChild("n1"));
  16587. this.n13 = (this.getChild("n13"));
  16588. this.n14 = (this.getChild("n14"));
  16589. this.n15 = (this.getChild("n15"));
  16590. this.n3 = (this.getChild("n3"));
  16591. this.n4 = (this.getChild("n4"));
  16592. this.n5 = (this.getChild("n5"));
  16593. this.n6 = (this.getChild("n6"));
  16594. this.n7 = (this.getChild("n7"));
  16595. this.n8 = (this.getChild("n8"));
  16596. this.n9 = (this.getChild("n9"));
  16597. this.n10 = (this.getChild("n10"));
  16598. this.n12 = (this.getChild("n12"));
  16599. this.n11 = (this.getChild("n11"));
  16600. this.n16 = (this.getChild("n16"));
  16601. this.n17 = (this.getChild("n17"));
  16602. this.n18 = (this.getChild("n18"));
  16603. this.n20 = (this.getChild("n20"));
  16604. this.n21 = (this.getChild("n21"));
  16605. this.t0 = this.getTransition("t0");
  16606. }
  16607. }
  16608. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16609. class ui_btn5 extends fgui.GButton {
  16610. static createInstance() {
  16611. return (fgui.UIPackage.createObject("loading", "btn5"));
  16612. }
  16613. onConstruct() {
  16614. this.n9 = (this.getChild("n9"));
  16615. this.n1 = (this.getChild("n1"));
  16616. }
  16617. }
  16618. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16619. class ui_UILoading extends fgui.GComponent {
  16620. static createInstance() {
  16621. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16622. }
  16623. onConstruct() {
  16624. this.n12 = (this.getChild("n12"));
  16625. this.loadinfo = (this.getChild("loadinfo"));
  16626. this.n13 = (this.getChild("n13"));
  16627. this.txtLoad = (this.getChild("txtLoad"));
  16628. this.n18 = (this.getChild("n18"));
  16629. }
  16630. }
  16631. ui_UILoading.URL = "ui://37nctnhwphc33";
  16632. class ui_AgeItem extends fgui.GComponent {
  16633. static createInstance() {
  16634. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16635. }
  16636. onConstruct() {
  16637. this.txtAge = (this.getChild("txtAge"));
  16638. }
  16639. }
  16640. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16641. class ui_btn1 extends fgui.GButton {
  16642. static createInstance() {
  16643. return (fgui.UIPackage.createObject("loading", "btn1"));
  16644. }
  16645. onConstruct() {
  16646. this.n6 = (this.getChild("n6"));
  16647. this.n1 = (this.getChild("n1"));
  16648. }
  16649. }
  16650. ui_btn1.URL = "ui://37nctnhwxe622p";
  16651. class ui_btn3 extends fgui.GButton {
  16652. static createInstance() {
  16653. return (fgui.UIPackage.createObject("loading", "btn3"));
  16654. }
  16655. onConstruct() {
  16656. this.n9 = (this.getChild("n9"));
  16657. this.n1 = (this.getChild("n1"));
  16658. }
  16659. }
  16660. ui_btn3.URL = "ui://37nctnhwxe622s";
  16661. class ui_btn2 extends fgui.GButton {
  16662. static createInstance() {
  16663. return (fgui.UIPackage.createObject("loading", "btn2"));
  16664. }
  16665. onConstruct() {
  16666. this.n6 = (this.getChild("n6"));
  16667. this.n1 = (this.getChild("n1"));
  16668. }
  16669. }
  16670. ui_btn2.URL = "ui://37nctnhwxe622t";
  16671. class ui_btnBack extends fgui.GButton {
  16672. static createInstance() {
  16673. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16674. }
  16675. onConstruct() {
  16676. this.n6 = (this.getChild("n6"));
  16677. this.n7 = (this.getChild("n7"));
  16678. }
  16679. }
  16680. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16681. class ui_btnXy1 extends fgui.GButton {
  16682. static createInstance() {
  16683. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16684. }
  16685. onConstruct() {
  16686. this.n1 = (this.getChild("n1"));
  16687. }
  16688. }
  16689. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16690. class ui_btnXy2 extends fgui.GButton {
  16691. static createInstance() {
  16692. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16693. }
  16694. onConstruct() {
  16695. this.n1 = (this.getChild("n1"));
  16696. }
  16697. }
  16698. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16699. class ui_btnXy3 extends fgui.GButton {
  16700. static createInstance() {
  16701. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16702. }
  16703. onConstruct() {
  16704. this.n1 = (this.getChild("n1"));
  16705. }
  16706. }
  16707. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16708. class ui_btn4 extends fgui.GButton {
  16709. static createInstance() {
  16710. return (fgui.UIPackage.createObject("loading", "btn4"));
  16711. }
  16712. onConstruct() {
  16713. this.n9 = (this.getChild("n9"));
  16714. this.n1 = (this.getChild("n1"));
  16715. }
  16716. }
  16717. ui_btn4.URL = "ui://37nctnhwxe622z";
  16718. class loadingBinder {
  16719. static bindAll() {
  16720. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16721. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16722. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16723. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16724. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16725. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16726. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16727. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16728. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16729. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16730. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16731. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16732. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16733. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16734. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16735. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16736. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16737. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16738. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16739. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16740. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16741. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16742. }
  16743. }
  16744. class UIMgr {
  16745. constructor() {
  16746. this._stage = null;
  16747. this._uiList = [];
  16748. this._showList = [];
  16749. this._bindPkgList = [];
  16750. this.uiIndex = 0;
  16751. }
  16752. static get inst() {
  16753. if (UIMgr._inst == null) {
  16754. UIMgr._inst = new UIMgr();
  16755. }
  16756. return UIMgr._inst;
  16757. }
  16758. setStage(s) {
  16759. if (this._stage) {
  16760. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16761. return;
  16762. }
  16763. this._stage = s;
  16764. }
  16765. clearTempData() {
  16766. console.log('zh:clearTempData start');
  16767. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16768. console.log('zh:clearTempData end');
  16769. }
  16770. init() {
  16771. this.setStage(Laya.stage);
  16772. fairygui.UIConfig.defaultFont = "微软雅黑";
  16773. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16774. fairygui.UIConfig.packageFileExtension = "obj";
  16775. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16776. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16777. fairygui.GRoot.inst.width = Laya.stage.width;
  16778. fairygui.GRoot.inst.height = Laya.stage.height;
  16779. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16780. }
  16781. addAllUpdate() {
  16782. this.uiIndex = 0;
  16783. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16784. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16785. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16786. }
  16787. }
  16788. }
  16789. bindFUI(pkgname) {
  16790. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16791. return;
  16792. }
  16793. switch (pkgname) {
  16794. case fguiRes.loading:
  16795. fairygui.UIPackage.addPackage(pkgname);
  16796. loadingBinder.bindAll();
  16797. this._bindPkgList.push(pkgname);
  16798. break;
  16799. case fguiRes.game:
  16800. fairygui.UIPackage.addPackage(pkgname);
  16801. gameBinder.bindAll();
  16802. this._bindPkgList.push(pkgname);
  16803. break;
  16804. default:
  16805. break;
  16806. }
  16807. }
  16808. Show(cls, ...param) {
  16809. let nameStr = cls.uiName;
  16810. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16811. let temp = this._uiList[i];
  16812. let str = temp.className;
  16813. if (str == nameStr) {
  16814. if (temp.isMuti) {
  16815. if (temp.isHide) {
  16816. temp.show(...param);
  16817. this._uiList.splice(i, 1);
  16818. this._uiList.push(temp);
  16819. return temp;
  16820. }
  16821. }
  16822. else {
  16823. temp.show(...param);
  16824. this._uiList.splice(i, 1);
  16825. this._uiList.push(temp);
  16826. return temp;
  16827. }
  16828. }
  16829. }
  16830. let ui = new cls();
  16831. ui.className = nameStr;
  16832. this._showUI(ui, param);
  16833. return ui;
  16834. }
  16835. destroyUI(ui) {
  16836. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16837. let temp = this._uiList[i].className;
  16838. if (temp == ui.className) {
  16839. this._uiList.splice(i, 1);
  16840. break;
  16841. }
  16842. }
  16843. this.checkUIState();
  16844. }
  16845. _showUI(ui, param) {
  16846. this._uiList.push(ui);
  16847. ui.show(...param);
  16848. }
  16849. Hide(uiClass) {
  16850. let ui = this.getUI(uiClass);
  16851. if (ui && !ui.isHide) {
  16852. ui.hide();
  16853. }
  16854. }
  16855. getUI(ui) {
  16856. let nameStr = ui.uiName;
  16857. for (let index = 0; index < this._uiList.length; index++) {
  16858. let temp = this._uiList[index];
  16859. if (temp.className == nameStr) {
  16860. return temp;
  16861. }
  16862. }
  16863. return null;
  16864. }
  16865. isShow(cls) {
  16866. for (var i of this._uiList) {
  16867. if (i instanceof cls) {
  16868. return i.isShowing;
  16869. }
  16870. }
  16871. return false;
  16872. }
  16873. showUINum() {
  16874. let num = 0;
  16875. for (var i of this._uiList) {
  16876. if (i.isShowing) {
  16877. num++;
  16878. }
  16879. }
  16880. return num;
  16881. }
  16882. checkUIState() {
  16883. Laya.timer.clear(this, this._uiCheck);
  16884. Laya.timer.once(400, this, this._uiCheck);
  16885. }
  16886. _uiCheck() {
  16887. let showList = [];
  16888. for (var i of this._uiList) {
  16889. if (!i.isHide) {
  16890. showList.push(i);
  16891. }
  16892. }
  16893. for (let index = 0; index < showList.length; index++) {
  16894. if (index == showList.length - 1) {
  16895. showList[index].checkActive(true);
  16896. }
  16897. else {
  16898. showList[index].checkActive(false);
  16899. }
  16900. }
  16901. }
  16902. showTip(msg, time = 600, size = 30) {
  16903. }
  16904. }
  16905. class UIShowList {
  16906. }
  16907. class SoundMgr {
  16908. constructor() {
  16909. this.soundMax = 4;
  16910. this.isLoad = false;
  16911. this.soundMap = {};
  16912. this.isSound = true;
  16913. this.openShake = true;
  16914. SoundMgr._instance = this;
  16915. }
  16916. static getInstance() {
  16917. if (!this._instance) {
  16918. this._instance = new SoundMgr();
  16919. }
  16920. return this._instance;
  16921. }
  16922. init() {
  16923. console.log('zh:sm init 1');
  16924. Laya.SoundManager.autoReleaseSound = true;
  16925. Laya.SoundManager.autoStopMusic = true;
  16926. Laya.SoundManager.musicVolume = 0.3;
  16927. Laya.SoundManager.soundVolume = 0.5;
  16928. this.musicPlayed = false;
  16929. this.audioUrl = "asset/sound/ogg/";
  16930. console.log('zh:sm init 2');
  16931. console.log('zh:dev type ');
  16932. if (Laya.Browser.onAndroid) {
  16933. console.log('zh:dev type android');
  16934. this.audioUrl = "asset/sound/ogg/";
  16935. this.isLoad = true;
  16936. }
  16937. else {
  16938. console.log('zh:dev type not android');
  16939. this.audioUrl = "asset/sound/mp3/";
  16940. this.isLoad = true;
  16941. }
  16942. }
  16943. onSetting(isS) {
  16944. this.isSound = isS;
  16945. this.mute(!this.isSound);
  16946. }
  16947. clearCount() {
  16948. for (var key in this.soundMap) {
  16949. delete this.soundMap[key];
  16950. }
  16951. }
  16952. playMusic(path, loop = 0) {
  16953. console.log('zh:playMusic 1 PATH=' + path);
  16954. this.musicPath = path;
  16955. if (!this.isLoad) {
  16956. return;
  16957. }
  16958. if (!path || path == "") {
  16959. return;
  16960. }
  16961. if (!this.isSound) {
  16962. return;
  16963. }
  16964. this.musicPlayed = true;
  16965. let url = this.getUrl(path);
  16966. if (!Laya.Browser.onAndroid) {
  16967. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16968. this.play(url, loop);
  16969. }));
  16970. }
  16971. else {
  16972. this.play(url, loop);
  16973. }
  16974. }
  16975. play(url, loop) {
  16976. Laya.SoundManager.playMusic(url, loop);
  16977. }
  16978. getUrl(path) {
  16979. let url = this.audioUrl + path;
  16980. if (Laya.Browser.onAndroid) {
  16981. url += ".ogg";
  16982. }
  16983. else {
  16984. url += ".mp3";
  16985. }
  16986. return url;
  16987. }
  16988. pauseMusic(pause) {
  16989. if (pause) {
  16990. this.mute(true);
  16991. }
  16992. else if (this.isSound)
  16993. this.mute(false);
  16994. }
  16995. stopMusic() {
  16996. Laya.SoundManager.stopMusic();
  16997. if (Moyu.isNeedPlatAudio) {
  16998. Moyu.stopMusic();
  16999. }
  17000. }
  17001. mute(mute) {
  17002. if (Moyu.isNeedPlatAudio) {
  17003. Moyu.pauseMusic(mute);
  17004. }
  17005. else {
  17006. Laya.SoundManager.musicMuted = mute;
  17007. if (!mute && !this.musicPlayed && this.musicPath) {
  17008. this.playMusic(this.musicPath);
  17009. }
  17010. }
  17011. }
  17012. stopSound(path) {
  17013. let url = this.getUrl(path);
  17014. Laya.SoundManager.stopSound(url);
  17015. }
  17016. playSound(path, loop = 1, soundMax = this.soundMax) {
  17017. if (!this.isLoad)
  17018. return;
  17019. if (!this.isSound)
  17020. return;
  17021. if (!path || path == "")
  17022. return;
  17023. let url = this.getUrl(path);
  17024. if (Moyu.isNeedPlatAudio) {
  17025. Moyu.playSound(path, loop == 0);
  17026. }
  17027. else {
  17028. let count = 1;
  17029. if (this.soundMap[path])
  17030. count = this.soundMap[path] + 1;
  17031. if (count > soundMax)
  17032. return;
  17033. this.soundMap[path] = count;
  17034. Laya.SoundManager.playSound(url, loop);
  17035. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17036. }
  17037. }
  17038. removePath(path) {
  17039. if (this.soundMap[path]) {
  17040. let count = this.soundMap[path];
  17041. count--;
  17042. if (count < 1)
  17043. delete this.soundMap[path];
  17044. else
  17045. this.soundMap[path] = count;
  17046. }
  17047. }
  17048. playBtnSound() {
  17049. this.playSound("btn");
  17050. }
  17051. playGetSound() {
  17052. }
  17053. playCloseUISound() {
  17054. }
  17055. }
  17056. SoundMgr._instance = null;
  17057. var Handler$1 = Laya.Handler;
  17058. var EResType;
  17059. (function (EResType) {
  17060. EResType[EResType["none"] = 0] = "none";
  17061. EResType[EResType["nromal"] = 1] = "nromal";
  17062. EResType[EResType["td"] = 2] = "td";
  17063. EResType[EResType["sk"] = 3] = "sk";
  17064. })(EResType || (EResType = {}));
  17065. class CResLoader {
  17066. constructor(doneCall, proCall) {
  17067. this.completrCall = doneCall;
  17068. this.progressCall = proCall;
  17069. this.progressHander = new Handler$1(this, this.onProgress);
  17070. this.tdResMap = {};
  17071. }
  17072. load(resList) {
  17073. this.resCount = 0;
  17074. this.loadCount = 0;
  17075. for (let i = 0; i < resList.length; i++) {
  17076. let path = resList[i];
  17077. if (!path)
  17078. continue;
  17079. this.resCount++;
  17080. let type = this.getResType(path);
  17081. if (type == EResType.nromal)
  17082. this.loadNromal(path);
  17083. else if (type == EResType.td)
  17084. this.loadTd(path);
  17085. }
  17086. }
  17087. getRes(path) {
  17088. let type = this.getResType(path);
  17089. if (type == EResType.nromal)
  17090. return Laya.loader.getRes(path);
  17091. else if (type == EResType.td) {
  17092. let res = this.tdResMap[path];
  17093. if (res)
  17094. return res.clone();
  17095. return null;
  17096. }
  17097. }
  17098. destroy() {
  17099. this.progressHander.clear();
  17100. this.progressHander = null;
  17101. }
  17102. clearRes(path) {
  17103. let type = this.getResType(path);
  17104. if (type == EResType.nromal)
  17105. Laya.loader.clearRes(path);
  17106. else if (type == EResType.td) {
  17107. let obj = this.tdResMap[path];
  17108. if (obj)
  17109. obj.destroy();
  17110. delete this.tdResMap[path];
  17111. }
  17112. }
  17113. getResType(path) {
  17114. let exs = this.getExtension(path);
  17115. if (exs == "sk")
  17116. return EResType.sk;
  17117. if (exs == "ls" || exs == "lh" || exs == "lm")
  17118. return EResType.td;
  17119. else
  17120. return EResType.nromal;
  17121. }
  17122. getExtension(res) {
  17123. var index = res.lastIndexOf(".");
  17124. return res.substr(index + 1);
  17125. }
  17126. loadNromal(path) {
  17127. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17128. if (res) {
  17129. this.onLoad();
  17130. }
  17131. else
  17132. console.log("load res fail:" + path);
  17133. }), this.progressHander);
  17134. }
  17135. loadSk() {
  17136. }
  17137. loadTd(path) {
  17138. if (this.tdResMap[path]) {
  17139. this.onLoad();
  17140. return;
  17141. }
  17142. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17143. if (res) {
  17144. this.tdResMap[path] = res;
  17145. this.onLoad();
  17146. }
  17147. else
  17148. console.log("load res fail:" + path);
  17149. }));
  17150. }
  17151. onLoad() {
  17152. this.loadCount++;
  17153. this.onProgress(1);
  17154. if (this.loadCount >= this.resCount) {
  17155. this.completrCall.run();
  17156. }
  17157. }
  17158. onProgress(pro) {
  17159. let progress = (this.loadCount + pro) / this.resCount;
  17160. this.progressCall.runWith(progress);
  17161. }
  17162. }
  17163. var Handler$2 = Laya.Handler;
  17164. class ResInfo {
  17165. constructor() {
  17166. this.index = 0;
  17167. }
  17168. }
  17169. class ResMgr {
  17170. constructor() {
  17171. this.resList = [];
  17172. this.doneList = [];
  17173. this.resMap = {};
  17174. this.currentLoad = null;
  17175. this.completeHandler = new Handler$2(this, this.onComplete);
  17176. this.progressHandler = new Handler$2(this, this.onProgress);
  17177. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17178. }
  17179. static getInstance() {
  17180. if (ResMgr._instance == null) {
  17181. ResMgr._instance = new ResMgr();
  17182. }
  17183. return ResMgr._instance;
  17184. }
  17185. loadList(list, completeHandler, progressHandler) {
  17186. if (list.length < 1) {
  17187. completeHandler.run();
  17188. return;
  17189. }
  17190. let info = this.getResInfo();
  17191. info.resList = list;
  17192. info.completeHandler = completeHandler;
  17193. info.progressHandler = progressHandler;
  17194. this.resList.push(info);
  17195. this.startLoad();
  17196. }
  17197. loadFguiRes(list, completeHandler, progressHandler) {
  17198. Laya.loader.load(list, completeHandler, progressHandler);
  17199. }
  17200. loadAny(list, completeHandler, progressHandler) {
  17201. Laya.loader.load(list, completeHandler, progressHandler);
  17202. }
  17203. load(path, completeHandler, progressHandler) {
  17204. let count = this.resMap[path];
  17205. if (count && count > 0) {
  17206. if (completeHandler)
  17207. completeHandler.run();
  17208. }
  17209. else
  17210. this.loadList([path], completeHandler, progressHandler);
  17211. }
  17212. getRes(path) {
  17213. let res = this.resMap[path];
  17214. if (!res)
  17215. this.showLog("资源不存在:" + path);
  17216. else
  17217. return this.loader.getRes(path);
  17218. }
  17219. clearList(list, force = false) {
  17220. if (!list || list.length < 1)
  17221. return;
  17222. let cr = () => {
  17223. for (const k in list) {
  17224. let v = list[k];
  17225. if (!v)
  17226. continue;
  17227. if (force) {
  17228. this.loader.clearRes(v);
  17229. delete this.resMap[v];
  17230. }
  17231. else {
  17232. let count = this.resMap[v];
  17233. if (count && count > 1) {
  17234. count--;
  17235. this.resMap[v] = count;
  17236. }
  17237. else {
  17238. this.loader.clearRes(v);
  17239. delete this.resMap[v];
  17240. }
  17241. }
  17242. }
  17243. if (!window.hasOwnProperty("ks"))
  17244. Laya.Resource.destroyUnusedResources();
  17245. };
  17246. Laya.timer.clearAll(this);
  17247. Laya.timer.once(2000, this, cr);
  17248. }
  17249. clear3D() {
  17250. for (const k in this.loader.tdResMap) {
  17251. this.loader.clearRes(k);
  17252. if (this.resMap[k])
  17253. delete this.resMap[k];
  17254. }
  17255. if (!window.hasOwnProperty("ks"))
  17256. Laya.Resource.destroyUnusedResources();
  17257. }
  17258. clear(path, force = false) {
  17259. this.clearList([path], force);
  17260. }
  17261. getResInfo() {
  17262. if (this.doneList.length > 0)
  17263. return this.doneList.pop();
  17264. else
  17265. return new ResInfo();
  17266. }
  17267. startLoad() {
  17268. if (this.currentLoad)
  17269. return;
  17270. this.currentLoad = this.resList.pop();
  17271. if (this.currentLoad) {
  17272. this.loader.load(this.currentLoad.resList);
  17273. }
  17274. }
  17275. onComplete() {
  17276. if (!this.currentLoad)
  17277. return;
  17278. for (const k in this.currentLoad.resList) {
  17279. let v = this.currentLoad.resList[k];
  17280. let count = this.resMap[v];
  17281. if (count)
  17282. count++;
  17283. else
  17284. count = 1;
  17285. this.resMap[v] = count;
  17286. }
  17287. if (this.currentLoad.completeHandler)
  17288. this.currentLoad.completeHandler.run();
  17289. this.doneList.push(this.currentLoad);
  17290. this.currentLoad = null;
  17291. this.startLoad();
  17292. }
  17293. onProgress(pro) {
  17294. if (!this.currentLoad)
  17295. return;
  17296. if (this.currentLoad.progressHandler)
  17297. this.currentLoad.progressHandler.runWith(pro);
  17298. }
  17299. showLog(str, ...args) {
  17300. console.log("[ResLoader] " + str);
  17301. }
  17302. }
  17303. ResMgr._instance = null;
  17304. class EventMgr extends Laya.EventDispatcher {
  17305. }
  17306. let eventMgr = new EventMgr();
  17307. /*! *****************************************************************************
  17308. Copyright (c) Microsoft Corporation. All rights reserved.
  17309. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17310. this file except in compliance with the License. You may obtain a copy of the
  17311. License at http://www.apache.org/licenses/LICENSE-2.0
  17312. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17313. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17314. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17315. MERCHANTABLITY OR NON-INFRINGEMENT.
  17316. See the Apache Version 2.0 License for specific language governing permissions
  17317. and limitations under the License.
  17318. ***************************************************************************** */
  17319. /* global Reflect, Promise */
  17320. var extendStatics = function(d, b) {
  17321. extendStatics = Object.setPrototypeOf ||
  17322. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17323. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17324. return extendStatics(d, b);
  17325. };
  17326. function __extends(d, b) {
  17327. extendStatics(d, b);
  17328. function __() { this.constructor = d; }
  17329. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17330. }
  17331. var __assign = function() {
  17332. __assign = Object.assign || function __assign(t) {
  17333. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17334. s = arguments[i];
  17335. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17336. }
  17337. return t;
  17338. };
  17339. return __assign.apply(this, arguments);
  17340. };
  17341. function __rest(s, e) {
  17342. var t = {};
  17343. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17344. t[p] = s[p];
  17345. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17346. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17347. t[p[i]] = s[p[i]];
  17348. return t;
  17349. }
  17350. function __decorate(decorators, target, key, desc) {
  17351. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17352. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17353. 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;
  17354. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17355. }
  17356. function __param(paramIndex, decorator) {
  17357. return function (target, key) { decorator(target, key, paramIndex); }
  17358. }
  17359. function __metadata(metadataKey, metadataValue) {
  17360. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17361. }
  17362. function __awaiter(thisArg, _arguments, P, generator) {
  17363. return new (P || (P = Promise))(function (resolve, reject) {
  17364. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17365. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17366. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17367. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17368. });
  17369. }
  17370. function __generator(thisArg, body) {
  17371. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17372. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17373. function verb(n) { return function (v) { return step([n, v]); }; }
  17374. function step(op) {
  17375. if (f) throw new TypeError("Generator is already executing.");
  17376. while (_) try {
  17377. 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;
  17378. if (y = 0, t) op = [op[0] & 2, t.value];
  17379. switch (op[0]) {
  17380. case 0: case 1: t = op; break;
  17381. case 4: _.label++; return { value: op[1], done: false };
  17382. case 5: _.label++; y = op[1]; op = [0]; continue;
  17383. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17384. default:
  17385. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17386. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17387. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17388. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17389. if (t[2]) _.ops.pop();
  17390. _.trys.pop(); continue;
  17391. }
  17392. op = body.call(thisArg, _);
  17393. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17394. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17395. }
  17396. }
  17397. function __exportStar(m, exports) {
  17398. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17399. }
  17400. function __values(o) {
  17401. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17402. if (m) return m.call(o);
  17403. return {
  17404. next: function () {
  17405. if (o && i >= o.length) o = void 0;
  17406. return { value: o && o[i++], done: !o };
  17407. }
  17408. };
  17409. }
  17410. function __read(o, n) {
  17411. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17412. if (!m) return o;
  17413. var i = m.call(o), r, ar = [], e;
  17414. try {
  17415. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17416. }
  17417. catch (error) { e = { error: error }; }
  17418. finally {
  17419. try {
  17420. if (r && !r.done && (m = i["return"])) m.call(i);
  17421. }
  17422. finally { if (e) throw e.error; }
  17423. }
  17424. return ar;
  17425. }
  17426. function __spread() {
  17427. for (var ar = [], i = 0; i < arguments.length; i++)
  17428. ar = ar.concat(__read(arguments[i]));
  17429. return ar;
  17430. }
  17431. function __await(v) {
  17432. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17433. }
  17434. function __asyncGenerator(thisArg, _arguments, generator) {
  17435. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17436. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17437. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17438. 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); }); }; }
  17439. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17440. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17441. function fulfill(value) { resume("next", value); }
  17442. function reject(value) { resume("throw", value); }
  17443. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17444. }
  17445. function __asyncDelegator(o) {
  17446. var i, p;
  17447. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17448. 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; }
  17449. }
  17450. function __asyncValues(o) {
  17451. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17452. var m = o[Symbol.asyncIterator], i;
  17453. 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);
  17454. 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); }); }; }
  17455. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17456. }
  17457. function __makeTemplateObject(cooked, raw) {
  17458. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17459. return cooked;
  17460. };
  17461. function __importStar(mod) {
  17462. if (mod && mod.__esModule) return mod;
  17463. var result = {};
  17464. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17465. result.default = mod;
  17466. return result;
  17467. }
  17468. function __importDefault(mod) {
  17469. return (mod && mod.__esModule) ? mod : { default: mod };
  17470. }
  17471. class CustomAlert {
  17472. static show(title, content, buttons) {
  17473. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17474. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17475. return;
  17476. }
  17477. const bg = new Laya.Box();
  17478. bg.alpha = 0;
  17479. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17480. Laya.stage.addChild(bg);
  17481. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17482. const panel = new Laya.Box();
  17483. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17484. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17485. bg.addChild(panel);
  17486. const titleText = new Laya.Text();
  17487. titleText.text = title;
  17488. titleText.fontSize = 32;
  17489. titleText.color = "#333333";
  17490. titleText.bold = true;
  17491. titleText.pos(20, 20);
  17492. titleText.width = 360;
  17493. titleText.align = "center";
  17494. panel.addChild(titleText);
  17495. const contentText = new Laya.Text();
  17496. contentText.text = content;
  17497. contentText.fontSize = 21;
  17498. contentText.color = "#555555";
  17499. contentText.pos(20, 70);
  17500. contentText.width = 360;
  17501. contentText.wordWrap = true;
  17502. contentText.align = "center";
  17503. panel.addChild(contentText);
  17504. const buttonContainer = new Laya.Box();
  17505. buttonContainer.pos(20, 160);
  17506. panel.addChild(buttonContainer);
  17507. const btnWidth = 120;
  17508. const spacing = 30;
  17509. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17510. buttons.forEach((btn, index) => {
  17511. const button = new Laya.Button();
  17512. button.label = btn.label;
  17513. button.size(btnWidth, 40);
  17514. button.labelSize = 22;
  17515. button.pos(index * (btnWidth + spacing), 0);
  17516. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17517. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17518. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17519. button.alpha = 0.9;
  17520. });
  17521. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17522. button.alpha = 1;
  17523. });
  17524. button.on(Laya.Event.CLICK, this, () => {
  17525. btn.handler();
  17526. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17527. bg.removeSelf();
  17528. }));
  17529. });
  17530. buttonContainer.addChild(button);
  17531. });
  17532. buttonContainer.x = (panel.width - totalWidth) / 2;
  17533. }
  17534. }
  17535. class ConfigMgr {
  17536. constructor() {
  17537. this.httpReqCount = 4;
  17538. this.httpReqOkCount = 0;
  17539. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17540. try {
  17541. this.httpReqOkCount = 0;
  17542. let reqData = xGame.httpMgr.getReqData();
  17543. console.log('zh:第1个请求getClassicCfg');
  17544. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17545. this.classicCfg = classicCfg;
  17546. this.httpReqOkCount++;
  17547. console.log('zh:第2个请求getLevelCfg');
  17548. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17549. this.levelCfg = levelCfg;
  17550. this.httpReqOkCount++;
  17551. console.log('zh:第3个请求 getPlaceBallCfg');
  17552. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17553. this.placeBallCfg = placeBallCfg;
  17554. this.httpReqOkCount++;
  17555. console.log('zh:第4个请求 npc');
  17556. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17557. this.npcJson = npc.Data;
  17558. this.httpReqOkCount++;
  17559. console.log('zh:所有配置加载完成');
  17560. }
  17561. catch (error) {
  17562. console.error('❌请求失败:', error);
  17563. Laya.timer.once(5000, this, () => {
  17564. let retryCount = 0;
  17565. const maxRetries = 3;
  17566. const tryFetchConfig = () => {
  17567. try {
  17568. xGame.cfgMgr.getConfigFromServer();
  17569. }
  17570. catch (error) {
  17571. if (retryCount < maxRetries) {
  17572. retryCount++;
  17573. console.log(`🔄 第${retryCount}次重试获取配置...`);
  17574. Laya.timer.once(5000, this, tryFetchConfig);
  17575. }
  17576. else {
  17577. console.error("❌ 达到最大重试次数,配置获取失败");
  17578. }
  17579. }
  17580. };
  17581. tryFetchConfig();
  17582. });
  17583. }
  17584. finally {
  17585. if (this.httpReqCount > this.httpReqOkCount) {
  17586. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17587. {
  17588. label: "Okay", handler: () => {
  17589. console.log("zh:好的知道了");
  17590. JSBridgeUtils.instance.exitAndCloseGame();
  17591. }
  17592. }
  17593. ]);
  17594. }
  17595. }
  17596. });
  17597. this.sendPostAsync = (action, reqData) => {
  17598. return new Promise((resolve, reject) => {
  17599. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17600. try {
  17601. let code = res.code;
  17602. if (code == 200) {
  17603. const parsedData = JSON.parse(res.msg);
  17604. resolve(parsedData);
  17605. }
  17606. else {
  17607. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17608. reject(new Error(`Request failed with code: ${code}`));
  17609. }
  17610. }
  17611. catch (error) {
  17612. console.error(`ERROR=${error}`);
  17613. alert("Please check your network connection.");
  17614. reject(error);
  17615. }
  17616. finally {
  17617. console.log(`zh:${action}的请求处理完毕`);
  17618. }
  17619. });
  17620. });
  17621. };
  17622. }
  17623. static getInstance() {
  17624. if (!this._instance) {
  17625. this._instance = new ConfigMgr();
  17626. }
  17627. return this._instance;
  17628. }
  17629. init() {
  17630. this.getConfigFromServer();
  17631. }
  17632. test() {
  17633. let reqData = xGame.httpMgr.getReqData();
  17634. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17635. console.log('zh:1s');
  17636. try {
  17637. let code = res.code;
  17638. let data = res.data;
  17639. if (code == 200) {
  17640. const parsedData = JSON.parse(data);
  17641. this.classicCfg = parsedData;
  17642. }
  17643. else {
  17644. console.log('zh:res = ' + JSON.stringify(res));
  17645. }
  17646. }
  17647. catch (error) {
  17648. console.log('error=' + error);
  17649. alert("Please check your network connection.");
  17650. }
  17651. finally {
  17652. console.log('zh:1');
  17653. }
  17654. });
  17655. }
  17656. getUserInfoByIndex(index) {
  17657. return this.npcJson[index];
  17658. }
  17659. getRandomUserInfo() {
  17660. let index = xGame.tools.random(0, this.npcJson.length);
  17661. let rs = this.npcJson[index];
  17662. return rs;
  17663. }
  17664. getMaxBigMoveLength() {
  17665. return Object.keys(this.levelCfg).length;
  17666. }
  17667. getBigMoveLevelByIndex(index) {
  17668. let cfg = this.levelCfg;
  17669. cfg = cfg[index];
  17670. return cfg;
  17671. }
  17672. getRandomClassicLevel() {
  17673. let cfg = this.classicCfg;
  17674. let num = Object.keys(cfg).length;
  17675. let rand = xGame.common.randomNum(1, num);
  17676. return cfg[rand];
  17677. }
  17678. getPlaceBallByLevel(level) {
  17679. return this.placeBallCfg[level];
  17680. }
  17681. getMaxPlaceBall() {
  17682. return Object.keys(this.placeBallCfg).length;
  17683. }
  17684. }
  17685. class PoolD3Mgr {
  17686. constructor() {
  17687. this.pool = {};
  17688. }
  17689. static get ins() {
  17690. return this._ins || (this._ins = new PoolD3Mgr);
  17691. }
  17692. createList(key, prefab, parent) {
  17693. if (!this.pool[key]) {
  17694. this.pool[key] = {};
  17695. this.pool[key].prefab = prefab;
  17696. this.pool[key].list = [];
  17697. this.pool[key].parent = parent;
  17698. }
  17699. }
  17700. getItem(key) {
  17701. if (!this.pool[key]) {
  17702. return;
  17703. }
  17704. let temp;
  17705. if (this.pool[key].list.length > 0) {
  17706. temp = this.pool[key].list.pop();
  17707. }
  17708. else {
  17709. temp = this.pool[key].prefab.clone();
  17710. if (this.pool[key].parent) {
  17711. this.pool[key].parent.addChild(temp);
  17712. }
  17713. }
  17714. temp.active = true;
  17715. return temp;
  17716. }
  17717. putItem(key, obj) {
  17718. if (!this.pool[key]) {
  17719. return;
  17720. }
  17721. obj.active = false;
  17722. this.pool[key].list.push(obj);
  17723. }
  17724. }
  17725. let context$1 = context;
  17726. let uiMgr = UIMgr.inst;
  17727. let soundMgr = SoundMgr.getInstance();
  17728. let resMgr = ResMgr.getInstance();
  17729. let httpMgr = HttpMgr.getInstance();
  17730. let common = Common.getInstance();
  17731. let cfgMgr = ConfigMgr.getInstance();
  17732. let poolD3Mgr = PoolD3Mgr.ins;
  17733. let d3TexUrl = "res/d3Res/";
  17734. let d3ModeUrl = "res/unityRes/";
  17735. function setStageSize(view) {
  17736. if (view.width) {
  17737. view.width = Laya.stage.width;
  17738. view.height = Laya.stage.height;
  17739. }
  17740. }
  17741. function filledBg(view) {
  17742. let wh = Laya.stage.height / Laya.stage.width;
  17743. if (wh > 16 / 9) {
  17744. view.height = Laya.stage.height;
  17745. view.width = Laya.stage.height / 1334 * 750;
  17746. }
  17747. else {
  17748. view.width = Laya.stage.width;
  17749. view.height = Laya.stage.width / 750 * 1334;
  17750. }
  17751. }
  17752. function setNotch(view) {
  17753. if (view.height) {
  17754. view.y += context$1.notchHeight;
  17755. }
  17756. }
  17757. function showTip(str) {
  17758. uiMgr.Show(UIMsg, str);
  17759. }
  17760. function log(...args) {
  17761. console.log(args);
  17762. }
  17763. let xGame = {
  17764. context: context$1,
  17765. eventMgr,
  17766. resMgr,
  17767. uiMgr,
  17768. soundMgr,
  17769. define,
  17770. tools,
  17771. httpMgr,
  17772. d3TexUrl,
  17773. d3ModeUrl,
  17774. common,
  17775. cfgMgr,
  17776. poolD3Mgr,
  17777. setStageSize,
  17778. filledBg,
  17779. setNotch,
  17780. showTip,
  17781. log,
  17782. };
  17783. window["xGame"] = xGame;
  17784. let dataName = 'tBall_';
  17785. class UserData {
  17786. constructor() {
  17787. this.userId = "";
  17788. this.isAgree = false;
  17789. this.coinNum = 0;
  17790. this.gemNum = 0;
  17791. this.sound = true;
  17792. this.vibration = true;
  17793. this.currentDate = 0;
  17794. this.createTime = 0;
  17795. this.awardTime = 0;
  17796. this.roleId = 1;
  17797. this.roleList = [];
  17798. this.roleAds = [];
  17799. this.dressId = 101;
  17800. this.itemId = 201;
  17801. this.bigSkills = [1, 1, 1, 1, 1];
  17802. this.coin = 4000;
  17803. this.diamond = 0;
  17804. this.skillSuccessTimes = 0;
  17805. this.skillGuide = 0;
  17806. this.skillAccTimes = 0;
  17807. this.placeBallData = [];
  17808. this.shareDiamondTimes = 0;
  17809. this.dailyVideoShareTimes = 0;
  17810. this.secretary = [1, 0];
  17811. this.curSecretary = 0;
  17812. this.ballRod = [1, 0, 0, 0, 0, 1];
  17813. this.curBallRod = 5;
  17814. this.signData = 0;
  17815. this.signTime = 0;
  17816. this.drawTimes = 0;
  17817. this.drawAwardTimes = 0;
  17818. this.dailyfreeDrawTimes = 1;
  17819. this.power = 5;
  17820. this.powerTime = 0;
  17821. this.challengeTimes = 0;
  17822. this.extraSign = 0;
  17823. this.classicTimes = 0;
  17824. this.guideHelpLine = 0;
  17825. this.newUser = true;
  17826. this.rootBallFoul = 0;
  17827. this.timeoutFoul = 0;
  17828. this.roleList = [1];
  17829. }
  17830. saveData() {
  17831. let data = {};
  17832. for (let k in this) {
  17833. data[k.toString()] = this[k];
  17834. }
  17835. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17836. }
  17837. getData() {
  17838. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17839. if (ld) {
  17840. let localData = JSON.parse(ld);
  17841. if (localData) {
  17842. for (let k in this) {
  17843. let key = k.toString();
  17844. let data = localData[key];
  17845. if (data != undefined) {
  17846. this[k] = data;
  17847. }
  17848. }
  17849. }
  17850. }
  17851. }
  17852. }
  17853. class ItemData {
  17854. constructor() {
  17855. this.itemList = {};
  17856. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17857. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17858. }
  17859. saveData() {
  17860. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17861. }
  17862. getData() {
  17863. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17864. if (ld) {
  17865. let localData = JSON.parse(ld);
  17866. if (localData) {
  17867. this.itemList = localData;
  17868. }
  17869. }
  17870. }
  17871. }
  17872. class GameData {
  17873. constructor() {
  17874. this.curLevel = 0;
  17875. this.gameType = 1;
  17876. this.signIdx = 0;
  17877. this.signMax = 0;
  17878. this.rotaryTime = 0;
  17879. this.rotaryCount = 0;
  17880. this.rotaryList = [];
  17881. this.diyCount = 3;
  17882. this.awardIdx = 0;
  17883. this.shareNum = 2;
  17884. this.rankWeek = 0;
  17885. this.rankScore = 0;
  17886. this.gameCount = 0;
  17887. this.trySkill = -1;
  17888. this.tryTime = 0;
  17889. }
  17890. saveData() {
  17891. let data = {};
  17892. for (let k in this) {
  17893. data[k.toString()] = this[k];
  17894. }
  17895. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17896. }
  17897. getData() {
  17898. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17899. if (ld) {
  17900. let localData = JSON.parse(ld);
  17901. if (localData) {
  17902. for (let k in this) {
  17903. let key = k.toString();
  17904. let data = localData[key];
  17905. if (data != undefined) {
  17906. this[k] = data;
  17907. }
  17908. }
  17909. }
  17910. }
  17911. }
  17912. }
  17913. class Diy2025GameData {
  17914. constructor() {
  17915. this.challengeMode_overLev = 0;
  17916. this.xszyForClassic = false;
  17917. this.xszyForChallenge = false;
  17918. }
  17919. saveData() {
  17920. let data = {};
  17921. for (let k in this) {
  17922. data[k.toString()] = this[k];
  17923. }
  17924. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17925. }
  17926. getData() {
  17927. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17928. if (ld) {
  17929. let localData = JSON.parse(ld);
  17930. if (localData) {
  17931. for (let k in this) {
  17932. let key = k.toString();
  17933. let data = localData[key];
  17934. if (data != undefined) {
  17935. this[k] = data;
  17936. }
  17937. }
  17938. }
  17939. }
  17940. }
  17941. }
  17942. class DataMgr {
  17943. static Init() {
  17944. this.userData = new UserData();
  17945. this.gameData = new GameData();
  17946. this.itemData = new ItemData();
  17947. this.diyGameData = new Diy2025GameData();
  17948. this.userData.getData();
  17949. this.gameData.getData();
  17950. this.itemData.getData();
  17951. this.diyGameData.getData();
  17952. this.roleId = this.userData.roleId;
  17953. this.resetUse();
  17954. }
  17955. static isNewDay() {
  17956. Moyu.isNewDay(this, (isnew) => {
  17957. xGame.common.isNewDay = isnew;
  17958. if (!isnew)
  17959. return;
  17960. DataMgr.setShareDiamondTimes(0, false);
  17961. DataMgr.setDailyVideoShareTimes(0, false);
  17962. DataMgr.setDailyfreeDrawTimes(1);
  17963. DataMgr.setExtraSign(0);
  17964. });
  17965. }
  17966. static deletData() {
  17967. Laya.LocalStorage.clear();
  17968. }
  17969. static upRankData() {
  17970. let num = xGame.common.getAllStarNum();
  17971. if (num > 0)
  17972. Moyu.upRankData(xGame.common.curRankID, num);
  17973. }
  17974. static addItem(id, count = 1) {
  17975. let v = this.itemData.itemList[id];
  17976. if (!v)
  17977. v = { id: id, count: count, adnum: 0, active: true };
  17978. else {
  17979. if (v.active) {
  17980. v.count += count;
  17981. }
  17982. else {
  17983. v.count = count;
  17984. v.active = true;
  17985. }
  17986. }
  17987. this.itemData.itemList[id] = v;
  17988. xGame.soundMgr.playGetSound();
  17989. this.saveItemData();
  17990. }
  17991. static hasItem(id) {
  17992. let v = this.itemData.itemList[id];
  17993. if (v && v.active)
  17994. return true;
  17995. return false;
  17996. }
  17997. static getItem(id) {
  17998. let v = this.itemData.itemList[id];
  17999. return v;
  18000. }
  18001. static getItemCount(id) {
  18002. let v = this.itemData.itemList[id];
  18003. if (v && v.active)
  18004. return v.count;
  18005. return 0;
  18006. }
  18007. static getItemAd(id) {
  18008. let v = this.itemData.itemList[id];
  18009. if (v) {
  18010. return v.adnum;
  18011. }
  18012. return 0;
  18013. }
  18014. static onItemAd(id, num = 1) {
  18015. let v = this.itemData.itemList[id];
  18016. if (!v)
  18017. v = { id: id, count: 1, adnum: num, active: false };
  18018. else
  18019. v.adnum += num;
  18020. this.itemData.itemList[id] = v;
  18021. this.saveItemData();
  18022. }
  18023. static costItem(id, count) {
  18024. let v = this.itemData.itemList[id];
  18025. if (v && v.active) {
  18026. if (v.count < count)
  18027. return false;
  18028. else {
  18029. v.count -= count;
  18030. this.itemData.itemList[id] = v;
  18031. return true;
  18032. }
  18033. }
  18034. return false;
  18035. }
  18036. static resetUse() {
  18037. this.dressId = this.userData.dressId;
  18038. this.itemId = this.userData.itemId;
  18039. }
  18040. static passLevel() {
  18041. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18042. this.gameData.curLevel++;
  18043. this.curLevel = this.gameData.curLevel;
  18044. this.saveGameData();
  18045. }
  18046. static useRole(id) {
  18047. this.roleId = id;
  18048. if (this.hasRole(id)) {
  18049. this.userData.roleId = id;
  18050. this.saveUserData();
  18051. }
  18052. }
  18053. static addRole(id) {
  18054. if (this.hasRole(id))
  18055. return;
  18056. this.userData.roleList.push(id);
  18057. this.saveUserData();
  18058. }
  18059. static hasRole(id) {
  18060. return this.userData.roleList.indexOf(id) >= 0;
  18061. }
  18062. static gemEnough(num) {
  18063. return this.userData.gemNum >= num;
  18064. }
  18065. static roleHasAd(id) {
  18066. let count = this.userData.roleAds[id];
  18067. if (count != undefined && count >= 0)
  18068. return true;
  18069. else
  18070. return false;
  18071. }
  18072. static saveUserData(time = 500, event, arg) {
  18073. if (this.userSaving)
  18074. return;
  18075. this.userSaving = true;
  18076. Laya.timer.once(time, this, () => {
  18077. this.userSaving = false;
  18078. this.userData.saveData();
  18079. if (event)
  18080. xGame.eventMgr.event(event, arg);
  18081. });
  18082. }
  18083. static saveGameData() {
  18084. if (this.gameSaving)
  18085. return;
  18086. this.gameSaving = true;
  18087. Laya.timer.once(1000, this, () => {
  18088. this.gameSaving = false;
  18089. this.gameData.saveData();
  18090. });
  18091. }
  18092. static saveItemData() {
  18093. let fun = () => {
  18094. this.itemData.saveData();
  18095. };
  18096. Laya.timer.clear(this, fun);
  18097. Laya.timer.once(500, this, fun);
  18098. }
  18099. static saveData() {
  18100. this.saveUserData();
  18101. this.saveGameData();
  18102. }
  18103. static getBigSkillList() {
  18104. return this.userData.bigSkills;
  18105. }
  18106. static getBigSkillByIndex(index) {
  18107. return this.userData.bigSkills[index];
  18108. }
  18109. static setBigSkill(index, val, addUp = true) {
  18110. if (addUp) {
  18111. this.userData.bigSkills[index] += val;
  18112. }
  18113. else {
  18114. this.userData.bigSkills[index] = val;
  18115. }
  18116. this.saveUserData();
  18117. }
  18118. static coinEnough(need) {
  18119. if (typeof need != "number") {
  18120. console.error("金币格式错误");
  18121. return;
  18122. }
  18123. return this.userData.coin >= need;
  18124. }
  18125. static setCoin(val) {
  18126. if (typeof val != "number") {
  18127. return;
  18128. }
  18129. this.userData.coin += val;
  18130. this.saveUserData();
  18131. xGame.eventMgr.event(COIN_CHANGE);
  18132. this.updateUserInfo2Server("jb");
  18133. }
  18134. static setCoinFormServer(val) {
  18135. if (typeof val != "number") {
  18136. return;
  18137. }
  18138. this.userData.coin = val;
  18139. this.saveUserData();
  18140. xGame.eventMgr.event(COIN_CHANGE);
  18141. }
  18142. static getCoin() {
  18143. return this.userData.coin;
  18144. }
  18145. static diamondEnough(need) {
  18146. if (typeof need != "number") {
  18147. console.error("金币格式错误");
  18148. return;
  18149. }
  18150. return this.userData.diamond >= need;
  18151. }
  18152. static setDiamond(val) {
  18153. if (typeof val != "number") {
  18154. return;
  18155. }
  18156. this.userData.diamond += val;
  18157. this.saveUserData();
  18158. xGame.eventMgr.event(DIAMOND_CHANGE);
  18159. this.updateUserInfo2Server("zs");
  18160. }
  18161. static setDiamondFormServer(val) {
  18162. if (typeof val != "number") {
  18163. return;
  18164. }
  18165. this.userData.diamond = val;
  18166. this.saveUserData();
  18167. xGame.eventMgr.event(DIAMOND_CHANGE);
  18168. }
  18169. static getDiamond() {
  18170. return this.userData.diamond;
  18171. }
  18172. static getSkillSuccessTimes() {
  18173. return this.userData.skillSuccessTimes;
  18174. }
  18175. static setSkillSuccessTimes(val, addUp = true) {
  18176. if (addUp)
  18177. this.userData.skillSuccessTimes += val;
  18178. else
  18179. this.userData.skillSuccessTimes = val;
  18180. this.saveUserData();
  18181. }
  18182. static getSkillAccTimes() {
  18183. return this.userData.skillAccTimes;
  18184. }
  18185. static setSkillAccTimes(val) {
  18186. this.userData.skillAccTimes += val;
  18187. this.saveUserData();
  18188. }
  18189. static getSkillGuide() {
  18190. if (!xGame.common.openGuide) {
  18191. return 1;
  18192. }
  18193. return this.userData.skillGuide;
  18194. }
  18195. static setSkillGuide(val) {
  18196. this.userData.skillGuide = val;
  18197. this.saveUserData();
  18198. }
  18199. static getPlaceBallLevelList() {
  18200. return this.userData.placeBallData;
  18201. }
  18202. static getPlaceBallLevel(level) {
  18203. let arr = this.userData.placeBallData;
  18204. let index = level - 1;
  18205. let out;
  18206. if (arr[index]) {
  18207. out = arr[index];
  18208. }
  18209. else {
  18210. let max = arr.length;
  18211. if (max == index) {
  18212. out = {
  18213. star: 0,
  18214. play: true,
  18215. isCur: true,
  18216. getAward: false
  18217. };
  18218. }
  18219. else {
  18220. out = {
  18221. star: 0,
  18222. play: false,
  18223. getAward: false
  18224. };
  18225. }
  18226. }
  18227. return out;
  18228. }
  18229. static setPlaceBallLevel(level, star) {
  18230. let arr = this.userData.placeBallData;
  18231. let index = level - 1;
  18232. if (arr[index]) {
  18233. arr[index].star = Math.max(arr[index].star, star);
  18234. }
  18235. else {
  18236. let max = arr.length;
  18237. if (max == index) {
  18238. arr.push({
  18239. star: star,
  18240. play: true,
  18241. getAward: false
  18242. });
  18243. }
  18244. else {
  18245. console.error("关卡存储出错");
  18246. }
  18247. }
  18248. this.saveUserData();
  18249. }
  18250. static setPlaceBallAward(level) {
  18251. let arr = this.userData.placeBallData;
  18252. let index = level - 1;
  18253. if (arr[index]) {
  18254. arr[index].getAward = true;
  18255. }
  18256. this.saveUserData();
  18257. }
  18258. static getShareDiamondTimes() {
  18259. return this.userData.shareDiamondTimes;
  18260. }
  18261. static setShareDiamondTimes(val, addUp = true) {
  18262. if (addUp) {
  18263. this.userData.shareDiamondTimes += val;
  18264. }
  18265. else {
  18266. this.userData.shareDiamondTimes = val;
  18267. }
  18268. this.saveUserData();
  18269. }
  18270. static getDailyVideoShareTimes() {
  18271. return this.userData.dailyVideoShareTimes;
  18272. }
  18273. static setDailyVideoShareTimes(val, addUp = true) {
  18274. if (addUp) {
  18275. this.userData.dailyVideoShareTimes += val;
  18276. }
  18277. else {
  18278. this.userData.dailyVideoShareTimes = val;
  18279. }
  18280. this.saveUserData();
  18281. }
  18282. static getSecretary(index) {
  18283. return this.userData.secretary[index];
  18284. }
  18285. static setSecretary(index, val) {
  18286. this.userData.secretary[index] = val;
  18287. this.saveUserData();
  18288. }
  18289. static getCurSecretary() {
  18290. return this.userData.curSecretary;
  18291. }
  18292. static setCurSecretary(index) {
  18293. this.userData.curSecretary = index;
  18294. this.saveUserData();
  18295. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18296. }
  18297. static getBallRod(index) {
  18298. return this.userData.ballRod[index];
  18299. }
  18300. static setBallRod(index, val) {
  18301. this.userData.ballRod[index] = val;
  18302. this.saveUserData();
  18303. }
  18304. static setBallRodFormServer(haveQiuGanJsonStr) {
  18305. if (!haveQiuGanJsonStr) {
  18306. console.log("setBallRodFormServer数据为空或未定义");
  18307. return;
  18308. }
  18309. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18310. const keys = Object.keys(haveQiuGanJsonObj);
  18311. keys.forEach(key => {
  18312. let v = haveQiuGanJsonObj[key];
  18313. let k = parseInt(key);
  18314. let idx = k - 1;
  18315. console.log('zh:更新IDX = ' + idx);
  18316. console.log('this.userData.ballRod[idx]===' + this.userData.ballRod[idx]);
  18317. if (this.userData.ballRod[idx] === 0) {
  18318. console.log('zh: uuuuu ' + (k - 1));
  18319. this.userData.ballRod[k - 1] = 1;
  18320. this.saveUserData();
  18321. }
  18322. });
  18323. }
  18324. static getCurBallRod() {
  18325. return this.userData.curBallRod;
  18326. }
  18327. static setCurBallRod(index) {
  18328. this.userData.curBallRod = index;
  18329. this.saveUserData();
  18330. }
  18331. static setSignData(val) {
  18332. this.userData.signData = val;
  18333. this.saveUserData();
  18334. }
  18335. static getSignData() {
  18336. return this.userData.signData;
  18337. }
  18338. static setSignTime(val) {
  18339. this.userData.signTime = val;
  18340. this.saveUserData();
  18341. }
  18342. static getSignTime() {
  18343. return this.userData.signTime;
  18344. }
  18345. static getDrawTimes() {
  18346. return this.userData.drawTimes;
  18347. }
  18348. static setDrawTimes(val, addUp = true) {
  18349. if (addUp) {
  18350. this.userData.drawTimes += val;
  18351. }
  18352. else {
  18353. this.userData.drawTimes = val;
  18354. }
  18355. this.saveUserData();
  18356. }
  18357. static getDrawAwardTimes() {
  18358. return this.userData.drawAwardTimes;
  18359. }
  18360. static setDrawAwardTimes(val) {
  18361. this.userData.drawAwardTimes = val;
  18362. this.saveUserData();
  18363. }
  18364. static getDailyfreeDrawTimes() {
  18365. return this.userData.dailyfreeDrawTimes;
  18366. }
  18367. static setDailyfreeDrawTimes(val) {
  18368. this.userData.dailyfreeDrawTimes = val;
  18369. this.saveUserData();
  18370. }
  18371. static setPower(val, addUp = true) {
  18372. if (addUp)
  18373. this.userData.power += val;
  18374. else
  18375. this.userData.power = val;
  18376. if (this.userData.power >= xGame.common.maxPower) {
  18377. this.userData.power = xGame.common.maxPower;
  18378. }
  18379. xGame.eventMgr.event(POWER_CHANGE, val);
  18380. this.saveUserData();
  18381. }
  18382. static getPower() {
  18383. return this.userData.power;
  18384. }
  18385. static setPowerTime(val) {
  18386. this.userData.powerTime = val;
  18387. this.saveUserData();
  18388. }
  18389. static getPowerTime() {
  18390. return this.userData.powerTime;
  18391. }
  18392. static powerEnough() {
  18393. return this.getPower() > 0;
  18394. }
  18395. static getChallengeTimes() {
  18396. return this.userData.challengeTimes;
  18397. }
  18398. static setChallengeTimes(val) {
  18399. this.userData.challengeTimes += val;
  18400. this.saveUserData();
  18401. }
  18402. static getExtraSign() {
  18403. return this.userData.extraSign;
  18404. }
  18405. static setExtraSign(val) {
  18406. this.userData.extraSign = val;
  18407. this.saveUserData();
  18408. }
  18409. static getClassicTimes() {
  18410. return this.userData.classicTimes;
  18411. }
  18412. static setClassicTimes() {
  18413. this.userData.classicTimes += 1;
  18414. this.saveUserData();
  18415. }
  18416. static getGuideHelpLine() {
  18417. return this.userData.guideHelpLine;
  18418. }
  18419. static setGuideHelpLine() {
  18420. this.userData.guideHelpLine = 1;
  18421. this.saveUserData();
  18422. }
  18423. static getNewUser() {
  18424. return this.userData.newUser;
  18425. }
  18426. static setNewUser() {
  18427. this.userData.newUser = false;
  18428. this.saveUserData();
  18429. }
  18430. static getRootBallFoul() {
  18431. return this.userData.rootBallFoul;
  18432. }
  18433. static setRootBallFoul() {
  18434. this.userData.rootBallFoul = 1;
  18435. this.saveUserData();
  18436. }
  18437. static getTimeoutFoul() {
  18438. return this.userData.timeoutFoul;
  18439. }
  18440. static setTimeoutFoul() {
  18441. this.userData.timeoutFoul = 1;
  18442. this.saveUserData();
  18443. }
  18444. static saveDiyGameData() {
  18445. if (this.diyGameSaving)
  18446. return;
  18447. this.diyGameSaving = true;
  18448. Laya.timer.once(500, this, () => {
  18449. this.diyGameSaving = false;
  18450. this.diyGameData.saveData();
  18451. });
  18452. }
  18453. static getChallengeMode_overLev() {
  18454. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18455. return this.challengeMode_overLev;
  18456. }
  18457. static setChallengeMode_overLev(levNum) {
  18458. this.diyGameData.challengeMode_overLev = levNum;
  18459. this.saveDiyGameData();
  18460. }
  18461. static updateUserInfo2Server(type, count = 0) {
  18462. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18463. if (userInfoData == null) {
  18464. return;
  18465. }
  18466. let reqData = xGame.httpMgr.getReqData();
  18467. let rd = JSON.parse(reqData);
  18468. rd.dataType = type;
  18469. let dataValue = 0;
  18470. if (type == "zs") {
  18471. dataValue = this.getDiamond();
  18472. }
  18473. if (type == "jb") {
  18474. dataValue = this.getCoin();
  18475. }
  18476. rd.dataValue = dataValue;
  18477. reqData = JSON.stringify(rd);
  18478. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18479. try {
  18480. let code = res.code;
  18481. let data = res.data;
  18482. if (code == 401) {
  18483. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18484. console.log('zh:保存资产信息失败,请重新登录 ');
  18485. return;
  18486. }
  18487. if (code == 200) {
  18488. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18489. }
  18490. else {
  18491. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18492. }
  18493. }
  18494. catch (error) {
  18495. console.log('error=' + error);
  18496. alert("Please check your network connection.");
  18497. }
  18498. finally {
  18499. }
  18500. });
  18501. }
  18502. static getUserZiChanInfo() {
  18503. console.log('zh:开始获取用户资产信息');
  18504. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18505. if (userInfoData == null) {
  18506. return;
  18507. }
  18508. let reqData = xGame.httpMgr.getReqData();
  18509. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18510. try {
  18511. console.log('zh:buySp res = ' + JSON.stringify(res));
  18512. let code = res.code;
  18513. let msg = res.msg;
  18514. if (code == 401) {
  18515. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18516. alert(TIP_MSG_key.pleaseLoginIn);
  18517. return;
  18518. }
  18519. if (code == 200) {
  18520. let d = res.data;
  18521. let zuanShi = d.zuanShi;
  18522. let jinBi = d.jinBi;
  18523. let haveQiuGanJson = d.haveQiuGanJson;
  18524. DataMgr.setDiamondFormServer(zuanShi);
  18525. DataMgr.setCoinFormServer(jinBi);
  18526. console.log('zh:更新球杆信息');
  18527. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18528. }
  18529. else {
  18530. alert(msg);
  18531. }
  18532. }
  18533. catch (error) {
  18534. console.log('error=' + error);
  18535. alert(error);
  18536. }
  18537. finally {
  18538. }
  18539. });
  18540. }
  18541. }
  18542. DataMgr.isNewUser = false;
  18543. DataMgr.fristEnter = true;
  18544. DataMgr.levelType = 0;
  18545. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18546. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18547. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18548. DataMgr.challengeMode_overLev = 0;
  18549. DataMgr.xszyForClassic = false;
  18550. DataMgr.xszyForChallenge = false;
  18551. DataMgr.awardId = 0;
  18552. DataMgr.awardCoin = 0;
  18553. DataMgr.sceneId = -1;
  18554. DataMgr.tryId = 0;
  18555. DataMgr.curLevel = 1;
  18556. DataMgr.vipLevel = 0;
  18557. DataMgr.maxLevel = 0;
  18558. DataMgr.awardRatio = 1;
  18559. DataMgr.gameList = [];
  18560. DataMgr.rankList = [];
  18561. DataMgr.recoverTime = 480000;
  18562. DataMgr.minScore = 0;
  18563. DataMgr.rankDis = 0;
  18564. DataMgr.userSaving = false;
  18565. DataMgr.gameSaving = false;
  18566. DataMgr.diyGameSaving = false;
  18567. class D3Tween extends Laya.Script3D {
  18568. constructor() {
  18569. super();
  18570. this.isInited = false;
  18571. }
  18572. ;
  18573. init() {
  18574. if (this.isInited)
  18575. return;
  18576. this.isInited = true;
  18577. this.gameObj = this.owner;
  18578. this.transform = this.gameObj.transform;
  18579. }
  18580. get rotX() {
  18581. return this.transform.localRotationEulerX;
  18582. }
  18583. set rotX(v) {
  18584. this.transform.localRotationEulerX = v;
  18585. }
  18586. get rotY() {
  18587. return this.transform.localRotationEulerY;
  18588. }
  18589. set rotY(v) {
  18590. this.transform.localRotationEulerY = v;
  18591. }
  18592. get rotZ() {
  18593. return this.transform.localRotationEulerZ;
  18594. }
  18595. set rotZ(v) {
  18596. this.transform.localRotationEulerZ = v;
  18597. }
  18598. get posX() {
  18599. return this.transform.localPositionX;
  18600. }
  18601. set posX(v) {
  18602. this.transform.localPositionX = v;
  18603. }
  18604. get posY() {
  18605. return this.transform.localPositionY;
  18606. }
  18607. set posY(v) {
  18608. this.transform.localPositionY = v;
  18609. }
  18610. get posZ() {
  18611. return this.transform.localPositionZ;
  18612. }
  18613. set posZ(v) {
  18614. this.transform.localPositionZ = v;
  18615. }
  18616. get rotation() {
  18617. return this.transform.localRotation;
  18618. }
  18619. set rotation(v) {
  18620. this.transform.localRotation = v;
  18621. }
  18622. }
  18623. class D2Hole extends Laya.Script {
  18624. constructor() { super(); }
  18625. onTriggerEnter(collider) {
  18626. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18627. return;
  18628. }
  18629. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18630. if (collider.owner["mySrc"].isRunSkillAni) {
  18631. return;
  18632. }
  18633. if (collider.owner["mySrc"].number != 0) {
  18634. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18635. }
  18636. xGame.common.ballColliHole(collider);
  18637. xGame.common.recoverCameraView();
  18638. }
  18639. }
  18640. }
  18641. class Table extends Laya.Script3D {
  18642. constructor() {
  18643. super();
  18644. this.isSetBorder = false;
  18645. this.inited = false;
  18646. }
  18647. ;
  18648. onAwake() {
  18649. this.init();
  18650. }
  18651. init() {
  18652. if (this.inited)
  18653. return;
  18654. this.inited = true;
  18655. this.gameObj = this.owner;
  18656. this.border = this.gameObj.getChildByName("border");
  18657. }
  18658. setBorderPos() {
  18659. if (this.isSetBorder)
  18660. return;
  18661. this.isSetBorder = true;
  18662. let ui = xGame.common.gameUI.ui;
  18663. let bar1 = this.border.getChildByName("bar1");
  18664. let bar2 = this.border.getChildByName("bar2");
  18665. let bar3 = this.border.getChildByName("bar3");
  18666. let bar4 = this.border.getChildByName("bar4");
  18667. let bar5 = this.border.getChildByName("bar5");
  18668. let bar6 = this.border.getChildByName("bar6");
  18669. this.setInfo(bar1, ui.border.bar1, "box");
  18670. this.setInfo(bar2, ui.border.bar2, "box");
  18671. this.setInfo(bar3, ui.border.bar3, "box");
  18672. this.setInfo(bar4, ui.border.bar4, "box");
  18673. this.setInfo(bar5, ui.border.bar5, "box");
  18674. this.setInfo(bar6, ui.border.bar6, "box");
  18675. let circle1 = this.border.getChildByName("circle1");
  18676. let circle2 = this.border.getChildByName("circle2");
  18677. let circle3 = this.border.getChildByName("circle3");
  18678. let circle4 = this.border.getChildByName("circle4");
  18679. let circle5 = this.border.getChildByName("circle5");
  18680. let circle6 = this.border.getChildByName("circle6");
  18681. this.setInfo(circle1, ui.border.circle1, "circle");
  18682. this.setInfo(circle2, ui.border.circle2, "circle");
  18683. this.setInfo(circle3, ui.border.circle3, "circle");
  18684. this.setInfo(circle4, ui.border.circle4, "circle");
  18685. this.setInfo(circle5, ui.border.circle5, "circle");
  18686. this.setInfo(circle6, ui.border.circle6, "circle");
  18687. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18688. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18689. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18690. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  18691. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  18692. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  18693. let arr = xGame.common.gameMgr.holePosList;
  18694. xGame.common.gameMgr.posObj = {
  18695. "1": arr[0],
  18696. "3": arr[2],
  18697. "4": arr[3],
  18698. "6": arr[5]
  18699. };
  18700. }
  18701. initHolePos(x, y) {
  18702. if (x < 300)
  18703. x += 25;
  18704. else if (x > 1000)
  18705. x -= 25;
  18706. else if (y > 200)
  18707. y -= 10;
  18708. else
  18709. y += 10;
  18710. if (y < 200)
  18711. y += 30;
  18712. else if (y > 500)
  18713. y -= 30;
  18714. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  18715. }
  18716. setInfo(d3Obj, d2Obj, type) {
  18717. let ui = xGame.common.gameUI.ui;
  18718. let sprite = new Laya.Sprite();
  18719. ui.border.displayObject.addChild(sprite);
  18720. let colli = xGame.common.getCollider(type);
  18721. sprite.addComponentIntance(colli);
  18722. let rigy = xGame.common.getRigbody();
  18723. rigy.type = "static";
  18724. sprite.addComponentIntance(rigy);
  18725. let d3Pos = d3Obj.transform.position;
  18726. xGame.common.pos3to2Convert(d3Pos);
  18727. let scaleX = d3Obj.transform.localScaleX;
  18728. let scaleZ = d3Obj.transform.localScaleZ;
  18729. let width = xGame.common.scale3to2Convert(scaleZ);
  18730. let height = xGame.common.scale3to2Convert(scaleX);
  18731. sprite.pivotX = width / 2;
  18732. sprite.pivotY = height / 2;
  18733. sprite.x = d3Pos.x;
  18734. sprite.y = d3Pos.y;
  18735. sprite.width = width;
  18736. sprite.height = height;
  18737. d2Obj.x = d3Pos.x;
  18738. d2Obj.y = d3Pos.y;
  18739. d2Obj.width = width;
  18740. d2Obj.height = height;
  18741. if (type == "box") {
  18742. colli.width = width;
  18743. colli.height = height;
  18744. colli.isSensor = false;
  18745. colli.label = "border";
  18746. }
  18747. else {
  18748. colli.radius = width / 2;
  18749. colli.isSensor = true;
  18750. colli.label = "hole";
  18751. sprite.addComponent(D2Hole);
  18752. }
  18753. }
  18754. }
  18755. class D3World extends Laya.Script3D {
  18756. constructor() {
  18757. super();
  18758. this.loadNum = 0;
  18759. this.setLoadNum = 7;
  18760. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  18761. }
  18762. onAwake() {
  18763. }
  18764. loadScene() {
  18765. this.scene = this.owner;
  18766. let url = `res/unityRes/root.lh`;
  18767. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  18768. this.scene.addChild(prefab);
  18769. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  18770. this.putCameraInfo();
  18771. this.camera.enableHDR = false;
  18772. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  18773. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  18774. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  18775. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  18776. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  18777. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  18778. this.knife.active = false;
  18779. this.loadD3Obj();
  18780. }));
  18781. }
  18782. putCameraInfo() {
  18783. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  18784. this.cameraObj = new cameraType();
  18785. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  18786. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  18787. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  18788. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  18789. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  18790. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  18791. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  18792. this.visitAngleChild.init();
  18793. this.visitRootObj.posX = this.visitAngleChild.posX;
  18794. this.visitRootObj.posY = this.visitAngleChild.posY;
  18795. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  18796. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  18797. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  18798. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  18799. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18800. xGame.common.showOneCamera("mainCamera");
  18801. }
  18802. loadD3Obj() {
  18803. this.loadTable();
  18804. this.loadRoom();
  18805. this.loadInHoleParticial();
  18806. this.loadIceParticial();
  18807. this.loadHitParticial();
  18808. this.loadFireworksParticial();
  18809. this.loadBall();
  18810. }
  18811. loadInHoleParticial() {
  18812. this.loadD3Res("inHoleEft", "", (prefab) => {
  18813. prefab.addComponent(Partical);
  18814. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  18815. });
  18816. }
  18817. loadIceParticial() {
  18818. this.loadD3Res("iceEft", "", (prefab) => {
  18819. prefab.addComponent(Partical);
  18820. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  18821. });
  18822. }
  18823. loadHitParticial() {
  18824. this.loadD3Res("hitEft", "", (prefab) => {
  18825. prefab.addComponent(Partical);
  18826. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18827. });
  18828. }
  18829. loadFireworksParticial() {
  18830. this.loadD3Res("fireworksEft", "", (prefab) => {
  18831. prefab.addComponent(Partical);
  18832. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18833. });
  18834. }
  18835. loadBall(index = 1) {
  18836. this.loadD3Res("ball", index, (prefab) => {
  18837. this.ballPrefab = prefab;
  18838. this.ballPrefab.addComponent(Ball);
  18839. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18840. });
  18841. }
  18842. loadTable(index = 1) {
  18843. this.loadD3Res("table", index, (prefab) => {
  18844. this.tableSrc = prefab.addComponent(Table);
  18845. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18846. this.d3Hand.init();
  18847. this.tableRoot.addChild(prefab);
  18848. });
  18849. }
  18850. loadRoom(index = 1) {
  18851. this.loadD3Res("room", index, (prefab) => {
  18852. this.roomRoot.addChild(prefab);
  18853. });
  18854. }
  18855. loadD3Res(type, index, callback) {
  18856. let url = `res/unityRes/${type}${index}.lh`;
  18857. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18858. callback && callback(prefab);
  18859. this.checkResLoad();
  18860. }));
  18861. }
  18862. checkResLoad() {
  18863. this.loadNum++;
  18864. if (this.loadNum >= this.setLoadNum) {
  18865. xGame.eventMgr.event(D3RES_LOADED);
  18866. }
  18867. }
  18868. prePlayEft() {
  18869. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  18870. eft.transform.localPositionX = 0;
  18871. eft.transform.localPositionY = -5;
  18872. eft.transform.localPositionZ = 0;
  18873. eft.active = true;
  18874. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  18875. ice.transform.localPositionX = 0;
  18876. ice.transform.localPositionY = -5;
  18877. ice.transform.localPositionZ = 0;
  18878. ice.active = true;
  18879. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  18880. hit.transform.localPositionX = 0;
  18881. hit.transform.localPositionY = -5;
  18882. hit.transform.localPositionZ = 0;
  18883. hit.active = true;
  18884. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  18885. fireworks.transform.localPositionX = 0;
  18886. fireworks.transform.localPositionY = -5;
  18887. fireworks.transform.localPositionZ = 0;
  18888. fireworks.active = true;
  18889. }
  18890. }
  18891. class cameraType {
  18892. }
  18893. class MoyuMgr$1 {
  18894. static initMoyu() {
  18895. this.moyuView = new MoyuView$1();
  18896. Laya.stage.addChild(this.moyuView.ui.displayObject);
  18897. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  18898. this.moyuView.ui.displayObject.zOrder = 1000;
  18899. this.moyuView.init();
  18900. this.moyuView.showTip(true);
  18901. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  18902. window['XApk'] = this;
  18903. }
  18904. static showAge(show) {
  18905. if (this.moyuView)
  18906. this.moyuView.showAge(show);
  18907. }
  18908. static onPlatMsg(idx) {
  18909. if (!MoyuMgr$1.moyuView)
  18910. return;
  18911. if (idx == '0') {
  18912. MoyuMgr$1.moyuView.showTip(false);
  18913. }
  18914. }
  18915. static showAgree(call) {
  18916. if (this.moyuView)
  18917. this.moyuView.showAgree(call);
  18918. else
  18919. call && call();
  18920. }
  18921. static showXy(type = 1) {
  18922. if (this.moyuView)
  18923. this.moyuView.showXy(type);
  18924. }
  18925. }
  18926. MoyuMgr$1.isAdvise = false;
  18927. class MoyuView$1 {
  18928. constructor() {
  18929. this.ysxyNum = 1;
  18930. this.ysJson = null;
  18931. this.ui = ui_UIMoyu.createInstance();
  18932. }
  18933. init() {
  18934. this.ui.mainBg.visible = false;
  18935. this.ui.xyNode.visible = false;
  18936. this.ui.ageNode.visible = false;
  18937. this.ui.tipNode.visible = false;
  18938. this.ui.rnNode.visible = false;
  18939. this.ui.fcmNode.visible = false;
  18940. this.ui.ageTip.visible = false;
  18941. this.ui.msgNode.visible = false;
  18942. this.ui.visible = false;
  18943. this.ui.xyNode.xyList.setVirtual();
  18944. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  18945. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  18946. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  18947. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  18948. this.ui.xyNode.btnKnown.visible = false;
  18949. this.ui.xyNode.xy1.visible = false;
  18950. this.ui.xyNode.xy2.visible = false;
  18951. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  18952. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  18953. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  18954. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  18955. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  18956. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  18957. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  18958. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  18959. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  18960. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  18961. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  18962. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  18963. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  18964. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  18965. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  18966. this.ysxyNum = 2;
  18967. }
  18968. }
  18969. onClick(obj) {
  18970. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18971. switch (obj) {
  18972. case this.ui.ageTip:
  18973. if (Moyu.isTTApk) {
  18974. this.ui.ageNode.visible = true;
  18975. this.ui.mainBg.visible = true;
  18976. }
  18977. break;
  18978. case this.ui.tipNode:
  18979. this.showTip(false);
  18980. break;
  18981. case this.ui.ageNode.btnAge:
  18982. this.ui.ageNode.visible = false;
  18983. this.ui.mainBg.visible = false;
  18984. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  18985. this.ui.visible = false;
  18986. break;
  18987. case this.ui.xyNode.btnXy3:
  18988. case this.ui.xyNode.btnXy1:
  18989. this.loadXy(1);
  18990. break;
  18991. case this.ui.xyNode.btnXy2:
  18992. this.loadXy(2);
  18993. break;
  18994. case this.ui.xyNode.btnBack:
  18995. this.ui.xyNode.xy1.visible = true;
  18996. this.ui.xyNode.xy2.visible = false;
  18997. break;
  18998. case this.ui.xyNode.btnKnown:
  18999. this.ui.xyNode.visible = false;
  19000. this.ui.mainBg.visible = false;
  19001. this.ui.visible = false;
  19002. break;
  19003. case this.ui.rnNode.btnCheck:
  19004. this.check();
  19005. break;
  19006. case this.ui.rnNode.btnExit:
  19007. case this.ui.xyNode.btnNo:
  19008. this.ysxyNum--;
  19009. if (this.ysxyNum > 0)
  19010. this.showMsg("Refuse to quit the game once again");
  19011. else {
  19012. Moyu.userAgree(false);
  19013. Moyu.exit();
  19014. }
  19015. break;
  19016. case this.ui.xyNode.btnSure:
  19017. case this.ui.xyNode.btnYes:
  19018. DataMgr.userData.isAgree = true;
  19019. DataMgr.saveUserData();
  19020. this.onAgree();
  19021. break;
  19022. case this.ui.rnNode.btnDone:
  19023. this.ui.rnNode.visible = false;
  19024. this.ui.visible = false;
  19025. break;
  19026. case this.ui.fcmNode.btnRn:
  19027. this.showRn();
  19028. break;
  19029. }
  19030. }
  19031. showTip(show) {
  19032. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19033. return;
  19034. if (show) {
  19035. MoyuMgr$1.isAdvise = true;
  19036. this.ui.visible = true;
  19037. this.ui.tipNode.visible = true;
  19038. this.ui.tipNode.alpha = 1;
  19039. Laya.timer.once(1000, this, this.showTip, [false]);
  19040. }
  19041. else {
  19042. this.ui.tipNode.alpha = 1;
  19043. this.ui.tipNode.visible = true;
  19044. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19045. this.ui.tipNode.visible = false;
  19046. MoyuMgr$1.isAdvise = false;
  19047. }), 1000);
  19048. }
  19049. }
  19050. showAge(show, px = 0, py = 0) {
  19051. if (Moyu.platType > 10 && !Moyu.isIos) {
  19052. this.ui.ageTip.x = px;
  19053. this.ui.ageTip.y = py;
  19054. this.ui.ageTip.visible = show;
  19055. if (show)
  19056. this.ui.visible = true;
  19057. }
  19058. }
  19059. showAgree(call) {
  19060. this.agreeCall = call;
  19061. this.onAgree();
  19062. return;
  19063. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19064. this.showXy(0);
  19065. }
  19066. else
  19067. this.onAgree();
  19068. }
  19069. onAgree() {
  19070. if (!this.ui.ageNode.visible)
  19071. this.ui.visible = false;
  19072. this.ui.xyNode.visible = false;
  19073. Moyu.userAgree(true);
  19074. this.showAge(false);
  19075. this.agreeCall && this.agreeCall();
  19076. this.showRn();
  19077. }
  19078. showMsg(txt) {
  19079. this.ui.msgNode.txtMsg.text = txt;
  19080. this.ui.msgNode.visible = true;
  19081. this.ui.msgNode.alpha = 1;
  19082. this.ui.visible = true;
  19083. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19084. this.ui.msgNode.visible = false;
  19085. }), 2500, true);
  19086. }
  19087. showRn() {
  19088. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19089. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19090. this.ui.rnNode.rn1.visible = true;
  19091. this.ui.rnNode.rn2.visible = false;
  19092. this.ui.rnNode.rn3.visible = false;
  19093. this.ui.rnNode.rn4.visible = false;
  19094. this.ui.rnNode.visible = true;
  19095. this.ui.mainBg.visible = true;
  19096. this.ui.rnNode.btnDone.visible = false;
  19097. this.ui.rnNode.btnExit.visible = true;
  19098. this.ui.rnNode.btnCheck.visible = true;
  19099. this.ui.fcmNode.visible = false;
  19100. this.ui.visible = true;
  19101. return;
  19102. }
  19103. }
  19104. this.showFcm();
  19105. }
  19106. showFcm() {
  19107. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19108. Moyu.initFCM(true);
  19109. if (Moyu.gameTime < 1)
  19110. this.fcmLoop();
  19111. else if (Moyu.gameTime < 999)
  19112. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19113. }
  19114. }
  19115. fcmLoop() {
  19116. if (Moyu.gameTime < 1) {
  19117. this.ui.rnNode.visible = false;
  19118. this.ui.fcmNode.visible = true;
  19119. this.ui.mainBg.visible = true;
  19120. this.ui.visible = true;
  19121. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19122. Laya.timer.clear(this.ui, this.fcmLoop);
  19123. }
  19124. }
  19125. check() {
  19126. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19127. this.ui.rnNode.rn1.visible = false;
  19128. this.ui.rnNode.rn2.visible = false;
  19129. this.ui.rnNode.rn4.visible = true;
  19130. }
  19131. else if (this.ui.rnNode.rn4.visible) {
  19132. let name = this.ui.rnNode.inputName.text;
  19133. let code = this.ui.rnNode.inputCode.text;
  19134. if (code && code.length == 18) {
  19135. this.ui.rnNode.rn1.visible = false;
  19136. this.ui.rnNode.rn4.visible = false;
  19137. Moyu.authenticate(name, code, (res) => {
  19138. this.ui.rnNode.rn2.visible = !res;
  19139. this.ui.rnNode.rn3.visible = res;
  19140. this.ui.rnNode.btnDone.visible = res;
  19141. this.ui.rnNode.btnExit.visible = !res;
  19142. this.ui.rnNode.btnCheck.visible = !res;
  19143. if (res)
  19144. this.showFcm();
  19145. });
  19146. }
  19147. else
  19148. this.showMsg("信息填写不完整");
  19149. }
  19150. }
  19151. loadXy(type = 0) {
  19152. this.ui.xyNode.xy1.visible = false;
  19153. this.ui.xyNode.xy2.visible = true;
  19154. this.ui.xyNode.xyList.scrollToView(0);
  19155. if (type == 1) {
  19156. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19157. }
  19158. else if (type == 2) {
  19159. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19160. }
  19161. }
  19162. showXy(type = 0) {
  19163. this.xyBtn();
  19164. if (type == 0) {
  19165. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19166. this.ui.xyNode.btnSure.visible = true;
  19167. }
  19168. else {
  19169. this.ui.xyNode.btnYes.visible = true;
  19170. this.ui.xyNode.btnNo.visible = true;
  19171. }
  19172. }
  19173. else {
  19174. this.ui.xyNode.btnKnown.visible = true;
  19175. this.ui.mainBg.visible = true;
  19176. }
  19177. this.ui.xyNode.xy1.visible = true;
  19178. this.ui.xyNode.xy2.visible = false;
  19179. this.ui.xyNode.visible = true;
  19180. this.ui.visible = true;
  19181. }
  19182. xyBtn() {
  19183. this.ui.xyNode.btnSure.visible = false;
  19184. this.ui.xyNode.btnYes.visible = false;
  19185. this.ui.xyNode.btnNo.visible = false;
  19186. this.ui.xyNode.btnKnown.visible = false;
  19187. {
  19188. this.ui.xyNode.btnXy3.visible = false;
  19189. this.ui.xyNode.btnXy2.visible = true;
  19190. this.ui.xyNode.btnXy1.visible = true;
  19191. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19192. }
  19193. }
  19194. createXY(json) {
  19195. this.ysJson = json.content;
  19196. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19197. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19198. this.ui.xyNode.xy2.visible = true;
  19199. }
  19200. renderListItem(idx, cell) {
  19201. let xy = this.ysJson[idx];
  19202. cell.height = xy.line * 30;
  19203. cell.xyItem.text = xy.text;
  19204. }
  19205. onDestroy() {
  19206. this.agreeCall = null;
  19207. }
  19208. }
  19209. class UILoading extends UIBase {
  19210. constructor() {
  19211. super();
  19212. this.accTime = 0;
  19213. this.curNum = 0;
  19214. this.rate = 1;
  19215. this.loadSubOk = false;
  19216. this.loadResOK = false;
  19217. this.openLoading = true;
  19218. this.beginLoadRes = false;
  19219. this.finishD2 = false;
  19220. this.finishD3 = false;
  19221. }
  19222. onConstructor() {
  19223. this.ui = ui_UILoading.createInstance();
  19224. this.contentPane = this.ui;
  19225. this.isEject = false;
  19226. this._initUI();
  19227. this._addEvent();
  19228. }
  19229. _initUI() {
  19230. MoyuMgr$1.initMoyu();
  19231. }
  19232. _addEvent() {
  19233. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19234. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19235. }
  19236. show() {
  19237. super.show();
  19238. console.log('zh:加载分包资源');
  19239. loadSubRes(this.subResProgress.bind(this));
  19240. this.ui.txtLoad.text = "Loading...";
  19241. }
  19242. subResProgress(pro, finish) {
  19243. this.curNum = pro;
  19244. if (finish) {
  19245. this.curNum = 1;
  19246. this.loadSubOk = true;
  19247. }
  19248. }
  19249. laodD3Res() {
  19250. let scene3D = new Laya.Scene3D();
  19251. xGame.common.d3Scene = scene3D;
  19252. xGame.common.d3World = scene3D.addComponent(D3World);
  19253. xGame.common.d3World.loadScene();
  19254. }
  19255. loadD2Res() {
  19256. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19257. this.finishD2 = true;
  19258. this.checkLoadAll();
  19259. this.curNum = 1;
  19260. }), Laya.Handler.create(this, (pro) => {
  19261. this.curNum = pro;
  19262. }, null, false));
  19263. }
  19264. d3ResFinish() {
  19265. this.finishD3 = true;
  19266. this.checkLoadAll();
  19267. }
  19268. checkLoadAll() {
  19269. if (this.finishD2 && this.finishD3) {
  19270. this.loadResOK = true;
  19271. }
  19272. }
  19273. loadRes() {
  19274. this.laodD3Res();
  19275. this.loadD2Res();
  19276. }
  19277. myUpdate(dt) {
  19278. if (!this.openLoading)
  19279. return;
  19280. this.accTime += dt * this.rate;
  19281. if (this.accTime >= this.curNum)
  19282. this.accTime = this.curNum;
  19283. this.ui.loadinfo.value = this.accTime * 100;
  19284. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19285. if (!this.beginLoadRes) {
  19286. this.beginLoadRes = true;
  19287. this.ui.txtLoad.text = "Loading...";
  19288. this.curNum = 0;
  19289. this.accTime = 0;
  19290. this.loadRes();
  19291. }
  19292. if (this.loadResOK) {
  19293. this.openLoading = false;
  19294. Laya.timer.once(300, this, () => {
  19295. xGame.common.d3Scene.active = false;
  19296. MoyuMgr$1.showAgree(enterGame);
  19297. });
  19298. }
  19299. }
  19300. }
  19301. release() {
  19302. }
  19303. hide() {
  19304. super.hide();
  19305. this.release();
  19306. }
  19307. onClose() {
  19308. this.hide();
  19309. }
  19310. }
  19311. UILoading.uiName = "UILoading";
  19312. class UIRepentProp$1 extends UIBase {
  19313. constructor() {
  19314. super();
  19315. this.viewType = 0;
  19316. this.regretType = 0;
  19317. }
  19318. onConstructor() {
  19319. this.ui = ui_UIRepentProp.createInstance();
  19320. this.contentPane = this.ui;
  19321. this.isEject = false;
  19322. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19323. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19324. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19325. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19326. }
  19327. show(viewType, regretType, callback) {
  19328. PlatMgr.showInsert(true);
  19329. this.viewType = viewType;
  19330. this.regretType = regretType;
  19331. this.callback = callback;
  19332. super.show();
  19333. this.ui.t0.play();
  19334. this.ui.c1.selectedIndex = this.viewType;
  19335. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19336. if (this.viewType == 0) {
  19337. let guide = DataMgr.getGuideHelpLine();
  19338. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19339. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19340. }
  19341. xGame.common.gameMgr.gamePause = true;
  19342. }
  19343. hideSelf() {
  19344. xGame.common.gameMgr.gamePause = false;
  19345. this.callback && this.callback(false);
  19346. this.hide();
  19347. }
  19348. videoRegret() {
  19349. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19350. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19351. }
  19352. else {
  19353. console.log('zh:AD 失败,直接发放奖励');
  19354. this.qjff_AD_for_UIrepentProp_videoRegret();
  19355. }
  19356. }
  19357. qjff_AD_for_UIrepentProp_videoRegret() {
  19358. this.callback && this.callback(true);
  19359. this.hideSelf();
  19360. }
  19361. videoAddHelpLine() {
  19362. let guide = DataMgr.getGuideHelpLine();
  19363. if (guide == 0) {
  19364. this.callback && this.callback(true);
  19365. this.hideSelf();
  19366. DataMgr.setGuideHelpLine();
  19367. xGame.common.gameUI.ui.guideNode.visible = false;
  19368. }
  19369. else {
  19370. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19371. if (Laya.Browser.onAndroid) {
  19372. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19373. if (!boo) {
  19374. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19375. return;
  19376. }
  19377. }
  19378. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19379. }
  19380. else {
  19381. console.log('zh:AD 失败,直接发放奖励');
  19382. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19383. }
  19384. }
  19385. }
  19386. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19387. this.callback && this.callback(true);
  19388. this.hideSelf();
  19389. }
  19390. }
  19391. UIRepentProp$1.uiName = "UIRepentProp";
  19392. class UIRodMethod$1 extends UIBase {
  19393. constructor() {
  19394. super();
  19395. this.isPressd = false;
  19396. }
  19397. onConstructor() {
  19398. this.ui = ui_UIRodMethod.createInstance();
  19399. this.contentPane = this.ui;
  19400. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19401. this.moveDir = new Laya.Vector2();
  19402. this.moveDest = new Laya.Vector2();
  19403. this.centerPos = new Laya.Vector2();
  19404. xGame.common.uiRodMethod = this;
  19405. }
  19406. show() {
  19407. super.show();
  19408. xGame.common.gameMgr.gamePause = true;
  19409. this.openPressDotEvent();
  19410. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19411. this.centerPos.x = this.ui.white.x;
  19412. this.centerPos.y = this.ui.white.y;
  19413. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19414. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19415. this.setDot();
  19416. }
  19417. setDot() {
  19418. this.ui.dot.x = this.moveDest.x;
  19419. this.ui.dot.y = this.moveDest.y;
  19420. }
  19421. closeSelf() {
  19422. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19423. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19424. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19425. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19426. xGame.common.gameMgr.gamePause = false;
  19427. this.hide();
  19428. }
  19429. openPressDotEvent() {
  19430. this.closePressDotEvent();
  19431. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19432. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19433. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19434. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19435. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19436. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19437. }
  19438. closePressDotEvent() {
  19439. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19440. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19441. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19442. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19443. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19444. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19445. }
  19446. onDown(e) {
  19447. if (e.type == Laya.Event.MOUSE_DOWN)
  19448. this.isPressd = true;
  19449. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19450. this.isPressd = false;
  19451. if (!this.isPressd)
  19452. return;
  19453. this.moveDest.x = e.stageX;
  19454. this.moveDest.y = e.stageY;
  19455. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19456. if (dis > 6724) {
  19457. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19458. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19459. }
  19460. this.setDot();
  19461. }
  19462. resetRod() {
  19463. this.ui.dot.x = this.ui.white.x;
  19464. this.ui.dot.y = this.ui.white.y;
  19465. this.gameRod.dot.x = this.gameRod.bg.x;
  19466. this.gameRod.dot.y = this.gameRod.bg.y;
  19467. xGame.common.rodOffest.x = 0;
  19468. xGame.common.rodOffest.y = 0;
  19469. }
  19470. }
  19471. UIRodMethod$1.uiName = "UIRodMethod";
  19472. class UIMsg$1 extends UIBase {
  19473. constructor() {
  19474. super();
  19475. }
  19476. onConstructor() {
  19477. this.ui = ui_UIMsg.createInstance();
  19478. this.contentPane = this.ui;
  19479. this.isEject = false;
  19480. this.isMuti = true;
  19481. }
  19482. show(msg, callback) {
  19483. super.show();
  19484. this.ui.tipsNode.msgTxt.text = msg;
  19485. this.ui.alpha = 1;
  19486. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19487. this.hide();
  19488. callback && callback();
  19489. }), 1000);
  19490. }
  19491. }
  19492. UIMsg$1.uiName = "UIMsg";
  19493. class UITips$1 extends UIBase {
  19494. constructor() {
  19495. super();
  19496. this.type = 0;
  19497. }
  19498. onConstructor() {
  19499. this.ui = ui_UITips.createInstance();
  19500. this.contentPane = this.ui;
  19501. this.isEject = false;
  19502. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19503. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19504. }
  19505. show(tipsTxt, womanTxt, type) {
  19506. super.show();
  19507. this.ui.t0.play();
  19508. this.ui.myNode.tipsTxt.text = tipsTxt;
  19509. this.ui.myNode.womanTxt.text = womanTxt;
  19510. PlatMgr.showInsert(true);
  19511. this.ui.myNode.c1.selectedIndex = type;
  19512. this.type = type;
  19513. switch (this.type) {
  19514. case TipsType.exitGame:
  19515. xGame.common.gameMgr.gamePause = true;
  19516. break;
  19517. case TipsType.foul:
  19518. Laya.timer.once(200, this, () => {
  19519. xGame.common.gameMgr.gamePause = true;
  19520. });
  19521. break;
  19522. default:
  19523. break;
  19524. }
  19525. }
  19526. clickLeftBtn() {
  19527. this.hide();
  19528. xGame.common.gameMgr.gamePause = false;
  19529. switch (this.type) {
  19530. case TipsType.exitGame:
  19531. break;
  19532. case TipsType.foul:
  19533. break;
  19534. default:
  19535. break;
  19536. }
  19537. }
  19538. clickRightBtn() {
  19539. this.hide();
  19540. switch (this.type) {
  19541. case TipsType.exitGame:
  19542. xGame.eventMgr.event(RESET_GAME);
  19543. xGame.uiMgr.Show(UIMain$1);
  19544. Moyu.recordEnd(this, null);
  19545. xGame.common.longHelpLine = false;
  19546. break;
  19547. case TipsType.foul:
  19548. xGame.common.gameMgr.gamePause = false;
  19549. Laya.timer.clearAll(this);
  19550. break;
  19551. default:
  19552. break;
  19553. }
  19554. }
  19555. }
  19556. UITips$1.uiName = "UITips";
  19557. class UIGame$1 extends UIBase {
  19558. constructor() {
  19559. super();
  19560. this.powerNum = 0;
  19561. this.isD3Inited = false;
  19562. this.isPrePlay = false;
  19563. this.isMoveRod = false;
  19564. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19565. this.rulerDis = 20;
  19566. this.rulerOffset = 0;
  19567. }
  19568. onConstructor() {
  19569. this.ui = ui_UIGame.createInstance();
  19570. this.contentPane = this.ui;
  19571. this.ui.x += xGame.common.sysOffestNum;
  19572. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19573. this.isEject = false;
  19574. xGame.common.gameUI = this;
  19575. this.initSelf();
  19576. }
  19577. isTurnSelf() {
  19578. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19579. return true;
  19580. }
  19581. }
  19582. initSelf() {
  19583. let topUI = this.ui.topNode;
  19584. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19585. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19586. this.barInfo = {};
  19587. this.barInfo.curY = 0;
  19588. this.barInfo.height = this.ui.powerNode.height;
  19589. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19590. this.barInfo.powerStartY = this.ui.powerNode.y;
  19591. xGame.common.aiPlayer = new AIPlayer();
  19592. xGame.common.gameMgr = new GameMgr();
  19593. xGame.common.skillMgr = new SkillMgr();
  19594. xGame.common.wordsMgr = new WordsMgr();
  19595. xGame.common.talkMgr = new TalkMgr();
  19596. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19597. console.log("加载经典模式表情文件chenggon !");
  19598. });
  19599. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19600. console.log("挑战模式奖励模式spine加载成功!");
  19601. });
  19602. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19603. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19604. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19605. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19606. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19607. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19608. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19609. }
  19610. getGanZiImg() {
  19611. let index = DataMgr.getCurBallRod();
  19612. let data = cfgTable.ballrodData[index + 1];
  19613. let gan_url = xGame.common.getGameIconUrl(data.img);
  19614. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19615. this.ui.powerNode.showImg.url = gan_url;
  19616. console.log('zh:修改杆子图标O K');
  19617. }
  19618. returnHome() {
  19619. let tips = "Are you sure to exit the game?";
  19620. let woman = "Boss, why don't you play for a while longer?";
  19621. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19622. }
  19623. addRodMethodClick() {
  19624. if (this.isTurnSelf()) {
  19625. xGame.uiMgr.Show(UIRodMethod$1);
  19626. }
  19627. }
  19628. clickHelpLineBtn(force = false) {
  19629. if (!this.isTurnSelf())
  19630. return;
  19631. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19632. if (success) {
  19633. xGame.common.longHelpLine = true;
  19634. xGame.common.d2World.getHelpLine();
  19635. Moyu.sendDataEvent("guideNum");
  19636. }
  19637. else {
  19638. }
  19639. });
  19640. }
  19641. renderSelfDisplayBalls(index, target) {
  19642. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19643. target.myImg.url = xGame.common.getGameIconUrl(str);
  19644. }
  19645. renderAIDisplayBalls(index, target) {
  19646. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19647. target.myImg.url = xGame.common.getGameIconUrl(str);
  19648. ;
  19649. }
  19650. updateMode() {
  19651. if (xGame.common.gameMode == GameMode.classic) {
  19652. this.ui.topNode.scoreNode.visible = false;
  19653. }
  19654. else if (xGame.common.gameMode == GameMode.bigMove) {
  19655. this.ui.topNode.scoreNode.visible = true;
  19656. }
  19657. }
  19658. show() {
  19659. super.show();
  19660. console.log("zh:uigame show AADD");
  19661. this.ui.alpha = 0;
  19662. this.updateSelf();
  19663. xGame.common.gameMgr.gamePause = false;
  19664. xGame.common.gameUI.ui.blackAni.visible = false;
  19665. xGame.common.gameUI.ui.whiteAni.visible = false;
  19666. this.ui.powerEft.visible = false;
  19667. this.ui.colorNode.visible = false;
  19668. this.updateHead();
  19669. let curUse = DataMgr.getCurBallRod();
  19670. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19671. this.getGanZiImg();
  19672. }
  19673. updateSelf() {
  19674. if (xGame.common.gameMode == GameMode.classic) {
  19675. this.ui.c1.selectedIndex = 0;
  19676. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19677. this.ui.topNode.middleNode.visible = true;
  19678. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19679. }
  19680. else if (xGame.common.gameMode == GameMode.bigMove) {
  19681. this.ui.c1.selectedIndex = 0;
  19682. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19683. this.ui.topNode.middleNode.visible = false;
  19684. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19685. let rand = xGame.common.randomNum(1, max);
  19686. let guide = DataMgr.getSkillGuide();
  19687. if (guide == 0)
  19688. rand = 1;
  19689. xGame.common.bigMoveLevelIndex = rand;
  19690. }
  19691. else if (xGame.common.gameMode == GameMode.placeBall) {
  19692. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19693. this.ui.c1.selectedIndex = 1 + data.type;
  19694. this.ui.alpha = 1;
  19695. this.startGame();
  19696. }
  19697. this.updateMode();
  19698. this.initD3world();
  19699. this.initD2world();
  19700. }
  19701. startGame() {
  19702. this.ui.snowNode.visible = Math.random() <= 0.1;
  19703. this.ui.d2Node.visible = false;
  19704. xGame.common.d3World.d3Hand.gameObj.active = false;
  19705. xGame.common.d3World.tableSrc.init();
  19706. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19707. this.cameraViewChange(() => {
  19708. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  19709. switch (xGame.common.gameMode) {
  19710. case GameMode.classic:
  19711. xGame.common.d3World.d3Hand.gameObj.active = true;
  19712. this.playPutBallD3Ani();
  19713. break;
  19714. case GameMode.bigMove:
  19715. this.enterGame();
  19716. Laya.timer.once(500, this, () => {
  19717. this.ui.topNode.middleNode.visible = true;
  19718. this.ui.topNode.middleNode.t0.play();
  19719. });
  19720. break;
  19721. case GameMode.placeBall:
  19722. this.enterGame();
  19723. break;
  19724. default:
  19725. break;
  19726. }
  19727. });
  19728. PlatMgr.showBanner(false);
  19729. }
  19730. enterGame() {
  19731. this.ui.d2Node.visible = true;
  19732. xGame.common.d3World.d3Hand.gameObj.active = false;
  19733. xGame.common.showOneCamera("mainCamera");
  19734. Moyu.recordGame(30, true);
  19735. if (!this.isPrePlay) {
  19736. this.isPrePlay = true;
  19737. xGame.common.d3World.prePlayEft();
  19738. }
  19739. xGame.common.gameMgr.gameReady();
  19740. this.openAllEvent();
  19741. this.ui.snowNode.visible = false;
  19742. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  19743. this.ui.helpBtn.visible = condition;
  19744. }
  19745. showHelpLineGuide() {
  19746. let longGuide = DataMgr.getGuideHelpLine();
  19747. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  19748. this.ui.helpBtn.visible = true;
  19749. this.ui.guideNode.visible = true;
  19750. }
  19751. }
  19752. setTurnAlpha(alpha) {
  19753. this.ui.keduNode.alpha = alpha;
  19754. this.ui.ganNode.alpha = alpha;
  19755. this.ui.rodMethodNode.alpha = alpha;
  19756. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  19757. }
  19758. cameraViewChange(callback) {
  19759. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19760. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  19761. xGame.common.showOneCamera("visitAngle");
  19762. cameraSrc.localRotationEulerY = 180;
  19763. cameraSrc.localRotationEulerZ = 0;
  19764. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  19765. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  19766. callback && callback();
  19767. }));
  19768. }));
  19769. }
  19770. playPutBallD3Ani() {
  19771. xGame.common.showOneCamera("mainCamera");
  19772. let handSrc = xGame.common.d3World.d3Hand;
  19773. handSrc.gameObj.active = true;
  19774. handSrc.transform.localPositionZ = 3;
  19775. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  19776. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  19777. handSrc.gameObj.active = false;
  19778. this.enterGame();
  19779. }), 400);
  19780. }));
  19781. }
  19782. updateHead() {
  19783. let user = Moyu.getUserInfo();
  19784. this.ui.topNode.selfNameTxt.text = user.nickName;
  19785. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  19786. let aiData = xGame.cfgMgr.getRandomUserInfo();
  19787. if (DataMgr.getSkillGuide() < 1) {
  19788. this.ui.topNode.aiNameTxt.text = 'billiards';
  19789. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  19790. }
  19791. else {
  19792. this.ui.topNode.aiNameTxt.text = aiData.name;
  19793. let randNo = Math.floor(Math.random() * 10) + 1;
  19794. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  19795. }
  19796. }
  19797. initD2world() {
  19798. let node = this.ui.d2Root.displayObject;
  19799. let src = node.getComponent(D2World);
  19800. if (!src) {
  19801. xGame.common.d2World = node.addComponent(D2World);
  19802. }
  19803. xGame.common.d2World.initSelf();
  19804. }
  19805. initD3world() {
  19806. if (this.isD3Inited)
  19807. return;
  19808. this.isD3Inited = true;
  19809. let scene3D = xGame.common.d3Scene;
  19810. this.ui.d3Root.displayObject.addChild(scene3D);
  19811. scene3D.active = true;
  19812. xGame.common.d3World.tableSrc.setBorderPos();
  19813. }
  19814. onRootMove(e) {
  19815. let rootBall = xGame.common.d2World.rootBall;
  19816. this.ui.moveNode.x = e.x;
  19817. this.ui.moveNode.y = e.y;
  19818. rootBall.gameObj.x = e.x;
  19819. rootBall.gameObj.y = e.y;
  19820. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  19821. }
  19822. aiRootMove(move) {
  19823. if (move)
  19824. this.hideBallUI();
  19825. else {
  19826. this.showBallUI();
  19827. xGame.common.d2World.getHelpLine();
  19828. }
  19829. }
  19830. aiForce(type, force = 0) {
  19831. this.pressTarget = PressType.powerNode;
  19832. if (type == 1)
  19833. this.onEventUp({ force: true });
  19834. else if (type == 2)
  19835. this.onEventMove({ stageY: force, force: true });
  19836. }
  19837. onEventPress(e) {
  19838. if (e.stopPropagation)
  19839. e.stopPropagation();
  19840. if (!this.isTurnSelf())
  19841. return;
  19842. let target = e.target;
  19843. switch (target) {
  19844. case this.ui.myPowerNode.displayObject:
  19845. this.pressTarget = PressType.powerNode;
  19846. this.barInfo.curY = e.stageY;
  19847. this.updateBarInfo();
  19848. break;
  19849. case this.ui.moveNode.displayObject:
  19850. this.pressTarget = PressType.moveNode;
  19851. this.hideBallUI();
  19852. this.eventObj.curX = this.ui.moveNode.x;
  19853. this.eventObj.curY = this.ui.moveNode.y;
  19854. this.ui.moveNode.finger.visible = false;
  19855. this.eventObj.lastX = e.stageX;
  19856. this.eventObj.lastY = e.stageY;
  19857. break;
  19858. case this.ui.rulerClickNode.displayObject:
  19859. this.pressTarget = PressType.rulerNode;
  19860. this.eventObj.lastY = e.stageY;
  19861. break;
  19862. case this.ui.d2Root.displayObject:
  19863. this.pressTarget = PressType.d2Root;
  19864. this.eventObj.lastX = e.stageX;
  19865. this.eventObj.lastY = e.stageY;
  19866. this.eventObj.starX = e.stageX;
  19867. this.eventObj.starY = e.stageY;
  19868. this.eventObj.curX = 0;
  19869. this.eventObj.curY = 0;
  19870. xGame.common.d2World.d2Gan.setGanLastInfo();
  19871. this.rulerOffset = 0;
  19872. break;
  19873. default:
  19874. break;
  19875. }
  19876. }
  19877. onEventMove(e) {
  19878. if (e.stopPropagation)
  19879. e.stopPropagation();
  19880. if (e && e.force) {
  19881. }
  19882. else {
  19883. if (!this.isTurnSelf())
  19884. return;
  19885. }
  19886. switch (this.pressTarget) {
  19887. case PressType.powerNode:
  19888. this.barInfo.curY = e.stageY;
  19889. this.updateBarInfo();
  19890. this.isMoveRod = true;
  19891. break;
  19892. case PressType.moveNode:
  19893. let rootBall = xGame.common.d2World.rootBall;
  19894. let radius = rootBall.gameObj.width / 2;
  19895. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  19896. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  19897. let border = xGame.common.d2World.borderRect;
  19898. if (curX <= border.x + radius)
  19899. curX = border.x + radius;
  19900. else if (curX >= border.x + border.width - radius)
  19901. curX = border.x + border.width - radius;
  19902. if (curY <= border.y + radius)
  19903. curY = border.y + radius;
  19904. else if (curY >= border.y + border.height - radius)
  19905. curY = border.y + border.height - radius;
  19906. if (xGame.common.gameMgr.isOpenBall) {
  19907. if (curX >= border.x + border.openBallW - radius)
  19908. curX = border.x + border.openBallW - radius;
  19909. }
  19910. this.ui.moveNode.x = curX;
  19911. this.ui.moveNode.y = curY;
  19912. rootBall.gameObj.x = curX;
  19913. rootBall.gameObj.y = curY;
  19914. rootBall.d3BallSrc.setTransPos(curX, curY);
  19915. this.isMoveRod = true;
  19916. break;
  19917. case PressType.rulerNode:
  19918. let yy = e.stageY - this.eventObj.lastY;
  19919. this.eventObj.lastY = e.stageY;
  19920. let ruler1 = this.ui.rulerNode.img1;
  19921. let ruler2 = this.ui.rulerNode.img2;
  19922. ruler1.y += yy;
  19923. ruler2.y += yy;
  19924. this.rulerOffset += yy;
  19925. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  19926. this.rulerOffset = 0;
  19927. xGame.soundMgr.playSound("inch", 1, 10);
  19928. }
  19929. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  19930. let h = ruler1.height;
  19931. this.checkGuide();
  19932. this.isMoveRod = true;
  19933. if (ruler1.y >= h) {
  19934. ruler1.y = -h;
  19935. ruler2.y = 0;
  19936. return;
  19937. }
  19938. else if (ruler1.y <= -h) {
  19939. ruler1.y = h;
  19940. ruler2.y = 0;
  19941. return;
  19942. }
  19943. if (ruler2.y >= h) {
  19944. ruler2.y = -h;
  19945. ruler1.y = 0;
  19946. return;
  19947. }
  19948. else if (ruler2.y <= -h) {
  19949. ruler2.y = h;
  19950. ruler1.y = 0;
  19951. return;
  19952. }
  19953. break;
  19954. case PressType.d2Root:
  19955. this.eventObj.curX = e.stageX;
  19956. this.eventObj.curY = e.stageY;
  19957. let offset = this.checkRodMoveDir();
  19958. xGame.common.d2World.d2Gan.rotateSelf(offset);
  19959. this.eventObj.lastX = e.stageX;
  19960. this.eventObj.lastY = e.stageY;
  19961. break;
  19962. default:
  19963. break;
  19964. }
  19965. }
  19966. onEventUp(e) {
  19967. if (e.stopPropagation)
  19968. e.stopPropagation();
  19969. if (e && e.force) {
  19970. }
  19971. else {
  19972. if (!this.isTurnSelf())
  19973. return;
  19974. }
  19975. switch (this.pressTarget) {
  19976. case PressType.powerNode:
  19977. this.ui.powerNode.value = 0;
  19978. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19979. this.ui.powerTxt.text = "";
  19980. if (this.powerNum > 0) {
  19981. xGame.eventMgr.event(BALL_SHOOT);
  19982. xGame.common.d2World.shoot(this.powerNum);
  19983. xGame.common.d2World.d2Gan.shoot();
  19984. xGame.common.d2World.d2HelpLine.shoot();
  19985. this.finishGuide();
  19986. this.ui.powerEft.visible = false;
  19987. this.ui.colorNode.visible = false;
  19988. let ganStr = "";
  19989. if (this.powerNum <= 30) {
  19990. ganStr = "gan_30";
  19991. }
  19992. else if (this.powerNum <= 60) {
  19993. ganStr = "gan_50";
  19994. }
  19995. else {
  19996. ganStr = "gan_80";
  19997. }
  19998. xGame.soundMgr.playSound(ganStr);
  19999. }
  20000. break;
  20001. case PressType.moveNode:
  20002. let rootBall = xGame.common.d2World.rootBall;
  20003. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20004. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20005. let isIntersect = this.judgeBallIntersect();
  20006. if (isIntersect) {
  20007. this.ui.moveNode.x = lastX;
  20008. this.ui.moveNode.y = lastY;
  20009. rootBall.gameObj.x = lastX;
  20010. rootBall.gameObj.y = lastY;
  20011. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20012. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20013. }
  20014. else {
  20015. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20016. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20017. }
  20018. this.showBallUI();
  20019. this.ui.moveNode.finger.visible = true;
  20020. xGame.common.d2World.getHelpLine();
  20021. break;
  20022. case PressType.rulerNode:
  20023. break;
  20024. case PressType.d2Root:
  20025. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20026. if (dis <= 25) {
  20027. this.moveToClickDot(e);
  20028. }
  20029. break;
  20030. default:
  20031. break;
  20032. }
  20033. this.pressTarget = -1;
  20034. }
  20035. checkGuide() {
  20036. let guide = DataMgr.getSkillGuide();
  20037. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20038. xGame.common.guideStep++;
  20039. xGame.common.gameUI.ui.guide2.visible = false;
  20040. xGame.common.gameUI.ui.guide3.visible = true;
  20041. }
  20042. }
  20043. finishGuide() {
  20044. let guide = DataMgr.getSkillGuide();
  20045. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20046. xGame.common.guideStep = 10;
  20047. this.closeAllGuide();
  20048. console.log('zh: 新手引导完毕');
  20049. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20050. }
  20051. }
  20052. closeAllGuide() {
  20053. xGame.common.gameUI.ui.guide1.visible = false;
  20054. xGame.common.gameUI.ui.guide2.visible = false;
  20055. xGame.common.gameUI.ui.guide3.visible = false;
  20056. }
  20057. updateBarInfo() {
  20058. let star = this.ui.powerNode.y;
  20059. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20060. if (rate >= 1)
  20061. rate = 1;
  20062. if (rate <= 0)
  20063. rate = 0;
  20064. this.powerNum = Math.ceil(rate * 100);
  20065. this.ui.powerNode.value = this.powerNum;
  20066. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20067. this.ui.colorNode.value = this.powerNum;
  20068. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20069. this.ui.powerEft.visible = this.powerNum != 0;
  20070. this.ui.colorNode.visible = this.powerNum != 0;
  20071. this.ui.powerTxt.text = this.powerNum + "";
  20072. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20073. }
  20074. forceCancel() {
  20075. this.ui.powerNode.value = 0;
  20076. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20077. this.ui.powerTxt.text = "";
  20078. }
  20079. checkRodMoveDir() {
  20080. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20081. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20082. if (tempX >= 0 && tempY <= 0) {
  20083. return this.checkDir();
  20084. }
  20085. else if (tempX < 0 && tempY < 0) {
  20086. return this.checkDir(1, -1);
  20087. }
  20088. else if (tempX < 0 && tempY > 0) {
  20089. return this.checkDir(-1, -1);
  20090. }
  20091. else {
  20092. return this.checkDir(-1, 1);
  20093. }
  20094. }
  20095. checkDir(flagX = 1, flagY = 1) {
  20096. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20097. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20098. if (offsetY == 0) {
  20099. return offsetX * flagX;
  20100. }
  20101. if (offsetX == 0) {
  20102. return offsetY * flagY;
  20103. }
  20104. let angle = offsetY / offsetX;
  20105. if (Math.abs(angle) >= 1) {
  20106. return offsetY * flagY;
  20107. }
  20108. else {
  20109. return offsetX * flagX;
  20110. }
  20111. }
  20112. judgeBallIntersect() {
  20113. let rootBall = xGame.common.d2World.rootBall;
  20114. let ballArr = xGame.common.d2World.ballArr;
  20115. let radius = rootBall.gameObj.width / 2;
  20116. let temp;
  20117. let isIntersect = false;
  20118. for (let index = 0; index < ballArr.length; index++) {
  20119. temp = ballArr[index];
  20120. if (temp.number == rootBall.number)
  20121. continue;
  20122. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20123. if (isIntersect) {
  20124. break;
  20125. }
  20126. }
  20127. return isIntersect;
  20128. }
  20129. hideBallUI() {
  20130. let d2Gan = xGame.common.d2World.d2Gan;
  20131. if (!d2Gan.ui.isDisposed)
  20132. d2Gan.ui.visible = false;
  20133. let d2Help = xGame.common.d2World.d2HelpLine;
  20134. if (!d2Help.ui.isDisposed)
  20135. d2Help.ui.visible = false;
  20136. let rootBall = xGame.common.d2World.rootBall;
  20137. if (!rootBall.destroyed) {
  20138. rootBall.gameObj.active = false;
  20139. }
  20140. }
  20141. showBallUI() {
  20142. let d2Gan = xGame.common.d2World.d2Gan;
  20143. if (!d2Gan.ui.isDisposed)
  20144. d2Gan.ui.visible = true;
  20145. let d2Help = xGame.common.d2World.d2HelpLine;
  20146. if (!d2Help.ui.isDisposed)
  20147. d2Help.ui.visible = true;
  20148. let rootBall = xGame.common.d2World.rootBall;
  20149. if (!rootBall.destroyed) {
  20150. rootBall.gameObj.active = true;
  20151. }
  20152. }
  20153. moveToClickDot(e) {
  20154. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20155. let root = xGame.common.d2World.rootBall.gameObj;
  20156. let xx = e.stageX - xGame.common.sysOffestNum;
  20157. let yy = e.stageY;
  20158. let x = xx - root.x;
  20159. let y = yy - root.y;
  20160. let angle = xGame.common.getfguiRotation(x, y);
  20161. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20162. xGame.common.d2World.getHelpLine();
  20163. }
  20164. this.isMoveRod = false;
  20165. xGame.common.clickedBall = false;
  20166. }
  20167. openAllEvent() {
  20168. this.closeAllEvent();
  20169. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20170. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20171. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20172. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20173. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20174. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20175. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20176. }
  20177. closeAllEvent() {
  20178. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20179. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20180. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20181. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20182. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20183. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20184. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20185. }
  20186. resetGame() {
  20187. this.closeAllEvent();
  20188. this.hideBallUI();
  20189. xGame.common.gameMgr.gamePause = true;
  20190. }
  20191. }
  20192. UIGame$1.uiName = "UIGame";
  20193. class UIAddCoin$1 extends UIBase {
  20194. constructor() {
  20195. super();
  20196. this.coinNum = 2000;
  20197. }
  20198. onConstructor() {
  20199. this.ui = ui_UIAddCoin.createInstance();
  20200. this.contentPane = this.ui;
  20201. this.isEject = false;
  20202. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20203. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20204. }
  20205. show() {
  20206. super.show();
  20207. this.ui.t0.play();
  20208. }
  20209. videoAddCoin() {
  20210. console.log('zh:qjff_AD_for_UIAddCoin');
  20211. if (Laya.Browser.onAndroid) {
  20212. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20213. if (!boo) {
  20214. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20215. return;
  20216. }
  20217. }
  20218. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20219. }
  20220. else {
  20221. console.log('zh:AD 失败,直接发放奖励');
  20222. this.qjff_AD_for_UIAddCoin();
  20223. }
  20224. }
  20225. qjff_AD_for_UIAddCoin() {
  20226. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20227. this.hide();
  20228. }
  20229. }
  20230. UIAddCoin$1.uiName = "UIAddCoin";
  20231. class UIInvitation$1 extends UIBase {
  20232. constructor() {
  20233. super();
  20234. }
  20235. onConstructor() {
  20236. this.ui = ui_UIInvitation.createInstance();
  20237. this.contentPane = this.ui;
  20238. this.isEject = false;
  20239. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20240. }
  20241. show() {
  20242. super.show();
  20243. }
  20244. enterGame() {
  20245. xGame.common.gameMode = GameMode.classic;
  20246. DataMgr.setChallengeTimes(1);
  20247. xGame.common.passAwardCoin = 2000;
  20248. let need = xGame.common.classicNiceNeddCoin;
  20249. if (DataMgr.coinEnough(need)) {
  20250. DataMgr.setCoin(-need);
  20251. xGame.eventMgr.event(RESTART_GAME, true);
  20252. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20253. }
  20254. else {
  20255. xGame.eventMgr.event(RESTART_GAME, true);
  20256. }
  20257. this.hide();
  20258. }
  20259. hide() {
  20260. super.hide();
  20261. }
  20262. }
  20263. UIInvitation$1.uiName = "UIInvitation";
  20264. class UIPower$1 extends UIBase {
  20265. constructor() {
  20266. super();
  20267. }
  20268. onConstructor() {
  20269. this.ui = ui_UIPower.createInstance();
  20270. this.contentPane = this.ui;
  20271. this.isEject = false;
  20272. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20273. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20274. }
  20275. show() {
  20276. super.show();
  20277. this.ui.t0.play();
  20278. }
  20279. videoGetPower() {
  20280. console.log('zh:qjff_AD_for_uipower');
  20281. if (Laya.Browser.onAndroid) {
  20282. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20283. if (!boo) {
  20284. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20285. return;
  20286. }
  20287. }
  20288. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20289. }
  20290. else {
  20291. console.log('zh:AD 失败,直接发放奖励');
  20292. this.qjff_AD_for_uipower();
  20293. }
  20294. }
  20295. qjff_AD_for_uipower() {
  20296. DataMgr.setPower(xGame.common.videoPower, true);
  20297. xGame.eventMgr.event(POWER_TIME);
  20298. this.hide();
  20299. }
  20300. }
  20301. UIPower$1.uiName = "UIPower";
  20302. class UIGameEnd$1 extends UIBase {
  20303. constructor() {
  20304. super();
  20305. this.success = false;
  20306. this.awardCoinNum = 1000;
  20307. this.awardDiamondNum = 10;
  20308. }
  20309. onConstructor() {
  20310. this.ui = ui_UIGameEnd.createInstance();
  20311. this.contentPane = this.ui;
  20312. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20313. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20314. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20315. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20316. this.ui.talkNode.visible = false;
  20317. if (Moyu.isKs)
  20318. this.ui.closeNode.closeBtn.x += 100;
  20319. }
  20320. updateType() {
  20321. switch (xGame.common.gameMode) {
  20322. case GameMode.classic:
  20323. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20324. this.ui.coinNode.visible = this.success;
  20325. if (!this.success) {
  20326. Laya.timer.once(500, this, () => {
  20327. xGame.uiMgr.Show(UIAddCoin$1);
  20328. });
  20329. }
  20330. else {
  20331. this.logEventForClassic_win();
  20332. }
  20333. this.logEventForClassic_complete();
  20334. this.ui.isGetAward.visible = false;
  20335. this.ui.leftBtn.c1.selectedIndex = 3;
  20336. this.ui.rightBtn.c1.selectedIndex = 0;
  20337. this.moneyNode.ui.c1.selectedIndex = 1;
  20338. break;
  20339. case GameMode.bigMove:
  20340. console.log('zh:招法模式 aaaaaa bigMove');
  20341. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20342. this.ui.coinNode.visible = this.success;
  20343. if (xGame.common.gameMode == GameMode.bigMove) {
  20344. if (this.success) {
  20345. DataMgr.setSkillSuccessTimes(1, true);
  20346. DataMgr.setSkillAccTimes(1);
  20347. }
  20348. else {
  20349. DataMgr.setSkillSuccessTimes(0, false);
  20350. }
  20351. }
  20352. this.logEventForRod_complete_N();
  20353. if (!this.success) {
  20354. Laya.timer.once(500, this, () => {
  20355. xGame.uiMgr.Show(UIAddCoin$1);
  20356. });
  20357. }
  20358. else {
  20359. this.logEventForRod_win();
  20360. }
  20361. this.ui.isGetAward.visible = false;
  20362. this.ui.leftBtn.c1.selectedIndex = 3;
  20363. this.ui.rightBtn.c1.selectedIndex = 0;
  20364. this.moneyNode.ui.c1.selectedIndex = 1;
  20365. break;
  20366. case GameMode.placeBall:
  20367. this.ui.coinNode.visible = false;
  20368. if (this.success) {
  20369. if (xGame.common.placeBallStarNum == 3) {
  20370. this.ui.c1.selectedIndex = 2;
  20371. }
  20372. else {
  20373. this.ui.c1.selectedIndex = 3;
  20374. }
  20375. let level = xGame.common.placeBallCurLevel;
  20376. if (level > 59) {
  20377. this.logEventForChallenge_level_complete(level);
  20378. }
  20379. else {
  20380. this.logEventForChallenge_level_N(level);
  20381. }
  20382. }
  20383. else {
  20384. this.ui.c1.selectedIndex = 4;
  20385. }
  20386. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20387. if (cfg.type == PlaceBallType.challenge) {
  20388. this.ui.c1.selectedIndex = 2;
  20389. }
  20390. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20391. this.updatePlaceBallBtn();
  20392. this.updatePlaceBallStarNum();
  20393. this.updatePlaceBallAwardState();
  20394. this.moneyNode.ui.c1.selectedIndex = 2;
  20395. this.moneyNode.checkPowerTime();
  20396. this.moneyNode.powerChange();
  20397. DataMgr.upRankData();
  20398. break;
  20399. default:
  20400. break;
  20401. }
  20402. }
  20403. logEventForRod_complete_N() {
  20404. let gfmsIdx = xGame.common.curPlayerSkillType;
  20405. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20406. let gfmc = 'Skyfall Shot';
  20407. if (gfmsIdx == 0) {
  20408. gfmc = 'Skyfall Shot';
  20409. }
  20410. if (gfmsIdx == 1) {
  20411. gfmc = 'Surging break';
  20412. }
  20413. if (gfmsIdx == 2) {
  20414. gfmc = 'Frost Lock';
  20415. }
  20416. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20417. console.log('zh:logEventForRod_complete_N level = ' + level);
  20418. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20419. let jsonStr = {
  20420. "count": 0,
  20421. "name": gfmc
  20422. };
  20423. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20424. const d = LocalStorageManager.getItem(keyStr);
  20425. jsonStr.count = d.count + 1;
  20426. LocalStorageManager.setItem(keyStr, jsonStr);
  20427. }
  20428. else {
  20429. LocalStorageManager.setItem(keyStr, jsonStr);
  20430. }
  20431. const d2 = LocalStorageManager.getItem(keyStr);
  20432. let count = d2.count;
  20433. console.log('zh:logEventForRod_complete_N count = ' + count);
  20434. if (count % 5 == 0) {
  20435. const reqStr = JSON.stringify(jsonStr);
  20436. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20437. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20438. }
  20439. }
  20440. logEventForRod_win() {
  20441. console.log('zh:logEventForRod_win,胜利');
  20442. let gfmsIdx = xGame.common.curPlayerSkillType;
  20443. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20444. let gfmc = 'Skyfall Shot';
  20445. if (gfmsIdx == 0) {
  20446. gfmc = 'Skyfall Shot';
  20447. }
  20448. if (gfmsIdx == 1) {
  20449. gfmc = 'Surging break';
  20450. }
  20451. if (gfmsIdx == 2) {
  20452. gfmc = 'Frost Lock';
  20453. }
  20454. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20455. console.log('zh:logEventForRod_win level = ' + level);
  20456. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20457. let jsonStr = {
  20458. "count": 1,
  20459. "name": gfmc + ' Lev' + level
  20460. };
  20461. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20462. const d = LocalStorageManager.getItem(keyStr);
  20463. jsonStr.count = d.count + 1;
  20464. LocalStorageManager.setItem(keyStr, jsonStr);
  20465. }
  20466. else {
  20467. LocalStorageManager.setItem(keyStr, jsonStr);
  20468. }
  20469. const reqStr = JSON.stringify(jsonStr);
  20470. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20471. }
  20472. logEventForClassic_win() {
  20473. console.log('zh:logEventForClassic_win,胜利');
  20474. let rtype = xGame.common.classicRoomType;
  20475. let msmc = '';
  20476. if (rtype == 1) {
  20477. msmc = 'beginner';
  20478. }
  20479. if (rtype == 2) {
  20480. msmc = 'expert';
  20481. }
  20482. if (rtype == 3) {
  20483. msmc = 'master';
  20484. }
  20485. let keyStr = 'sjmd_classic_win_' + rtype;
  20486. let jsonStr = {
  20487. "difficulty": msmc,
  20488. "classic_count": 1,
  20489. "difficulty_count": 1
  20490. };
  20491. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20492. const d = LocalStorageManager.getItem(keyStr);
  20493. jsonStr.classic_count = d.classic_count + 1;
  20494. jsonStr.difficulty_count = d.difficulty_count + 1;
  20495. LocalStorageManager.setItem(keyStr, jsonStr);
  20496. }
  20497. else {
  20498. LocalStorageManager.setItem(keyStr, jsonStr);
  20499. }
  20500. const reqStr = JSON.stringify(jsonStr);
  20501. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20502. }
  20503. logEventForClassic_complete() {
  20504. console.log('zh:logEventForClassic_complete,胜利');
  20505. let rtype = xGame.common.classicRoomType;
  20506. let msmc = '';
  20507. if (rtype == 1) {
  20508. msmc = 'beginner';
  20509. }
  20510. if (rtype == 2) {
  20511. msmc = 'expert';
  20512. }
  20513. if (rtype == 3) {
  20514. msmc = 'master';
  20515. }
  20516. let keyStr = 'sjmd_classic_complete_' + rtype;
  20517. let jsonStr = {
  20518. "msmc": msmc,
  20519. "count": 0
  20520. };
  20521. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20522. const d = LocalStorageManager.getItem(keyStr);
  20523. jsonStr.count = d.count + 1;
  20524. LocalStorageManager.setItem(keyStr, jsonStr);
  20525. }
  20526. else {
  20527. LocalStorageManager.setItem(keyStr, jsonStr);
  20528. }
  20529. if (jsonStr.count % 5 == 0) {
  20530. const reqStr = JSON.stringify(jsonStr);
  20531. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20532. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20533. }
  20534. }
  20535. updatePlaceBallBtn() {
  20536. this.ui.leftBtn.c1.selectedIndex = 5;
  20537. if (this.success) {
  20538. this.ui.rightBtn.c1.selectedIndex = 14;
  20539. }
  20540. else {
  20541. if (xGame.common.placeBallStarNum == 3) {
  20542. this.ui.rightBtn.c1.selectedIndex = 14;
  20543. }
  20544. else {
  20545. this.ui.rightBtn.c1.selectedIndex = 1;
  20546. }
  20547. }
  20548. }
  20549. updatePlaceBallStarNum() {
  20550. let starNum = xGame.common.placeBallStarNum;
  20551. if (starNum == 0)
  20552. this.ui.starNumNode.c1.selectedIndex = 3;
  20553. else {
  20554. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20555. }
  20556. }
  20557. updatePlaceBallAwardState() {
  20558. let level = xGame.common.placeBallCurLevel;
  20559. let starNum = xGame.common.placeBallStarNum;
  20560. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20561. let data = cfgTable.placeballData[level].award;
  20562. let cfg = cfgTable.placeballData[level];
  20563. this.awardDiamondNum = data[1];
  20564. this.awardCoinNum = data[0];
  20565. if (cfg.type == PlaceBallType.challenge) {
  20566. this.awardDiamondNum = 0;
  20567. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20568. }
  20569. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20570. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20571. if (cfg.type == PlaceBallType.challenge) {
  20572. this.ui.awardNode.coinNode.visible = true;
  20573. }
  20574. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20575. this.ui.awardNode.diamondNode.x = 265;
  20576. this.ui.awardNode.coinNode.x = 354;
  20577. }
  20578. else {
  20579. this.ui.awardNode.diamondNode.x = 291;
  20580. this.ui.awardNode.coinNode.x = 291;
  20581. }
  20582. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20583. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20584. if (this.awardCoinNum == 0) {
  20585. this.ui.awardNode.coinNode.numTxt.text = "";
  20586. }
  20587. if (getAward) {
  20588. this.ui.isGetAward.visible = true;
  20589. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20590. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20591. }
  20592. else {
  20593. this.ui.isGetAward.visible = false;
  20594. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20595. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20596. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20597. }
  20598. else {
  20599. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20600. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20601. }
  20602. }
  20603. }
  20604. show(success) {
  20605. super.show();
  20606. xGame.eventMgr.event(RESET_GAME);
  20607. this.success = success;
  20608. Laya.timer.clearAll(this);
  20609. this.playSecretaryAni();
  20610. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20611. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20612. offsetTime = Math.floor(offsetTime / 1000);
  20613. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20614. this.updateType();
  20615. Laya.timer.once(200, this, () => {
  20616. this.addAward(() => {
  20617. this.updateType();
  20618. Laya.timer.once(500, this, () => {
  20619. this.showChallengeLevel();
  20620. });
  20621. });
  20622. });
  20623. if (this.success) {
  20624. JSBridgeUtils.instance.showInternAd('gameend_success');
  20625. console.log('zh:game end 成功');
  20626. xGame.soundMgr.playSound('slots_roll01');
  20627. xGame.soundMgr.playSound("s_win");
  20628. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20629. this.diyGameDataUtilForGameWin();
  20630. }
  20631. else {
  20632. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20633. console.log('zh:game end失败');
  20634. xGame.soundMgr.playSound('matchwin01');
  20635. xGame.soundMgr.playSound("s_lose");
  20636. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20637. }
  20638. let challengeNum = DataMgr.getChallengeTimes();
  20639. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20640. DataMgr.setChallengeTimes(1);
  20641. }
  20642. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20643. DataMgr.setClassicTimes();
  20644. }
  20645. }
  20646. diyGameDataUtilForGameWin() {
  20647. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20648. switch (xGame.common.gameMode) {
  20649. case GameMode.classic:
  20650. console.log('zh:DiyGameDataUtilForGameWin 111');
  20651. case GameMode.bigMove:
  20652. console.log('zh:DiyGameDataUtilForGameWin 222');
  20653. this.restartGame();
  20654. break;
  20655. case GameMode.placeBall:
  20656. console.log('zh:DiyGameDataUtilForGameWin 333');
  20657. var level = xGame.common.placeBallCurLevel;
  20658. console.log('zh:练习模式 联系了多少LEV=' + level);
  20659. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20660. if (level > db_over_lev) {
  20661. DataMgr.setChallengeMode_overLev(level);
  20662. }
  20663. break;
  20664. default:
  20665. console.log('zh:DiyGameDataUtilForGameWin 444');
  20666. break;
  20667. }
  20668. }
  20669. showChallengeLevel() {
  20670. if (DataMgr.getChallengeTimes() != 0)
  20671. return;
  20672. let skill = DataMgr.getSkillAccTimes();
  20673. let put = DataMgr.getPlaceBallLevelList().length;
  20674. if (skill >= 3 || put >= 5) {
  20675. xGame.uiMgr.Show(UIInvitation$1);
  20676. this.hide();
  20677. }
  20678. }
  20679. addAward(callback) {
  20680. if (!this.success) {
  20681. callback && callback();
  20682. return;
  20683. }
  20684. switch (xGame.common.gameMode) {
  20685. case GameMode.classic:
  20686. this.awardCoinNum = xGame.common.passAwardCoin;
  20687. this.awardDiamondNum = 0;
  20688. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20689. break;
  20690. case GameMode.bigMove:
  20691. this.awardCoinNum = xGame.common.passAwardCoin;
  20692. this.awardDiamondNum = 0;
  20693. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20694. callback && callback();
  20695. break;
  20696. case GameMode.placeBall:
  20697. let level = xGame.common.placeBallCurLevel;
  20698. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  20699. if (xGame.common.placeBallStarNum != 3) {
  20700. callback && callback();
  20701. return;
  20702. }
  20703. else {
  20704. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20705. if (getAward) {
  20706. callback && callback();
  20707. return;
  20708. }
  20709. }
  20710. let cfg = cfgTable.placeballData[level];
  20711. let data = cfgTable.placeballData[level].award;
  20712. this.awardCoinNum = data[0];
  20713. this.awardDiamondNum = data[1];
  20714. if (cfg.type == PlaceBallType.challenge) {
  20715. this.awardDiamondNum = 0;
  20716. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20717. }
  20718. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  20719. let diamondAward;
  20720. if (this.awardDiamondNum > 0) {
  20721. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  20722. xGame.common.getAward([diamondAward, coinAward], callback);
  20723. }
  20724. else {
  20725. xGame.common.getAward([coinAward], callback);
  20726. }
  20727. if (cfg.type == PlaceBallType.normal) {
  20728. DataMgr.setPlaceBallAward(level);
  20729. }
  20730. break;
  20731. default:
  20732. break;
  20733. }
  20734. }
  20735. playSecretaryAni_old() {
  20736. let parent = this.ui.secretary.displayObject;
  20737. parent.destroyChildren();
  20738. let xx = this.ui.secretary.width / 2;
  20739. let yy = this.ui.secretary.height;
  20740. let scale = xGame.common.getSecretaryScale();
  20741. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20742. if (this.success) {
  20743. let rand = Math.random() <= 0.5 ? 2 : 3;
  20744. xGame.common.secretary.play(data, rand, false, parent, () => {
  20745. xGame.common.secretary.play(data, 1, true, parent);
  20746. });
  20747. }
  20748. else {
  20749. xGame.common.secretary.play(data, 0, true, parent);
  20750. }
  20751. }
  20752. playSecretaryAni() {
  20753. let parent = this.ui.secretary.displayObject;
  20754. parent.destroyChildren();
  20755. let xx = this.ui.secretary.width / 2;
  20756. let yy = this.ui.secretary.height;
  20757. let scale = xGame.common.getSecretaryScale();
  20758. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20759. if (this.success) {
  20760. let rand = 0;
  20761. xGame.common.secretary.play(data, 0, true, parent);
  20762. }
  20763. else {
  20764. xGame.common.secretary.play(data, 0, true, parent);
  20765. }
  20766. }
  20767. restartGame() {
  20768. switch (xGame.common.gameMode) {
  20769. case GameMode.classic:
  20770. xGame.eventMgr.event(RESTART_GAME);
  20771. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20772. break;
  20773. case GameMode.bigMove:
  20774. this.hide();
  20775. xGame.eventMgr.event(RESTART_GAME);
  20776. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20777. break;
  20778. default:
  20779. break;
  20780. }
  20781. }
  20782. hide() {
  20783. super.hide();
  20784. xGame.common.stopGirlPop(this.ui.talkNode);
  20785. PlatMgr.showBanner(false);
  20786. }
  20787. returnHome() {
  20788. this.hide();
  20789. let showFailWords = !this.success;
  20790. xGame.uiMgr.Show(UIMain$1, showFailWords);
  20791. }
  20792. clickLeftBtn() {
  20793. switch (xGame.common.gameMode) {
  20794. case GameMode.classic:
  20795. case GameMode.bigMove:
  20796. this.returnHome();
  20797. break;
  20798. case GameMode.placeBall:
  20799. let level = xGame.common.placeBallCurLevel;
  20800. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  20801. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20802. break;
  20803. default:
  20804. break;
  20805. }
  20806. }
  20807. powerStartPlaceBallLevel(level, btn) {
  20808. if (DataMgr.powerEnough()) {
  20809. btn.touchable = false;
  20810. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20811. btn.touchable = true;
  20812. DataMgr.setPower(-1);
  20813. xGame.eventMgr.event(POWER_TIME);
  20814. this.startPlaceBallLevel(level);
  20815. this.logEventForChallenge_level_start(level);
  20816. }));
  20817. }
  20818. else {
  20819. xGame.uiMgr.Show(UIPower$1, 0);
  20820. }
  20821. }
  20822. clickRightBtn() {
  20823. switch (xGame.common.gameMode) {
  20824. case GameMode.classic:
  20825. console.log('zh:clickRightBtn 111');
  20826. case GameMode.bigMove:
  20827. console.log('zh:clickRightBtn 222');
  20828. this.restartGame();
  20829. break;
  20830. case GameMode.placeBall:
  20831. console.log('zh:clickRightBtn 333');
  20832. let level = xGame.common.placeBallCurLevel;
  20833. let data = DataMgr.getPlaceBallLevel(level);
  20834. let curPss = data.play && !data.isCur;
  20835. if (curPss) {
  20836. console.log('zh:clickRightBtn 333-111');
  20837. console.log('zh:当前LV=' + level);
  20838. if (level == 60) {
  20839. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  20840. Laya.timer.once(3000, this, () => {
  20841. this.returnHome();
  20842. });
  20843. }
  20844. else {
  20845. let lev = level + 1;
  20846. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20847. }
  20848. }
  20849. else {
  20850. console.log('zh:clickRightBtn 333-000');
  20851. Moyu.sendDataEvent("placeBallNextLevel");
  20852. console.log('zh:qjff_AD_for_uiGameEnd');
  20853. if (Laya.Browser.onAndroid) {
  20854. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20855. if (!boo) {
  20856. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20857. return;
  20858. }
  20859. }
  20860. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  20861. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  20862. }
  20863. else {
  20864. console.log('zh:AD 失败,直接发放奖励');
  20865. this.qjff_AD_for_uiGameEnd(level);
  20866. }
  20867. }
  20868. break;
  20869. default:
  20870. console.log('zh:clickRightBtn 444');
  20871. break;
  20872. }
  20873. }
  20874. logEventForChallenge_level_start(level) {
  20875. let keyStr = 'sjmd_challenge_level_start';
  20876. let jsonStr = {
  20877. "count": 0,
  20878. "gold_balance ": DataMgr.getCoin(),
  20879. "level": level,
  20880. "diamond_balance ": DataMgr.getDiamond()
  20881. };
  20882. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20883. const d = LocalStorageManager.getItem(keyStr);
  20884. if (level > d.level) {
  20885. jsonStr.count = d.count + 1;
  20886. LocalStorageManager.setItem(keyStr, jsonStr);
  20887. }
  20888. else {
  20889. }
  20890. }
  20891. else {
  20892. LocalStorageManager.setItem(keyStr, jsonStr);
  20893. }
  20894. const reqStr = JSON.stringify(jsonStr);
  20895. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20896. }
  20897. qjff_AD_for_uiGameEnd(level) {
  20898. DataMgr.setPlaceBallLevel(level, 1);
  20899. this.startPlaceBallLevel(level + 1);
  20900. }
  20901. startPlaceBallLevel(level) {
  20902. xGame.common.gameMode = GameMode.placeBall;
  20903. xGame.common.placeBallCurLevel = level;
  20904. xGame.uiMgr.Show(UIGame$1);
  20905. this.hide();
  20906. }
  20907. logEventForChallenge_level_complete(level) {
  20908. let keyStr = 'sjmd_challenge_level_complete';
  20909. let jsonStr = {
  20910. "count": 1,
  20911. "gold_balance ": DataMgr.getCoin(),
  20912. "level": level,
  20913. "diamond_balance ": DataMgr.getDiamond()
  20914. };
  20915. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20916. const d = LocalStorageManager.getItem(keyStr);
  20917. jsonStr.count = d.count + 1;
  20918. LocalStorageManager.setItem(keyStr, jsonStr);
  20919. }
  20920. else {
  20921. LocalStorageManager.setItem(keyStr, jsonStr);
  20922. }
  20923. const reqStr = JSON.stringify(jsonStr);
  20924. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  20925. }
  20926. logEventForChallenge_level_N(level) {
  20927. console.log('zh:logEventForChallenge_level_N ' + level);
  20928. let keyStr = 'sjmd_challenge_level_N';
  20929. if (LocalStorageManager.hasKey(keyStr)) {
  20930. let lev = LocalStorageManager.getItem(keyStr);
  20931. if (level > lev) {
  20932. LocalStorageManager.setItem(keyStr, level);
  20933. }
  20934. if ((level) % 5 == 0) {
  20935. console.log('zh:每5关上报1次');
  20936. let sjmc = 'challenge_level_' + level;
  20937. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  20938. let sjmcForFirebase = 'challenge_level_' + level;
  20939. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  20940. }
  20941. else {
  20942. console.log('zh:5 no 上报');
  20943. }
  20944. }
  20945. else {
  20946. LocalStorageManager.setItem(keyStr, level);
  20947. }
  20948. }
  20949. }
  20950. UIGameEnd$1.uiName = "UIGameEnd";
  20951. class ShowItem$1 {
  20952. constructor() {
  20953. this.ui = ui_ShowItem.createInstance();
  20954. }
  20955. destroySelf() {
  20956. if (!this.ui.isDisposed) {
  20957. this.ui.removeFromParent();
  20958. this.ui.dispose();
  20959. }
  20960. }
  20961. setParent(parent) {
  20962. parent.addChild(this.ui);
  20963. }
  20964. setPos(x, y) {
  20965. this.ui.x = x;
  20966. this.ui.y = y;
  20967. }
  20968. setUrl(index) {
  20969. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  20970. }
  20971. }
  20972. class UILevelProp$1 extends UIBase {
  20973. constructor() {
  20974. super();
  20975. this.firstPos = 385;
  20976. this.secondPos = 467;
  20977. this.showItemArr = [];
  20978. }
  20979. onFontLoaded() {
  20980. try {
  20981. this.ui.myNode.conditionTxt.font = "arial";
  20982. console.log("zh: onFontLoaded 设置arial字体成功");
  20983. }
  20984. catch (error) {
  20985. console.log("zh: constructor onFontLoaded加载arial字体失败");
  20986. }
  20987. }
  20988. onConstructor() {
  20989. this.ui = ui_UILevelProp.createInstance();
  20990. this.contentPane = this.ui;
  20991. this.isEject = false;
  20992. this.addUIClick(this.ui.closeBtn, this.hide);
  20993. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20994. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  20995. }
  20996. show(level) {
  20997. super.show();
  20998. this.ui.t1.play();
  20999. this.level = level;
  21000. this.data = cfgTable.placeballData[this.level];
  21001. this.updateSelf();
  21002. this.showPreView();
  21003. this.moneyNode.ui.c1.selectedIndex = 2;
  21004. this.moneyNode.checkPowerTime();
  21005. this.moneyNode.powerChange();
  21006. }
  21007. showPreView() {
  21008. let item;
  21009. let data;
  21010. for (let index = 0; index < this.showItemArr.length; index++) {
  21011. item = this.showItemArr[index];
  21012. item.destroySelf();
  21013. }
  21014. this.showItemArr = [];
  21015. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21016. for (const key in cfgData) {
  21017. data = cfgData[key];
  21018. item = new ShowItem$1();
  21019. item.setParent(this.ui.myNode.displayRoot);
  21020. item.setPos(data.x, data.y);
  21021. item.setUrl(data.value);
  21022. this.showItemArr.push(item);
  21023. }
  21024. }
  21025. updateSelf() {
  21026. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21027. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21028. if (this.data.ball == -1) {
  21029. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21030. }
  21031. else {
  21032. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21033. }
  21034. let localData = DataMgr.getPlaceBallLevel(this.level);
  21035. let getAward = localData.getAward;
  21036. let cfg = cfgTable.placeballData[this.level];
  21037. let coin = this.data.award[0];
  21038. let diamond = this.data.award[1];
  21039. if (cfg.type == PlaceBallType.challenge) {
  21040. diamond = 0;
  21041. coin = 100;
  21042. }
  21043. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21044. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21045. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21046. if (cfg.type == PlaceBallType.challenge) {
  21047. this.ui.myNode.coinNode.numTxt.text = "";
  21048. }
  21049. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21050. if (coin > 0 && diamond > 0) {
  21051. this.ui.myNode.diamondNode.x = 385;
  21052. this.ui.myNode.coinNode.x = 467;
  21053. }
  21054. else {
  21055. this.ui.myNode.diamondNode.x = 385;
  21056. this.ui.myNode.coinNode.x = 385;
  21057. }
  21058. if (!getAward) {
  21059. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21060. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21061. }
  21062. else {
  21063. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21064. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21065. }
  21066. }
  21067. startGame() {
  21068. if (DataMgr.powerEnough()) {
  21069. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21070. this.ui.myNode.startBtn.touchable = false;
  21071. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21072. console.log('zh:startGame ');
  21073. this.ui.myNode.startBtn.touchable = true;
  21074. DataMgr.setPower(-1);
  21075. xGame.eventMgr.event(POWER_TIME);
  21076. xGame.common.gameMode = GameMode.placeBall;
  21077. xGame.common.placeBallCurLevel = this.level;
  21078. xGame.uiMgr.Show(UIGame$1);
  21079. this.logEventForChallenge_level_start(this.level);
  21080. xGame.uiMgr.Hide(UILevelDisplay$1);
  21081. xGame.uiMgr.Hide(UIMain$1);
  21082. this.hide();
  21083. }));
  21084. }
  21085. else {
  21086. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21087. xGame.uiMgr.Show(UIPower$1);
  21088. }
  21089. }
  21090. logEventForChallenge_level_start(level) {
  21091. let keyStr = 'sjmd_challenge_level_start';
  21092. let jsonStr = {
  21093. "count": 1,
  21094. "gold_balance ": DataMgr.getCoin(),
  21095. "level": level,
  21096. "diamond_balance ": DataMgr.getDiamond()
  21097. };
  21098. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21099. const d = LocalStorageManager.getItem(keyStr);
  21100. if (level > d.level) {
  21101. jsonStr.count = d.count + 1;
  21102. LocalStorageManager.setItem(keyStr, jsonStr);
  21103. }
  21104. else {
  21105. }
  21106. }
  21107. else {
  21108. LocalStorageManager.setItem(keyStr, jsonStr);
  21109. }
  21110. const reqStr = JSON.stringify(jsonStr);
  21111. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21112. }
  21113. hide() {
  21114. super.hide();
  21115. }
  21116. }
  21117. UILevelProp$1.uiName = "UILevelProp";
  21118. class PutBallLevelDisplay$1 {
  21119. constructor(ui, index) {
  21120. this.index = 0;
  21121. this.ui = ui;
  21122. this.index = index;
  21123. this.ui.onClick(this, this.clickSelf);
  21124. this.updateSelf();
  21125. this.ui.levelTxt.text = (this.index + 1) + "";
  21126. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21127. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21128. }
  21129. updateSelf() {
  21130. let level = this.index + 1;
  21131. this.data = DataMgr.getPlaceBallLevel(level);
  21132. this.ui.starNode.c1.selectedIndex = this.data.star;
  21133. let isChallenge = cfgTable.placeballData[level].type;
  21134. if (this.data.isCur) {
  21135. if (isChallenge) {
  21136. this.ui.c1.selectedIndex = 5;
  21137. }
  21138. else {
  21139. this.ui.c1.selectedIndex = 2;
  21140. }
  21141. }
  21142. else {
  21143. if (this.data.play) {
  21144. if (this.data.star == 3) {
  21145. this.ui.c1.selectedIndex = 0;
  21146. }
  21147. else {
  21148. this.ui.c1.selectedIndex = 1;
  21149. }
  21150. }
  21151. else {
  21152. if (isChallenge) {
  21153. this.ui.c1.selectedIndex = 4;
  21154. }
  21155. else {
  21156. this.ui.c1.selectedIndex = 3;
  21157. }
  21158. }
  21159. }
  21160. }
  21161. clickSelf() {
  21162. if (!this.data.play)
  21163. return;
  21164. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21165. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21166. }
  21167. }
  21168. class UILevelDisplay$1 extends UIBase {
  21169. constructor() {
  21170. super();
  21171. }
  21172. onConstructor() {
  21173. this.ui = ui_UILevelDisplay.createInstance();
  21174. this.contentPane = this.ui;
  21175. this.isEject = false;
  21176. this.myList = this.ui.myNode.myList;
  21177. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21178. this.levelItemArr = [];
  21179. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21180. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21181. this.myList.numItems = levelNum;
  21182. if (Moyu.isKs)
  21183. this.ui.closeNode.closeBtn.x += 100;
  21184. }
  21185. levelItemRender(index, target) {
  21186. let item = new PutBallLevelDisplay$1(target, index);
  21187. this.levelItemArr.push(item);
  21188. }
  21189. show() {
  21190. super.show();
  21191. this.updateLevel();
  21192. this.scrollToPlace();
  21193. }
  21194. updateLevel() {
  21195. let temp;
  21196. for (let index = 0; index < this.levelItemArr.length; index++) {
  21197. temp = this.levelItemArr[index];
  21198. temp.updateSelf();
  21199. }
  21200. }
  21201. scrollToPlace() {
  21202. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21203. let passArr = DataMgr.getPlaceBallLevelList();
  21204. let offest = passArr.length;
  21205. if (offest >= maxNum - 1)
  21206. offest = maxNum - 1;
  21207. this.myList.scrollToView(offest, true, true);
  21208. }
  21209. hide() {
  21210. super.hide();
  21211. }
  21212. }
  21213. UILevelDisplay$1.uiName = "UILevelDisplay";
  21214. class UIMatching$1 extends UIBase {
  21215. constructor() {
  21216. super();
  21217. }
  21218. onConstructor() {
  21219. this.ui = ui_UIMatching.createInstance();
  21220. this.contentPane = this.ui;
  21221. this.isEject = false;
  21222. }
  21223. show(callback) {
  21224. super.show();
  21225. PlatMgr.showBanner(true);
  21226. this.callback = callback;
  21227. let user = Moyu.getUserInfo();
  21228. if (!this.selfPot) {
  21229. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21230. }
  21231. if (!this.aiPot) {
  21232. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21233. }
  21234. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21235. this.ui.selfHead.nameTxt.text = user.nickName;
  21236. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21237. this.ui.aiHead.nameTxt.text = "???";
  21238. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21239. this.ui.selfHead.c1.selectedIndex = 0;
  21240. this.ui.aiHead.c1.selectedIndex = 0;
  21241. this.ui.selfHead.x = this.selfPot.x;
  21242. this.ui.selfHead.y = this.selfPot.y;
  21243. this.ui.aiHead.x = this.aiPot.x;
  21244. this.ui.aiHead.y = this.aiPot.y;
  21245. switch (xGame.common.gameMode) {
  21246. case GameMode.classic:
  21247. break;
  21248. case GameMode.bigMove:
  21249. this.initSkillData();
  21250. break;
  21251. default:
  21252. break;
  21253. }
  21254. this.ui.t1.play(Laya.Handler.create(this, () => {
  21255. this.ui.t2.play(Laya.Handler.create(this, () => {
  21256. switch (xGame.common.gameMode) {
  21257. case GameMode.classic:
  21258. this.waitingPeople();
  21259. break;
  21260. case GameMode.bigMove:
  21261. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21262. break;
  21263. default:
  21264. break;
  21265. }
  21266. }));
  21267. }));
  21268. }
  21269. initSkillData() {
  21270. this.skillSelectData = [];
  21271. let skillUrl = xGame.common.skillIconList;
  21272. let skillName = xGame.common.skillNameList;
  21273. let skillLevel = DataMgr.getBigSkillList();
  21274. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21275. for (let index = 0; index < 5; index++) {
  21276. let obj = {};
  21277. obj.skillImg = skillUrl[index];
  21278. obj.skillName = skillName[index];
  21279. obj.skillType = skillType[index];
  21280. obj.skillLevel = skillLevel[index];
  21281. this.skillSelectData.push(obj);
  21282. }
  21283. }
  21284. getAISkillLevel(myLevel) {
  21285. let video = xGame.common.upSkillLevel;
  21286. let aiLevel;
  21287. let temp;
  21288. if (video) {
  21289. temp = xGame.common.randomNum(-2, -1);
  21290. }
  21291. else {
  21292. if (myLevel <= 5) {
  21293. temp = xGame.common.randomNum(1, 3);
  21294. }
  21295. else if (myLevel <= 9) {
  21296. temp = xGame.common.randomNum(-2, 1);
  21297. }
  21298. else {
  21299. temp = xGame.common.randomNum(-4, 0);
  21300. }
  21301. }
  21302. aiLevel = temp + myLevel;
  21303. if (aiLevel <= 1)
  21304. aiLevel = 1;
  21305. if (aiLevel >= 10)
  21306. aiLevel = 10;
  21307. return aiLevel;
  21308. }
  21309. getAISkillType() {
  21310. return xGame.common.randomNum(1, 4);
  21311. let successTimes = DataMgr.getSkillSuccessTimes();
  21312. let info = cfgTable.aiskillData[successTimes];
  21313. if (!info) {
  21314. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21315. info = cfgTable.aiskillData[max];
  21316. }
  21317. let dataArr = info.skillselect;
  21318. let myCfg = {};
  21319. for (let index = 0; index < dataArr.length; index++) {
  21320. let temp = dataArr[index].split('-');
  21321. myCfg[temp[0]] = {};
  21322. myCfg[temp[0]].id = parseInt(temp[0]);
  21323. myCfg[temp[0]].weight = parseInt(temp[1]);
  21324. }
  21325. let aiCfg = xGame.common.initWeight(myCfg);
  21326. let curData = xGame.common.getRandomWeightData(aiCfg);
  21327. return parseInt(curData.id);
  21328. }
  21329. getAISkillData(index) {
  21330. let myLevel = this.skillSelectData[index].skillLevel;
  21331. let aiLevel = this.getAISkillLevel(myLevel);
  21332. let aiType = this.getAISkillType() - 1;
  21333. return { aiLevel, aiType } = { aiLevel, aiType };
  21334. }
  21335. skillSelectFinish(index) {
  21336. let aiInfo = this.getAISkillData(index);
  21337. xGame.common.gameMgr.selfCurSkill = index;
  21338. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21339. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21340. this.ui.selfHead.c1.selectedIndex = 1;
  21341. this.ui.aiHead.c1.selectedIndex = 1;
  21342. let myData = this.skillSelectData[index];
  21343. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21344. let guide = DataMgr.getSkillGuide();
  21345. if (guide == 0) {
  21346. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21347. }
  21348. else {
  21349. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21350. }
  21351. let aiData = this.skillSelectData[aiInfo.aiType];
  21352. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21353. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21354. this.waitingPeople();
  21355. }
  21356. waitingPeople() {
  21357. let time = xGame.common.randomNum(1000, 3000);
  21358. time += 1000;
  21359. Laya.timer.once(time, this, () => {
  21360. this.matchingSuccess();
  21361. });
  21362. }
  21363. matchingSuccess() {
  21364. let gameUI = xGame.common.gameUI;
  21365. let name = gameUI.ui.topNode.aiNameTxt.text;
  21366. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21367. this.ui.aiHead.nameTxt.text = name;
  21368. this.ui.aiHead.headImg.url = url;
  21369. name = gameUI.ui.topNode.selfNameTxt.text;
  21370. url = gameUI.ui.topNode.selfHeadLoader.url;
  21371. this.ui.selfHead.nameTxt.text = name;
  21372. this.ui.selfHead.headImg.url = url;
  21373. this.ui.t3.play(Laya.Handler.create(this, () => {
  21374. this.callback && this.callback();
  21375. this.ui.t4.play(Laya.Handler.create(this, () => {
  21376. this.destroySelf();
  21377. }));
  21378. }));
  21379. }
  21380. destroySelf() {
  21381. this.callback = null;
  21382. this.skillSelectData = null;
  21383. this.selfPot = null;
  21384. this.aiPot = null;
  21385. if (!this.ui.isDisposed) {
  21386. this.ui.removeFromParent();
  21387. this.ui.dispose();
  21388. }
  21389. xGame.uiMgr.destroyUI(this);
  21390. }
  21391. }
  21392. UIMatching$1.uiName = "UIMatching";
  21393. class SkillDisplay$1 {
  21394. constructor(ui, data, uiIndex) {
  21395. this.starX = 0;
  21396. this.starY = 0;
  21397. this.index = 0;
  21398. this.ui = ui;
  21399. this.data = data;
  21400. this.index = uiIndex;
  21401. this.initSelf();
  21402. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21403. }
  21404. initSelf() {
  21405. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21406. this.ui.nameTxt.text = this.data.name;
  21407. this.ui.describeTxt.text = this.data.describe;
  21408. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21409. this.ui.startBtn.onClick(this, this.startGame);
  21410. this.updateSelf();
  21411. }
  21412. updateSelf() {
  21413. this.checkTry();
  21414. let level = DataMgr.getBigSkillByIndex(this.index);
  21415. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21416. }
  21417. checkTry() {
  21418. let index = this.index;
  21419. let level = DataMgr.getBigSkillByIndex(index);
  21420. if (level == null) {
  21421. DataMgr.setBigSkill(index, 1, false);
  21422. level = 1;
  21423. }
  21424. this.ui.levelTxt.text = "LV." + level;
  21425. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21426. this.ui.tryNode.visible = true;
  21427. else
  21428. this.ui.tryNode.visible = false;
  21429. }
  21430. clickAddLevel() {
  21431. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21432. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21433. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21434. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21435. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21436. }
  21437. else {
  21438. console.log('zh:AD 失败,直接发放奖励');
  21439. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21440. }
  21441. }
  21442. qjff_AD_for_skilldisplay_clickAddLevel() {
  21443. DataMgr.setBigSkill(this.data.index, 1);
  21444. this.updateSelf();
  21445. xGame.common.upSkillLevel = true;
  21446. }
  21447. startGame() {
  21448. console.log('zh:rod skill startgame');
  21449. if (this.data.index == 3) {
  21450. alert('Coming soon!');
  21451. return;
  21452. }
  21453. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21454. let needCoin = xGame.common.bigMoveNeedCoin;
  21455. xGame.common.passAwardCoin = 2000;
  21456. let guide = DataMgr.getSkillGuide();
  21457. console.log('zh:startGame guide=' + guide);
  21458. xGame.common.temSelfLevel = 0;
  21459. if (guide == 0) {
  21460. needCoin = 0;
  21461. xGame.common.temSelfLevel = 100;
  21462. }
  21463. if (DataMgr.coinEnough(needCoin)) {
  21464. DataMgr.setCoin(-needCoin);
  21465. xGame.common.curPlayerSkillType = this.index;
  21466. if (guide == 0)
  21467. xGame.common.curPlayerSkillType = 0;
  21468. console.log('zh: skilldisplay 1');
  21469. xGame.uiMgr.Show(UIGame$1);
  21470. xGame.uiMgr.Hide(UIMain$1);
  21471. xGame.uiMgr.Show(UIMatching$1, () => {
  21472. xGame.common.gameUI.ui.alpha = 1;
  21473. xGame.common.gameUI.startGame();
  21474. xGame.uiMgr.Hide(UISkill$1);
  21475. });
  21476. this.logEventForRod_start();
  21477. }
  21478. else {
  21479. console.log('zh: skilldisplay 2');
  21480. xGame.uiMgr.Show(UIAddProp$1, 0);
  21481. Moyu.sendDataEvent("AddCoinVideo");
  21482. }
  21483. }
  21484. logEventForRod_start() {
  21485. let gfmsIdx = xGame.common.curPlayerSkillType;
  21486. console.log('zh:选择的技能=' + gfmsIdx);
  21487. let gfmc = 'Skyfall Shot';
  21488. if (gfmsIdx == 0) {
  21489. gfmc = 'Skyfall Shot';
  21490. }
  21491. if (gfmsIdx == 1) {
  21492. gfmc = 'Surging break';
  21493. }
  21494. if (gfmsIdx == 2) {
  21495. gfmc = 'Frost Lock';
  21496. }
  21497. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21498. let jsonStr = {
  21499. "count": 0,
  21500. "name": gfmc
  21501. };
  21502. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21503. const d = LocalStorageManager.getItem(keyStr);
  21504. jsonStr.count = d.count + 1;
  21505. LocalStorageManager.setItem(keyStr, jsonStr);
  21506. }
  21507. else {
  21508. LocalStorageManager.setItem(keyStr, jsonStr);
  21509. }
  21510. const reqStr = JSON.stringify(jsonStr);
  21511. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21512. }
  21513. }
  21514. class UISkill$1 extends UIBase {
  21515. constructor() {
  21516. super();
  21517. this.skillData = [];
  21518. }
  21519. onConstructor() {
  21520. this.ui = ui_UISkill.createInstance();
  21521. this.contentPane = this.ui;
  21522. this.isEject = false;
  21523. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21524. this.initSkillData();
  21525. console.log('zh:aaaaaa1111111111');
  21526. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21527. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21528. console.log('zh:aaaaaa22222222');
  21529. this.displayList = [];
  21530. this.ui.skillNode.skillList.numItems = 3;
  21531. this.addUIClick(this.ui, this.interuptSecretary);
  21532. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21533. this.ui.talkNode.visible = false;
  21534. if (Moyu.isKs)
  21535. this.ui.closeNode.closeBtn.x += 100;
  21536. }
  21537. show() {
  21538. super.show();
  21539. this.playSecretaryIdle();
  21540. this.moneyNode.ui.c1.selectedIndex = 1;
  21541. Laya.timer.clearAll(this);
  21542. xGame.soundMgr.playSound("s_start");
  21543. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21544. let guide = DataMgr.getSkillGuide();
  21545. this.ui.guideNode.visible = guide == 0;
  21546. let item = this.getSkillItemByUIIndex(0);
  21547. if (guide == 0) {
  21548. item.ui.c1.selectedIndex = 1;
  21549. }
  21550. else {
  21551. item.ui.c1.selectedIndex = 0;
  21552. }
  21553. this.ui.guideNode.guideBtn.visible = guide == 0;
  21554. for (let index = 0; index < this.displayList.length; index++) {
  21555. this.displayList[index].checkTry();
  21556. }
  21557. }
  21558. getSkillItemByUIIndex(cur) {
  21559. for (let index = 0; index < this.displayList.length; index++) {
  21560. if (this.displayList[index].index == cur) {
  21561. return this.displayList[index];
  21562. }
  21563. }
  21564. }
  21565. enterGuideLevel() {
  21566. let item = this.getSkillItemByUIIndex(0);
  21567. item.startGame();
  21568. if (DataMgr.getNewUser())
  21569. Moyu.sendDataEvent("gameStart1");
  21570. }
  21571. initSkillData() {
  21572. this.skillData = [];
  21573. let nameList = xGame.common.skillNameList;
  21574. let iconList = xGame.common.skillIconList;
  21575. let describeList = [
  21576. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21577. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21578. "The power of frost descends—freezing the flow and taking full control of the game!"
  21579. ];
  21580. console.log('zh:initSkillData 111111111');
  21581. let data;
  21582. for (let index = 0; index < nameList.length; index++) {
  21583. data = {};
  21584. data.name = nameList[index];
  21585. data.icon = iconList[index];
  21586. data.describe = describeList[index];
  21587. data.index = index;
  21588. this.skillData.push(data);
  21589. }
  21590. }
  21591. updateSkillItem(index, target) {
  21592. if (this.displayList[index] == null) {
  21593. let uiIndex;
  21594. switch (index) {
  21595. case 0:
  21596. uiIndex = 1;
  21597. break;
  21598. case 1:
  21599. uiIndex = 0;
  21600. break;
  21601. case 2:
  21602. uiIndex = 2;
  21603. break;
  21604. case 3:
  21605. uiIndex = 3;
  21606. break;
  21607. default:
  21608. break;
  21609. }
  21610. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21611. this.displayList.push(temp);
  21612. }
  21613. }
  21614. playSecretaryIdle() {
  21615. let parent = this.ui.secretary.displayObject;
  21616. parent.destroyChildren();
  21617. let xx = this.ui.secretary.width / 2;
  21618. let yy = this.ui.secretary.height;
  21619. let scale = xGame.common.getSecretaryScale();
  21620. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21621. xGame.common.secretary.play(data, 0, true, parent);
  21622. }
  21623. returnUIMain() {
  21624. this.hide();
  21625. xGame.common.stopGirlPop(this.ui.talkNode);
  21626. xGame.uiMgr.Show(UIMain$1);
  21627. }
  21628. interuptSecretary() {
  21629. Laya.timer.clearAll(this);
  21630. this.playSecretaryRandomSound();
  21631. }
  21632. playSecretaryRandomSound() {
  21633. if (this.isHide)
  21634. return;
  21635. let time = xGame.common.randomNum(45000, 60000);
  21636. Laya.timer.once(time, this, () => {
  21637. if (this.isHide)
  21638. return;
  21639. let index = xGame.common.randomNum(4, 7);
  21640. xGame.soundMgr.playSound("s_main0" + index);
  21641. let words = 1;
  21642. switch (index) {
  21643. case 4:
  21644. words = 5;
  21645. break;
  21646. case 5:
  21647. words = 3;
  21648. break;
  21649. case 6:
  21650. words = 6;
  21651. break;
  21652. case 7:
  21653. words = 7;
  21654. break;
  21655. default:
  21656. break;
  21657. }
  21658. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21659. this.playSecretaryRandomSound();
  21660. });
  21661. }
  21662. }
  21663. UISkill$1.uiName = "UISkill";
  21664. class UIAddProp$1 extends UIBase {
  21665. constructor() {
  21666. super();
  21667. this.curType = "";
  21668. }
  21669. onConstructor() {
  21670. this.ui = ui_UIAddProp.createInstance();
  21671. this.contentPane = this.ui;
  21672. this.isEject = false;
  21673. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21674. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  21675. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  21676. this.updateUI();
  21677. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  21678. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  21679. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  21680. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  21681. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  21682. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  21683. }
  21684. show(type) {
  21685. super.show();
  21686. this.curType = type == 0 ? "coin" : "diamond";
  21687. this.switchBtn("");
  21688. this.ui.t0.play();
  21689. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  21690. PlatMgr.showInsert(true);
  21691. }
  21692. closeSelf() {
  21693. this.hide();
  21694. }
  21695. updateUI() {
  21696. let data = cfgTable.moneyData;
  21697. let temp;
  21698. let obj;
  21699. for (const key in data) {
  21700. temp = data[key];
  21701. obj = this.ui.myNode["node" + key];
  21702. if (parseInt(key) <= 2) {
  21703. obj.diamondTxt.text = "+" + temp.num;
  21704. }
  21705. else {
  21706. obj.coinTxt.text = temp.num;
  21707. obj.diamondTxt.text = temp.get.split('_')[1];
  21708. }
  21709. }
  21710. this.updateDiamondShare();
  21711. }
  21712. updateDiamondShare() {
  21713. let data = DataMgr.getShareDiamondTimes();
  21714. if (data >= xGame.common.maxShareDiamondTimes) {
  21715. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  21716. this.ui.myNode.node1.touchable = false;
  21717. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21718. }
  21719. else {
  21720. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  21721. this.ui.myNode.node1.touchable = true;
  21722. }
  21723. }
  21724. switchBtn(type) {
  21725. if (type == "")
  21726. type = this.curType;
  21727. else {
  21728. if (this.curType == type) {
  21729. return;
  21730. }
  21731. else {
  21732. this.curType = type;
  21733. }
  21734. }
  21735. if (type == "coin") {
  21736. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  21737. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  21738. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  21739. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  21740. this.ui.myNode.c1.selectedIndex = 0;
  21741. }
  21742. else {
  21743. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  21744. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  21745. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  21746. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  21747. this.ui.myNode.c1.selectedIndex = 1;
  21748. }
  21749. }
  21750. convertCoin(index) {
  21751. let data = cfgTable.moneyData[index];
  21752. let coinNum = data.num;
  21753. let str = data.get.split('_')[1];
  21754. let needDiamond = parseInt(str);
  21755. if (DataMgr.diamondEnough(needDiamond)) {
  21756. DataMgr.setDiamond(-needDiamond);
  21757. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  21758. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  21759. }
  21760. else {
  21761. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  21762. this.switchBtn("diamond");
  21763. }
  21764. }
  21765. videoGetDiamond() {
  21766. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  21767. if (Laya.Browser.onAndroid) {
  21768. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21769. if (!boo) {
  21770. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21771. return;
  21772. }
  21773. }
  21774. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  21775. }
  21776. else {
  21777. console.log('zh:AD 失败,直接发放奖励');
  21778. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  21779. }
  21780. }
  21781. qjff_AD_for_uiAddProp_videoGetDiamond() {
  21782. let num = cfgTable.moneyData[2].num;
  21783. xGame.common.playObjFlyAnim(num, Prop.diamond);
  21784. this.closeSelf();
  21785. }
  21786. videoGetCoin() {
  21787. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  21788. if (Laya.Browser.onAndroid) {
  21789. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21790. if (!boo) {
  21791. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21792. return;
  21793. }
  21794. }
  21795. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  21796. }
  21797. else {
  21798. console.log('zh:AD 失败,直接发放奖励');
  21799. this.qjff_AD_for_uiAddProp_videoGetCoin();
  21800. }
  21801. }
  21802. qjff_AD_for_uiAddProp_videoGetCoin() {
  21803. xGame.common.playObjFlyAnim(2000, Prop.coin);
  21804. this.closeSelf();
  21805. }
  21806. shareGetDiamond() {
  21807. let times = DataMgr.getShareDiamondTimes();
  21808. if (times >= xGame.common.maxShareDiamondTimes) {
  21809. console.log('zh: 233333333333 maxShareDiamondTimes');
  21810. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21811. }
  21812. else {
  21813. console.log('zh:33333333333333ad');
  21814. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  21815. if (Laya.Browser.onAndroid) {
  21816. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21817. if (!boo) {
  21818. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21819. return;
  21820. }
  21821. }
  21822. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  21823. }
  21824. else {
  21825. console.log('zh:AD 失败,直接发放奖励');
  21826. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  21827. }
  21828. }
  21829. }
  21830. qjff_AD_for_uiAddProp_shareGetDiamond() {
  21831. let diamond = xGame.common.randomNum(50, 100);
  21832. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  21833. DataMgr.setShareDiamondTimes(1);
  21834. this.updateDiamondShare();
  21835. }
  21836. openPutBallView() {
  21837. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  21838. let skill = xGame.uiMgr.getUI(UISkill$1);
  21839. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  21840. let uigame = xGame.uiMgr.getUI(UIGame$1);
  21841. if (end && !end.isHide) {
  21842. xGame.uiMgr.Hide(UIGameEnd$1);
  21843. xGame.uiMgr.Show(UIMain$1);
  21844. }
  21845. if (skill && !skill.isHide)
  21846. xGame.uiMgr.Hide(UISkill$1);
  21847. if (uigame && !uigame.isHide)
  21848. xGame.uiMgr.Hide(UIGame$1);
  21849. if (level && !level.isHide) {
  21850. }
  21851. else {
  21852. xGame.uiMgr.Show(UILevelDisplay$1);
  21853. }
  21854. this.closeSelf();
  21855. }
  21856. }
  21857. UIAddProp$1.uiName = "UIAddProp";
  21858. class MoneyNode$1 {
  21859. constructor(ui) {
  21860. this.leftTime = 0;
  21861. this.ui = ui;
  21862. this.ui.addCoinBtn.onClick(this, this.addCoin);
  21863. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  21864. this.ui.addPowerBtn.onClick(this, this.addPower);
  21865. this.ui.c1.selectedIndex = 1;
  21866. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  21867. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  21868. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  21869. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  21870. this.coinChange();
  21871. this.diamondChange();
  21872. this.powerChange();
  21873. }
  21874. addPower() {
  21875. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21876. xGame.uiMgr.Show(UIPower$1);
  21877. }
  21878. powerChange() {
  21879. let powerNum = DataMgr.getPower();
  21880. this.ui.powerTxt.text = powerNum + "";
  21881. }
  21882. checkPowerTime() {
  21883. let cur = new Date().getTime();
  21884. let last = DataMgr.getPowerTime();
  21885. if (last == 0) {
  21886. last = cur;
  21887. DataMgr.setPowerTime(cur);
  21888. }
  21889. let power = DataMgr.getPower();
  21890. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  21891. Laya.timer.clearAll(this);
  21892. if (power >= xGame.common.natureMaxPower) {
  21893. this.ui.powerTimeTxt.text = "";
  21894. DataMgr.setPowerTime(cur);
  21895. return;
  21896. }
  21897. if (power + offset >= xGame.common.natureMaxPower) {
  21898. DataMgr.setPower(xGame.common.natureMaxPower, false);
  21899. this.ui.powerTimeTxt.text = "";
  21900. DataMgr.setPowerTime(cur);
  21901. }
  21902. else {
  21903. if (offset > 0) {
  21904. DataMgr.setPower(offset);
  21905. DataMgr.setPowerTime(cur);
  21906. }
  21907. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  21908. this.leftTime = xGame.common.powerRecoverNum - time;
  21909. if (this.leftTime <= 0)
  21910. this.leftTime = 0;
  21911. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21912. Laya.timer.loop(1000, this, this.updatePowerTime);
  21913. }
  21914. }
  21915. updatePowerTime() {
  21916. this.leftTime -= 1;
  21917. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21918. if (this.leftTime <= 0) {
  21919. this.checkPowerTime();
  21920. }
  21921. }
  21922. coinChange() {
  21923. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  21924. }
  21925. diamondChange() {
  21926. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  21927. }
  21928. addCoin() {
  21929. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21930. Moyu.sendDataEvent("AddCoinBtn");
  21931. xGame.uiMgr.Show(UIAddProp$1, 0);
  21932. }
  21933. addDiamond() {
  21934. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21935. Moyu.sendDataEvent("AddDiamondBtn");
  21936. xGame.uiMgr.Show(UIAddProp$1, 1);
  21937. }
  21938. }
  21939. class SettingNode$1 {
  21940. constructor(ui) {
  21941. this.showSetting = false;
  21942. this.openSound = true;
  21943. this.openShake = true;
  21944. this.ui = ui;
  21945. this.ui.soundBtn.onClick(this, this.switchSound);
  21946. this.ui.shakeBtn.onClick(this, this.switchShake);
  21947. this.ui.xyBtn.onClick(this, this.onXy);
  21948. this.ui.clickNode.onClick(this, this.changeSetting);
  21949. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  21950. this.ui.xyBtn.visible = false;
  21951. this.ui.shakeBtn.visible = false;
  21952. }
  21953. changeSetting() {
  21954. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21955. this.showSetting = !this.showSetting;
  21956. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  21957. }
  21958. switchSound() {
  21959. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21960. this.openSound = !this.openSound;
  21961. Moyu.onSetting(this.openSound, this.openShake);
  21962. xGame.soundMgr.onSetting(this.openSound);
  21963. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  21964. }
  21965. switchShake() {
  21966. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21967. this.openShake = !this.openShake;
  21968. Moyu.onSetting(this.openSound, this.openShake);
  21969. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  21970. }
  21971. onXy() {
  21972. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21973. MoyuMgr$1.showXy(1);
  21974. }
  21975. }
  21976. class UIDraw$1 extends UIBase {
  21977. constructor() {
  21978. super();
  21979. this.curKey = 0;
  21980. }
  21981. onConstructor() {
  21982. this.ui = ui_UIDraw.createInstance();
  21983. this.contentPane = this.ui;
  21984. this.isEject = false;
  21985. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21986. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21987. this.addUIClick(this.ui.drawBtn, this.startDraw);
  21988. this.initDraw();
  21989. this.initUI();
  21990. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21991. if (Moyu.isKs)
  21992. this.ui.closeNode.closeBtn.x += 100;
  21993. }
  21994. show() {
  21995. super.show();
  21996. this.ui.t0.play();
  21997. this.playSecretaryIdle();
  21998. this.updateDraw();
  21999. this.checkFree();
  22000. if (PlatMgr.bannerDelay > 0) {
  22001. this.ui.closeNode.closeBtn.visible = false;
  22002. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22003. this.ui.closeNode.closeBtn.visible = true;
  22004. });
  22005. }
  22006. PlatMgr.showRateBanner();
  22007. }
  22008. hide() {
  22009. Laya.timer.clearAll(this);
  22010. super.hide();
  22011. }
  22012. checkFree() {
  22013. let isFree = DataMgr.getDailyfreeDrawTimes();
  22014. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22015. }
  22016. initDraw() {
  22017. this.drawObj = [];
  22018. let data = cfgTable.drawData;
  22019. let temp;
  22020. let weight = 0;
  22021. for (const key in data) {
  22022. temp = data[key];
  22023. weight += temp.weight;
  22024. this.drawObj.push(weight);
  22025. }
  22026. this.allWeight = weight;
  22027. }
  22028. initUI() {
  22029. let data = cfgTable.drawData;
  22030. let temp;
  22031. let img;
  22032. let txt;
  22033. for (const key in data) {
  22034. temp = data[key];
  22035. img = this.ui.myNode.rotNode["img" + key];
  22036. txt = this.ui.myNode.rotNode["txt" + key];
  22037. img.url = xGame.common.getGameIconUrl(temp.icon);
  22038. txt.visible = true;
  22039. if (temp.award > 2) {
  22040. img.rotation = 0;
  22041. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22042. }
  22043. else {
  22044. img.rotation = temp.rotation;
  22045. txt.text = temp.num;
  22046. }
  22047. }
  22048. }
  22049. getCurkey() {
  22050. let rand = Math.random() * this.allWeight;
  22051. let temp;
  22052. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22053. temp = this.drawObj[index];
  22054. if (index == 0) {
  22055. if (rand < temp) {
  22056. return index + 1;
  22057. }
  22058. }
  22059. else {
  22060. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22061. return index + 1;
  22062. }
  22063. }
  22064. }
  22065. return 2;
  22066. }
  22067. startDraw() {
  22068. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22069. if (freeTimes > 0) {
  22070. this.beginDraw();
  22071. DataMgr.setDailyfreeDrawTimes(0);
  22072. this.checkFree();
  22073. }
  22074. else {
  22075. if (Laya.Browser.onAndroid) {
  22076. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22077. if (!boo) {
  22078. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22079. return;
  22080. }
  22081. }
  22082. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22083. }
  22084. else {
  22085. console.log('zh:AD 失败,直接发放奖励');
  22086. this.qjff_chouJiang();
  22087. }
  22088. }
  22089. }
  22090. qjff_chouJiang() {
  22091. this.beginDraw();
  22092. }
  22093. beginDraw() {
  22094. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22095. this.ui.drawBtn.touchable = false;
  22096. this.curKey = this.getCurkey();
  22097. console.log("当前key", this.curKey);
  22098. let cell = 60;
  22099. let lap = 3;
  22100. let angle = cell * (this.curKey - 1) + lap * 360;
  22101. let target = this.ui.myNode.rotNode;
  22102. target.rotation = 0;
  22103. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22104. console.log("旋转完成");
  22105. this.ui.drawBtn.touchable = true;
  22106. this.getAward();
  22107. }));
  22108. }
  22109. getAward() {
  22110. let data = cfgTable.drawData[this.curKey];
  22111. let temp = new AwardType();
  22112. temp.type = data.award;
  22113. temp.num = data.num;
  22114. xGame.common.getAward([temp], () => {
  22115. DataMgr.setDrawTimes(1);
  22116. this.updateDraw();
  22117. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22118. });
  22119. }
  22120. updateDraw() {
  22121. let drawTimes = DataMgr.getDrawTimes();
  22122. let awardTimes = DataMgr.getDrawAwardTimes();
  22123. if (Math.floor(drawTimes / 3) > awardTimes) {
  22124. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22125. this.ui.extraNode.boxBtn.touchable = true;
  22126. this.ui.extraNode.tipsTxt.text = "3/3";
  22127. this.ui.extraNode.barNode.width = 265;
  22128. this.getExtraAward();
  22129. }
  22130. else {
  22131. this.ui.extraNode.boxBtn.t0.stop();
  22132. this.ui.extraNode.boxBtn.touchable = false;
  22133. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22134. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22135. }
  22136. let data = cfgTable.drawData[1];
  22137. if (awardTimes == 0) {
  22138. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22139. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22140. this.ui.myNode.rotNode.img1.rotation = 0;
  22141. }
  22142. else {
  22143. let award = data.nextid;
  22144. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22145. this.ui.myNode.rotNode.txt1.text = award[1];
  22146. this.ui.myNode.rotNode.img1.rotation = 0;
  22147. }
  22148. }
  22149. getExtraAward() {
  22150. let drawTimes = DataMgr.getDrawTimes();
  22151. let awardTimes = DataMgr.getDrawAwardTimes();
  22152. let data = cfgTable.drawData[1];
  22153. let award = new AwardType();
  22154. if (awardTimes == 0) {
  22155. award.num = data.num;
  22156. award.type = data.award;
  22157. xGame.common.getAward([award], () => {
  22158. let all = Math.floor(drawTimes / 3);
  22159. DataMgr.setDrawAwardTimes(all);
  22160. this.updateDraw();
  22161. });
  22162. }
  22163. else {
  22164. award.num = parseInt(data.nextid[1]);
  22165. award.type = parseInt(data.nextid[0]);
  22166. xGame.common.getAward([award], () => {
  22167. let all = Math.floor(drawTimes / 3);
  22168. DataMgr.setDrawAwardTimes(all);
  22169. this.updateDraw();
  22170. });
  22171. }
  22172. }
  22173. closeSelf() {
  22174. this.hide();
  22175. }
  22176. playSecretaryIdle() {
  22177. let parent = this.ui.secretary.displayObject;
  22178. parent.destroyChildren();
  22179. let xx = this.ui.secretary.width / 2;
  22180. let yy = this.ui.secretary.height;
  22181. let scale = xGame.common.getSecretaryScale();
  22182. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22183. xGame.common.secretary.play(data, 0, true, parent);
  22184. }
  22185. }
  22186. UIDraw$1.uiName = "UIDraw";
  22187. class UIRanking$1 extends UIBase {
  22188. constructor() {
  22189. super();
  22190. this.showSelf = true;
  22191. this.rankType = 1;
  22192. this.rankList = [];
  22193. this.topX = 10;
  22194. this.myIndex = this.topX + 1;
  22195. this.myStar = 0;
  22196. }
  22197. onConstructor() {
  22198. this.ui = ui_UIRanking.createInstance();
  22199. this.contentPane = this.ui;
  22200. this.isEject = false;
  22201. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22202. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22203. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22204. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22205. this.ui.myNode.myList.setVirtual();
  22206. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22207. }
  22208. show() {
  22209. super.show();
  22210. this.getPaiHangBangDataFormJosnFile();
  22211. this.updateSelf();
  22212. let self = Moyu.getUserInfo();
  22213. if (!self.isAuth) {
  22214. Moyu.initUser(this, () => {
  22215. DataMgr.upRankData();
  22216. });
  22217. }
  22218. }
  22219. getPaiHangBangDataFormJosnFile() {
  22220. const rankingList = cfgTable.paiHangBangData.list;
  22221. this.updateItemData(rankingList);
  22222. }
  22223. updateSelfItem() {
  22224. console.log('zh:Moyu.platType =' + Moyu.platType);
  22225. let self = Moyu.getUserInfo();
  22226. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22227. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22228. if (this.myIndex > this.topX) {
  22229. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22230. }
  22231. else {
  22232. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22233. }
  22234. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22235. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22236. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22237. }
  22238. updateItemData(data) {
  22239. this.myStar = xGame.common.getAllStarNum();
  22240. if (this.rankList.length < 2) {
  22241. this.rankList = data;
  22242. let self = Moyu.getUserInfo();
  22243. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22244. self.headIcon = self.headIcon;
  22245. for (let i = 0; i < data.length; i++) {
  22246. let data = this.rankList[i];
  22247. if (data.userId == self.userId) {
  22248. this.rankList.splice(i, 1);
  22249. break;
  22250. }
  22251. }
  22252. for (let i = 0; i < data.length; i++) {
  22253. let data = this.rankList[i];
  22254. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22255. this.myIndex = i + 1;
  22256. let user = { headIcon: self.headIcon, nickName: "myself" };
  22257. let ud = { user: user, data: {} };
  22258. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22259. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22260. if (Moyu.platType < 11) {
  22261. user.headIcon = self.headIcon;
  22262. user.nickName = self.nickName;
  22263. }
  22264. this.rankList.splice(i, 0, md);
  22265. break;
  22266. }
  22267. }
  22268. }
  22269. this.updateSelfItem();
  22270. this.ui.myNode.myList.numItems = this.rankList.length;
  22271. }
  22272. updateItemUI(index, obj) {
  22273. let data = this.rankList[index];
  22274. let userData = JSON.parse(data.userData).user;
  22275. obj.nameTxt.text = userData.nickName.toString();
  22276. obj.valueTxt.text = data.rankScore;
  22277. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22278. obj.rankTxt.text = index + 1;
  22279. switch (index) {
  22280. case 0:
  22281. this.setImg(obj, 1, 0, 0);
  22282. obj.rankTxt.color = "#FFC047";
  22283. break;
  22284. case 1:
  22285. this.setImg(obj, 0, 1, 0);
  22286. obj.rankTxt.color = "#ACACAC";
  22287. break;
  22288. case 2:
  22289. this.setImg(obj, 0, 0, 1);
  22290. obj.rankTxt.color = "#D09672";
  22291. break;
  22292. default:
  22293. this.setImg(obj, 0, 0, 0);
  22294. obj.rankTxt.color = "#496FAB";
  22295. break;
  22296. }
  22297. }
  22298. setImg(obj, a, b, c) {
  22299. obj.img1.visible = a ? true : false;
  22300. obj.img2.visible = b ? true : false;
  22301. obj.img3.visible = c ? true : false;
  22302. }
  22303. changeList(type) {
  22304. this.rankType = type;
  22305. this.updateSelf();
  22306. }
  22307. changeSelfNode() {
  22308. this.showSelf = !this.showSelf;
  22309. this.updateSelf();
  22310. }
  22311. updateSelf() {
  22312. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22313. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22314. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22315. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22316. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22317. }
  22318. }
  22319. UIRanking$1.uiName = "UIRanking";
  22320. class UISecretary$1 extends UIBase {
  22321. constructor() {
  22322. super();
  22323. this.curIndex = 1;
  22324. }
  22325. onConstructor() {
  22326. this.ui = ui_UISecretary.createInstance();
  22327. this.contentPane = this.ui;
  22328. this.isEject = false;
  22329. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22330. this.nodeObj = { left: null, right: null, cur: null };
  22331. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22332. }
  22333. show() {
  22334. super.show();
  22335. this.ui.t0.play();
  22336. this.updateData();
  22337. }
  22338. addSecretarySpine(node, spineName) {
  22339. if (spineName == "mishu") {
  22340. if (this.secretarySpine1) {
  22341. node.displayObject.destroyChildren();
  22342. this.playWoman(this.secretarySpine1, node.displayObject);
  22343. }
  22344. else {
  22345. let spine1 = new SpineMgr("mishu", () => {
  22346. this.secretarySpine1 = spine1;
  22347. this.playWoman(this.secretarySpine1, node.displayObject);
  22348. });
  22349. }
  22350. }
  22351. else {
  22352. if (this.secretarySpine2) {
  22353. node.displayObject.destroyChildren();
  22354. this.playWoman(this.secretarySpine2, node.displayObject);
  22355. }
  22356. else {
  22357. let spine2 = new SpineMgr("xiaomishu2", () => {
  22358. this.secretarySpine2 = spine2;
  22359. this.playWoman(this.secretarySpine2, node.displayObject);
  22360. });
  22361. }
  22362. }
  22363. }
  22364. playWoman(node, parent) {
  22365. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22366. let yy = this.ui.myNode.gameNode3.secretary.height;
  22367. let scale = 1.5;
  22368. if (node == this.secretarySpine2) {
  22369. scale = 1.2;
  22370. }
  22371. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22372. node.play(data, 0, true, parent);
  22373. }
  22374. turnLeft() {
  22375. this.curIndex--;
  22376. if (this.curIndex < 1) {
  22377. this.curIndex = 2;
  22378. }
  22379. let left = this.nodeObj.left;
  22380. let right = this.nodeObj.right;
  22381. let cur = this.nodeObj.cur;
  22382. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22383. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22384. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22385. this.updateData();
  22386. }));
  22387. this.ui.myNode.setChildIndex(right, 2);
  22388. this.nodeObj.left = cur;
  22389. this.nodeObj.right = left;
  22390. this.nodeObj.cur = right;
  22391. }
  22392. turnRight() {
  22393. this.curIndex++;
  22394. if (this.curIndex > 2) {
  22395. this.curIndex = 1;
  22396. }
  22397. let left = this.nodeObj.left;
  22398. let right = this.nodeObj.right;
  22399. let cur = this.nodeObj.cur;
  22400. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22401. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22402. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22403. this.updateData();
  22404. }));
  22405. this.ui.myNode.setChildIndex(left, 2);
  22406. this.nodeObj.left = right;
  22407. this.nodeObj.right = cur;
  22408. this.nodeObj.cur = left;
  22409. }
  22410. updateData() {
  22411. console.log('zh: updateData FFFFFFFFFF');
  22412. let data = cfgTable.secretaryshopData;
  22413. let children = this.ui.myNode._children;
  22414. let temp;
  22415. let curData;
  22416. for (let index = 0; index < children.length; index++) {
  22417. temp = children[index];
  22418. curData = data[1];
  22419. temp.heightTxt.text = curData.height;
  22420. temp.foodTxt.text = curData.food;
  22421. temp.historyTxt.text = curData.history;
  22422. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22423. this.addSecretarySpine(temp.secretary, curData.spine);
  22424. let womanIndex = curData.id - 1;
  22425. let getWoman = DataMgr.getSecretary(womanIndex);
  22426. let curUse = DataMgr.getCurSecretary();
  22427. if (getWoman) {
  22428. if (curUse == womanIndex) {
  22429. temp.purchaseBtn.c1.selectedIndex = 1;
  22430. }
  22431. else {
  22432. temp.purchaseBtn.c1.selectedIndex = 2;
  22433. }
  22434. }
  22435. else {
  22436. temp.purchaseBtn.c1.selectedIndex = 0;
  22437. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22438. }
  22439. temp.purchaseBtn.visible = false;
  22440. }
  22441. }
  22442. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22443. console.log('zh: 点击了clickSecretary ');
  22444. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22445. if (getWoman) {
  22446. if (curUse != womanIndex) {
  22447. console.log();
  22448. DataMgr.setCurSecretary(womanIndex);
  22449. this.updateData();
  22450. }
  22451. }
  22452. else {
  22453. console.log('zh:点击购买了');
  22454. let need = needDiamond;
  22455. if (DataMgr.diamondEnough(need)) {
  22456. DataMgr.setDiamond(-need);
  22457. DataMgr.setSecretary(womanIndex, 1);
  22458. DataMgr.setCurSecretary(womanIndex);
  22459. this.updateData();
  22460. }
  22461. else {
  22462. xGame.uiMgr.Show(UIAddProp$1, 1);
  22463. }
  22464. }
  22465. }
  22466. closeSelf() {
  22467. this.hide();
  22468. }
  22469. }
  22470. UISecretary$1.uiName = "UISecretary";
  22471. class BallRodDisplay$1 {
  22472. constructor(ui, index) {
  22473. this.index = 0;
  22474. this.uiIndex = 0;
  22475. this.ui = ui;
  22476. this.index = index;
  22477. this.initData();
  22478. }
  22479. initData() {
  22480. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22481. let data = cfgTable.ballrodData[this.index + 1];
  22482. this.ui.nameTxt.text = data.name;
  22483. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22484. this.ui.levelNode.c1.selectedIndex = data.quality;
  22485. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22486. if (data.spine) {
  22487. this.mySpine = new SpineMgr(data.spine, () => {
  22488. let xx = 150;
  22489. let yy = 70;
  22490. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22491. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22492. });
  22493. }
  22494. }
  22495. updateSelf() {
  22496. console.log('zh:updateSelf -------------- ');
  22497. let get = DataMgr.getBallRod(this.index);
  22498. if (get == null)
  22499. get = 1;
  22500. let curUse = DataMgr.getCurBallRod();
  22501. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22502. if (get) {
  22503. if (curUse == this.index) {
  22504. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22505. }
  22506. else {
  22507. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22508. }
  22509. }
  22510. else {
  22511. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22512. }
  22513. }
  22514. buyBallRod() {
  22515. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22516. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22517. switch (selectedIndex) {
  22518. case 0:
  22519. break;
  22520. case 1:
  22521. console.log('zh:点击了 USE THIS');
  22522. DataMgr.setCurBallRod(this.index);
  22523. let curUse = DataMgr.getCurBallRod();
  22524. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22525. let ui = xGame.uiMgr.getUI(UIShop$1);
  22526. ui.updateBallRod();
  22527. break;
  22528. case 2:
  22529. let data = cfgTable.ballrodData[this.index + 1];
  22530. let need = data.price;
  22531. if (DataMgr.diamondEnough(need)) {
  22532. this.buyQiuGan(data);
  22533. DataMgr.setDiamond(-need);
  22534. DataMgr.setBallRod(this.index, 1);
  22535. DataMgr.setCurBallRod(this.index);
  22536. let ui = xGame.uiMgr.getUI(UIShop$1);
  22537. ui.updateBallRod();
  22538. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22539. }
  22540. else {
  22541. xGame.uiMgr.Show(UIAddProp$1, 1);
  22542. }
  22543. break;
  22544. default:
  22545. break;
  22546. }
  22547. }
  22548. buyQiuGan(qgItem) {
  22549. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  22550. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22551. if (userInfo == null) {
  22552. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22553. return;
  22554. }
  22555. let reqData = xGame.httpMgr.getReqData();
  22556. let pd = JSON.parse(reqData);
  22557. pd.qiuGanData = qgItem;
  22558. reqData = JSON.stringify(pd);
  22559. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  22560. try {
  22561. console.log('zh:buySp res = ' + JSON.stringify(res));
  22562. let code = res.code;
  22563. let msg = res.msg;
  22564. if (code == 401) {
  22565. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22566. alert(TIP_MSG_key.loginTimeOut);
  22567. xGame.uiMgr.Show(UIMsg$1, msg);
  22568. return;
  22569. }
  22570. if (code == 200) {
  22571. xGame.uiMgr.Show(UIMsg$1, msg);
  22572. DataMgr.getUserZiChanInfo();
  22573. }
  22574. else {
  22575. xGame.uiMgr.Show(UIMsg$1, msg);
  22576. }
  22577. }
  22578. catch (error) {
  22579. console.log('error=' + error);
  22580. alert(error);
  22581. }
  22582. finally {
  22583. }
  22584. });
  22585. }
  22586. logEventForGouMaiGan(qiuGanName) {
  22587. const ev = {
  22588. value: qiuGanName
  22589. };
  22590. const jsonStr = JSON.stringify(ev);
  22591. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22592. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22593. }
  22594. }
  22595. class DaoJuDisplay$1 {
  22596. constructor(ui, index) {
  22597. this.index = 0;
  22598. this.uiIndex = 0;
  22599. this.ggSpid = "";
  22600. this.ui = ui;
  22601. this.index = index;
  22602. this.initData();
  22603. }
  22604. initData() {
  22605. this.ui.btn_buy.onClick(this, this.gotoBuy);
  22606. let data = cfgTable.daoJuData[this.index + 1];
  22607. console.log('zh:' + JSON.stringify(data));
  22608. this.ui.nameTxt.text = data.spbt;
  22609. this.ui.n_jiaGe.text = data.spjg + "";
  22610. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22611. this.ggSpid = data.ggSpid;
  22612. let baseUrl = "asset/sound/ogg/";
  22613. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  22614. }
  22615. gotoBuy() {
  22616. let userInfo = LocalStorageManager.getItem('userInfo');
  22617. if (userInfo != null) {
  22618. let token = userInfo.token;
  22619. let ggSpid = this.ggSpid;
  22620. JSBridgeUtils.instance.startGgPay(token, ggSpid);
  22621. return;
  22622. }
  22623. else {
  22624. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22625. }
  22626. }
  22627. gotoBuy1() {
  22628. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22629. let djItem = cfgTable.daoJuData[this.index + 1];
  22630. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  22631. let userInfo = LocalStorageManager.getItem('userInfo');
  22632. if (userInfo == null) {
  22633. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22634. return;
  22635. }
  22636. let reqData = xGame.httpMgr.getReqData();
  22637. let pd = JSON.parse(reqData);
  22638. pd.spItem = djItem;
  22639. reqData = JSON.stringify(pd);
  22640. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  22641. try {
  22642. console.log('zh:buySp res = ' + JSON.stringify(res));
  22643. let code = res.code;
  22644. let msg = res.msg;
  22645. if (code == 401) {
  22646. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22647. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22648. return;
  22649. }
  22650. if (code == 200) {
  22651. xGame.uiMgr.Show(UIMsg$1, msg);
  22652. DataMgr.getUserZiChanInfo();
  22653. }
  22654. else {
  22655. xGame.uiMgr.Show(UIMsg$1, msg);
  22656. }
  22657. }
  22658. catch (error) {
  22659. console.log('error=' + error);
  22660. alert(error);
  22661. }
  22662. finally {
  22663. }
  22664. });
  22665. }
  22666. }
  22667. class UIShop$1 extends UIBase {
  22668. constructor() {
  22669. super();
  22670. this.itemNums = 0;
  22671. this.itemNumsForDj = 0;
  22672. this.curType = "";
  22673. }
  22674. onConstructor() {
  22675. this.ui = ui_UIShop.createInstance();
  22676. this.contentPane = this.ui;
  22677. this.isEject = false;
  22678. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22679. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22680. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  22681. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  22682. this.addUIClick(this.ui, this.interuptSecretary);
  22683. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  22684. this.ballRodArr = [];
  22685. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  22686. this.ui.myNode.myList.numItems = this.itemNums;
  22687. this.loadDjdata_old();
  22688. }
  22689. loadDjdata_old() {
  22690. let fff = cfgTable.daoJuData;
  22691. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  22692. this.daoJuArr = [];
  22693. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  22694. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  22695. }
  22696. getProductList() {
  22697. let reqData = xGame.httpMgr.getReqData();
  22698. let pd = JSON.parse(reqData);
  22699. pd.splx = "Consumable";
  22700. reqData = JSON.stringify(pd);
  22701. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  22702. try {
  22703. let code = res.code;
  22704. let msg = res.msg;
  22705. if (code == 401) {
  22706. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22707. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  22708. return;
  22709. }
  22710. if (code == 200) {
  22711. let data = res.data;
  22712. for (let index = 0; index < data.length; index++) {
  22713. let element = data[index];
  22714. cfgTable.daoJuData[element.spid] = element;
  22715. }
  22716. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  22717. }
  22718. else {
  22719. xGame.uiMgr.Show(UIMsg, msg);
  22720. }
  22721. }
  22722. catch (error) {
  22723. console.log('error=' + error);
  22724. alert(error);
  22725. }
  22726. finally {
  22727. }
  22728. });
  22729. }
  22730. show(type) {
  22731. super.show();
  22732. this.curType = type == 0 ? "qiugan" : "daoju";
  22733. this.switchBtn("qiugan");
  22734. this.playSecretaryIdle();
  22735. this.updateBallRod();
  22736. }
  22737. test123() {
  22738. console.log('zh:test123 ');
  22739. }
  22740. switchBtn(type) {
  22741. console.log('zh:1111切換 sel type=' + type);
  22742. if (type == "") {
  22743. type = this.curType;
  22744. }
  22745. else {
  22746. if (this.curType == type) {
  22747. return;
  22748. }
  22749. else {
  22750. this.curType = type;
  22751. }
  22752. }
  22753. if (type == "qiugan") {
  22754. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  22755. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  22756. this.ui.myNode.c1.selectedIndex = 0;
  22757. this.ui.myNode.myList.visible = true;
  22758. this.ui.myNode.djList.visible = false;
  22759. }
  22760. else {
  22761. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  22762. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  22763. this.ui.myNode.c1.selectedIndex = 1;
  22764. this.ui.myNode.myList.visible = false;
  22765. this.ui.myNode.djList.visible = true;
  22766. }
  22767. }
  22768. updateBallRod() {
  22769. for (let index = 0; index < this.ballRodArr.length; index++) {
  22770. this.ballRodArr[index].updateSelf();
  22771. }
  22772. }
  22773. renderBallRod(sort, obj) {
  22774. let index = this.getIndexBySort(sort + 1) - 1;
  22775. let ballRod = new BallRodDisplay$1(obj, index);
  22776. this.ballRodArr.push(ballRod);
  22777. }
  22778. renderDaoJu(idx, obj) {
  22779. let index = this.getIndexBySortForDj(idx + 1) - 1;
  22780. let b = new DaoJuDisplay$1(obj, index);
  22781. this.daoJuArr.push(b);
  22782. }
  22783. getIndexBySort(sort) {
  22784. let object = cfgTable.ballrodData;
  22785. for (const key in object) {
  22786. if (object[key].sort == sort) {
  22787. return parseInt(key);
  22788. }
  22789. }
  22790. }
  22791. getIndexBySortForDj(idx) {
  22792. let object = cfgTable.daoJuData;
  22793. for (const key in object) {
  22794. if (object[key].idx == idx) {
  22795. return parseInt(key);
  22796. }
  22797. }
  22798. }
  22799. playSecretaryIdle() {
  22800. let parent = this.ui.secretary.displayObject;
  22801. parent.destroyChildren();
  22802. let xx = this.ui.secretary.width / 2;
  22803. let yy = this.ui.secretary.height;
  22804. let scale = xGame.common.getSecretaryScale();
  22805. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22806. xGame.common.secretary.play(data, 0, true, parent);
  22807. }
  22808. interuptSecretary() {
  22809. Laya.timer.clearAll(this);
  22810. this.playSecretaryRandomSound();
  22811. }
  22812. playSecretaryRandomSound() {
  22813. if (this.isHide)
  22814. return;
  22815. let time = xGame.common.randomNum(45000, 60000);
  22816. Laya.timer.once(time, this, () => {
  22817. if (this.isHide)
  22818. return;
  22819. let index = xGame.common.randomNum(4, 7);
  22820. xGame.soundMgr.playSound("s_main0" + index);
  22821. let words = 1;
  22822. switch (index) {
  22823. case 4:
  22824. words = 5;
  22825. break;
  22826. case 5:
  22827. words = 3;
  22828. break;
  22829. case 6:
  22830. words = 6;
  22831. break;
  22832. case 7:
  22833. words = 7;
  22834. break;
  22835. default:
  22836. break;
  22837. }
  22838. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22839. this.playSecretaryRandomSound();
  22840. });
  22841. }
  22842. closeSelf() {
  22843. this.hide();
  22844. }
  22845. }
  22846. UIShop$1.uiName = "UIShop";
  22847. class SignMax$1 {
  22848. constructor(ui) {
  22849. this.ui = ui;
  22850. }
  22851. updateSelf(index, sameDay, curDayIndex) {
  22852. let data = cfgTable.signData[index + 1];
  22853. this.ui.titleTxt.text = data.title;
  22854. let arr1 = data.award[0].split('-');
  22855. let arr2 = data.award[1].split('-');
  22856. let num1 = parseInt(arr1[1]);
  22857. let num2 = parseInt(arr2[1]);
  22858. this.ui.numTxt1.text = num1 + "";
  22859. this.ui.numTxt2.text = num2 + "";
  22860. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  22861. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  22862. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  22863. this.ui.numTxt1.visible = false;
  22864. }
  22865. else {
  22866. this.ui.numTxt1.visible = true;
  22867. }
  22868. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  22869. this.ui.numTxt2.visible = false;
  22870. }
  22871. else {
  22872. this.ui.numTxt2.visible = true;
  22873. }
  22874. if (index < curDayIndex) {
  22875. this.ui.c1.selectedIndex = 1;
  22876. }
  22877. else if (index == curDayIndex) {
  22878. if (sameDay) {
  22879. this.ui.c1.selectedIndex = 2;
  22880. }
  22881. else {
  22882. this.ui.c1.selectedIndex = 2;
  22883. }
  22884. }
  22885. else {
  22886. this.ui.c1.selectedIndex = 0;
  22887. }
  22888. }
  22889. }
  22890. class SignNormal$1 {
  22891. constructor(ui) {
  22892. this.ui = ui;
  22893. }
  22894. updateSelf(index, sameDay, curDayIndex) {
  22895. let data = cfgTable.signData[index + 1];
  22896. this.ui.titleTxt.text = data.title;
  22897. let arr = data.award[0].split('-');
  22898. let type = parseInt(arr[0]);
  22899. let num = parseInt(arr[1]);
  22900. this.ui.numTxt.text = num + "";
  22901. if (type > 2) {
  22902. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  22903. this.ui.myIcon.rotation = 0;
  22904. }
  22905. else {
  22906. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  22907. this.ui.myIcon.rotation = 0;
  22908. }
  22909. if (xGame.common.signAwardContainsRod(data.award)) {
  22910. this.ui.numTxt.visible = false;
  22911. }
  22912. else {
  22913. this.ui.numTxt.visible = true;
  22914. }
  22915. if (index < curDayIndex) {
  22916. this.ui.c1.selectedIndex = 1;
  22917. }
  22918. else if (index == curDayIndex) {
  22919. if (sameDay) {
  22920. this.ui.c1.selectedIndex = 2;
  22921. }
  22922. else {
  22923. this.ui.c1.selectedIndex = 2;
  22924. }
  22925. }
  22926. else {
  22927. this.ui.c1.selectedIndex = 0;
  22928. }
  22929. }
  22930. }
  22931. class UISign$1 extends UIBase {
  22932. constructor() {
  22933. super();
  22934. this.curDayIndex = 0;
  22935. this.starX = 0;
  22936. }
  22937. onConstructor() {
  22938. this.ui = ui_UISign.createInstance();
  22939. this.contentPane = this.ui;
  22940. this.isEject = false;
  22941. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22942. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22943. this.initSignItem();
  22944. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  22945. this.addUIClick(this.ui.againBtn, this.againGetAward);
  22946. }
  22947. show() {
  22948. super.show();
  22949. this.ui.t0.play();
  22950. this.playSecretaryIdle();
  22951. this.updateSign();
  22952. }
  22953. initSignItem() {
  22954. this.signArr = [];
  22955. for (let index = 0; index < 6; index++) {
  22956. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  22957. this.signArr.push(temp);
  22958. }
  22959. this.signMax = new SignMax$1(this.ui.myNode.day7);
  22960. if (Moyu.isKs)
  22961. this.ui.closeNode.closeBtn.x += 100;
  22962. }
  22963. updateSign() {
  22964. let sameDay = xGame.common.judgeSameDay();
  22965. let max = 7;
  22966. this.curDayIndex = DataMgr.getSignData();
  22967. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  22968. this.curDayIndex = 0;
  22969. if (!sameDay) {
  22970. this.ui.normalBtn.visible = true;
  22971. this.ui.tipsNode.visible = false;
  22972. this.ui.againBtn.visible = false;
  22973. }
  22974. else {
  22975. this.ui.normalBtn.visible = false;
  22976. let again = DataMgr.getExtraSign();
  22977. let isCurrency = false;
  22978. let index = this.curDayIndex;
  22979. if (index == 0)
  22980. index = 7;
  22981. let award = cfgTable.signData[index].award;
  22982. let num = award[0].split("-")[0];
  22983. if (num == "1" || num == "2")
  22984. isCurrency = true;
  22985. let showAgain = again == 0 && isCurrency;
  22986. this.ui.againBtn.visible = showAgain;
  22987. this.ui.tipsNode.visible = !showAgain;
  22988. }
  22989. for (let index = 0; index < this.signArr.length; index++) {
  22990. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  22991. }
  22992. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  22993. }
  22994. playSecretaryIdle() {
  22995. let parent = this.ui.secretary.displayObject;
  22996. parent.destroyChildren();
  22997. let xx = this.ui.secretary.width / 2;
  22998. let yy = this.ui.secretary.height;
  22999. let scale = xGame.common.getSecretaryScale();
  23000. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23001. xGame.common.secretary.play(data, 0, true, parent);
  23002. }
  23003. closeSelf() {
  23004. this.hide();
  23005. }
  23006. normalGetAward() {
  23007. let sameDay = xGame.common.judgeSameDay();
  23008. if (!sameDay) {
  23009. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23010. let temp;
  23011. let type;
  23012. let num;
  23013. let arr = [];
  23014. for (let index = 0; index < award.length; index++) {
  23015. temp = award[index].split("-");
  23016. type = parseInt(temp[0]);
  23017. num = parseInt(temp[1]);
  23018. let awardType = new AwardType();
  23019. awardType.num = num;
  23020. awardType.type = type;
  23021. arr.push(awardType);
  23022. }
  23023. xGame.common.getAward(arr, (watchVideo) => {
  23024. this.curDayIndex++;
  23025. if (this.curDayIndex > 7)
  23026. this.curDayIndex = 0;
  23027. DataMgr.setSignData(this.curDayIndex);
  23028. DataMgr.setSignTime(new Date().getTime());
  23029. if (watchVideo) {
  23030. DataMgr.setExtraSign(1);
  23031. Moyu.sendDataEvent("signIn1");
  23032. }
  23033. this.updateSign();
  23034. });
  23035. }
  23036. }
  23037. againGetAward() {
  23038. Moyu.sendDataEvent("signIn2");
  23039. console.log('zh:qjff_AD_for_uisign');
  23040. if (Laya.Browser.onAndroid) {
  23041. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23042. if (!boo) {
  23043. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23044. return;
  23045. }
  23046. }
  23047. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23048. }
  23049. else {
  23050. console.log('zh:AD 失败,直接发放奖励');
  23051. this.qjff_AD_for_uisign();
  23052. }
  23053. }
  23054. qjff_AD_for_uisign() {
  23055. let index = this.curDayIndex;
  23056. if (index == 0)
  23057. index = 7;
  23058. let award = cfgTable.signData[index].award;
  23059. let temp;
  23060. let type;
  23061. let num;
  23062. for (let index = 0; index < award.length; index++) {
  23063. temp = award[index].split("-");
  23064. type = parseInt(temp[0]);
  23065. num = parseInt(temp[1]) * 3;
  23066. xGame.common.playObjFlyAnim(num, type);
  23067. }
  23068. DataMgr.setExtraSign(1);
  23069. this.updateSign();
  23070. }
  23071. }
  23072. UISign$1.uiName = "UISign";
  23073. class UIModeSelection$1 extends UIBase {
  23074. constructor() {
  23075. super();
  23076. }
  23077. onConstructor() {
  23078. this.ui = ui_UIModeSelection.createInstance();
  23079. this.contentPane = this.ui;
  23080. this.isEject = false;
  23081. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23082. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23083. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23084. this.addUIClick(this.ui.closeBtn, this.hide);
  23085. this.peopleArr = [65, 990, 580];
  23086. this.peopleOffest = [5, 10, 10];
  23087. }
  23088. show(callback) {
  23089. this.updateSelf();
  23090. super.show();
  23091. this.ui.t0.play();
  23092. this.callback = callback;
  23093. }
  23094. updateSelf() {
  23095. let cfg = cfgTable.modeselectData;
  23096. for (let index = 1; index <= 3; index++) {
  23097. let node = this.ui.myNode["type" + index];
  23098. node.need.text = cfg[index].need;
  23099. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23100. node.peopleTxt.text = this.getRandPeople(index - 1);
  23101. }
  23102. }
  23103. enterGame(type) {
  23104. console.log('zh: 进入经典模式 type: ' + type);
  23105. xGame.common.classicRoomType = type;
  23106. let cfg = cfgTable.modeselectData[type];
  23107. let need = cfg.need;
  23108. xGame.common.passAwardCoin = cfg.award;
  23109. if (DataMgr.coinEnough(need)) {
  23110. DataMgr.setCoin(-need);
  23111. this.ui.myNode["type" + type].t0.play();
  23112. Laya.timer.once(200, this, () => {
  23113. this.callback && this.callback();
  23114. });
  23115. this.logEventForClassic_start();
  23116. }
  23117. else {
  23118. Moyu.sendDataEvent("AddCoinVideo");
  23119. xGame.uiMgr.Show(UIAddProp$1, 0);
  23120. }
  23121. }
  23122. getRandPeople(index) {
  23123. let rand = this.peopleOffest[index];
  23124. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23125. }
  23126. logEventForClassic_start() {
  23127. let rtype = xGame.common.classicRoomType;
  23128. let msmc = '';
  23129. if (rtype == 1) {
  23130. msmc = 'beginner';
  23131. }
  23132. if (rtype == 2) {
  23133. msmc = 'expert';
  23134. }
  23135. if (rtype == 3) {
  23136. msmc = 'master';
  23137. }
  23138. let keyStr = 'sjmd_classic_start_' + rtype;
  23139. let jsonStr = {
  23140. "difficulty": msmc,
  23141. "classic_count": 1,
  23142. "difficulty_count": 1
  23143. };
  23144. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23145. const d = LocalStorageManager.getItem(keyStr);
  23146. jsonStr.classic_count = d.classic_count + 1;
  23147. jsonStr.difficulty_count = d.difficulty_count + 1;
  23148. LocalStorageManager.setItem(keyStr, jsonStr);
  23149. }
  23150. else {
  23151. LocalStorageManager.setItem(keyStr, jsonStr);
  23152. }
  23153. const reqStr = JSON.stringify(jsonStr);
  23154. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23155. }
  23156. }
  23157. UIModeSelection$1.uiName = "UIModeSelection";
  23158. class UILogin$1 extends UIBase {
  23159. constructor() {
  23160. super();
  23161. }
  23162. onConstructor() {
  23163. this.ui = ui_UILogin.createInstance();
  23164. this.contentPane = this.ui;
  23165. this.isEject = false;
  23166. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23167. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23168. this.addUIClick(this.ui.btn_login, this.userLogin);
  23169. }
  23170. show() {
  23171. super.show();
  23172. this.x = (Laya.stage.width - this.width) / 2;
  23173. this.y = (Laya.stage.height - this.height) / 2;
  23174. }
  23175. closeSelf() {
  23176. this.hide();
  23177. }
  23178. userLogin() {
  23179. let ua = this.ui.txt_ua.text;
  23180. let up = this.ui.txt_up.text;
  23181. if (ua && up) {
  23182. let reqData = JSON.stringify({
  23183. username: ua.trim(),
  23184. password: up.trim(),
  23185. fromMark: 'app_game'
  23186. });
  23187. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23188. try {
  23189. console.log('zh:res = ' + JSON.stringify(res));
  23190. let code = res.code;
  23191. let msg = res.msg;
  23192. if (code == 200) {
  23193. let keyStr = 'userInfo';
  23194. let jsonStr = {
  23195. "username": res.username,
  23196. "token": res.token
  23197. };
  23198. LocalStorageManager.setItem(keyStr, jsonStr);
  23199. xGame.uiMgr.Show(UIMsg$1, msg);
  23200. DataMgr.getUserZiChanInfo();
  23201. this.closeSelf();
  23202. }
  23203. else {
  23204. xGame.uiMgr.Show(UIMsg$1, msg);
  23205. }
  23206. }
  23207. catch (error) {
  23208. console.log('error=' + error);
  23209. alert(error);
  23210. }
  23211. finally {
  23212. }
  23213. });
  23214. }
  23215. else {
  23216. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23217. }
  23218. }
  23219. gotoRegPage() {
  23220. this.closeSelf();
  23221. xGame.uiMgr.Show(UIReg$1);
  23222. }
  23223. }
  23224. UILogin$1.uiName = "UILogin";
  23225. class UIReg$1 extends UIBase {
  23226. constructor() {
  23227. super();
  23228. }
  23229. onConstructor() {
  23230. this.ui = ui_UIReg.createInstance();
  23231. this.contentPane = this.ui;
  23232. this.isEject = false;
  23233. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23234. this.addUIClick(this.ui.btn_reg, this.regUser);
  23235. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23236. }
  23237. show() {
  23238. super.show();
  23239. this.x = (Laya.stage.width - this.width) / 2;
  23240. this.y = (Laya.stage.height - this.height) / 2;
  23241. }
  23242. closeSelf() {
  23243. this.hide();
  23244. }
  23245. regUser() {
  23246. this.ui.lab_tip.visible = false;
  23247. let ua = this.ui.txt_ua.text;
  23248. let up1 = this.ui.txt_up1.text;
  23249. let up2 = this.ui.txt_up2.text;
  23250. if (ua && up1 && up2 && up1 == up2) {
  23251. let reqData = JSON.stringify({
  23252. username: ua.trim(),
  23253. password: up1.trim(),
  23254. fromMark: 'app_game'
  23255. });
  23256. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23257. try {
  23258. console.log('zh:res = ' + JSON.stringify(res));
  23259. let code = res.code;
  23260. let msg = res.msg;
  23261. xGame.uiMgr.Show(UIMsg$1, msg);
  23262. if (code == 200) {
  23263. this.ui.lab_tip.color = "#FFFFFF";
  23264. xGame.uiMgr.Show(UIMsg$1, msg);
  23265. this.closeSelf();
  23266. }
  23267. else {
  23268. this.ui.lab_tip.color = "#FF0000";
  23269. xGame.uiMgr.Show(UIMsg$1, msg);
  23270. }
  23271. }
  23272. catch (error) {
  23273. console.log('error=' + error);
  23274. alert(error);
  23275. }
  23276. finally {
  23277. }
  23278. });
  23279. }
  23280. else {
  23281. if (up1 != up2) {
  23282. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23283. }
  23284. else {
  23285. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23286. }
  23287. }
  23288. }
  23289. gotoLogin() {
  23290. this.closeSelf();
  23291. xGame.uiMgr.Show(UILogin$1);
  23292. }
  23293. }
  23294. UIReg$1.uiName = "UIReg";
  23295. class UIFuli1$1 extends UIBase {
  23296. constructor() {
  23297. super();
  23298. }
  23299. onConstructor() {
  23300. this.ui = ui_UIFuli1.createInstance();
  23301. this.contentPane = this.ui;
  23302. this.isEject = false;
  23303. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23304. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23305. }
  23306. show() {
  23307. super.show();
  23308. this.x = (Laya.stage.width - this.width) / 2;
  23309. this.y = (Laya.stage.height - this.height) / 2;
  23310. }
  23311. closeSelf() {
  23312. this.hide();
  23313. }
  23314. gotoBuy() {
  23315. let userInfo = LocalStorageManager.getItem('userInfo');
  23316. if (userInfo != null) {
  23317. let token = userInfo.token;
  23318. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  23319. JSBridgeUtils.instance.startGgPay(token, ggSpid);
  23320. return;
  23321. }
  23322. else {
  23323. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23324. }
  23325. }
  23326. gotoBuy2() {
  23327. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23328. if (userInfo == null) {
  23329. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23330. return;
  23331. }
  23332. let reqData = xGame.httpMgr.getReqData();
  23333. let pd = JSON.parse(reqData);
  23334. pd.productId = 1;
  23335. reqData = JSON.stringify(pd);
  23336. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23337. try {
  23338. console.log('zh:buySp res = ' + JSON.stringify(res));
  23339. let code = res.code;
  23340. let msg = res.msg;
  23341. if (code == 401) {
  23342. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23343. alert(TIP_MSG_key.loginTimeOut);
  23344. xGame.uiMgr.Show(UIMsg$1, msg);
  23345. return;
  23346. }
  23347. if (code == 200) {
  23348. xGame.uiMgr.Show(UIMsg$1, msg);
  23349. DataMgr.getUserZiChanInfo();
  23350. this.closeSelf();
  23351. }
  23352. else {
  23353. xGame.uiMgr.Show(UIMsg$1, msg);
  23354. }
  23355. }
  23356. catch (error) {
  23357. console.log('error=' + error);
  23358. alert(error);
  23359. }
  23360. finally {
  23361. }
  23362. });
  23363. }
  23364. }
  23365. UIFuli1$1.uiName = "UIFuli1";
  23366. class UIFuli2$1 extends UIBase {
  23367. constructor() {
  23368. super();
  23369. }
  23370. onConstructor() {
  23371. this.ui = ui_UIFuli2.createInstance();
  23372. this.contentPane = this.ui;
  23373. this.isEject = false;
  23374. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  23375. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  23376. }
  23377. show() {
  23378. super.show();
  23379. this.x = (Laya.stage.width - this.width) / 2;
  23380. this.y = (Laya.stage.height - this.height) / 2;
  23381. }
  23382. closeSelf() {
  23383. this.hide();
  23384. }
  23385. gotoBuy() {
  23386. let userInfo = LocalStorageManager.getItem('userInfo');
  23387. if (userInfo != null) {
  23388. let token = userInfo.token;
  23389. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  23390. JSBridgeUtils.instance.startGgPay(token, ggSpid);
  23391. return;
  23392. }
  23393. else {
  23394. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23395. }
  23396. }
  23397. gotoBuy1() {
  23398. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23399. if (userInfo == null) {
  23400. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23401. return;
  23402. }
  23403. let reqData = xGame.httpMgr.getReqData();
  23404. let pd = JSON.parse(reqData);
  23405. pd.productId = 2;
  23406. reqData = JSON.stringify(pd);
  23407. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23408. try {
  23409. console.log('zh:buySp res = ' + JSON.stringify(res));
  23410. let code = res.code;
  23411. let msg = res.msg;
  23412. if (code == 401) {
  23413. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23414. alert(TIP_MSG_key.loginTimeOut);
  23415. xGame.uiMgr.Show(UIMsg$1, msg);
  23416. return;
  23417. }
  23418. if (code == 200) {
  23419. xGame.uiMgr.Show(UIMsg$1, msg);
  23420. DataMgr.getUserZiChanInfo();
  23421. this.closeSelf();
  23422. }
  23423. else {
  23424. xGame.uiMgr.Show(UIMsg$1, msg);
  23425. }
  23426. }
  23427. catch (error) {
  23428. console.log('error=' + error);
  23429. alert(error);
  23430. }
  23431. finally {
  23432. }
  23433. });
  23434. }
  23435. }
  23436. UIFuli2$1.uiName = "UIFuli2";
  23437. class UITry$1 extends UIBase {
  23438. constructor() {
  23439. super();
  23440. this.closeTime = 0;
  23441. this.closeNum = 0;
  23442. this.skillUrl = xGame.common.skillIconList;
  23443. }
  23444. onConstructor() {
  23445. this.ui = ui_UITry.createInstance();
  23446. this.contentPane = this.ui;
  23447. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23448. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23449. }
  23450. show() {
  23451. super.show();
  23452. this.closeNum = 0;
  23453. this.closeTime = 15;
  23454. this.ui.t0.play();
  23455. PlatMgr.showRateBanner();
  23456. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23457. Laya.timer.loop(1000, this, this.updateTime);
  23458. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23459. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23460. xGame.common.gameMgr.gamePause = true;
  23461. }
  23462. updateTime() {
  23463. if (this.closeTime > 1) {
  23464. this.closeTime--;
  23465. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23466. }
  23467. else
  23468. this.hide();
  23469. }
  23470. hide() {
  23471. Laya.timer.clearAll(this);
  23472. Moyu.showBannerAd(false);
  23473. super.hide();
  23474. xGame.common.gameMgr.gamePause = false;
  23475. }
  23476. onTry() {
  23477. console.log('zh:qjff_AD_for_uitry');
  23478. if (Laya.Browser.onAndroid) {
  23479. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23480. if (!boo) {
  23481. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23482. return;
  23483. }
  23484. }
  23485. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  23486. }
  23487. else {
  23488. console.log('zh:AD 失败,直接发放奖励');
  23489. this.qjff_AD_for_uitry();
  23490. }
  23491. }
  23492. qjff_AD_for_uitry() {
  23493. let select = xGame.common.curPlayerSkillType;
  23494. DataMgr.gameData.trySkill = select;
  23495. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  23496. DataMgr.saveGameData();
  23497. DataMgr.setBigSkill(select, 1);
  23498. xGame.showTip("Trial Successful");
  23499. this.hide();
  23500. }
  23501. onCancel() {
  23502. if (this.closeNum > 0) {
  23503. this.closeNum--;
  23504. if (this.closeNum < 2)
  23505. this.hide();
  23506. return;
  23507. }
  23508. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  23509. this.onTry();
  23510. }
  23511. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  23512. this.closeNum = 3;
  23513. }
  23514. else
  23515. this.hide();
  23516. }
  23517. }
  23518. UITry$1.uiName = "UITry";
  23519. class UIGetAward$1 extends UIBase {
  23520. constructor() {
  23521. super();
  23522. this.showTriple = true;
  23523. }
  23524. onConstructor() {
  23525. this.ui = ui_UIGetAward.createInstance();
  23526. this.contentPane = this.ui;
  23527. this.isEject = false;
  23528. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  23529. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  23530. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  23531. }
  23532. show(arr, showTriple, callback) {
  23533. super.show();
  23534. this.ui.t0.play();
  23535. this.ui.eftNode.visible = true;
  23536. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  23537. this.ui.eftNode.visible = false;
  23538. }), 1, 0, 0, 0.9);
  23539. this.awardArr = arr;
  23540. this.showTriple = showTriple;
  23541. this.callback = callback;
  23542. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  23543. this.ui.myList.numItems = arr.length;
  23544. xGame.soundMgr.playSound("getaward");
  23545. }
  23546. updateSelf(index, obj) {
  23547. let temp = this.awardArr[index];
  23548. let icon = this.getIcon(temp.type);
  23549. let str = icon;
  23550. if (temp.type > 2) {
  23551. str = "s" + icon;
  23552. }
  23553. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  23554. obj.myIcon.rotation = 0;
  23555. obj.numTxt.text = temp.num + "";
  23556. obj.numTxt.visible = temp.type > 2 ? false : true;
  23557. obj.nameTxt.text = this.getNameStr(temp.type);
  23558. }
  23559. renderItem(index, obj) {
  23560. this.updateSelf(index, obj);
  23561. }
  23562. tripleGetAward() {
  23563. console.log('zh:qjff_AD_for_uigetAward');
  23564. if (Laya.Browser.onAndroid) {
  23565. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23566. if (!boo) {
  23567. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23568. return;
  23569. }
  23570. }
  23571. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  23572. }
  23573. else {
  23574. console.log('zh:AD 失败,直接发放奖励');
  23575. this.qjff_AD_for_uigetAward();
  23576. }
  23577. }
  23578. qjff_AD_for_uigetAward() {
  23579. this.getAward(3);
  23580. }
  23581. normalGetAward() {
  23582. if (PlatMgr.isMisVideo())
  23583. this.tripleGetAward();
  23584. else
  23585. this.getAward();
  23586. }
  23587. getAward(times = 1) {
  23588. this.hide();
  23589. for (let index = 0; index < this.awardArr.length; index++) {
  23590. this.awardArr[index].num *= times;
  23591. }
  23592. this.callback && this.callback(times != 1);
  23593. }
  23594. getIcon(type) {
  23595. switch (type) {
  23596. case Prop.diamond:
  23597. return "ty_zs";
  23598. case Prop.coin:
  23599. return "ty_jb";
  23600. case Prop.gan1:
  23601. return "qg1";
  23602. case Prop.gan2:
  23603. return "qg2";
  23604. case Prop.gan3:
  23605. return "qg3";
  23606. case Prop.gan4:
  23607. return "qg4";
  23608. default:
  23609. break;
  23610. }
  23611. }
  23612. getNameStr(type) {
  23613. switch (type) {
  23614. case Prop.diamond:
  23615. return "Diamond";
  23616. case Prop.coin:
  23617. return "Coins";
  23618. case Prop.gan1:
  23619. case Prop.gan2:
  23620. case Prop.gan3:
  23621. case Prop.gan4:
  23622. return cfgTable.ballrodData[type - 1].name;
  23623. default:
  23624. break;
  23625. }
  23626. }
  23627. }
  23628. UIGetAward$1.uiName = "UIGetAward";
  23629. class UIBox$1 extends UIBase {
  23630. constructor() {
  23631. super();
  23632. this.boxNum = 0;
  23633. this.boxMax = 10;
  23634. this.inAd = false;
  23635. this.isClose = false;
  23636. }
  23637. onConstructor() {
  23638. this.ui = ui_UIBox.createInstance();
  23639. this.contentPane = this.ui;
  23640. this.isEject = false;
  23641. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  23642. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  23643. Laya.timer.loop(1000, this, this.update);
  23644. }
  23645. update() {
  23646. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  23647. this.boxNum -= 1;
  23648. this.upBar();
  23649. }
  23650. }
  23651. upBar() {
  23652. if (this.boxNum > this.boxMax)
  23653. this.boxNum = this.boxMax;
  23654. this.ui.bar.value = this.boxNum * 10;
  23655. }
  23656. show() {
  23657. super.show();
  23658. this.isClose = false;
  23659. this.boxNum = 0;
  23660. this.inAd = false;
  23661. this.upBar();
  23662. this.ui.t0.play();
  23663. this.ui.closeBtn.visible = false;
  23664. Laya.timer.once(3000, this, () => {
  23665. this.ui.closeBtn.visible = true;
  23666. this.ui.bar.alpha = 1;
  23667. });
  23668. Laya.timer.once(500, this, () => {
  23669. this.ui.t1.play();
  23670. });
  23671. }
  23672. hide() {
  23673. Laya.timer.clearAll(this);
  23674. Moyu.showBannerAd(false);
  23675. super.hide();
  23676. }
  23677. onOpenBox() {
  23678. this.boxNum++;
  23679. if (this.boxNum < this.boxMax) {
  23680. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  23681. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  23682. }
  23683. }
  23684. else if (this.boxNum == this.boxMax) {
  23685. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  23686. this.ui.openBtn.c1.selectedIndex = 13;
  23687. this.inAd = true;
  23688. }
  23689. else
  23690. this.getAward();
  23691. }
  23692. else if (this.inAd) {
  23693. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  23694. if (Laya.Browser.onAndroid) {
  23695. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23696. if (!boo) {
  23697. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23698. return;
  23699. }
  23700. }
  23701. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  23702. }
  23703. else {
  23704. console.log('zh:AD 失败,直接发放奖励');
  23705. this.qjff_AD_for_UIBOX_onOpenBox();
  23706. }
  23707. }
  23708. this.upBar();
  23709. }
  23710. qjff_AD_for_UIBOX_onOpenBox() {
  23711. this.getAward();
  23712. }
  23713. onCloseBox() {
  23714. if (this.isClose)
  23715. this.hide();
  23716. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  23717. this.isClose = true;
  23718. PlatMgr.showBanner(true, 0, 3000);
  23719. }
  23720. else
  23721. this.hide();
  23722. }
  23723. getAward() {
  23724. let str = "";
  23725. if (Math.random() < 0.5) {
  23726. let max = Moyu.isLegal ? 500 : 2500;
  23727. let num = xGame.tools.random(max, 500 + max);
  23728. DataMgr.setCoin(num);
  23729. str = "金币x" + num;
  23730. }
  23731. else {
  23732. let max = Moyu.isLegal ? 10 : 30;
  23733. let num = xGame.tools.random(max, 30 + max);
  23734. DataMgr.setDiamond(num);
  23735. str = "钻石x" + num;
  23736. }
  23737. xGame.showTip("恭喜获得-" + str);
  23738. this.hide();
  23739. }
  23740. }
  23741. UIBox$1.uiName = "UIBox";
  23742. class UIMain$1 extends UIBase {
  23743. constructor() {
  23744. super();
  23745. this.firstEnter = true;
  23746. }
  23747. nativeCallJs(msg) {
  23748. let t = msg;
  23749. console.log("zh: nativeCallJs 奖励开始发放:", t);
  23750. switch (t) {
  23751. case 'qjff_chouJiang':
  23752. let dui = xGame.uiMgr.getUI(UIDraw$1);
  23753. dui.qjff_chouJiang();
  23754. break;
  23755. case 'qjff_AD_for_uisign':
  23756. let dui2 = xGame.uiMgr.getUI(UISign$1);
  23757. dui2.qjff_AD_for_uisign();
  23758. break;
  23759. case 'qjff_AD_for_uitry':
  23760. let dui3 = xGame.uiMgr.getUI(UITry$1);
  23761. dui3.qjff_AD_for_uitry();
  23762. break;
  23763. case 'qjff_AD_for_uipower':
  23764. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  23765. dui4.qjff_AD_for_uipower();
  23766. break;
  23767. case 'qjff_AD_for_uigetAward':
  23768. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  23769. dui5.qjff_AD_for_uigetAward();
  23770. break;
  23771. case 'qjff_AD_for_uiGameEnd':
  23772. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  23773. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  23774. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  23775. break;
  23776. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  23777. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  23778. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  23779. break;
  23780. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  23781. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  23782. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  23783. break;
  23784. case 'qjff_AD_for_UIrepentProp_videoRegret':
  23785. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  23786. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  23787. break;
  23788. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  23789. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  23790. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  23791. break;
  23792. case 'qjff_AD_for_UIBOX_onOpenBox':
  23793. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  23794. dui11.qjff_AD_for_UIBOX_onOpenBox();
  23795. break;
  23796. case 'qjff_AD_for_UIAddCoin':
  23797. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  23798. dui12.qjff_AD_for_UIAddCoin();
  23799. break;
  23800. case '111a':
  23801. let dui14 = xGame.uiMgr.getUI(UISign$1);
  23802. dui14.qjff_AD_for_uisign();
  23803. break;
  23804. case '222a':
  23805. let dui15 = xGame.uiMgr.getUI(UISign$1);
  23806. dui15.qjff_AD_for_uisign();
  23807. break;
  23808. case '333a':
  23809. let dui16 = xGame.uiMgr.getUI(UISign$1);
  23810. dui16.qjff_AD_for_uisign();
  23811. break;
  23812. default:
  23813. console.log('zh:未知的方法名字' + t);
  23814. break;
  23815. }
  23816. }
  23817. onConstructor() {
  23818. console.log('zh: UIMain onConstructor');
  23819. this.ui = ui_UIMain.createInstance();
  23820. this.contentPane = this.ui;
  23821. this.isEject = false;
  23822. this.addEvent();
  23823. this.addClickSpine();
  23824. this.settingNode = new SettingNode$1(this.ui.settingNode);
  23825. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23826. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  23827. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  23828. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  23829. let curUse = DataMgr.getCurSecretary();
  23830. this.changeSecretary(curUse);
  23831. this.ui.talkNode.visible = false;
  23832. let guide = DataMgr.getSkillGuide();
  23833. if (xGame.common.isNewDay && guide == 1) {
  23834. xGame.common.isNewDay = false;
  23835. xGame.soundMgr.playSound("s_main01");
  23836. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23837. console.log("zh:播放小秘书每天语音");
  23838. }
  23839. this.onGetUserInfo();
  23840. DataMgr.getUserZiChanInfo();
  23841. this.ui.n83.visible = false;
  23842. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23843. const d = LocalStorageManager.getItem(keyForLoginInfo);
  23844. let ua = d.username;
  23845. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23846. }
  23847. this.c_btn_for_user();
  23848. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  23849. }
  23850. Logout() {
  23851. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23852. LocalStorageManager.removeItem(keyForLoginInfo);
  23853. this.freshUser();
  23854. }
  23855. JSBridgeUtils.instance.loginOutForApp();
  23856. }
  23857. gotoLogin() {
  23858. xGame.uiMgr.Show(UILogin$1);
  23859. }
  23860. gotoRegUser() {
  23861. xGame.uiMgr.Show(UIReg$1);
  23862. }
  23863. showFuLi1() {
  23864. console.log('zh:福利1');
  23865. xGame.uiMgr.Show(UIFuli1$1);
  23866. }
  23867. showFuLi2() {
  23868. console.log('zh:福利2');
  23869. xGame.uiMgr.Show(UIFuli2$1);
  23870. }
  23871. c_btn_for_user() {
  23872. this.ui.n_Logout.visible = false;
  23873. this.ui.n_dengLu.visible = false;
  23874. this.ui.n_zhuCe.visible = false;
  23875. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23876. this.ui.n_Logout.visible = true;
  23877. }
  23878. else {
  23879. this.ui.n_dengLu.visible = true;
  23880. }
  23881. }
  23882. changeSecretary(curUse) {
  23883. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  23884. xGame.common.secretary && xGame.common.secretary.dispose();
  23885. this.addSecretarySpine(name);
  23886. }
  23887. addSecretarySpine(name) {
  23888. let spine = new SpineMgr(name, () => {
  23889. this.playSecretaryIdle();
  23890. });
  23891. xGame.common.secretary = spine;
  23892. }
  23893. addClickSpine() {
  23894. let clickSpine = new SpineMgr("dianji", () => {
  23895. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  23896. let parent = Laya.stage;
  23897. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  23898. clickSpine.play(data, 0, false, parent, (spine) => {
  23899. spine.destroy(true);
  23900. });
  23901. });
  23902. });
  23903. }
  23904. addEvent() {
  23905. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  23906. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  23907. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  23908. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  23909. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  23910. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  23911. this.addUIClick(this.ui, this.interuptSecretary);
  23912. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  23913. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  23914. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  23915. this.addUIClick(this.ui.shopBtn, this.openShopView);
  23916. this.addUIClick(this.ui.signBtn, this.openSignView);
  23917. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  23918. this.addUIClick(this.ui.rankBtn, this.openRanking);
  23919. this.addUIClick(this.ui.n_Logout, this.Logout);
  23920. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  23921. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  23922. this.addUIClick(this.ui.n_fuli, this.showFuLi2);
  23923. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  23924. }
  23925. show(showFailWords) {
  23926. super.show();
  23927. this.moneyNode.ui.c1.selectedIndex = 1;
  23928. this.playSecretaryIdle();
  23929. xGame.soundMgr.playMusic("caromhall01", 0);
  23930. Laya.timer.clearAll(this);
  23931. this.playSecretaryRandomSound();
  23932. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  23933. if (showFailWords) {
  23934. console.log('zh:uimain.ts ');
  23935. setTimeout(() => {
  23936. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  23937. let words = -1;
  23938. if (str == "s_main02") {
  23939. words = 2;
  23940. }
  23941. else {
  23942. words = 3;
  23943. }
  23944. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23945. xGame.soundMgr.playSound(str);
  23946. }, 300);
  23947. }
  23948. this.showGuide();
  23949. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  23950. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  23951. let guide = DataMgr.getSkillGuide();
  23952. if (guide == 1) {
  23953. let randTime = xGame.common.randomNum(300, 800);
  23954. if (this.firstEnter) {
  23955. console.log("zh: firstEnter");
  23956. this.firstEnter = false;
  23957. randTime += 900;
  23958. }
  23959. else {
  23960. console.log("zh: no firstEnter");
  23961. }
  23962. Laya.timer.once(randTime, this, () => {
  23963. });
  23964. Laya.timer.once(1000, this, () => {
  23965. console.log('zh: 1秒后 showFuLi1');
  23966. this.showFuLi1();
  23967. });
  23968. }
  23969. }
  23970. checkActive(show) {
  23971. }
  23972. showGuide() {
  23973. let guide = DataMgr.getSkillGuide();
  23974. this.ui.guideBtn.visible = guide == 0;
  23975. this.ui.enterGuide.visible = false;
  23976. this.ui.secretaryGuide.visible = guide == 0;
  23977. if (guide == 0) {
  23978. console.log("zh:显示引导");
  23979. xGame.soundMgr.playSound("s_guide");
  23980. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23981. }
  23982. else {
  23983. console.log("zh:不需要显示引导");
  23984. }
  23985. }
  23986. ensureSecretary() {
  23987. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  23988. this.ui.secretaryGuide.visible = false;
  23989. this.ui.enterGuide.visible = true;
  23990. this.ui.wordsNode.t0.play();
  23991. if (DataMgr.getNewUser())
  23992. Moyu.sendDataEvent("gameReady");
  23993. }
  23994. playSecretaryIdle() {
  23995. let parent = this.ui.secretary.displayObject;
  23996. parent.destroyChildren();
  23997. let xx = this.ui.secretary.width / 2;
  23998. let yy = this.ui.secretary.height;
  23999. let scale = xGame.common.getSecretaryScale();
  24000. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24001. xGame.common.secretary.play(data, 0, true, parent);
  24002. }
  24003. startGame(type) {
  24004. if (!this.isReadyForLoadNetSource()) {
  24005. return;
  24006. }
  24007. xGame.common.gameMode = type;
  24008. Moyu.sendDataEvent("PlayGame", { type: type });
  24009. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  24010. switch (xGame.common.gameMode) {
  24011. case GameMode.classic:
  24012. console.log('zh:进入经典模式111111111');
  24013. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24014. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24015. console.log('zh:classic db_over_lev=', db_over_lev);
  24016. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24017. console.log('zh:判断是否可以玩该模式classic =NO');
  24018. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24019. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24020. return;
  24021. }
  24022. else {
  24023. console.log('zh:可以玩该模式classic 66666666666666');
  24024. this.beginGame();
  24025. }
  24026. }
  24027. else {
  24028. console.log('zh:不需要判断是否可以玩该classic');
  24029. let challengeTimes = DataMgr.getChallengeTimes();
  24030. if (challengeTimes == 0) {
  24031. xGame.uiMgr.Show(UIInvitation$1);
  24032. }
  24033. else {
  24034. this.beginGame();
  24035. }
  24036. break;
  24037. }
  24038. case GameMode.bigMove:
  24039. console.error('zh:bigMove check');
  24040. let guide = DataMgr.getSkillGuide();
  24041. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24042. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24043. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24044. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24045. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24046. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24047. return;
  24048. }
  24049. else {
  24050. console.log('zh:可以玩该模式 bigMove');
  24051. this.beginGame();
  24052. if (DataMgr.getNewUser())
  24053. Moyu.sendDataEvent("gameStart0");
  24054. }
  24055. }
  24056. else {
  24057. this.beginGame();
  24058. if (DataMgr.getNewUser())
  24059. Moyu.sendDataEvent("gameStart0");
  24060. }
  24061. break;
  24062. default:
  24063. console.error('zh:未知错误!!!!');
  24064. break;
  24065. }
  24066. }
  24067. beginGame(isNice = false) {
  24068. console.log('zh:beginGame ');
  24069. let guide = DataMgr.getSkillGuide();
  24070. if (guide == 1) {
  24071. console.log('zh:非新手引导,showInternAd ');
  24072. JSBridgeUtils.instance.showInternAd('beginGame');
  24073. }
  24074. else {
  24075. console.log('zh:新手引导,不显示AD ');
  24076. }
  24077. console.log('zh:beginGame 2 go');
  24078. if (xGame.common.gameMode == GameMode.classic) {
  24079. if (isNice) {
  24080. this.enterClassic();
  24081. }
  24082. else {
  24083. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24084. console.log('zh:BBBBBBBBBBBBBBB');
  24085. this.enterClassic();
  24086. });
  24087. }
  24088. }
  24089. else if (xGame.common.gameMode == GameMode.bigMove) {
  24090. this.ui.enterGuide.visible = false;
  24091. xGame.uiMgr.Show(UISkill$1);
  24092. }
  24093. }
  24094. enterClassic() {
  24095. xGame.uiMgr.Show(UIGame$1);
  24096. xGame.uiMgr.Show(UIMatching$1, () => {
  24097. if (!this.isHide)
  24098. this.hide();
  24099. xGame.common.gameUI.ui.alpha = 1;
  24100. xGame.common.gameUI.startGame();
  24101. xGame.uiMgr.Hide(UIGameEnd$1);
  24102. });
  24103. }
  24104. start_debug_for_moni_payOk() {
  24105. console.log('zh:start_debug_for_moni_payOk 111');
  24106. let userInfo = LocalStorageManager.getItem('userInfo');
  24107. if (userInfo != null) {
  24108. let token = userInfo.token;
  24109. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24110. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid);
  24111. return;
  24112. }
  24113. else {
  24114. alert(TIP_MSG_key.pleaseLoginIn);
  24115. }
  24116. }
  24117. startGlobal() {
  24118. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24119. }
  24120. startWeekly() {
  24121. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24122. }
  24123. zhouSaiMonth() {
  24124. console.log('zh: zhouSaiMonth 被调用');
  24125. }
  24126. isReadyForLoadNetSource() {
  24127. let reqCount = xGame.cfgMgr.httpReqCount;
  24128. let ok = xGame.cfgMgr.httpReqOkCount;
  24129. if (reqCount > ok) {
  24130. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24131. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24132. Laya.timer.once(5000, this, () => {
  24133. let retryCount = 0;
  24134. const maxRetries = 3;
  24135. const tryFetchConfig = () => {
  24136. try {
  24137. xGame.cfgMgr.getConfigFromServer();
  24138. }
  24139. catch (error) {
  24140. if (retryCount < maxRetries) {
  24141. retryCount++;
  24142. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24143. Laya.timer.once(5000, this, tryFetchConfig);
  24144. }
  24145. else {
  24146. console.error("❌ 达到最大重试次数,配置获取失败");
  24147. }
  24148. }
  24149. };
  24150. tryFetchConfig();
  24151. });
  24152. return false;
  24153. }
  24154. return true;
  24155. }
  24156. startPlaceBall() {
  24157. if (!this.isReadyForLoadNetSource()) {
  24158. return;
  24159. }
  24160. xGame.uiMgr.Show(UILevelDisplay$1);
  24161. }
  24162. hide() {
  24163. console.log('zh:uimain hide ...');
  24164. super.hide();
  24165. xGame.common.stopGirlPop(this.ui.talkNode);
  24166. }
  24167. onGetUserInfo(force = false) {
  24168. if (Moyu.isWx) {
  24169. let info = Moyu.getSystemInfo();
  24170. if (info)
  24171. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24172. }
  24173. else {
  24174. Moyu.initUser(this, this.freshUser, force);
  24175. }
  24176. this.freshUser();
  24177. }
  24178. freshUser() {
  24179. let user = Moyu.getUserInfo();
  24180. if (!user.isAuth) {
  24181. user.headIcon = 'res/ty_touxiang.png';
  24182. }
  24183. else {
  24184. DataMgr.upRankData();
  24185. }
  24186. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24187. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24188. let keyStr = keyForLoginInfo;
  24189. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24190. const d = LocalStorageManager.getItem(keyStr);
  24191. let ua = d.username;
  24192. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24193. }
  24194. else {
  24195. }
  24196. this.c_btn_for_user();
  24197. }
  24198. interuptSecretary() {
  24199. Laya.timer.clearAll(this);
  24200. this.playSecretaryRandomSound();
  24201. }
  24202. playSecretaryRandomSound() {
  24203. if (this.isHide)
  24204. return;
  24205. let time = xGame.common.randomNum(45000, 60000);
  24206. Laya.timer.once(time, this, () => {
  24207. if (this.isHide)
  24208. return;
  24209. let index = xGame.common.randomNum(4, 7);
  24210. xGame.soundMgr.playSound("s_main0" + index);
  24211. let words = 1;
  24212. switch (index) {
  24213. case 4:
  24214. words = 5;
  24215. break;
  24216. case 5:
  24217. words = 3;
  24218. break;
  24219. case 6:
  24220. words = 6;
  24221. break;
  24222. case 7:
  24223. words = 7;
  24224. break;
  24225. default:
  24226. break;
  24227. }
  24228. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24229. this.playSecretaryRandomSound();
  24230. });
  24231. }
  24232. openSecretaryView() {
  24233. xGame.uiMgr.Show(UISecretary$1);
  24234. Moyu.sendDataEvent("secretary");
  24235. }
  24236. openShopView() {
  24237. xGame.uiMgr.Show(UIShop$1, 0);
  24238. }
  24239. openSignView() {
  24240. xGame.uiMgr.Show(UISign$1);
  24241. }
  24242. openDrawView() {
  24243. xGame.uiMgr.Show(UIDraw$1);
  24244. }
  24245. openRanking() {
  24246. console.log('zh:phb openRanking');
  24247. xGame.uiMgr.Show(UIRanking$1);
  24248. Moyu.sendDataEvent("rankingList");
  24249. }
  24250. }
  24251. UIMain$1.uiName = "UIMain";
  24252. function InitShader() {
  24253. }
  24254. function appInit() {
  24255. xGame.context.init(getLoadingResList(), initCallback);
  24256. }
  24257. function getLoadingResList() {
  24258. return [
  24259. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24260. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24261. ];
  24262. }
  24263. function getGameResList() {
  24264. return [
  24265. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24266. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24267. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24268. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24269. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24270. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24271. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24272. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24273. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24274. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24275. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24276. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24277. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24278. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24279. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24280. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24281. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24282. ];
  24283. }
  24284. function initCallback() {
  24285. window["DataMgr"] = DataMgr;
  24286. DataMgr.Init();
  24287. Moyu.init(getPlat(), this, () => {
  24288. DataMgr.isNewDay();
  24289. PlatMgr.initConfig();
  24290. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24291. }, true);
  24292. console.log('zh:开始sm init1 start');
  24293. xGame.soundMgr.init();
  24294. console.log('zh:开始sm init1 end');
  24295. xGame.uiMgr.init();
  24296. xGame.uiMgr.clearTempData();
  24297. xGame.uiMgr.bindFUI(fguiRes.loading);
  24298. xGame.uiMgr.Show(UILoading);
  24299. }
  24300. function loadSubRes(callback) {
  24301. var tab = ["asset", "res", "spine"];
  24302. let subDone = 0;
  24303. for (var i = 0; i < tab.length; i++) {
  24304. let sub = tab[i];
  24305. Moyu.loadSubRes(sub, (pro) => {
  24306. callback && callback(pro, false);
  24307. }).then(() => {
  24308. subDone++;
  24309. if (subDone >= tab.length)
  24310. callback && callback(1, true);
  24311. });
  24312. }
  24313. }
  24314. function enterGame() {
  24315. xGame.cfgMgr.init();
  24316. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24317. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24318. xGame.uiMgr.Hide(UILoading);
  24319. fgui.UIPackage.removePackage(fguiRes.loading);
  24320. xGame.uiMgr.bindFUI(fguiRes.game);
  24321. xGame.uiMgr.Show(UIMain$1);
  24322. if (DataMgr.getNewUser())
  24323. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24324. }
  24325. function getPlat() {
  24326. let cfg = new MoyuCfg();
  24327. cfg.plat = MoyuPlat.web;
  24328. cfg.myId = 180;
  24329. cfg.myKey = '8848a885774230a4';
  24330. cfg.version = 0;
  24331. if (window.hasOwnProperty("gamebox")) {
  24332. cfg.plat = MoyuPlat.f399;
  24333. cfg.version = 0;
  24334. }
  24335. else if (window.hasOwnProperty("ks")) {
  24336. cfg.plat = MoyuPlat.ks;
  24337. cfg.version = 0;
  24338. cfg.ads.ksVideoId = '2300002254_01';
  24339. cfg.ads.ksInsertId = '2300002254_02';
  24340. }
  24341. else if (Laya.Browser.onTTMiniGame) {
  24342. cfg.plat = MoyuPlat.tt;
  24343. cfg.version = 0;
  24344. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  24345. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  24346. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  24347. }
  24348. else if (Laya.Browser.onMiniGame) {
  24349. cfg.plat = MoyuPlat.wx;
  24350. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  24351. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  24352. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  24353. }
  24354. else if (Laya.Browser.onQQMiniGame) {
  24355. cfg.plat = MoyuPlat.qq;
  24356. }
  24357. else if (Laya.Browser.onQGMiniGame) {
  24358. cfg.plat = MoyuPlat.op;
  24359. cfg.ads.opVideoId = '455502';
  24360. cfg.ads.opBannerId = '455507';
  24361. }
  24362. else if (Laya.Browser.onVVMiniGame) {
  24363. cfg.plat = MoyuPlat.vv;
  24364. cfg.version = 0;
  24365. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  24366. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  24367. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  24368. }
  24369. else if (Laya.Browser.onHWMiniGame) {
  24370. cfg.plat = MoyuPlat.hw;
  24371. }
  24372. else if (window["mz"]) {
  24373. cfg.plat = MoyuPlat.mz;
  24374. }
  24375. else {
  24376. let cfg = window['conchConfig'];
  24377. if (cfg) {
  24378. var os = cfg.getOS();
  24379. if (os == "Conch-ios") {
  24380. cfg.plat = MoyuPlat.ios;
  24381. }
  24382. else if (os == "Conch-android") {
  24383. }
  24384. }
  24385. }
  24386. return cfg;
  24387. }
  24388. class Main {
  24389. constructor() {
  24390. if (window["Laya3D"])
  24391. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  24392. else {
  24393. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  24394. this.initMain();
  24395. }
  24396. }
  24397. initMain() {
  24398. Laya["Physics"] && Laya["Physics"].enable();
  24399. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  24400. Laya.stage.scaleMode = GameConfig.scaleMode;
  24401. Laya.stage.screenMode = GameConfig.screenMode;
  24402. Laya.stage.alignV = GameConfig.alignV;
  24403. Laya.stage.alignH = GameConfig.alignH;
  24404. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  24405. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  24406. Laya.enableDebugPanel();
  24407. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  24408. Laya["PhysicsDebugDraw"].enable();
  24409. if (GameConfig.stat)
  24410. Laya.Stat.show();
  24411. Laya.alertGlobalError(true);
  24412. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  24413. }
  24414. onVersionLoaded() {
  24415. appInit();
  24416. }
  24417. }
  24418. new Main();
  24419. }());
  24420. //# sourceMappingURL=bundle.js.map