bundle.js 927 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222
  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 baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  53. let poolKey = {
  54. inHoleEft: "inHoleEft",
  55. d3ball: "d3ball",
  56. iceEft: "iceEft",
  57. hitEft: "hitEft",
  58. fireworksEft: "fireworksEft",
  59. };
  60. var GameMode;
  61. (function (GameMode) {
  62. GameMode[GameMode["classic"] = 0] = "classic";
  63. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  64. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  65. })(GameMode || (GameMode = {}));
  66. var SkillType;
  67. (function (SkillType) {
  68. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  69. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  70. SkillType[SkillType["ice"] = 2] = "ice";
  71. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  72. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  73. })(SkillType || (SkillType = {}));
  74. var ClassicWordsType;
  75. (function (ClassicWordsType) {
  76. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  77. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  78. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  79. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  80. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  81. })(ClassicWordsType || (ClassicWordsType = {}));
  82. var PressType;
  83. (function (PressType) {
  84. PressType[PressType["powerNode"] = 0] = "powerNode";
  85. PressType[PressType["d2Root"] = 1] = "d2Root";
  86. PressType[PressType["moveNode"] = 2] = "moveNode";
  87. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  88. })(PressType || (PressType = {}));
  89. var PlaceBallType;
  90. (function (PlaceBallType) {
  91. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  92. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  93. })(PlaceBallType || (PlaceBallType = {}));
  94. var EAdType;
  95. (function (EAdType) {
  96. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  97. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  98. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  99. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  100. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  101. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  102. EAdType[EAdType["sign"] = 6] = "sign";
  103. EAdType[EAdType["draw"] = 7] = "draw";
  104. EAdType[EAdType["triple"] = 8] = "triple";
  105. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  106. EAdType[EAdType["getPower"] = 10] = "getPower";
  107. EAdType[EAdType["box"] = 11] = "box";
  108. EAdType[EAdType["try"] = 12] = "try";
  109. EAdType[EAdType["againSign"] = 13] = "againSign";
  110. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  111. })(EAdType || (EAdType = {}));
  112. var Prop;
  113. (function (Prop) {
  114. Prop[Prop["diamond"] = 1] = "diamond";
  115. Prop[Prop["coin"] = 2] = "coin";
  116. Prop[Prop["gan1"] = 3] = "gan1";
  117. Prop[Prop["gan2"] = 4] = "gan2";
  118. Prop[Prop["gan3"] = 5] = "gan3";
  119. Prop[Prop["gan4"] = 6] = "gan4";
  120. })(Prop || (Prop = {}));
  121. var TipsType;
  122. (function (TipsType) {
  123. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  124. TipsType[TipsType["foul"] = 1] = "foul";
  125. })(TipsType || (TipsType = {}));
  126. class AwardType {
  127. constructor(type, num) {
  128. this.type = type;
  129. this.num = num;
  130. }
  131. }
  132. var define = /*#__PURE__*/Object.freeze({
  133. fguiRes: fguiRes,
  134. ballCamp: ballCamp,
  135. FoulType: FoulType,
  136. ALL_BALL_STOP: ALL_BALL_STOP,
  137. WAIT_SHOOT: WAIT_SHOOT,
  138. D3RES_LOADED: D3RES_LOADED,
  139. BALL_SHOOT: BALL_SHOOT,
  140. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  141. RESET_GAME: RESET_GAME,
  142. COIN_CHANGE: COIN_CHANGE,
  143. DIAMOND_CHANGE: DIAMOND_CHANGE,
  144. RESTART_GAME: RESTART_GAME,
  145. GET_USER_INFO: GET_USER_INFO,
  146. CHANGE_SECRETARY: CHANGE_SECRETARY,
  147. POWER_CHANGE: POWER_CHANGE,
  148. POWER_TIME: POWER_TIME,
  149. keyForLoginInfo: keyForLoginInfo,
  150. baseHeadUrl: baseHeadUrl,
  151. poolKey: poolKey,
  152. get GameMode () { return GameMode; },
  153. get SkillType () { return SkillType; },
  154. get ClassicWordsType () { return ClassicWordsType; },
  155. get PressType () { return PressType; },
  156. get PlaceBallType () { return PlaceBallType; },
  157. get EAdType () { return EAdType; },
  158. get Prop () { return Prop; },
  159. get TipsType () { return TipsType; },
  160. AwardType: AwardType
  161. });
  162. class CContext {
  163. constructor() {
  164. this.winSize = { width: 0, height: 0 };
  165. this.notchHeight = 0;
  166. this.bannerHeight = 0;
  167. }
  168. init(resList, callback) {
  169. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  170. this.notchHeight = this.getNotchHeight();
  171. this.bannerHeight = this.getBannerHeight();
  172. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  173. callback && callback();
  174. }));
  175. }
  176. getNotchHeight() {
  177. let notchHeight = 50;
  178. if (Laya.Browser.onMiniGame) {
  179. let deviceInfo = wx.getSystemInfoSync();
  180. if (Laya.Browser.onIOS) {
  181. if (deviceInfo.model.search('iPhone X') != -1) {
  182. notchHeight = deviceInfo.statusBarHeight - 10;
  183. }
  184. else {
  185. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  186. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  187. notchHeight = deviceInfo.statusBarHeight - 10;
  188. }
  189. }
  190. }
  191. else if (Laya.Browser.onAndroid) {
  192. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  193. notchHeight = deviceInfo.statusBarHeight;
  194. }
  195. }
  196. }
  197. return notchHeight;
  198. }
  199. getBannerHeight() {
  200. return 0;
  201. }
  202. }
  203. let context = new CContext();
  204. var Handler = Laya.Handler;
  205. var Tween = Laya.Tween;
  206. function playClickEffect(btn) {
  207. if (!btn)
  208. return;
  209. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  210. if (!btn)
  211. return;
  212. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  213. if (!btn)
  214. return;
  215. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  216. }), 0, true);
  217. }), 0, true);
  218. }
  219. function getNumList(strList) {
  220. let dataList = [];
  221. if (strList) {
  222. let list = strList;
  223. let array = list.split(',');
  224. for (var v in array) {
  225. dataList.push(Number(array[v]));
  226. }
  227. }
  228. return dataList;
  229. }
  230. function getStrList(strList) {
  231. let dataList = [];
  232. if (strList) {
  233. let list = strList;
  234. let array = list.split('|');
  235. for (var v in array) {
  236. dataList.push(String(array[v]));
  237. }
  238. }
  239. return dataList;
  240. }
  241. function getRandStr(len) {
  242. 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'];
  243. let str = "";
  244. for (let i = 0; i < len; i++) {
  245. let rand = random(0, list.length);
  246. str += list[rand];
  247. }
  248. return str;
  249. }
  250. function getUserId() {
  251. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  252. return str;
  253. }
  254. function formatPos(pos, len = 2) {
  255. let v = Math.pow(10, len);
  256. pos.x = Math.floor(pos.x * v) / v;
  257. pos.y = Math.floor(pos.y * v) / v;
  258. if (pos.z)
  259. pos.z = Math.floor(pos.z * v) / v;
  260. return pos;
  261. }
  262. function setPosInt(pos) {
  263. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  264. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  265. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  266. return pos;
  267. }
  268. function random(min, max) {
  269. var rang = max - min;
  270. var rand = Math.random() * rang;
  271. return Math.floor(rand) + min;
  272. }
  273. function randomList(list, num) {
  274. if (list.length <= num)
  275. return list;
  276. let arry = [];
  277. list.forEach(item => {
  278. arry.push(item);
  279. });
  280. let nums = [];
  281. for (let i = 0; i < num; i++) {
  282. let rand = random(0, arry.length);
  283. let v = arry[rand];
  284. nums.push(v);
  285. arry.splice(rand, 1);
  286. }
  287. return nums;
  288. }
  289. function worldToScreen(camera, point, pos) {
  290. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  291. pos.x = pos.x / Laya.stage.clientScaleX;
  292. pos.y = pos.y / Laya.stage.clientScaleY;
  293. }
  294. function getStringLenght(str) {
  295. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  296. }
  297. function reviseString(str, len) {
  298. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  299. if (ld > len) {
  300. let sl = Math.floor(len / 2);
  301. let rs = str.substring(0, sl);
  302. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  303. while (d + 2 < len) {
  304. sl++;
  305. rs = str.substring(0, sl);
  306. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  307. }
  308. return rs + "...";
  309. }
  310. return str;
  311. }
  312. function getCoinString(coin) {
  313. if (coin < 10000)
  314. return coin.toString();
  315. else if (coin < 1000000) {
  316. let vh = Math.ceil(coin / 100);
  317. return (vh / 10) + "k";
  318. }
  319. else if (coin < 1000000000) {
  320. var vh = Math.ceil(coin / 100000);
  321. return (vh / 10) + "m";
  322. }
  323. else if (coin < 1000000000000) {
  324. var vh = Math.ceil(coin / 100000000);
  325. return (vh / 10) + "b";
  326. }
  327. else if (coin < 1000000000000000) {
  328. var vh = Math.ceil(coin / 100000000000);
  329. return (vh / 10) + "t";
  330. }
  331. }
  332. function getV3Dest(pos, dir, dis, dest) {
  333. dir.x *= dis;
  334. dir.y *= dis;
  335. dir.z *= dis;
  336. Laya.Vector3.add(pos, dir, dest);
  337. return dest;
  338. }
  339. function getV2Dest(x1, y1, dir, dis, dest) {
  340. dest.x = x1 + dir.x * dis;
  341. dest.y = y1 + dir.y * dis;
  342. return dest;
  343. }
  344. function getV2Dir(x1, y1, x2, y2, dir) {
  345. dir.x = x2 - x1;
  346. dir.y = y2 - y1;
  347. Laya.Vector2.normalize(dir, dir);
  348. return dir;
  349. }
  350. function getV3Dir(p1, p2, dir) {
  351. Laya.Vector3.subtract(p1, p2, dir);
  352. Laya.Vector3.normalize(dir, dir);
  353. return dir;
  354. }
  355. function copyPos(ip, op) {
  356. op.x = ip.x;
  357. op.y = ip.y;
  358. if (ip.z)
  359. op.z = ip.z;
  360. return op;
  361. }
  362. function getScreenImg() {
  363. let gl = Laya.WebGLContext.mainContext;
  364. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  365. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  366. let w = gl.drawingBufferWidth;
  367. let h = gl.drawingBufferHeight;
  368. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  369. texture2d.setPixels(pixels);
  370. return new Laya.Texture(texture2d);
  371. }
  372. function playMoveByPositions(sp, positions, v, completeCallback) {
  373. let p;
  374. let play = () => {
  375. if (positions.length == 0) {
  376. completeCallback();
  377. return;
  378. }
  379. p = positions[0];
  380. positions.splice(0, 1);
  381. 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, () => {
  382. play();
  383. }));
  384. };
  385. play();
  386. }
  387. function setStarPos(node, num, max) {
  388. for (let i = 1; i <= 5; i++) {
  389. let img = node.getChildAt(i - 1);
  390. img.width = img.height = 30;
  391. img.pivotX = img.pivotY = 0.5;
  392. img.gray = i > num;
  393. img.visible = i <= max;
  394. if (max == 3) {
  395. img.x = node.width / 2 + (i - 2) * 30 - 15;
  396. img.y = node.height - 40;
  397. if (i == 2)
  398. img.y = node.height - 30;
  399. }
  400. else if (max == 5) {
  401. let ly = Math.abs(i - 3);
  402. img.x = node.width / 2 + (i - 3) * 20 - 15;
  403. img.y = node.height - ly * 8 - 30;
  404. }
  405. }
  406. }
  407. function playLoopAnimRotate(sp, time, clockwise = true) {
  408. let rotation;
  409. sp.rotation = sp.rotation % 360;
  410. if (clockwise) {
  411. rotation = -360;
  412. }
  413. else {
  414. rotation = 360;
  415. }
  416. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  417. this.playLoopAnimRotate(sp, time, clockwise);
  418. }));
  419. }
  420. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  421. let x, y;
  422. if (isBig) {
  423. x = valueXMin;
  424. y = valueYMin;
  425. }
  426. else {
  427. x = valueXMax;
  428. y = valueYMax;
  429. }
  430. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  431. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  432. }));
  433. }
  434. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  435. let scale;
  436. if (isBig) {
  437. scale = valueMin;
  438. }
  439. else {
  440. scale = valueMax;
  441. }
  442. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  443. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  444. }));
  445. }
  446. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  447. let value;
  448. if (isBig) {
  449. value = valueMin;
  450. }
  451. else {
  452. value = valueMax;
  453. }
  454. if (count) {
  455. count--;
  456. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  457. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  458. }));
  459. }
  460. else {
  461. sp.rotation = 0;
  462. }
  463. }
  464. function inRect(rect, p) {
  465. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  466. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  467. return true;
  468. }
  469. }
  470. return false;
  471. }
  472. function getNumberK(number) {
  473. if (number < 1000) {
  474. return number.toString();
  475. }
  476. else {
  477. return (number / 1000).toFixed(1) + "k";
  478. }
  479. }
  480. function pointInsideCircle(point, circle, r) {
  481. if (r === 0)
  482. return false;
  483. var dx = circle.x - point.x;
  484. var dy = circle.y - point.y;
  485. return dx * dx + dy * dy <= r * r;
  486. }
  487. function formatString(str, data) {
  488. if (!str || data == undefined) {
  489. return str;
  490. }
  491. if (typeof data === "object") {
  492. for (var key in data) {
  493. if (data.hasOwnProperty(key)) {
  494. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  495. }
  496. }
  497. }
  498. else {
  499. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  500. return str.replace(reg, function (match, index) {
  501. return args[index - (-1)];
  502. });
  503. }
  504. return str;
  505. }
  506. function getIntersection(a, b) {
  507. let t = [];
  508. for (var i = 0; i < a.length; i++) {
  509. for (var j = 0; j < b.length; j++) {
  510. if (a[i] == b[j]) {
  511. t.push(a[i]);
  512. }
  513. }
  514. }
  515. return t;
  516. }
  517. function getComplement(a, b) {
  518. let t = [];
  519. let count = false;
  520. for (var i = 0; i < a.length; i++) {
  521. count = false;
  522. for (var j = 0; j < b.length; j++) {
  523. if (a[i] == b[j]) {
  524. count = true;
  525. break;
  526. }
  527. }
  528. if (!count) {
  529. t.push(a[i]);
  530. }
  531. }
  532. return t;
  533. }
  534. function geSpriteStageRect(sp) {
  535. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  536. let rect = {
  537. x: point.x,
  538. y: point.y,
  539. width: sp.width * sp.globalScaleX,
  540. height: sp.height * sp.globalScaleY
  541. };
  542. return rect;
  543. }
  544. function touchButton(button) {
  545. let event = new Laya.Event();
  546. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  547. }
  548. function setColor(sprite, r, g, b) {
  549. var redMat = [
  550. r / 255, 0, 0, 0, 0,
  551. g / 255, 0, 0, 0, 0,
  552. b / 255, 0, 0, 0, 0,
  553. 0, 0, 0, 1, 0,
  554. ];
  555. var filter = new Laya.ColorFilter(redMat);
  556. sprite.filters = [filter];
  557. }
  558. function clone(obj, newobj = {}) {
  559. for (var attr in obj) {
  560. if (typeof obj[attr] == "object") {
  561. newobj[attr] = clone(obj[attr], newobj[attr]);
  562. }
  563. else {
  564. newobj[attr] = obj[attr];
  565. }
  566. }
  567. return newobj;
  568. }
  569. function _ms(arr, compare, begin, end) {
  570. const size = end - begin;
  571. if (size <= 1) {
  572. return;
  573. }
  574. const middle = (end + begin) >> 1;
  575. _ms(arr, compare, begin, middle);
  576. _ms(arr, compare, middle, end);
  577. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  578. return;
  579. }
  580. const merged = [];
  581. let leftIndex = begin, rightIndex = middle;
  582. while (merged.length < size) {
  583. if (leftIndex === middle) {
  584. merged.push(arr[rightIndex++]);
  585. }
  586. else if (rightIndex === end) {
  587. merged.push(arr[leftIndex++]);
  588. }
  589. else {
  590. const c = compare(arr[leftIndex], arr[rightIndex]);
  591. if (c <= 0) {
  592. merged.push(arr[leftIndex++]);
  593. }
  594. else {
  595. merged.push(arr[rightIndex++]);
  596. }
  597. }
  598. }
  599. arr.splice(begin, size, ...merged);
  600. }
  601. function sort(arr, compare) {
  602. if (!Array.isArray(arr)) {
  603. throw new Error('sort的参数必须为数组');
  604. }
  605. _ms(arr, compare, 0, arr.length);
  606. return arr;
  607. }
  608. function getLanguage(id) {
  609. }
  610. function getLanguageByTip(id) {
  611. }
  612. function toWeights(array) {
  613. let max = 0;
  614. for (var i = 0; i < array.length; i++) {
  615. max = max + array[i];
  616. if (array[i] == 0) {
  617. array[i] = 0;
  618. }
  619. else {
  620. array[i] = max;
  621. }
  622. }
  623. return array;
  624. }
  625. function unique(array) {
  626. var n = {}, r = [], len = array.length, val, type;
  627. for (var i = 0; i < array.length; i++) {
  628. val = array[i];
  629. type = typeof val;
  630. if (!n[val]) {
  631. n[val] = [type];
  632. r.push(val);
  633. }
  634. else if (n[val].indexOf(type) < 0) {
  635. n[val].push(type);
  636. r.push(val);
  637. }
  638. }
  639. return r;
  640. }
  641. function unique1(array) {
  642. var r = [];
  643. for (var i = 0, l = array.length; i < l; i++) {
  644. for (var j = i + 1; j < l; j++)
  645. if (array[i] == array[j])
  646. j == ++i;
  647. r.push(array[i]);
  648. }
  649. return r;
  650. }
  651. function getDistance(x1, y1, x2, y2) {
  652. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  653. }
  654. function getV2Dis(pos1, pos2) {
  655. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  656. }
  657. function getV2SqDis(pos1, pos2) {
  658. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  659. }
  660. function getDis(x1, y1, x2, y2) {
  661. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  662. }
  663. function getDeltaxy(x1, y1, x2, y2) {
  664. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  665. }
  666. function getSymbolNumber(num) {
  667. if (num > 0) {
  668. return "+" + num;
  669. }
  670. else if (num < 0) {
  671. return num.toString();
  672. }
  673. return num.toString();
  674. }
  675. function fixNumber(num, length) {
  676. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  677. }
  678. function toThousands(num) {
  679. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  680. }
  681. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  682. function fmtMoney(money) {
  683. money = toThousands(money.replace(/^0+/, ''));
  684. if (money.length == 0) {
  685. money = "0";
  686. }
  687. let unit = 0;
  688. for (var i = 0; i < money.length; i++) {
  689. if (money.charAt(i) == ",") {
  690. unit++;
  691. }
  692. }
  693. if (unit == 0) {
  694. return money;
  695. }
  696. else {
  697. let idx = money.indexOf(",");
  698. if (idx) {
  699. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  700. }
  701. return money.replace(",", ".");
  702. }
  703. }
  704. function flatten(arr) {
  705. while (arr.some(item => Array.isArray(item))) {
  706. arr = [].concat(...arr);
  707. }
  708. return arr;
  709. }
  710. function getDistanceByPoint(p1, p2) {
  711. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  712. }
  713. function getAngleByPoint(p1, p2) {
  714. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  715. }
  716. function toIntByArray(array) {
  717. for (var index = 0; index < array.length; index++) {
  718. array[index] = parseInt(array[index]);
  719. }
  720. return array;
  721. }
  722. function getAngle0To360(angle) {
  723. while (angle < 0) {
  724. angle += 360;
  725. }
  726. while (angle >= 360) {
  727. angle -= 360;
  728. }
  729. return angle;
  730. }
  731. function toAngle(radian) {
  732. return radian * 180 / Math.PI;
  733. }
  734. function toRadian(angle) {
  735. return angle * Math.PI / 180;
  736. }
  737. function getArrayValueRandom(array) {
  738. return array[random(0, array.length - 1)];
  739. }
  740. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  743. }
  744. function fmtTimeMMSS(time) {
  745. if (time < 0) {
  746. time = 0;
  747. }
  748. else
  749. time = Math.floor(time);
  750. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  751. }
  752. function fmtTimeMS(time) {
  753. if (time < 0) {
  754. time = 0;
  755. }
  756. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  757. }
  758. function fmtTimeHHMM(time) {
  759. if (time < 0) {
  760. time = 0;
  761. }
  762. time = Math.floor(time / 1000);
  763. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  764. }
  765. let severTime = 0;
  766. function getServerTime() {
  767. return new Date(new Date().getTime() - severTime);
  768. }
  769. function setServerTime(data) {
  770. severTime = (new Date().getTime() - data);
  771. }
  772. var tools = /*#__PURE__*/Object.freeze({
  773. playClickEffect: playClickEffect,
  774. getNumList: getNumList,
  775. getStrList: getStrList,
  776. getRandStr: getRandStr,
  777. getUserId: getUserId,
  778. formatPos: formatPos,
  779. setPosInt: setPosInt,
  780. random: random,
  781. randomList: randomList,
  782. worldToScreen: worldToScreen,
  783. getStringLenght: getStringLenght,
  784. reviseString: reviseString,
  785. getCoinString: getCoinString,
  786. getV3Dest: getV3Dest,
  787. getV2Dest: getV2Dest,
  788. getV2Dir: getV2Dir,
  789. getV3Dir: getV3Dir,
  790. copyPos: copyPos,
  791. getScreenImg: getScreenImg,
  792. playMoveByPositions: playMoveByPositions,
  793. setStarPos: setStarPos,
  794. playLoopAnimRotate: playLoopAnimRotate,
  795. playLoopAnimPosition: playLoopAnimPosition,
  796. playLoopAnimScale: playLoopAnimScale,
  797. playLoopAnimRotation: playLoopAnimRotation,
  798. inRect: inRect,
  799. getNumberK: getNumberK,
  800. pointInsideCircle: pointInsideCircle,
  801. formatString: formatString,
  802. getIntersection: getIntersection,
  803. getComplement: getComplement,
  804. geSpriteStageRect: geSpriteStageRect,
  805. touchButton: touchButton,
  806. setColor: setColor,
  807. clone: clone,
  808. sort: sort,
  809. getLanguage: getLanguage,
  810. getLanguageByTip: getLanguageByTip,
  811. toWeights: toWeights,
  812. unique: unique,
  813. unique1: unique1,
  814. getDistance: getDistance,
  815. getV2Dis: getV2Dis,
  816. getV2SqDis: getV2SqDis,
  817. getDis: getDis,
  818. getDeltaxy: getDeltaxy,
  819. getSymbolNumber: getSymbolNumber,
  820. fixNumber: fixNumber,
  821. toThousands: toThousands,
  822. fmtMoney: fmtMoney,
  823. flatten: flatten,
  824. getDistanceByPoint: getDistanceByPoint,
  825. getAngleByPoint: getAngleByPoint,
  826. toIntByArray: toIntByArray,
  827. getAngle0To360: getAngle0To360,
  828. toAngle: toAngle,
  829. toRadian: toRadian,
  830. getArrayValueRandom: getArrayValueRandom,
  831. promptByTip: promptByTip,
  832. promptByErrorCode: promptByErrorCode,
  833. fmtTimeMMSS: fmtTimeMMSS,
  834. fmtTimeMS: fmtTimeMS,
  835. fmtTimeHHMM: fmtTimeHHMM,
  836. getServerTime: getServerTime,
  837. setServerTime: setServerTime
  838. });
  839. class HttpMgr {
  840. constructor() {
  841. HttpMgr._instance = this;
  842. }
  843. static getInstance() {
  844. if (!this._instance) {
  845. this._instance = new HttpMgr();
  846. }
  847. return this._instance;
  848. }
  849. sendPost(url, data, call) {
  850. let httpObj = new Laya.HttpRequest();
  851. httpObj.http.timeout = 5000;
  852. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  853. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  854. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  855. function errorHandler(error) {
  856. console.log("errorHandler:" + error);
  857. alert("Please check your network connection.");
  858. }
  859. function completeHandler(data) {
  860. if (data && data.length > 0) {
  861. let jsonData = JSON.parse(data);
  862. if (call)
  863. call(jsonData);
  864. }
  865. }
  866. }
  867. getReqData() {
  868. let reqData = JSON.stringify({
  869. gameName: "TQ",
  870. gameUserName: "zhangSan"
  871. });
  872. return reqData;
  873. }
  874. sendPost2025(reqUrl, data, call) {
  875. let isDev = true;
  876. let urlTop = "https://api.kessongame.site/";
  877. let urlMid = urlTop + "prod-api/api/game/";
  878. if (isDev) {
  879. urlTop = "http://192.168.1.13:8090/";
  880. urlMid = urlTop + "api/game/";
  881. }
  882. let url = urlMid + reqUrl;
  883. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  884. if (isDev) {
  885. url = urlTop + reqUrl;
  886. }
  887. else {
  888. url = urlTop + "prod-api/" + reqUrl;
  889. }
  890. }
  891. let httpObj = new Laya.HttpRequest();
  892. httpObj.http.timeout = 5000;
  893. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  894. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  895. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  896. function errorHandler(error) {
  897. if (call) {
  898. call("{'msg':'Network exception','code':500}");
  899. }
  900. else {
  901. alert("Tip:Please check your network connection.");
  902. }
  903. }
  904. function completeHandler(data) {
  905. if (data && data.length > 0) {
  906. let jsonData = JSON.parse(data);
  907. if (call)
  908. call(jsonData);
  909. }
  910. }
  911. }
  912. sendGet(url, call) {
  913. let httpObj = new Laya.HttpRequest();
  914. httpObj.http.timeout = 5000;
  915. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  916. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  917. httpObj.send(url, '', 'get');
  918. function errorHandler(error) {
  919. console.log("errorHandler:" + error);
  920. }
  921. function completeHandler(data) {
  922. if (data && data.length > 0) {
  923. if (call)
  924. call(data);
  925. }
  926. }
  927. }
  928. }
  929. HttpMgr._instance = null;
  930. class LightShader extends Laya.Sprite {
  931. constructor() {
  932. super();
  933. this._time = 0;
  934. this._sin = 0;
  935. this.initShader();
  936. }
  937. initShader() {
  938. var vs = `
  939. #define FSHIGHPRECISION
  940. attribute vec4 posuv;
  941. uniform vec2 size;
  942. varying vec4 v_texcoord;
  943. void main() {
  944. vec4 pos = vec4(posuv.xy,0.,1.);
  945. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  946. gl_Position=pos1;
  947. v_texcoord.xy = posuv.xy;
  948. }
  949. `;
  950. var ps = `
  951. #define FSHIGHPRECISION
  952. precision highp float;
  953. varying vec4 v_texcoord;
  954. uniform vec2 size;
  955. uniform sampler2D texture;
  956. uniform float u_Time;
  957. void main() {
  958. vec4 color= texture2D(texture, v_texcoord.xy);
  959. float width = 0.2;
  960. float start = u_Time;
  961. float offset = 1.0;
  962. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  963. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  964. {
  965. color.r=1.1;
  966. color.g=1.1;
  967. color.b=1.1;
  968. gl_FragColor = color;
  969. } else {
  970. gl_FragColor = color;
  971. }
  972. }
  973. `;
  974. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  975. this.customRenderEnable = true;
  976. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  977. }
  978. customRender(context, x, y) {
  979. this.onUpdate();
  980. if (!this.texture)
  981. return;
  982. let xx = x - this.pivotX;
  983. let yy = y - this.pivotY;
  984. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  985. }
  986. onUpdate() {
  987. this._time += 2 * Laya.timer.delta * 0.001;
  988. this._sin = Math.sin(this._time);
  989. if (this._sin > 0.99) {
  990. this._sin = 0;
  991. this._time = 0;
  992. }
  993. this.shaderValue['u_Time'] = this._sin;
  994. }
  995. }
  996. LightShader.DissolveSurfaceSaveName = 9997;
  997. class UIBase extends fairygui.Window {
  998. constructor() {
  999. super();
  1000. this.isEject = true;
  1001. this.isHide = true;
  1002. this.showbanner = true;
  1003. this.className = "";
  1004. this.isMuti = false;
  1005. this.showbanner = false;
  1006. this.onConstructor();
  1007. }
  1008. checkActive(show) {
  1009. }
  1010. getUIName() {
  1011. return UIBase.uiName;
  1012. }
  1013. onConstructor() {
  1014. }
  1015. onInit() {
  1016. if (!!this.contentPane) {
  1017. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1018. }
  1019. this.setPivot(0.5, 0.5, false);
  1020. }
  1021. doShowAnimation() {
  1022. if (!this.isEject)
  1023. return;
  1024. super.doShowAnimation();
  1025. Laya.Tween.clearTween(this);
  1026. this.scaleX = this.scaleY = 0.8;
  1027. let tweenFunc1 = (func) => {
  1028. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1029. };
  1030. let tweenFunc2 = (func) => {
  1031. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1032. };
  1033. tweenFunc1(tweenFunc2);
  1034. }
  1035. show(...args) {
  1036. super.show();
  1037. this._openParam = args;
  1038. this.isHide = false;
  1039. xGame.uiMgr.checkUIState();
  1040. }
  1041. moveBannerButton() {
  1042. }
  1043. showBannerButton() {
  1044. this.bannerButton.visible = true;
  1045. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1046. this.bannerButton.touchable = true;
  1047. }));
  1048. }
  1049. hide() {
  1050. super.hide();
  1051. this.isHide = true;
  1052. xGame.uiMgr.checkUIState();
  1053. }
  1054. Dispose() {
  1055. super.dispose();
  1056. }
  1057. myUpdate(delay) {
  1058. }
  1059. refresh() { }
  1060. addUIClick(obj, func, arr = null) {
  1061. obj.onClick(this, func, arr);
  1062. obj.onClick(this, this.playBtnSound);
  1063. }
  1064. offUIClick(obj, func) {
  1065. obj.offClick(this, func);
  1066. }
  1067. playBtnSound() {
  1068. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1069. }
  1070. }
  1071. UIBase.lastShowBanner = 0;
  1072. UIBase.showBannerNum = 0;
  1073. UIBase.uiName = "";
  1074. class ui_UIDraw extends fgui.GComponent {
  1075. static createInstance() {
  1076. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1077. }
  1078. onConstruct() {
  1079. this.n1 = (this.getChild("n1"));
  1080. this.extraNode = (this.getChild("extraNode"));
  1081. this.myNode = (this.getChild("myNode"));
  1082. this.closeNode = (this.getChild("closeNode"));
  1083. this.moneyNode = (this.getChild("moneyNode"));
  1084. this.n38 = (this.getChild("n38"));
  1085. this.secretary = (this.getChild("secretary"));
  1086. this.drawBtn = (this.getChild("drawBtn"));
  1087. this.talkNode = (this.getChild("talkNode"));
  1088. this.t0 = this.getTransition("t0");
  1089. }
  1090. }
  1091. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1092. class ui_UIBox extends fgui.GComponent {
  1093. static createInstance() {
  1094. return (fgui.UIPackage.createObject("game", "UIBox"));
  1095. }
  1096. onConstruct() {
  1097. this.n0 = (this.getChild("n0"));
  1098. this.n12 = (this.getChild("n12"));
  1099. this.n1 = (this.getChild("n1"));
  1100. this.n2 = (this.getChild("n2"));
  1101. this.bar = (this.getChild("bar"));
  1102. this.closeBtn = (this.getChild("closeBtn"));
  1103. this.openBtn = (this.getChild("openBtn"));
  1104. this.t0 = this.getTransition("t0");
  1105. this.t1 = this.getTransition("t1");
  1106. }
  1107. }
  1108. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1109. class GlobalManager {
  1110. constructor() {
  1111. }
  1112. registerMethod(name, method) {
  1113. console.log('zh: 注册全局方法', name);
  1114. this[name] = method;
  1115. }
  1116. callMethod(name, ...args) {
  1117. console.log('zh: 调用全局方法', name);
  1118. if (this[name]) {
  1119. return this[name](...args);
  1120. }
  1121. else {
  1122. console.error(`zh: 全局方法 Method ${name} not found`);
  1123. }
  1124. }
  1125. }
  1126. GlobalManager.instance = new GlobalManager();
  1127. class JSBridgeUtils {
  1128. constructor() { }
  1129. static get instance() {
  1130. if (!this._instance) {
  1131. this._instance = new JSBridgeUtils();
  1132. }
  1133. return this._instance;
  1134. }
  1135. initBridge() {
  1136. if (!Laya.Browser.onAndroid) {
  1137. console.log('zh:非android dev');
  1138. return;
  1139. }
  1140. let cfg = window['conchConfig'];
  1141. if (cfg) {
  1142. var os = cfg.getOS();
  1143. if (os == "Conch-android") {
  1144. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1145. if (this.bridge) {
  1146. return true;
  1147. }
  1148. else {
  1149. return false;
  1150. }
  1151. }
  1152. else {
  1153. return false;
  1154. }
  1155. }
  1156. else {
  1157. return false;
  1158. }
  1159. }
  1160. testAd1() {
  1161. if (!Laya.Browser.onAndroid) {
  1162. console.log('zh:非android dev');
  1163. return;
  1164. }
  1165. if (!this.initBridge()) {
  1166. return;
  1167. }
  1168. let rs = this.bridge.call("testString", "hello");
  1169. console.log('zh:testString rs=' + rs);
  1170. }
  1171. testAdCallBack() {
  1172. if (!this.initBridge()) {
  1173. return;
  1174. }
  1175. console.log("zh:testAdCallBack start");
  1176. const defaultObj = { code: 200, msg: "req update Ui" };
  1177. const reqObj = { code: 300, msg: "hello java ui" };
  1178. this.bridge.callWithBack((rsStr) => {
  1179. const rsObj = JSON.parse(rsStr);
  1180. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1181. }, "testAsyncCallback", JSON.stringify(reqObj));
  1182. }
  1183. showInternAd(mark) {
  1184. console.log('zh:showInternAd start');
  1185. if (!Laya.Browser.onAndroid) {
  1186. console.log('zh:showInternAd 非android dev');
  1187. return false;
  1188. }
  1189. if (!this.initBridge()) {
  1190. return false;
  1191. }
  1192. let rs = this.bridge.call("showInternAd", mark);
  1193. try {
  1194. const result = JSON.parse(rs);
  1195. if (result.code === 200) {
  1196. console.log("zh:showInternAd OK");
  1197. return true;
  1198. }
  1199. else {
  1200. console.warn("zh:showInternAd FAILL:", result.msg);
  1201. return false;
  1202. }
  1203. }
  1204. catch (e) {
  1205. console.error("zh:解析桥接返回值失败:", e);
  1206. return false;
  1207. }
  1208. }
  1209. exitAndCloseGame() {
  1210. if (!Laya.Browser.onAndroid) {
  1211. return;
  1212. }
  1213. if (!this.initBridge()) {
  1214. return;
  1215. }
  1216. console.log('zh:开始关闭游戏-');
  1217. this.bridge.call("exitAndCloseGame");
  1218. }
  1219. showRewardAd(mark) {
  1220. if (!Laya.Browser.onAndroid) {
  1221. return false;
  1222. }
  1223. if (!this.initBridge()) {
  1224. return false;
  1225. }
  1226. let rs = this.bridge.call("showRewardAd", mark);
  1227. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1228. try {
  1229. const result = JSON.parse(rs);
  1230. if (result.code === 200) {
  1231. console.log("zh:广告显示成功");
  1232. return true;
  1233. }
  1234. else {
  1235. console.warn("zh:广告显示失败:", result.msg);
  1236. return false;
  1237. }
  1238. }
  1239. catch (e) {
  1240. console.error("zh:解析桥接返回值失败:", e);
  1241. return false;
  1242. }
  1243. }
  1244. logEventForAdNoParams(eventName) {
  1245. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1246. if (!Laya.Browser.onAndroid) {
  1247. return;
  1248. }
  1249. if (!this.initBridge()) {
  1250. return;
  1251. }
  1252. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1253. this.bridge.call("logEventForAdNoParams", eventName);
  1254. }
  1255. logEventForAdHaveParams(eventName, jsonStr) {
  1256. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1257. if (!Laya.Browser.onAndroid) {
  1258. return;
  1259. }
  1260. if (!this.initBridge()) {
  1261. return;
  1262. }
  1263. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1264. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1265. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1266. }
  1267. logEventForFirebase(eventName, jsonStr) {
  1268. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1269. if (!Laya.Browser.onAndroid) {
  1270. return;
  1271. }
  1272. if (!this.initBridge()) {
  1273. return;
  1274. }
  1275. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1276. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1277. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1278. }
  1279. testNetTip() {
  1280. if (Laya.Browser.onAndroid) {
  1281. let boo = this.getNetworkAvailable();
  1282. this.showToast2("Network error, reward unavailable");
  1283. return;
  1284. }
  1285. }
  1286. getNetworkAvailable() {
  1287. if (!Laya.Browser.onAndroid) {
  1288. return;
  1289. }
  1290. if (!this.initBridge()) {
  1291. return;
  1292. }
  1293. let boo = this.bridge.call("getNetworkAvailable");
  1294. console.log("zh:getNetworkAvailable boo=" + boo);
  1295. return boo;
  1296. }
  1297. showToast2(msg) {
  1298. if (!Laya.Browser.onAndroid) {
  1299. return;
  1300. }
  1301. if (!this.initBridge()) {
  1302. return;
  1303. }
  1304. this.bridge.call("showToast2", msg);
  1305. }
  1306. nativeCallJs(msg) {
  1307. console.log("zh:nativeCallJs received data: 1111", msg);
  1308. if (msg === 'Ad1') {
  1309. GlobalManager.instance.callMethod('Ad1');
  1310. console.log("zh: Ad1 奖励发送成功");
  1311. }
  1312. else if (msg === 'Ad2') {
  1313. GlobalManager.instance.callMethod('Ad2');
  1314. console.log("zh: Ad2 奖励发送成功");
  1315. }
  1316. else if (msg === 'Ad3') {
  1317. GlobalManager.instance.callMethod('Ad3');
  1318. console.log("zh: Ad3 奖励发送成功");
  1319. }
  1320. else if (msg === 'Ad4') {
  1321. GlobalManager.instance.callMethod('Ad4');
  1322. console.log("zh: Ad4 奖励发送成功");
  1323. }
  1324. else if (msg === 'Ad5') {
  1325. console.log("zh: Ad5 奖励发送成功");
  1326. GlobalManager.instance.callMethod('Ad5');
  1327. }
  1328. }
  1329. }
  1330. class UIBox extends UIBase {
  1331. constructor() {
  1332. super();
  1333. this.boxNum = 0;
  1334. this.boxMax = 10;
  1335. this.inAd = false;
  1336. this.isClose = false;
  1337. }
  1338. onConstructor() {
  1339. this.ui = ui_UIBox.createInstance();
  1340. this.contentPane = this.ui;
  1341. this.isEject = false;
  1342. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1343. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1344. Laya.timer.loop(1000, this, this.update);
  1345. }
  1346. update() {
  1347. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1348. this.boxNum -= 1;
  1349. this.upBar();
  1350. }
  1351. }
  1352. upBar() {
  1353. if (this.boxNum > this.boxMax)
  1354. this.boxNum = this.boxMax;
  1355. this.ui.bar.value = this.boxNum * 10;
  1356. }
  1357. show() {
  1358. super.show();
  1359. this.isClose = false;
  1360. this.boxNum = 0;
  1361. this.inAd = false;
  1362. this.upBar();
  1363. this.ui.t0.play();
  1364. this.ui.closeBtn.visible = false;
  1365. Laya.timer.once(3000, this, () => {
  1366. this.ui.closeBtn.visible = true;
  1367. this.ui.bar.alpha = 1;
  1368. });
  1369. Laya.timer.once(500, this, () => {
  1370. this.ui.t1.play();
  1371. });
  1372. }
  1373. hide() {
  1374. Laya.timer.clearAll(this);
  1375. Moyu.showBannerAd(false);
  1376. super.hide();
  1377. }
  1378. onOpenBox() {
  1379. this.boxNum++;
  1380. if (this.boxNum < this.boxMax) {
  1381. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1382. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1383. }
  1384. }
  1385. else if (this.boxNum == this.boxMax) {
  1386. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1387. this.ui.openBtn.c1.selectedIndex = 13;
  1388. this.inAd = true;
  1389. }
  1390. else
  1391. this.getAward();
  1392. }
  1393. else if (this.inAd) {
  1394. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1395. if (Laya.Browser.onAndroid) {
  1396. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1397. if (!boo) {
  1398. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1399. return;
  1400. }
  1401. }
  1402. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1403. }
  1404. else {
  1405. console.log('zh:AD 失败,直接发放奖励');
  1406. this.qjff_AD_for_UIBOX_onOpenBox();
  1407. }
  1408. }
  1409. this.upBar();
  1410. }
  1411. qjff_AD_for_UIBOX_onOpenBox() {
  1412. this.getAward();
  1413. }
  1414. onCloseBox() {
  1415. if (this.isClose)
  1416. this.hide();
  1417. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1418. this.isClose = true;
  1419. PlatMgr.showBanner(true, 0, 3000);
  1420. }
  1421. else
  1422. this.hide();
  1423. }
  1424. getAward() {
  1425. let str = "";
  1426. if (Math.random() < 0.5) {
  1427. let max = Moyu.isLegal ? 500 : 2500;
  1428. let num = xGame.tools.random(max, 500 + max);
  1429. DataMgr.setCoin(num);
  1430. str = "金币x" + num;
  1431. }
  1432. else {
  1433. let max = Moyu.isLegal ? 10 : 30;
  1434. let num = xGame.tools.random(max, 30 + max);
  1435. DataMgr.setDiamond(num);
  1436. str = "钻石x" + num;
  1437. }
  1438. xGame.showTip("恭喜获得-" + str);
  1439. this.hide();
  1440. }
  1441. }
  1442. UIBox.uiName = "UIBox";
  1443. class ui_UITry extends fgui.GComponent {
  1444. static createInstance() {
  1445. return (fgui.UIPackage.createObject("game", "UITry"));
  1446. }
  1447. onConstruct() {
  1448. this.n11 = (this.getChild("n11"));
  1449. this.myNode = (this.getChild("myNode"));
  1450. this.t0 = this.getTransition("t0");
  1451. }
  1452. }
  1453. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1454. class UITry extends UIBase {
  1455. constructor() {
  1456. super();
  1457. this.closeTime = 0;
  1458. this.closeNum = 0;
  1459. this.skillUrl = xGame.common.skillIconList;
  1460. }
  1461. onConstructor() {
  1462. this.ui = ui_UITry.createInstance();
  1463. this.contentPane = this.ui;
  1464. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1465. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1466. }
  1467. show() {
  1468. super.show();
  1469. this.closeNum = 0;
  1470. this.closeTime = 15;
  1471. this.ui.t0.play();
  1472. PlatMgr.showRateBanner();
  1473. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1474. Laya.timer.loop(1000, this, this.updateTime);
  1475. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1476. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1477. xGame.common.gameMgr.gamePause = true;
  1478. }
  1479. updateTime() {
  1480. if (this.closeTime > 1) {
  1481. this.closeTime--;
  1482. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1483. }
  1484. else
  1485. this.hide();
  1486. }
  1487. hide() {
  1488. Laya.timer.clearAll(this);
  1489. Moyu.showBannerAd(false);
  1490. super.hide();
  1491. xGame.common.gameMgr.gamePause = false;
  1492. }
  1493. onTry() {
  1494. console.log('zh:qjff_AD_for_uitry');
  1495. if (Laya.Browser.onAndroid) {
  1496. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1497. if (!boo) {
  1498. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1499. return;
  1500. }
  1501. }
  1502. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1503. }
  1504. else {
  1505. console.log('zh:AD 失败,直接发放奖励');
  1506. this.qjff_AD_for_uitry();
  1507. }
  1508. }
  1509. qjff_AD_for_uitry() {
  1510. let select = xGame.common.curPlayerSkillType;
  1511. DataMgr.gameData.trySkill = select;
  1512. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1513. DataMgr.saveGameData();
  1514. DataMgr.setBigSkill(select, 1);
  1515. xGame.showTip("Trial Successful");
  1516. this.hide();
  1517. }
  1518. onCancel() {
  1519. if (this.closeNum > 0) {
  1520. this.closeNum--;
  1521. if (this.closeNum < 2)
  1522. this.hide();
  1523. return;
  1524. }
  1525. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1526. this.onTry();
  1527. }
  1528. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1529. this.closeNum = 3;
  1530. }
  1531. else
  1532. this.hide();
  1533. }
  1534. }
  1535. UITry.uiName = "UITry";
  1536. class PlatMgr {
  1537. static initConfig() {
  1538. this.lastVt = 0;
  1539. if (!Moyu.platConfig)
  1540. return;
  1541. for (let k in Moyu.platConfig) {
  1542. let pd = this[k];
  1543. let pc = Moyu.platConfig[k];
  1544. if (pd != undefined && pc != undefined)
  1545. this[k] = pc;
  1546. }
  1547. Moyu.setBannerPos(0.5, 1);
  1548. }
  1549. static rand100(num) {
  1550. return xGame.tools.random(0, 100) < num;
  1551. }
  1552. static isMisVideo() {
  1553. let dt = Laya.timer.currTimer - this.lastVt;
  1554. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1555. this.lastVt = Laya.timer.currTimer;
  1556. return true;
  1557. }
  1558. else {
  1559. if (this.rand100(this.fullVideoRate)) {
  1560. console.log('zh:插屏 ad start');
  1561. JSBridgeUtils.instance.showInternAd('platMgr');
  1562. }
  1563. return false;
  1564. }
  1565. }
  1566. static showVideo(call, type) {
  1567. Moyu.showVideoAd(() => {
  1568. this.lastVt = Laya.timer.currTimer;
  1569. call && call();
  1570. }, type);
  1571. }
  1572. static showInsert(delay = false) {
  1573. if (this.getRand() < this.insertRate) {
  1574. let dt = delay ? this.insertDelay : 0;
  1575. console.log('zh:插屏 ad start');
  1576. JSBridgeUtils.instance.showInternAd('gameInsert');
  1577. }
  1578. }
  1579. static gameInsert() {
  1580. let t = this.getRand();
  1581. let r = this.gameInsertRate;
  1582. if (t < r) {
  1583. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1584. }
  1585. }
  1586. static showRateBanner() {
  1587. if (this.getRand() < this.bannerRate)
  1588. this.showBanner(true, this.bannerDelay, 3000);
  1589. }
  1590. static showBanner(show, delay = 0, hide = 0) {
  1591. if (2 > 1) {
  1592. console.log('zh:显示showBanner广告 直接返回');
  1593. return;
  1594. }
  1595. if (!show)
  1596. Moyu.showBannerAd(false);
  1597. else {
  1598. Laya.timer.clear(this, this.bannerShow);
  1599. if (delay > 0)
  1600. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1601. else
  1602. this.bannerShow(true);
  1603. if (hide > 0)
  1604. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1605. }
  1606. }
  1607. static bannerShow(show) {
  1608. if (2 > 1) {
  1609. console.log('zh:显示showBanner广告 直接返回');
  1610. return;
  1611. }
  1612. Moyu.showBannerAd(show);
  1613. console.log("showBanner" + show);
  1614. }
  1615. static getRand() {
  1616. return xGame.tools.random(0, 100);
  1617. }
  1618. static openBox() {
  1619. if (this.getRand() < this.boxRate)
  1620. xGame.uiMgr.Show(UIBox);
  1621. }
  1622. static openTry() {
  1623. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1624. return;
  1625. if (this.getRand() < this.tryRate)
  1626. xGame.uiMgr.Show(UITry);
  1627. else if (DataMgr.gameData.gameCount == 1)
  1628. xGame.uiMgr.Show(UITry);
  1629. }
  1630. }
  1631. PlatMgr.forceShare = 0;
  1632. PlatMgr.signAdRate = 0;
  1633. PlatMgr.forceVideoRate = 0;
  1634. PlatMgr.forceVideoGap = 0;
  1635. PlatMgr.fullVideoRate = 0;
  1636. PlatMgr.gameInsertRate = 0;
  1637. PlatMgr.insertGap = 0;
  1638. PlatMgr.insertDelay = 0;
  1639. PlatMgr.insertRate = 0;
  1640. PlatMgr.boxRate = 0;
  1641. PlatMgr.boxVideoRate = 0;
  1642. PlatMgr.boxInsertRate = 0;
  1643. PlatMgr.boxBannerRate = 0;
  1644. PlatMgr.tryRate = 0;
  1645. PlatMgr.tryClose3Rate = 0;
  1646. PlatMgr.tryVideoRate = 0;
  1647. PlatMgr.bannerRate = 0;
  1648. PlatMgr.lastVt = 0;
  1649. class ui_UIAddProp extends fgui.GComponent {
  1650. static createInstance() {
  1651. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1652. }
  1653. onConstruct() {
  1654. this.n11 = (this.getChild("n11"));
  1655. this.myNode = (this.getChild("myNode"));
  1656. this.closeBtn = (this.getChild("closeBtn"));
  1657. this.t0 = this.getTransition("t0");
  1658. }
  1659. }
  1660. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1661. class SpineMgr {
  1662. constructor(name, loadCb = null) {
  1663. this.loaded = false;
  1664. this.spineName = '';
  1665. this.loadedCallback = loadCb;
  1666. this.templet = new Laya.Templet();
  1667. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1668. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1669. if (name === 'mishu') {
  1670. this.templet.loadAni('spine/nvmishu.sk');
  1671. }
  1672. else {
  1673. this.templet.loadAni(`spine/${name}.sk`);
  1674. }
  1675. this.templet.lock = true;
  1676. this.spineName = name;
  1677. }
  1678. onError() {
  1679. console.log("zh:spine加载出错");
  1680. }
  1681. parseComplete() {
  1682. this.loaded = true;
  1683. this.loadedCallback && this.loadedCallback();
  1684. }
  1685. dispose() {
  1686. if (this.templet && !this.templet.destroyed) {
  1687. this.templet.destroy();
  1688. }
  1689. this.templet = null;
  1690. }
  1691. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1692. if (!this.loaded) {
  1693. return;
  1694. }
  1695. let spine;
  1696. if (mySpine) {
  1697. spine = mySpine;
  1698. }
  1699. else {
  1700. spine = this.createSpine(data, parent);
  1701. }
  1702. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1703. if (!isLoop) {
  1704. spine.on(Laya.Event.STOPPED, this, () => {
  1705. spine.offAll(Laya.Event.STOPPED);
  1706. callback && callback(spine);
  1707. });
  1708. }
  1709. return spine;
  1710. }
  1711. createSpine(data, parent, type = 1) {
  1712. let spine;
  1713. spine = this.templet.buildArmature(type);
  1714. spine.showSkinByIndex(0);
  1715. parent.addChild(spine);
  1716. spine.pos(data.x, data.y);
  1717. spine.scale(data.scaleX, data.scaleY, true);
  1718. return spine;
  1719. }
  1720. }
  1721. var AIState;
  1722. (function (AIState) {
  1723. AIState[AIState["none"] = 0] = "none";
  1724. AIState[AIState["idle"] = 1] = "idle";
  1725. AIState[AIState["reset"] = 2] = "reset";
  1726. AIState[AIState["move"] = 3] = "move";
  1727. AIState[AIState["wait"] = 4] = "wait";
  1728. AIState[AIState["select"] = 5] = "select";
  1729. AIState[AIState["turn"] = 6] = "turn";
  1730. AIState[AIState["shoot"] = 7] = "shoot";
  1731. AIState[AIState["leave"] = 8] = "leave";
  1732. })(AIState || (AIState = {}));
  1733. class AIPlayer {
  1734. constructor() {
  1735. this.dtime = 30;
  1736. this.awayTime = 0;
  1737. this.awayNum = 0;
  1738. this.hideTime = 0;
  1739. this.rootMoveTime = 0;
  1740. this.isGuide = false;
  1741. this.state = AIState.none;
  1742. this.waitTime = 0;
  1743. this.forceNum = 0;
  1744. this.forceMax = 0;
  1745. this.ballSize = 33;
  1746. this.selectNum = 0;
  1747. this.destRot = 0;
  1748. this.aiLv = 10;
  1749. this.kickBall = [];
  1750. this.lineBall = [];
  1751. this.scoreBall = [];
  1752. this.holeBall = [];
  1753. this.turnNum = 0;
  1754. this.setNum = 0;
  1755. this.setMax = 0;
  1756. this.setRate = 0;
  1757. this.rectL = 0;
  1758. this.rectR = 0;
  1759. this.rectT = 0;
  1760. this.rectB = 0;
  1761. this.rootPos = { x: 0, y: 0 };
  1762. this.bestForce = 0;
  1763. this.bestAngle = 180;
  1764. this.bestPos = { x: 0, y: 0 };
  1765. this.bestKick = { x: 0, y: 0 };
  1766. this.posList = [];
  1767. this.posIdx = 0;
  1768. this.chatTime = 3000;
  1769. this.tempDir1 = new Laya.Vector2();
  1770. this.tempDir2 = new Laya.Vector2();
  1771. this.tempDir3 = new Laya.Vector2();
  1772. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1773. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1774. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1775. this.gameSrc = xGame.common.gameUI;
  1776. this.hideTime = Laya.timer.currTimer;
  1777. Moyu.setOnTipCall((id) => {
  1778. if (id == 20012)
  1779. this.hideTime = Laya.timer.currTimer;
  1780. else
  1781. (id == 20011);
  1782. {
  1783. let dt = Laya.timer.currTimer - this.hideTime;
  1784. console.log("onshow" + dt);
  1785. if (dt > 30000 && this.state > AIState.none)
  1786. xGame.common.gameMgr.aiGameEnd(false);
  1787. }
  1788. }, this);
  1789. }
  1790. init() {
  1791. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1792. this.awayTime = xGame.tools.random(5000, 10000);
  1793. this.awayNum = 0;
  1794. this.hideTime = Laya.timer.currTimer;
  1795. let rect = xGame.common.d2World.borderRect;
  1796. this.rectL = Math.ceil(rect.x) + 17;
  1797. this.rectT = Math.ceil(rect.y) + 17;
  1798. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1799. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1800. this.wBall = xGame.common.d2World.rootBall;
  1801. this.ballSize = this.wBall.gameObj.width - 1;
  1802. if (this.posList.length < 1) {
  1803. let dp = 40;
  1804. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1805. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1806. let dx = i < this.rectR ? i : this.rectR;
  1807. let dy = j < this.rectB ? j : this.rectB;
  1808. let order = xGame.tools.random(0, 1000);
  1809. this.posList.push({ x: dx, y: dy, order: order });
  1810. }
  1811. }
  1812. this.posList.sort(function (a, b) {
  1813. return a.order - b.order;
  1814. });
  1815. this.setMax = this.posList.length;
  1816. }
  1817. this.state = AIState.idle;
  1818. }
  1819. setAiLevel(num) {
  1820. this.aiLv = num;
  1821. }
  1822. initBall() {
  1823. this.rootPos.x = this.wBall.gameObj.x;
  1824. this.rootPos.y = this.wBall.gameObj.y;
  1825. this.initHoleBall();
  1826. }
  1827. initHoleBall() {
  1828. this.kickBall = [];
  1829. this.lineBall = [];
  1830. this.scoreBall = [];
  1831. this.holeBall = [];
  1832. this.selectNum = 0;
  1833. this.forceNum = 0;
  1834. this.forceMax = 0;
  1835. this.turnNum = 0;
  1836. let list = xGame.common.d2World.ballArr;
  1837. if (list.length < 20 && !this.isGuide) {
  1838. let holes = xGame.common.gameMgr.holePosList;
  1839. for (let i = 0; i < list.length; i++) {
  1840. let obj = list[i];
  1841. if (!obj)
  1842. continue;
  1843. obj.kickPos.x = 0;
  1844. obj.kickPos.y = 0;
  1845. obj.poleAngle = 0;
  1846. obj.hard = 0;
  1847. obj.borderDis = 0;
  1848. obj.kickAngle = 180;
  1849. if (obj.number == 0)
  1850. continue;
  1851. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1852. continue;
  1853. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1854. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1855. continue;
  1856. }
  1857. let b = obj.gameObj;
  1858. let wbp = this.rootPos;
  1859. let bx = wbp.x - b.x;
  1860. let by = wbp.y - b.y;
  1861. obj.borderDis = xGame.tools.random(0, 100);
  1862. this.kickBall.push(obj);
  1863. if (!this.isLine(wbp, obj))
  1864. continue;
  1865. obj.kickAngle = xGame.tools.random(90, 180);
  1866. obj.kickPos.x = b.x;
  1867. obj.kickPos.y = b.y;
  1868. this.lineBall.push(obj);
  1869. let minDis = 999999;
  1870. let hole = false;
  1871. for (let j = 0; j < holes.length; j++) {
  1872. let hp = holes[j];
  1873. if (bx >= 0 && hp.x > b.x + 100)
  1874. continue;
  1875. if (bx <= 0 && hp.x < b.x - 100)
  1876. continue;
  1877. if (by < -10 && hp.y < wbp.y)
  1878. continue;
  1879. if (by > 10 && hp.y > wbp.y)
  1880. continue;
  1881. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1882. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1883. if (dis < minDis) {
  1884. let dx = b.x - this.tempDir1.x * this.ballSize;
  1885. let dy = b.y - this.tempDir1.y * this.ballSize;
  1886. this.tempDir3.x = this.tempDir1.x;
  1887. this.tempDir3.y = this.tempDir1.y;
  1888. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1889. obj.kickPos.x = dx;
  1890. obj.kickPos.y = dy;
  1891. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1892. if (num > 1)
  1893. num = 1;
  1894. obj.kickAngle = Math.acos(num) * 57.3;
  1895. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1896. dis = dis * 2;
  1897. if (Math.abs(hp.x - 600) < 100)
  1898. dis += 50;
  1899. obj.hard = dis + obj.kickAngle * 3;
  1900. hole = true;
  1901. }
  1902. }
  1903. }
  1904. }
  1905. if (hole) {
  1906. this.scoreBall.push(obj);
  1907. this.holeBall.push(obj);
  1908. }
  1909. }
  1910. this.scoreBall.sort(function (a, b) {
  1911. return a.hard - b.hard;
  1912. });
  1913. this.holeBall.sort(function (a, b) {
  1914. return a.kickAngle - b.kickAngle;
  1915. });
  1916. this.kickBall.sort(function (a, b) {
  1917. return a.borderDis - b.borderDis;
  1918. });
  1919. }
  1920. else {
  1921. let max = list.length - 1;
  1922. let i = xGame.tools.random(0, max);
  1923. for (i; i <= max; i++) {
  1924. let idx = i >= max ? i -= max : i;
  1925. let obj = list[idx];
  1926. if (obj && obj.number != 0) {
  1927. obj.kickAngle = xGame.tools.random(90, 180);
  1928. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1929. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1930. this.lineBall.push(obj);
  1931. break;
  1932. }
  1933. }
  1934. }
  1935. }
  1936. selectBall() {
  1937. let ball = null;
  1938. this.destRot = 0;
  1939. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1940. let ai = 110 - this.aiLv * 10;
  1941. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1942. let score = false;
  1943. if (this.scoreBall.length < 1) {
  1944. if (this.lineBall.length < 1) {
  1945. for (let i = 0; i < this.kickBall.length; i++) {
  1946. let list = [];
  1947. let bo = this.kickBall[i];
  1948. let bobj = bo.gameObj;
  1949. let rect = xGame.common.d2World.borderRect;
  1950. let mobj = this.wBall.gameObj;
  1951. let minb = bobj.y - rect.y - 20;
  1952. let minw = mobj.y - rect.y - 50;
  1953. if (minb > 0 && minw > 0) {
  1954. let dlenx = 0;
  1955. let dleny = mobj.y - rect.y;
  1956. let spx = mobj.x;
  1957. let spy = rect.y - dleny;
  1958. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1959. }
  1960. minb = rect.y + rect.height - bobj.y - 20;
  1961. minw = rect.y + rect.height - mobj.y - 50;
  1962. if (minb > 0 && minw > 0) {
  1963. let dlenx = 0;
  1964. let dleny = rect.y + rect.height - mobj.y;
  1965. let spx = mobj.x;
  1966. let spy = rect.y + rect.height + dleny;
  1967. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1968. }
  1969. minb = bobj.x - rect.x - 20;
  1970. minw = mobj.x - rect.x - 50;
  1971. if (minb > 0 && minw > 0) {
  1972. let dlenx = mobj.x - rect.x;
  1973. let dleny = 0;
  1974. let spx = rect.x - dlenx;
  1975. let spy = mobj.y;
  1976. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1977. }
  1978. minb = rect.x + rect.width - bobj.x - 20;
  1979. minw = rect.x + rect.width - mobj.x - 50;
  1980. if (minb > 0 && minw > 0) {
  1981. let dlenx = rect.x + rect.width - mobj.x;
  1982. let dleny = 0;
  1983. let spx = rect.x + rect.width + dlenx;
  1984. let spy = mobj.y;
  1985. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1986. }
  1987. list.sort(function (a, b) {
  1988. return a.order - b.order;
  1989. });
  1990. for (let i = 0; i < list.length; i++) {
  1991. let data = list[i];
  1992. let mx = mobj.x - bobj.x;
  1993. let my = mobj.y - bobj.y;
  1994. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1995. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1996. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1997. if (num > 1)
  1998. num = 1;
  1999. let cos = Math.acos(num);
  2000. if (cos > 1.57)
  2001. cos = 1.57;
  2002. else if (cos < 0.01)
  2003. cos = 0.01;
  2004. let tan = Math.tan(cos);
  2005. let dx = tan * data.dleny;
  2006. let dy = tan * data.dlenx;
  2007. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2008. if (Math.abs(bx - 667) < 40)
  2009. continue;
  2010. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2011. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2012. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2013. this.forceMax = dis * 0.08;
  2014. this.destRot += mis * 0.1;
  2015. this.setKick(bx, by);
  2016. return true;
  2017. }
  2018. }
  2019. }
  2020. }
  2021. else {
  2022. ball = xGame.common.getRandArrEle(this.lineBall);
  2023. }
  2024. }
  2025. else {
  2026. for (let i = 0; i < this.scoreBall.length; i++) {
  2027. if (i < this.scoreBall.length - 1) {
  2028. let rand = 70 + this.aiLv * 10 + i * 10;
  2029. if (xGame.tools.random(0, 100) < rand) {
  2030. ball = this.scoreBall[i];
  2031. break;
  2032. }
  2033. }
  2034. else {
  2035. ball = this.scoreBall[i];
  2036. break;
  2037. }
  2038. }
  2039. score = true;
  2040. this.selectNum++;
  2041. }
  2042. if (!ball)
  2043. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2044. if (this.selectNum >= max) {
  2045. let dx = ball.gameObj.x;
  2046. let dy = ball.gameObj.y;
  2047. let kickAngle = 0;
  2048. if (score) {
  2049. dx = ball.kickPos.x;
  2050. dy = ball.kickPos.y;
  2051. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2052. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2053. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2054. if (adot > 1)
  2055. adot = 1;
  2056. kickAngle = Math.acos(adot) * 57.3;
  2057. if (kickAngle > 45) {
  2058. let kdx = ball.kickPos.x - ball.gameObj.x;
  2059. let kdy = ball.kickPos.y - ball.gameObj.y;
  2060. dx = ball.kickPos.x - kdx * mis * 0.3;
  2061. dy = ball.kickPos.y - kdy * mis * 0.3;
  2062. }
  2063. else
  2064. this.destRot += mis;
  2065. }
  2066. else if (ball.poleAngle != 0) {
  2067. this.destRot += ball.poleAngle;
  2068. }
  2069. if (xGame.common.gameMode == 0) {
  2070. let af = kickAngle * 0.08;
  2071. this.forceMax = ball.hard * 0.1 + af * af;
  2072. }
  2073. this.setKick(dx, dy);
  2074. }
  2075. else {
  2076. let rand = this.aiLv * 5 + 40;
  2077. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2078. ball = xGame.common.getRandArrEle(this.scoreBall);
  2079. else
  2080. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2081. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2082. if (xGame.tools.random(0, 100) > rand) {
  2083. this.selectNum = max;
  2084. }
  2085. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2086. this.selectNum++;
  2087. }
  2088. ball.onClick(0, true);
  2089. }
  2090. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2091. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2092. let balls = xGame.common.d2World.ballArr;
  2093. let max = xGame.tools.getDis(hx, hy, bx, by);
  2094. for (let index = 0; index < balls.length; index++) {
  2095. let obj = balls[index];
  2096. if (obj.number == 0)
  2097. continue;
  2098. if (obj.number == bn || obj.number == dn)
  2099. continue;
  2100. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2101. if (dis * dis > max)
  2102. continue;
  2103. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2104. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2105. if (num > 1)
  2106. num = 1;
  2107. if (num < 0)
  2108. continue;
  2109. let gap = Math.sin(Math.acos(num)) * dis;
  2110. if (gap < this.ballSize)
  2111. return true;
  2112. }
  2113. return false;
  2114. }
  2115. isLine(xy, ball) {
  2116. let bx = xy.x;
  2117. let by = xy.y;
  2118. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2119. let dis = ball.getDestDis(xy);
  2120. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2121. let sin = Math.sin(angle);
  2122. let cos = Math.cos(angle);
  2123. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2124. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2125. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2126. let dx = bx + this.tempDir2.x * dis;
  2127. let dy = by + this.tempDir2.y * dis;
  2128. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2129. sin = Math.sin(-angle);
  2130. cos = Math.cos(-angle);
  2131. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2132. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2133. dx = bx + this.tempDir2.x * dis;
  2134. dy = by + this.tempDir2.y * dis;
  2135. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2136. if (isr && isl)
  2137. return false;
  2138. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2139. }
  2140. return true;
  2141. }
  2142. turnPole() {
  2143. this.turnNum++;
  2144. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2145. let dr = rot - this.destRot;
  2146. let abs = Math.abs(dr) % 360;
  2147. if (abs > 180) {
  2148. if (rot > 180)
  2149. rot -= 360;
  2150. if (this.destRot > 180)
  2151. this.destRot -= 360;
  2152. }
  2153. let max = this.turnNum * 5 + this.aiLv * 5;
  2154. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2155. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2156. let at = xGame.tools.random(1000, 2000);
  2157. if (!this.onAway(3))
  2158. at += xGame.tools.random(10000, 15000);
  2159. this.setState(AIState.shoot, at);
  2160. }
  2161. else {
  2162. let mr = 0;
  2163. if (abs > 3)
  2164. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2165. else if (Math.random() > 0.6)
  2166. mr = xGame.tools.random(1, 10) * 0.1;
  2167. mr = dr > 0 ? -mr : mr;
  2168. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2169. }
  2170. }
  2171. setKick(dx, dy) {
  2172. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2173. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2174. this.tempDir1.x = 0;
  2175. this.tempDir1.y = 1;
  2176. this.tempDir2.y = -this.tempDir2.y;
  2177. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2178. if (num > 1)
  2179. num = 1;
  2180. let rot = Math.acos(num) * 57.3;
  2181. if (this.tempDir2.x < 0)
  2182. rot = 360 - rot;
  2183. this.destRot += rot;
  2184. if (!xGame.common.gameMgr.finishOneShoot) {
  2185. this.forceMax += xGame.tools.random(10, 50);
  2186. this.forceMax -= this.aiLv * 2;
  2187. if (this.forceMax < 20)
  2188. this.forceMax = 20;
  2189. }
  2190. if (this.forceMax > 100)
  2191. this.forceMax = 101;
  2192. else if (this.forceMax < 10)
  2193. this.forceMax += xGame.tools.random(0, 10);
  2194. if (xGame.common.gameMode == 1)
  2195. this.forceMax = xGame.tools.random(80, 100);
  2196. else
  2197. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2198. let max = 2000 - this.aiLv * 100;
  2199. if (Math.random() > 0.8)
  2200. max += xGame.tools.random(100, 2000);
  2201. this.setState(AIState.turn, xGame.tools.random(500, max));
  2202. }
  2203. shoot() {
  2204. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2205. if (Math.random() > 0.8) {
  2206. this.gameSrc.aiForce(1);
  2207. this.setState(AIState.wait);
  2208. }
  2209. }
  2210. else {
  2211. let df = xGame.tools.random(3, 8);
  2212. if (this.forceNum < this.forceMax)
  2213. this.forceNum += df;
  2214. else
  2215. this.forceNum -= df;
  2216. let startY = this.gameSrc.ui.powerNode.y;
  2217. let height = this.gameSrc.ui.powerNode.height;
  2218. let force = startY + height * this.forceNum * 0.01;
  2219. this.gameSrc.aiForce(2, force);
  2220. }
  2221. }
  2222. reset() {
  2223. for (let i = 0; i < 4; i++) {
  2224. this.setRate--;
  2225. this.setNum++;
  2226. let pos = this.posList[this.posIdx];
  2227. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2228. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2229. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2230. this.rootPos.x = 387;
  2231. if (this.rootPos.x < this.rectL)
  2232. this.rootPos.x = this.rectL;
  2233. else if (this.rootPos.x > this.rectR)
  2234. this.rootPos.x = this.rectR;
  2235. if (this.rootPos.y < this.rectT)
  2236. this.rootPos.y = this.rectT;
  2237. else if (this.rootPos.y > this.rectB)
  2238. this.rootPos.y = this.rectB;
  2239. this.posIdx++;
  2240. let max = this.posList.length;
  2241. if (this.posIdx >= max)
  2242. this.posIdx -= max;
  2243. this.initHoleBall();
  2244. let ball = null;
  2245. if (this.scoreBall.length > 0)
  2246. ball = this.scoreBall[0];
  2247. else if (this.lineBall.length > 0)
  2248. ball = xGame.common.getRandArrEle(this.lineBall);
  2249. if (ball && ball.kickAngle < this.bestAngle) {
  2250. this.bestAngle = ball.kickAngle;
  2251. this.bestKick.x = ball.kickPos.x;
  2252. this.bestKick.y = ball.kickPos.y;
  2253. this.bestPos.x = this.rootPos.x;
  2254. this.bestPos.y = this.rootPos.y;
  2255. this.bestForce = ball.hard * 0.08;
  2256. }
  2257. }
  2258. if (this.setNum >= this.setMax)
  2259. this.setMax = 0;
  2260. if (this.setRate < 1) {
  2261. this.setState(AIState.move, 0);
  2262. this.rootMoveTime = Laya.timer.currTimer;
  2263. this.gameSrc.aiRootMove(true);
  2264. }
  2265. }
  2266. delayLine() {
  2267. this.gameSrc.aiRootMove(false);
  2268. }
  2269. move() {
  2270. if (this.bestPos.x < 1)
  2271. this.bestPos = this.rootPos;
  2272. let wObj = this.wBall.gameObj;
  2273. let destx = wObj.x;
  2274. let desty = wObj.y;
  2275. let dx = Math.abs(destx - this.bestPos.x);
  2276. let dy = Math.abs(desty - this.bestPos.y);
  2277. let mx = 3 + dx * 0.03;
  2278. let my = 3 + dy * 0.03;
  2279. if (dx < 4 && dy < 4) {
  2280. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2281. dt = dt < 1000 ? 1000 - dt : 0;
  2282. if (this.setMax > 0) {
  2283. let min = this.setMax * 0.3 + this.aiLv * 5;
  2284. this.setRate = xGame.tools.random(min, this.setMax);
  2285. this.setState(AIState.reset, 0);
  2286. }
  2287. else {
  2288. this.destRot = 0;
  2289. this.forceMax = this.bestForce;
  2290. this.setKick(this.bestKick.x, this.bestKick.y);
  2291. }
  2292. if (dt > 100) {
  2293. Laya.timer.clear(this, this.delayLine);
  2294. Laya.timer.once(dt, this, this.delayLine);
  2295. }
  2296. else
  2297. this.gameSrc.aiRootMove(false);
  2298. }
  2299. else {
  2300. if (dx > 4)
  2301. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2302. if (dy > 4)
  2303. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2304. this.gameSrc.onRootMove({ x: destx, y: desty });
  2305. }
  2306. }
  2307. resetRoot() {
  2308. this.bestAngle = 180;
  2309. this.bestForce = 0;
  2310. this.setMax = this.posList.length;
  2311. this.posIdx = xGame.tools.random(0, this.setMax);
  2312. let min = this.setMax * 0.3 + this.aiLv * 5;
  2313. this.setRate = xGame.tools.random(min, this.setMax);
  2314. let max = 2000 - this.aiLv * 100;
  2315. if (Math.random() > 0.8)
  2316. max += xGame.tools.random(100, 1000);
  2317. if (this.isGuide)
  2318. this.setState(AIState.select, 500);
  2319. else if (this.onAway(2))
  2320. this.setState(AIState.reset, xGame.tools.random(400, max));
  2321. else
  2322. this.setState(AIState.none);
  2323. if (xGame.common.gameMgr.finishOneShoot)
  2324. this.chat();
  2325. }
  2326. runAI() {
  2327. if (this.state > AIState.idle)
  2328. return;
  2329. this.initBall();
  2330. this.onGame(2500);
  2331. if (Math.random() > 0.6)
  2332. this.chat();
  2333. }
  2334. stopRun() {
  2335. this.setState(AIState.idle);
  2336. }
  2337. onGame(base) {
  2338. let max = base - this.aiLv * 100;
  2339. if (Math.random() > 0.8)
  2340. max += xGame.tools.random(100, 1000);
  2341. if (this.onAway(2))
  2342. this.setState(AIState.select, xGame.tools.random(500, max));
  2343. else
  2344. this.setState(AIState.none);
  2345. }
  2346. setState(sta, wt = 0) {
  2347. if (this.state == AIState.none)
  2348. return;
  2349. this.state = sta;
  2350. this.waitTime = wt;
  2351. }
  2352. onUpdate() {
  2353. if (this.state == AIState.none)
  2354. return;
  2355. this.awayTime -= this.dtime;
  2356. if (this.awayTime < 1) {
  2357. this.awayTime = xGame.tools.random(6000, 10000);
  2358. this.awayNum += (11 - this.aiLv);
  2359. this.onAway(1);
  2360. }
  2361. if (this.waitTime >= 0) {
  2362. this.waitTime -= this.dtime;
  2363. return;
  2364. }
  2365. switch (this.state) {
  2366. case AIState.idle:
  2367. this.chat();
  2368. break;
  2369. case AIState.reset:
  2370. this.reset();
  2371. break;
  2372. case AIState.move:
  2373. this.move();
  2374. break;
  2375. case AIState.leave:
  2376. this.state = AIState.none;
  2377. xGame.common.gameMgr.aiGameEnd(true);
  2378. break;
  2379. case AIState.select:
  2380. this.selectBall();
  2381. break;
  2382. case AIState.turn:
  2383. this.turnPole();
  2384. break;
  2385. case AIState.shoot:
  2386. this.shoot();
  2387. break;
  2388. }
  2389. }
  2390. onAway(type) {
  2391. if (type == 1) {
  2392. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2393. let num = this.awayNum + db * 20;
  2394. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2395. xGame.common.gameMgr.aiLeave();
  2396. this.setState(AIState.leave, 6666);
  2397. }
  2398. }
  2399. else if (type == 2) {
  2400. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2401. let num = this.awayNum + db * 30;
  2402. if (xGame.tools.random(0, 10000) < num)
  2403. return false;
  2404. }
  2405. else if (type == 3) {
  2406. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2407. let num = this.awayNum + db * 10;
  2408. if (xGame.tools.random(0, 4000) < num)
  2409. return false;
  2410. }
  2411. return true;
  2412. }
  2413. chat() {
  2414. if (this.chatTime > 0) {
  2415. this.chatTime -= this.dtime;
  2416. return;
  2417. }
  2418. this.chatTime = xGame.tools.random(2000, 10000);
  2419. let rand = xGame.tools.random(0, 100);
  2420. if (rand < 15)
  2421. this.talk();
  2422. else if (rand < 35)
  2423. this.emotion();
  2424. }
  2425. talk() {
  2426. xGame.common.talkMgr.showAITalk(0);
  2427. }
  2428. emotion() {
  2429. xGame.common.talkMgr.showAIEmotion(0);
  2430. }
  2431. resetAI() {
  2432. this.stopRun();
  2433. this.state = AIState.none;
  2434. }
  2435. }
  2436. class Partical extends Laya.Script3D {
  2437. constructor() {
  2438. super();
  2439. this.duration = 2000;
  2440. }
  2441. ;
  2442. onAwake() {
  2443. this.gameObj = this.owner;
  2444. }
  2445. onEnable() {
  2446. this.openTimer();
  2447. }
  2448. openTimer() {
  2449. Laya.timer.once(this.duration, this, this.disappear);
  2450. }
  2451. setCallback(obj, callback) {
  2452. this.obj = obj;
  2453. this.callback = callback;
  2454. Laya.timer.clearAll(this);
  2455. Laya.timer.once(this.duration, this, this.disappear);
  2456. }
  2457. disappear() {
  2458. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2459. this.callback && this.callback(this.obj);
  2460. }
  2461. }
  2462. class Ball extends Laya.Script3D {
  2463. constructor() {
  2464. super();
  2465. this.posV3 = new Laya.Vector3();
  2466. this.rotRate = 2.1;
  2467. this.rotSpeed = new Laya.Vector3();
  2468. this.myIndex = 0;
  2469. }
  2470. onAwake() {
  2471. this.gameObj = this.owner;
  2472. this.transform = this.gameObj.transform;
  2473. this.ballNode = this.gameObj.getChildByName("Ball");
  2474. this.shadowNode = this.gameObj.getChildByName("shadow");
  2475. }
  2476. initSelf(index, x, y, owner) {
  2477. this.d2BallSrc = owner;
  2478. this.myIndex = index;
  2479. this.setAlbedoTexture();
  2480. this.setTransPos(x, y);
  2481. this.setScale();
  2482. this.ballNode.transform.localRotationEulerX = 90;
  2483. if (index == 0) {
  2484. }
  2485. }
  2486. setAlbedoTexture(isIce = false) {
  2487. let url;
  2488. if (isIce) {
  2489. url = `res/d3Res/ballTexture/ice.jpg`;
  2490. }
  2491. else {
  2492. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2493. }
  2494. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2495. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2496. }));
  2497. }
  2498. runFireworks(obj, delay, callback) {
  2499. Laya.timer.clearAll(this);
  2500. Laya.timer.once(delay + 1, this, () => {
  2501. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2502. fire.transform.localPositionX = this.transform.localPositionX;
  2503. fire.transform.localPositionY = this.transform.localPositionY;
  2504. fire.transform.localPositionZ = this.transform.localPositionZ;
  2505. let src = fire.getComponent(Partical);
  2506. src.duration = 1000;
  2507. src.setCallback(obj, callback);
  2508. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2509. eft.transform.localPositionX = this.transform.localPositionX;
  2510. eft.transform.localPositionY = this.transform.localPositionY;
  2511. eft.transform.localPositionZ = this.transform.localPositionZ;
  2512. });
  2513. }
  2514. setTransPos(x, y) {
  2515. this.setRotation();
  2516. xGame.common.pos2to3Convert(x, y, this.posV3);
  2517. this.transform.localPositionX = this.posV3.x;
  2518. this.transform.localPositionY = 0;
  2519. this.transform.localPositionZ = this.posV3.z;
  2520. this.transform.localRotationEulerX = 0;
  2521. this.transform.localRotationEulerY = 0;
  2522. this.transform.localRotationEulerZ = 0;
  2523. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2524. this.shadowNode.transform.localPositionY = 0.1;
  2525. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2526. }
  2527. setRotation() {
  2528. if (this.d2BallSrc.canRot) {
  2529. let speed = this.d2BallSrc.rigy.linearVelocity;
  2530. this.rotSpeed.x = speed.x * this.rotRate;
  2531. this.rotSpeed.z = speed.y * this.rotRate;
  2532. this.rotSpeed.y = this.d2BallSrc.rotY;
  2533. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2534. }
  2535. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2536. this.rotSpeed.x = this.rotSpeed.y = 0;
  2537. this.rotSpeed.y = this.d2BallSrc.rotY;
  2538. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2539. }
  2540. }
  2541. setScale() {
  2542. let radius = xGame.common.d2World.rootBall.ui.width;
  2543. let scale = xGame.common.scale2to3Convert(radius);
  2544. this.transform.localScaleX = scale;
  2545. this.transform.localScaleY = scale;
  2546. this.transform.localScaleZ = scale;
  2547. }
  2548. playInHoleEft() {
  2549. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2550. eft.transform.position = this.transform.position;
  2551. }
  2552. playIceEft() {
  2553. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2554. eft.transform.position = this.transform.position;
  2555. }
  2556. get scaleXYZ() {
  2557. return this.transform.localScaleX;
  2558. }
  2559. set scaleXYZ(val) {
  2560. this.transform.localScaleX = val;
  2561. this.transform.localScaleY = val;
  2562. this.transform.localScaleZ = val;
  2563. }
  2564. get posX() {
  2565. return this.transform.localPositionX;
  2566. }
  2567. set posX(val) {
  2568. this.transform.localPositionX = val;
  2569. }
  2570. get posY() {
  2571. return this.transform.localPositionY;
  2572. }
  2573. set posY(val) {
  2574. this.transform.localPositionY = val;
  2575. }
  2576. get posZ() {
  2577. return this.transform.localPositionZ;
  2578. }
  2579. set posZ(val) {
  2580. this.transform.localPositionZ = val;
  2581. }
  2582. destroySelf() {
  2583. this.posV3 = null;
  2584. this.rotSpeed = null;
  2585. this.d2BallSrc = null;
  2586. this.ballNode = null;
  2587. this.gameObj.destroy(true);
  2588. this.transform = null;
  2589. this.destroy();
  2590. }
  2591. }
  2592. class ui_D2Ball extends fgui.GComponent {
  2593. static createInstance() {
  2594. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2595. }
  2596. onConstruct() {
  2597. this.myIcon = (this.getChild("myIcon"));
  2598. this.inner = (this.getChild("inner"));
  2599. this.n8 = (this.getChild("n8"));
  2600. this.n4 = (this.getChild("n4"));
  2601. this.wrongTips = (this.getChild("wrongTips"));
  2602. this.rightTips = (this.getChild("rightTips"));
  2603. this.breathAni = this.getTransition("breathAni");
  2604. }
  2605. }
  2606. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2607. class D2BallSrc extends Laya.Script {
  2608. constructor() {
  2609. super();
  2610. this.number = 0;
  2611. this.startX = 0;
  2612. this.startY = 0;
  2613. this.angleV2 = new Laya.Vector2();
  2614. this.isRootBall = false;
  2615. this.isBlackBall = false;
  2616. this.ballType = "";
  2617. this.canRot = true;
  2618. this.rotY = 0;
  2619. this.poleAngle = 0;
  2620. this.kickPos = { x: 0, y: 0 };
  2621. this.hard = 0;
  2622. this.kickAngle = 0;
  2623. this.borderDis = 0;
  2624. this.speedP10 = 5.6;
  2625. this.lastSpeed = { x: 0, y: 0 };
  2626. this.stillSpeed = 0.12;
  2627. this.ballFunc = "normal";
  2628. this.isRunSkillAni = false;
  2629. this.isInHole = false;
  2630. this.iceOwner = "";
  2631. this.forceRun = false;
  2632. this.myUNID = "";
  2633. this.rectL = 0;
  2634. this.rectR = 0;
  2635. this.rectT = 0;
  2636. this.rectB = 0;
  2637. this.forceVec = new Laya.Vector2();
  2638. this.lastDis = 0;
  2639. this.helpOut = { type: "", x: 0, y: 0 };
  2640. }
  2641. initSelf(number, x, y, d3Ball) {
  2642. if (!this.gameObj)
  2643. this.gameObj = this.owner;
  2644. this.number = number;
  2645. this.startX = x;
  2646. this.startY = y;
  2647. this.d3Ball = d3Ball;
  2648. this.isRootBall = false;
  2649. this.isBlackBall = false;
  2650. this.ballType = "";
  2651. if (number == 0) {
  2652. this.isRootBall = true;
  2653. }
  2654. else if (number == 8) {
  2655. this.isBlackBall = true;
  2656. }
  2657. else {
  2658. if (number <= 7) {
  2659. this.ballType = ballCamp.full;
  2660. }
  2661. else {
  2662. this.ballType = ballCamp.flower;
  2663. }
  2664. }
  2665. this.setInfo();
  2666. this.setD3Ball();
  2667. this.owner["mySrc"] = this;
  2668. this.rigy.linearDamping = 1;
  2669. D2BallSrc._unid++;
  2670. this.myUNID = "d2ball" + D2BallSrc._unid;
  2671. let rect = xGame.common.d2World.borderRect;
  2672. this.rectL = Math.ceil(rect.x) + 20;
  2673. this.rectT = Math.ceil(rect.y) + 20;
  2674. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2675. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2676. }
  2677. setInfo() {
  2678. this.gameObj.x = this.startX;
  2679. this.gameObj.y = this.startY;
  2680. let radius = this.ui.width / 2;
  2681. this.gameObj.width = radius * 2;
  2682. this.gameObj.height = radius * 2;
  2683. if (xGame.common.showDebug) {
  2684. this.ui.myIcon.alpha = 1;
  2685. this.ui.inner.alpha = 1;
  2686. }
  2687. else {
  2688. this.ui.myIcon.alpha = 0;
  2689. this.ui.inner.alpha = 0;
  2690. }
  2691. }
  2692. setD3Ball() {
  2693. this.d3Ball = this.d3Ball;
  2694. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2695. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2696. }
  2697. onUpdate() {
  2698. if (xGame.common.gameMgr.gamePause)
  2699. return;
  2700. if (this.isInHole)
  2701. return;
  2702. if (!xGame.common.d2World.openCheckStill)
  2703. return;
  2704. this.runBall();
  2705. }
  2706. runBall() {
  2707. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2708. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2709. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2710. this.judgeBorder();
  2711. }
  2712. getDestDis(dest) {
  2713. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2714. }
  2715. setmyXY(x, y) {
  2716. this.d3BallSrc.setTransPos(x, y);
  2717. }
  2718. getSpeed() {
  2719. let speed = this.rigy.linearVelocity;
  2720. return speed.x * speed.x + speed.y * speed.y;
  2721. }
  2722. onTriggerEnter(collider) {
  2723. if (!collider || !collider.owner)
  2724. return;
  2725. let coll = "collide";
  2726. let speed = this.getSpeed();
  2727. let sv2 = this.speedP10 * this.speedP10;
  2728. if (collider.label == "ball") {
  2729. if (speed < 9 && this.number != 0)
  2730. coll = "";
  2731. else if (speed < sv2)
  2732. coll = "collide_4";
  2733. else if (speed < sv2 * 6.2)
  2734. coll = "collide_3";
  2735. else if (speed < sv2 * 25)
  2736. coll = "collide_2";
  2737. else if (speed < sv2 * 56)
  2738. coll = "collide_1";
  2739. xGame.soundMgr.playSound(coll);
  2740. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2741. if (collider.owner) {
  2742. let rig = collider.owner.getComponent(D2BallSrc);
  2743. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2744. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2745. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2746. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2747. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2748. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2749. let rx = 0;
  2750. let ry = 0;
  2751. if (this.gameObj.x < this.rectL)
  2752. rx = vx;
  2753. else if (this.gameObj.x > this.rectR)
  2754. rx = -vx;
  2755. else if (this.gameObj.y < this.rectT)
  2756. ry = vy;
  2757. else if (this.gameObj.y > this.rectB)
  2758. ry = -vy;
  2759. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2760. }
  2761. }
  2762. if (this.number != 0) {
  2763. return;
  2764. }
  2765. else {
  2766. if (this.forceRun) {
  2767. console.log("randon force");
  2768. this.applyForce(collider);
  2769. }
  2770. }
  2771. if (xGame.common.d2World.isOnSameLine) {
  2772. xGame.common.d2World.isOnSameLine = false;
  2773. this.rigy.linearVelocity = { x: 0, y: 0 };
  2774. }
  2775. if (xGame.common.gameMgr.firstColliObj == null) {
  2776. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2777. xGame.common.gameMgr.isTouchedBall = true;
  2778. }
  2779. }
  2780. else {
  2781. xGame.common.recoverCameraView();
  2782. let wallStr = "";
  2783. if (speed < 9) { }
  2784. else if (speed < sv2) { }
  2785. else if (speed < sv2 * 6.2)
  2786. wallStr = "wall_30";
  2787. else if (speed < sv2 * 25)
  2788. wallStr = "wall_50";
  2789. else if (speed < sv2 * 56)
  2790. wallStr = "wall_80";
  2791. xGame.soundMgr.playSound(wallStr);
  2792. }
  2793. }
  2794. applyForce(collider) {
  2795. let src = collider.owner.mySrc;
  2796. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2797. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2798. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2799. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2800. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2801. }
  2802. checkWrongBall(playEft = true) {
  2803. if (this.isInHole)
  2804. return;
  2805. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2806. if (this.number != 0 && playEft)
  2807. this.d3BallSrc.playInHoleEft();
  2808. let coll = "inpocket_1";
  2809. let speed = this.getSpeed();
  2810. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2811. if (speed < 9 && this.number != 0)
  2812. coll = "";
  2813. else if (speed < sv2 * 6.2)
  2814. coll = "inpocket_4";
  2815. else if (speed < sv2 * 25)
  2816. coll = "collide_3";
  2817. else if (speed < sv2 * 56)
  2818. coll = "collide_2";
  2819. xGame.soundMgr.playSound(coll);
  2820. this.isInHole = true;
  2821. if (this.number == 0) {
  2822. console.log("白球进了。。");
  2823. this.reset();
  2824. this.rigy.linearVelocity = { x: 0, y: 0 };
  2825. this.hideSelf();
  2826. xGame.common.gameUI.ui.whiteAni.visible = true;
  2827. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2828. xGame.common.gameUI.ui.whiteAni.visible = false;
  2829. }));
  2830. }
  2831. else {
  2832. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2833. xGame.common.d2World.removeOneBall(this);
  2834. this.destroySelf();
  2835. xGame.common.playHappySound(this.number);
  2836. this.runFlyEft();
  2837. }
  2838. }
  2839. runFlyEft() {
  2840. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2841. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2842. }
  2843. }
  2844. hideSelf() {
  2845. if (this.d3Ball)
  2846. this.d3Ball.active = false;
  2847. }
  2848. showSelf() {
  2849. this.isInHole = false;
  2850. if (this.d3Ball && !this.d3Ball.active)
  2851. this.d3Ball.active = true;
  2852. }
  2853. isStill() {
  2854. let speed = this.rigy.linearVelocity;
  2855. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2856. this.rigy.linearVelocity = { x: 0, y: 0 };
  2857. return true;
  2858. }
  2859. return false;
  2860. }
  2861. reset() {
  2862. }
  2863. destroySelf() {
  2864. this.d3BallSrc.destroySelf();
  2865. if (!this.ui.isDisposed) {
  2866. this.ui.removeFromParent();
  2867. this.ui.dispose();
  2868. this.ui = null;
  2869. }
  2870. this.outColli = null;
  2871. this.innerColli = null;
  2872. this.rigy = null;
  2873. this.d3Ball = null;
  2874. this.d3BallSrc = null;
  2875. this.angleV2 = null;
  2876. this.gameObj.destroy(true);
  2877. this.destroy();
  2878. }
  2879. judgeBorder() {
  2880. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2881. return;
  2882. }
  2883. if (this.destroyed)
  2884. return;
  2885. if (xGame.common.gameMode == GameMode.classic)
  2886. return;
  2887. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2888. if (isOver) {
  2889. this.checkWrongBall();
  2890. }
  2891. }
  2892. onClick(e, force = false) {
  2893. if (this.number == 0)
  2894. return;
  2895. if (force) {
  2896. }
  2897. else {
  2898. if (xGame.common.d2World.openCheckStill)
  2899. return;
  2900. if (!xGame.common.gameMgr.selfTurn) {
  2901. return;
  2902. }
  2903. }
  2904. if (!xGame.common.gameMgr.finishOneShoot)
  2905. return;
  2906. let root = xGame.common.d2World.rootBall.gameObj;
  2907. let x = this.gameObj.x - root.x;
  2908. let y = this.gameObj.y - root.y;
  2909. let angle = xGame.common.getfguiRotation(x, y);
  2910. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2911. xGame.common.d2World.getHelpLine();
  2912. xGame.common.clickedBall = true;
  2913. this.checkGuide();
  2914. }
  2915. checkGuide() {
  2916. let guide = DataMgr.getSkillGuide();
  2917. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2918. xGame.common.guideStep++;
  2919. xGame.common.gameUI.ui.guide1.visible = false;
  2920. xGame.common.gameUI.ui.guide2.visible = true;
  2921. }
  2922. }
  2923. checkDistance(disX, disY, angle) {
  2924. let diameter = this.gameObj.width - 1;
  2925. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2926. if (!this.lastDis)
  2927. this.lastDis = dis;
  2928. else {
  2929. if (dis > this.lastDis) {
  2930. this.helpOut.type = "remove";
  2931. return this.helpOut;
  2932. }
  2933. }
  2934. if (dis <= Math.pow(diameter, 2)) {
  2935. let del = 0.01;
  2936. let offest = 0;
  2937. let realX = disX - this.gameObj.x;
  2938. let realY = disY - this.gameObj.y;
  2939. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2940. offest += del;
  2941. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2942. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2943. }
  2944. this.helpOut.type = "ok";
  2945. this.helpOut.x = realX + this.gameObj.x;
  2946. this.helpOut.y = realY + this.gameObj.y;
  2947. return this.helpOut;
  2948. }
  2949. else {
  2950. this.helpOut.type = "no";
  2951. return this.helpOut;
  2952. }
  2953. }
  2954. clearBallEft() {
  2955. this.clearBallRightEft();
  2956. this.clearBallWrongEft();
  2957. }
  2958. clearBallRightEft() {
  2959. this.ui.breathAni.stop();
  2960. this.ui.rightTips.visible = false;
  2961. }
  2962. clearBallWrongEft() {
  2963. this.ui.wrongTips.visible = false;
  2964. }
  2965. showWrongEft() {
  2966. if (!xGame.common.gameMgr.selfTurn)
  2967. return;
  2968. this.ui.wrongTips.visible = true;
  2969. }
  2970. showRightEft() {
  2971. if (!xGame.common.gameMgr.selfTurn)
  2972. return;
  2973. this.ui.rightTips.visible = true;
  2974. this.ui.rightTips.scaleX = 1;
  2975. this.ui.rightTips.scaleY = 1;
  2976. this.ui.breathAni.play();
  2977. }
  2978. setBallFunc(type, owner) {
  2979. if (type == "ice") {
  2980. this.ballFunc = type;
  2981. this.d3BallSrc.setAlbedoTexture(true);
  2982. this.rigy.type = "static";
  2983. this.iceOwner = owner;
  2984. }
  2985. else {
  2986. if (owner == this.iceOwner) {
  2987. this.ballFunc = type;
  2988. this.d3BallSrc.setAlbedoTexture(false);
  2989. this.rigy.type = "dynamic";
  2990. }
  2991. }
  2992. }
  2993. }
  2994. D2BallSrc._unid = 0;
  2995. class D2RootBallSrc extends D2BallSrc {
  2996. constructor() {
  2997. super();
  2998. this.maxSpeed = 0;
  2999. this.classicMaxSpeed = 2.2;
  3000. this.bigSkillMaxSpeed = 4;
  3001. this.angle = 0;
  3002. this.allPercent = 0;
  3003. this.linearPercent = 0;
  3004. this.anglePercent = 0;
  3005. this.maxAngleRate = 0.6;
  3006. this.baseRot = 7;
  3007. this.angleMax = 0;
  3008. this.speed = new Laya.Vector2();
  3009. this.rotSpeed = new Laya.Vector2();
  3010. }
  3011. isStill() {
  3012. let speed = this.rigy.linearVelocity;
  3013. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3014. if (this.anglePercent <= 0.1) {
  3015. this.rigy.linearVelocity = { x: 0, y: 0 };
  3016. return true;
  3017. }
  3018. }
  3019. return false;
  3020. }
  3021. reset() {
  3022. this.linearPercent = 0;
  3023. this.anglePercent = 0;
  3024. }
  3025. setSpeed(percent, angle) {
  3026. this.allPercent = percent;
  3027. this.angle = angle;
  3028. this.setAngleSpeed();
  3029. this.setLinearSpeed();
  3030. let hit = "hit";
  3031. if (percent < 25)
  3032. hit = "hit03";
  3033. else if (percent < 50)
  3034. hit = "hit02";
  3035. else if (percent < 75)
  3036. hit = "hit01";
  3037. xGame.soundMgr.playSound(hit);
  3038. }
  3039. setAngleSpeed() {
  3040. let offest = xGame.common.rodOffest;
  3041. let radius = 82;
  3042. let rate = Math.abs(offest.y / radius) * 0.5;
  3043. if (offest.y > 0)
  3044. this.angleMax = -this.baseRot * 2;
  3045. else
  3046. this.angleMax = this.baseRot;
  3047. this.rotY = -offest.x / radius * 100;
  3048. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3049. this.linearPercent = this.allPercent - this.anglePercent;
  3050. }
  3051. setLinearSpeed() {
  3052. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3053. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3054. if (!xGame.common.longHelpLine) {
  3055. let offset = -150 + xGame.common.randomNum(0, 300);
  3056. offset /= 100;
  3057. this.angle += offset;
  3058. }
  3059. }
  3060. }
  3061. let sin = Math.sin(this.angle * Math.PI / 180);
  3062. let cos = Math.cos(this.angle * Math.PI / 180);
  3063. switch (xGame.common.gameMode) {
  3064. case GameMode.classic:
  3065. this.maxSpeed = this.classicMaxSpeed;
  3066. break;
  3067. case GameMode.bigMove:
  3068. this.maxSpeed = this.bigSkillMaxSpeed;
  3069. break;
  3070. case GameMode.placeBall:
  3071. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3072. if (data.type == 1) {
  3073. this.maxSpeed = this.bigSkillMaxSpeed;
  3074. }
  3075. else {
  3076. this.maxSpeed = this.classicMaxSpeed;
  3077. }
  3078. break;
  3079. default:
  3080. break;
  3081. }
  3082. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3083. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3084. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3085. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3086. this.rigy.applyLinearImpulseToCenter(this.speed);
  3087. }
  3088. onUpdate() {
  3089. if (this.anglePercent > 0.1) {
  3090. this.anglePercent *= 0.97;
  3091. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3092. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3093. this.rigy.applyForceToCenter(this.rotSpeed);
  3094. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3095. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3096. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3097. if (num > 0.9)
  3098. this.canRot = true;
  3099. }
  3100. else
  3101. this.canRot = true;
  3102. if (Math.abs(this.rotY) > 0.1)
  3103. this.rotY *= 0.98;
  3104. super.onUpdate();
  3105. }
  3106. destroySelf() {
  3107. super.destroySelf();
  3108. this.speed = null;
  3109. }
  3110. }
  3111. class D2Ball extends Laya.Sprite {
  3112. constructor(isRootBall = false) {
  3113. super();
  3114. this.ui = ui_D2Ball.createInstance();
  3115. this.pivotX = this.ui.width / 2;
  3116. this.pivotY = this.ui.width / 2;
  3117. this.x = 0;
  3118. this.y = 0;
  3119. this.addChild(this.ui.displayObject);
  3120. this.ui.displayObject.x += this.ui.width / 2;
  3121. this.ui.displayObject.y += this.ui.width / 2;
  3122. if (isRootBall) {
  3123. this.d2Src = this.addComponent(D2RootBallSrc);
  3124. }
  3125. else {
  3126. this.d2Src = this.addComponent(D2BallSrc);
  3127. }
  3128. this.d2Src.ui = this.ui;
  3129. this.addCircleCollider();
  3130. this.addInnerCircleCollider();
  3131. this.addRigyBody();
  3132. }
  3133. addCircleCollider() {
  3134. let colli = xGame.common.getCollider("circle");
  3135. colli.radius = this.ui.width / 2;
  3136. this.addComponentIntance(colli);
  3137. this.d2Src.outColli = colli;
  3138. colli.label = "ball";
  3139. }
  3140. addInnerCircleCollider() {
  3141. let colli = xGame.common.getCollider("circle");
  3142. colli.radius = this.ui.inner.width / 2;
  3143. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3144. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3145. this.addComponentIntance(colli);
  3146. this.d2Src.innerColli = colli;
  3147. colli.label = "inner";
  3148. }
  3149. addRigyBody() {
  3150. let rigy = xGame.common.getRigbody();
  3151. rigy.type = "dynamic";
  3152. this.addComponentIntance(rigy);
  3153. this.d2Src.rigy = rigy;
  3154. }
  3155. disposeSelf() {
  3156. if (!this.ui.isDisposed) {
  3157. this.ui.dispose();
  3158. this.ui.removeFromParent();
  3159. this.ui = null;
  3160. }
  3161. }
  3162. }
  3163. class ui_D2Gan extends fgui.GComponent {
  3164. static createInstance() {
  3165. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3166. }
  3167. onConstruct() {
  3168. this.myIcon = (this.getChild("myIcon"));
  3169. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3170. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3171. this.self = (this.getChild("self"));
  3172. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3173. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3174. this.ai = (this.getChild("ai"));
  3175. }
  3176. }
  3177. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3178. class D2Gan {
  3179. constructor() {
  3180. this.offset = 0.15;
  3181. this.cell = 1.5;
  3182. this.onBallCell = 0.4;
  3183. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3184. this.moveNum = 70;
  3185. this.rulerRate = 0.1;
  3186. this.ui = ui_D2Gan.createInstance();
  3187. this.changeSelfRod();
  3188. this.changeAIRod();
  3189. }
  3190. changeSelfRod() {
  3191. let index = DataMgr.getCurBallRod();
  3192. let data = cfgTable.ballrodData[index + 1];
  3193. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3194. this.selfMySpine && this.selfMySpine.dispose();
  3195. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3196. if (data.spine) {
  3197. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3198. this.selfMySpine = new SpineMgr(data.spine, () => {
  3199. let xx = this.ui.selfEftRoot.width / 2;
  3200. let yy = this.ui.selfEftRoot.height / 2;
  3201. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3202. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3203. outSpine.rotation = -90;
  3204. });
  3205. }
  3206. }
  3207. changeAIRod() {
  3208. let length = Object.keys(cfgTable.ballrodData).length;
  3209. let rand = Math.floor(length * Math.random()) + 1;
  3210. let data = cfgTable.ballrodData[rand];
  3211. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3212. this.aiMySpine && this.aiMySpine.dispose();
  3213. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3214. if (data.spine) {
  3215. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3216. this.aiMySpine = new SpineMgr(data.spine, () => {
  3217. let xx = this.ui.aiEftRoot.width / 2;
  3218. let yy = this.ui.aiEftRoot.height / 2;
  3219. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3220. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3221. outSpine.rotation = -90;
  3222. });
  3223. }
  3224. }
  3225. setGanLastInfo() {
  3226. this.lastInfo.rotation = this.ui.rotation;
  3227. this.lastInfo.x = this.ui.x;
  3228. this.lastInfo.y = this.ui.y;
  3229. }
  3230. rotateSelf(flag, isRuler = false) {
  3231. let angle;
  3232. flag = flag * this.offset;
  3233. if (xGame.common.d2World.isHelpLineOnBall) {
  3234. angle = flag * this.onBallCell;
  3235. }
  3236. else {
  3237. angle = flag * this.cell;
  3238. }
  3239. if (isRuler) {
  3240. angle *= this.rulerRate;
  3241. }
  3242. this.ui.rotation += angle;
  3243. xGame.common.d2World.getHelpLine();
  3244. }
  3245. checkDistance() {
  3246. let target = xGame.common.d2World.targetBall;
  3247. let root = xGame.common.d2World.rootBall;
  3248. if (target == null) {
  3249. return 1;
  3250. }
  3251. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3252. if (dis <= 2500) {
  3253. return 5;
  3254. }
  3255. return 1;
  3256. }
  3257. rotDest(rot) {
  3258. this.ui.rotation = rot;
  3259. xGame.common.d2World.getHelpLine();
  3260. }
  3261. storagePower(powerNum) {
  3262. let pos = (powerNum / 100) * this.moveNum;
  3263. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3264. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3265. this.ui.x = this.lastInfo.x + xx;
  3266. this.ui.y = this.lastInfo.y + yy;
  3267. }
  3268. shoot() {
  3269. this.storagePower(0);
  3270. this.ui.visible = false;
  3271. }
  3272. destroySelf() {
  3273. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3274. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3275. this.selfMySpine && this.selfMySpine.dispose();
  3276. this.aiMySpine && this.aiMySpine.dispose();
  3277. this.lastInfo = null;
  3278. if (!this.ui.isDisposed) {
  3279. this.ui.removeFromParent();
  3280. this.ui.dispose();
  3281. }
  3282. }
  3283. }
  3284. class ui_HelpLine extends fgui.GComponent {
  3285. static createInstance() {
  3286. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3287. }
  3288. onConstruct() {
  3289. this.n10 = (this.getChild("n10"));
  3290. this.rect = (this.getChild("rect"));
  3291. this.dir11 = (this.getChild("dir11"));
  3292. this.dir = (this.getChild("dir"));
  3293. this.rootDir = (this.getChild("rootDir"));
  3294. this.dirDot = (this.getChild("dirDot"));
  3295. }
  3296. }
  3297. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3298. class D2HelpLine {
  3299. constructor() {
  3300. this.starX = 0;
  3301. this.starY = 0;
  3302. this.ui = ui_HelpLine.createInstance();
  3303. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3304. this.starX = this.ui.rect.x;
  3305. this.starY = this.ui.rect.y;
  3306. }
  3307. shoot() {
  3308. this.ui.visible = false;
  3309. }
  3310. destroySelf() {
  3311. if (this.ui.isDisposed) {
  3312. this.ui.removeFromParent();
  3313. this.ui.dispose();
  3314. }
  3315. }
  3316. }
  3317. class D2World extends Laya.Script {
  3318. constructor() {
  3319. super();
  3320. this.ballArr = [];
  3321. this.openCheckStill = false;
  3322. this.checkArr = [];
  3323. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3324. this.isHelpLineOnBall = false;
  3325. this.isOnSameLine = false;
  3326. this.reflectAngle = 0;
  3327. this.powerPercent = 0;
  3328. this.inHolesSpeed = [];
  3329. this.outDir = new Laya.Vector2();
  3330. this.rootDir = new Laya.Vector2();
  3331. this.aiLv = 0;
  3332. this.rootPos = new Laya.Vector2();
  3333. this.tempDir1 = new Laya.Vector2();
  3334. this.tempDir2 = new Laya.Vector2();
  3335. this.tempDir3 = new Laya.Vector2();
  3336. this.ballSize = 33;
  3337. this.destRot = 0;
  3338. }
  3339. initSelf() {
  3340. this.createBalls();
  3341. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3342. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3343. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3344. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3345. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3346. }
  3347. setBorderRect() {
  3348. let ui = xGame.common.gameUI.ui;
  3349. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3350. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3351. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3352. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3353. this.borderRect.x = starX;
  3354. this.borderRect.y = starY;
  3355. this.borderRect.width = width;
  3356. this.borderRect.height = height;
  3357. }
  3358. resetGame() {
  3359. this.openCheckStill = false;
  3360. let temp;
  3361. for (let index = 0; index < this.ballArr.length; index++) {
  3362. temp = this.ballArr[index];
  3363. temp.destroySelf();
  3364. }
  3365. xGame.common.d3World.ballRoot.destroyChildren();
  3366. xGame.common.gameUI.ui.ballNode.removeChildren();
  3367. console.log("进入摧毁逻辑");
  3368. this.d2Gan.destroySelf();
  3369. this.d2HelpLine.destroySelf();
  3370. this.ballArr = [];
  3371. }
  3372. setD2Gan() {
  3373. let ballNode = this.rootBall.ui;
  3374. let d2Gan = new D2Gan();
  3375. this.d2Gan = d2Gan;
  3376. let ganNode = d2Gan.ui;
  3377. ballNode.addChild(ganNode);
  3378. ganNode.pivotX = ganNode.pivotX;
  3379. ganNode.pivotY = ganNode.pivotY;
  3380. ganNode.x = ganNode.myIcon.width / 2;
  3381. ganNode.y = this.rootBall.gameObj.width;
  3382. d2Gan.setGanLastInfo();
  3383. }
  3384. setHelpLine() {
  3385. let d2Help = new D2HelpLine();
  3386. this.d2HelpLine = d2Help;
  3387. }
  3388. createBalls() {
  3389. let cfg;
  3390. switch (xGame.common.gameMode) {
  3391. case GameMode.classic:
  3392. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3393. break;
  3394. case GameMode.bigMove:
  3395. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3396. break;
  3397. case GameMode.placeBall:
  3398. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3399. break;
  3400. default:
  3401. break;
  3402. }
  3403. cfg = JSON.parse(JSON.stringify(cfg));
  3404. for (const key in cfg) {
  3405. if (cfg[key].value == 0) {
  3406. this.createRootBall(cfg[key]);
  3407. delete cfg[key];
  3408. break;
  3409. }
  3410. }
  3411. this.createOtherBalls(cfg);
  3412. }
  3413. createRootBall(data) {
  3414. let root = new D2Ball(true);
  3415. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3416. this.rootBall = root.d2Src;
  3417. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3418. let d3BallSrc = d3Ball.getComponent(Ball);
  3419. xGame.common.d3World.rootBall = d3Ball;
  3420. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3421. let xx = data.x;
  3422. let yy = data.y;
  3423. let numer = data.value;
  3424. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3425. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3426. this.ballArr.push(this.rootBall);
  3427. this.setD2Gan();
  3428. this.setHelpLine();
  3429. }
  3430. createOtherBalls(cfg) {
  3431. let temp;
  3432. let src;
  3433. let data;
  3434. for (const key in cfg) {
  3435. data = cfg[key];
  3436. temp = new D2Ball();
  3437. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3438. src = temp.d2Src;
  3439. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3440. src.initSelf(data.value, data.x, data.y, d3Ball);
  3441. this.ballArr.push(src);
  3442. }
  3443. }
  3444. shoot(percent) {
  3445. this.powerPercent = percent;
  3446. this.openCheckStill = true;
  3447. let d2Angle = this.d2Gan.ui.rotation;
  3448. this.rootBall.setSpeed(percent, d2Angle);
  3449. this.clearBallAllEft();
  3450. this.changePlayerView();
  3451. }
  3452. onUpdate() {
  3453. if (!this.openCheckStill)
  3454. return;
  3455. this.checkStill();
  3456. }
  3457. checkStill() {
  3458. for (let index = 0; index < this.ballArr.length; index++) {
  3459. if (!this.ballArr[index].isStill()) {
  3460. return;
  3461. }
  3462. }
  3463. xGame.eventMgr.event(ALL_BALL_STOP);
  3464. }
  3465. allBallStop() {
  3466. this.openCheckStill = false;
  3467. xGame.common.recoverCameraView();
  3468. }
  3469. waitShoot() {
  3470. if (!this.d2Gan.ui.isDisposed) {
  3471. this.d2Gan.ui.visible = true;
  3472. }
  3473. if (!this.d2HelpLine.ui.isDisposed) {
  3474. this.d2HelpLine.ui.visible = true;
  3475. }
  3476. this.clearBallAllEft();
  3477. this.showBallRightEft();
  3478. this.getHelpLine();
  3479. this.inHolesSpeed = [];
  3480. this.selectOneBall();
  3481. }
  3482. _getAllBallArr() {
  3483. let arr = this.ballArr;
  3484. let outArr = [];
  3485. for (let index = 0; index < arr.length; index++) {
  3486. if (arr[index] instanceof D2RootBallSrc)
  3487. continue;
  3488. if (arr[index].ballFunc == "ice")
  3489. continue;
  3490. if (arr[index].destroyed)
  3491. continue;
  3492. outArr.push(arr[index]);
  3493. }
  3494. return outArr;
  3495. }
  3496. _getBlackObj() {
  3497. let arr = this.ballArr;
  3498. for (let index = 0; index < arr.length; index++) {
  3499. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3500. return arr[index];
  3501. }
  3502. }
  3503. }
  3504. selectOneBall() {
  3505. let all = this._getAllBallArr();
  3506. let target;
  3507. switch (xGame.common.gameMode) {
  3508. case GameMode.classic:
  3509. if (xGame.common.gameMgr.selfTurn) {
  3510. let self = xGame.common.gameMgr.selfBallArr;
  3511. let black = this._getBlackObj();
  3512. if (xGame.common.gameMgr.ensureBallType) {
  3513. if (self.length > 0) {
  3514. let out = [];
  3515. for (let j = 0; j < all.length; j++) {
  3516. if (self.indexOf(all[j].number) > -1) {
  3517. out.push(all[j]);
  3518. }
  3519. }
  3520. target = this.selectBestEnterOne(out);
  3521. }
  3522. else {
  3523. target = this.selectBestEnterOne([black]);
  3524. }
  3525. }
  3526. else {
  3527. target = this.selectBestEnterOne(all);
  3528. }
  3529. }
  3530. else {
  3531. target = this.selectBestEnterOne(all);
  3532. }
  3533. break;
  3534. case GameMode.bigMove:
  3535. target = this.selectBestEnterOne(all);
  3536. break;
  3537. case GameMode.placeBall:
  3538. if (all.length > 0) {
  3539. target = this.selectBestEnterOne(all);
  3540. }
  3541. break;
  3542. default:
  3543. break;
  3544. }
  3545. if (target && !target.destroyed && target.onClick) {
  3546. target.onClick(0, true);
  3547. let num = -200 + xGame.common.randomNum(0, 400);
  3548. num /= 150;
  3549. if (xGame.common.longHelpLine) {
  3550. num = 0;
  3551. }
  3552. this.destRot += num;
  3553. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3554. }
  3555. }
  3556. removeOneBall(ball) {
  3557. for (let index = 0; index < this.ballArr.length; index++) {
  3558. if (this.ballArr[index].id == ball.id) {
  3559. this.ballArr.splice(index, 1);
  3560. break;
  3561. }
  3562. }
  3563. }
  3564. getHelpLine() {
  3565. this.d2HelpLine.ui.dirDot.visible = false;
  3566. this.isOnSameLine = false;
  3567. let startX = this.rootBall.gameObj.x;
  3568. let startY = this.rootBall.gameObj.y;
  3569. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3570. if (dis == null) {
  3571. this.d2HelpLine.ui.visible = false;
  3572. console.error("辅助线异常");
  3573. return;
  3574. }
  3575. this.d2HelpLine.ui.visible = true;
  3576. let angle = this.d2Gan.ui.rotation;
  3577. let radius = 16.5;
  3578. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3579. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3580. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3581. if (colliObj == null) {
  3582. this.getColliPos(disX, disY, radius, angle);
  3583. xGame.common.d2World.isHelpLineOnBall = false;
  3584. this.targetBall = null;
  3585. this.reflectAngle = 0;
  3586. this.showBallWrongEft();
  3587. }
  3588. else {
  3589. let target = colliObj.src;
  3590. let radius = 16.5;
  3591. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3592. dis1 = Math.sqrt(dis1);
  3593. let realDis = colliObj.disHon - dis1;
  3594. let dir = colliObj.dir;
  3595. let xx = startX + dir.x * realDis;
  3596. let yy = startY + dir.y * realDis;
  3597. this.getColliPos(xx, yy, radius, angle);
  3598. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3599. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3600. let offset = xGame.common.rodOffest;
  3601. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3602. this.isOnSameLine = true;
  3603. }
  3604. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3605. xGame.common.d2World.isHelpLineOnBall = true;
  3606. this.targetBall = target;
  3607. this.reflectAngle = reflectAngle;
  3608. this.showBallWrongEft();
  3609. if (xGame.common.longHelpLine) {
  3610. this.delayReflectLine(target, reflectAngle);
  3611. }
  3612. }
  3613. }
  3614. getBorderDot(startX, startY, angle) {
  3615. let radius = 17;
  3616. let distance;
  3617. let isDone;
  3618. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3619. isDone = this.judgeUpDown(distance, angle, startX);
  3620. if (isDone != null) {
  3621. return isDone;
  3622. }
  3623. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3624. isDone = this.judgeUpDown(distance, angle, startX);
  3625. if (isDone != null) {
  3626. return isDone;
  3627. }
  3628. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3629. isDone = this.judgeLeftRight(distance, angle, startY);
  3630. if (isDone != null) {
  3631. return isDone;
  3632. }
  3633. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3634. isDone = this.judgeLeftRight(distance, angle, startY);
  3635. if (isDone != null) {
  3636. return isDone;
  3637. }
  3638. }
  3639. judgeUpDown(distance, angle, startX) {
  3640. let flag = Math.sin(angle * Math.PI / 180);
  3641. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3642. if (distance >= 0) {
  3643. if (flag > 0) {
  3644. if (temp < this.borderRect.x + this.borderRect.width) {
  3645. return distance;
  3646. }
  3647. }
  3648. else {
  3649. if (temp > this.borderRect.x) {
  3650. return distance;
  3651. }
  3652. }
  3653. }
  3654. }
  3655. judgeLeftRight(distance, angle, starY) {
  3656. let flag = -Math.cos(angle * Math.PI / 180);
  3657. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3658. if (distance >= 0) {
  3659. if (flag > 0) {
  3660. if (temp < this.borderRect.y + this.borderRect.height) {
  3661. return distance;
  3662. }
  3663. }
  3664. else {
  3665. if (temp > this.borderRect.y) {
  3666. return distance;
  3667. }
  3668. }
  3669. }
  3670. }
  3671. clearBallAllEft() {
  3672. let temp;
  3673. for (let index = 0; index < this.ballArr.length; index++) {
  3674. temp = this.ballArr[index];
  3675. temp.clearBallEft();
  3676. }
  3677. }
  3678. showBallRightEft() {
  3679. let gameMgr = xGame.common.gameMgr;
  3680. let temp;
  3681. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3682. if (targetArr.length <= 0)
  3683. return;
  3684. for (let index = 0; index < this.ballArr.length; index++) {
  3685. temp = this.ballArr[index];
  3686. if (targetArr.indexOf(temp.number) > -1) {
  3687. temp.showRightEft();
  3688. }
  3689. }
  3690. }
  3691. showBallWrongEft() {
  3692. let gameMgr = xGame.common.gameMgr;
  3693. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3694. if (targetArr.length <= 0)
  3695. return;
  3696. let temp;
  3697. for (let index = 0; index < this.ballArr.length; index++) {
  3698. temp = this.ballArr[index];
  3699. if (this.targetBall && this.targetBall.number == temp.number) {
  3700. if (targetArr.indexOf(temp.number) <= -1) {
  3701. temp.showWrongEft();
  3702. }
  3703. else {
  3704. temp.clearBallWrongEft();
  3705. }
  3706. }
  3707. else {
  3708. temp.clearBallWrongEft();
  3709. }
  3710. }
  3711. }
  3712. getColliPos(x, y, radius, angle) {
  3713. this.d2HelpLine.ui.x = x;
  3714. this.d2HelpLine.ui.y = y;
  3715. let dirX = x - this.rootBall.gameObj.x;
  3716. let dirY = y - this.rootBall.gameObj.y;
  3717. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3718. if (rectH <= 0)
  3719. rectH = 0;
  3720. this.d2HelpLine.ui.rect.height = 0;
  3721. this.d2HelpLine.ui.rect.height = rectH;
  3722. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3723. if (rectH < this.rootBall.gameObj.width) {
  3724. this.d2HelpLine.ui.rect.visible = false;
  3725. }
  3726. else {
  3727. this.d2HelpLine.ui.rect.visible = true;
  3728. }
  3729. this.d2HelpLine.ui.dir.visible = false;
  3730. this.d2HelpLine.ui.rootDir.visible = false;
  3731. }
  3732. getReflectLine(x, y, radius, target) {
  3733. this.d2HelpLine.ui.dir.visible = true;
  3734. let dirX = target.x - x;
  3735. let dirY = target.y - y;
  3736. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3737. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3738. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3739. this.d2HelpLine.ui.dir.height = 48;
  3740. this.d2HelpLine.ui.dir.rotation = angle;
  3741. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3742. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3743. return angle;
  3744. }
  3745. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3746. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3747. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3748. let targetX = target.gameObj.x;
  3749. let targetY = target.gameObj.y;
  3750. this.outDir.setValue(targetX - xx, targetY - yy);
  3751. this.rootDir.setValue(rtX - xx, rtY - yy);
  3752. let ver = Math.PI / 2;
  3753. let sin = Math.sin(ver);
  3754. let cos = Math.cos(ver);
  3755. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3756. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3757. this.outDir.setValue(outX, outY);
  3758. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3759. Laya.Vector2.normalize(this.outDir, this.outDir);
  3760. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3761. if (Math.abs(result) <= 0.08) {
  3762. this.d2HelpLine.ui.rootDir.visible = false;
  3763. return;
  3764. }
  3765. if (result > 0) {
  3766. angle += 90;
  3767. }
  3768. else if (result < 0) {
  3769. angle -= 90;
  3770. }
  3771. this.d2HelpLine.ui.rootDir.visible = true;
  3772. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3773. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3774. this.d2HelpLine.ui.rootDir.rotation = angle;
  3775. }
  3776. delayReflectLine(obj, angle) {
  3777. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3778. return;
  3779. }
  3780. this.isOnSameLine = false;
  3781. let startX = obj.gameObj.x;
  3782. let startY = obj.gameObj.y;
  3783. let dis = this.getBorderDot(startX, startY, angle);
  3784. if (dis == null) {
  3785. this.d2HelpLine.ui.dirDot.visible = false;
  3786. return;
  3787. }
  3788. this.d2HelpLine.ui.visible = true;
  3789. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3790. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3791. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3792. if (colliObj == null) {
  3793. this.setDelayLine(disX, disY, obj, angle);
  3794. }
  3795. else {
  3796. let radius = 16;
  3797. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3798. dis1 = Math.sqrt(dis1);
  3799. let realDis = colliObj.disHon - dis1;
  3800. let dir = colliObj.dir;
  3801. let xx = startX + dir.x * realDis;
  3802. let yy = startY + dir.y * realDis;
  3803. this.setDelayLine(xx, yy, obj, angle);
  3804. }
  3805. }
  3806. setDelayLine(x, y, obj, angle) {
  3807. let dirX = x - obj.gameObj.x;
  3808. let dirY = y - obj.gameObj.y;
  3809. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3810. if (rectH <= 0)
  3811. rectH = 0;
  3812. this.d2HelpLine.ui.dir.height = rectH;
  3813. this.d2HelpLine.ui.dirDot.visible = true;
  3814. this.d2HelpLine.ui.dirDot.x = 17;
  3815. this.d2HelpLine.ui.dirDot.y = 17;
  3816. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3817. ;
  3818. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3819. }
  3820. changePlayerView() {
  3821. if (Math.random() >= 0.7)
  3822. return;
  3823. if (!this.targetBall) {
  3824. return;
  3825. }
  3826. if (!xGame.common.gameMgr.selfTurn)
  3827. return;
  3828. switch (xGame.common.gameMode) {
  3829. case GameMode.classic:
  3830. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3831. if (this.targetBall.number != 8) {
  3832. return;
  3833. }
  3834. }
  3835. break;
  3836. case GameMode.bigMove:
  3837. return;
  3838. case GameMode.placeBall:
  3839. break;
  3840. default:
  3841. break;
  3842. }
  3843. let startX = this.targetBall.gameObj.x;
  3844. let startY = this.targetBall.gameObj.y;
  3845. let angle = this.reflectAngle;
  3846. let dis = this.getBorderDot(startX, startY, angle);
  3847. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3848. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3849. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3850. if (colliObj) {
  3851. return;
  3852. }
  3853. let offset = 40;
  3854. let posObj = xGame.common.gameMgr.posObj;
  3855. let temp;
  3856. let radius;
  3857. let tarX, tarY;
  3858. for (const key in posObj) {
  3859. temp = posObj[key];
  3860. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3861. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3862. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3863. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3864. xGame.common.showOneCamera("angle" + key);
  3865. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3866. Laya.physicsTimer.scale = 0.7;
  3867. break;
  3868. }
  3869. }
  3870. }
  3871. selectBestEnterOne(arr) {
  3872. this.aiLv = xGame.tools.random(1, 11);
  3873. this.aiLv = 10;
  3874. this.wBall = xGame.common.d2World.rootBall;
  3875. this.rootPos.x = this.wBall.gameObj.x;
  3876. this.rootPos.y = this.wBall.gameObj.y;
  3877. this.initHoleBall(arr);
  3878. return this.selectBall();
  3879. }
  3880. selectBall() {
  3881. let ball = null;
  3882. this.destRot = 0;
  3883. let ai = 110 - this.aiLv * 10;
  3884. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3885. let score = false;
  3886. if (this.scoreBall.length < 1) {
  3887. if (this.lineBall.length < 1) {
  3888. for (let i = 0; i < this.kickBall.length; i++) {
  3889. let list = [];
  3890. let bo = this.kickBall[i];
  3891. let bobj = bo.gameObj;
  3892. let rect = xGame.common.d2World.borderRect;
  3893. let mobj = this.wBall.gameObj;
  3894. let minb = bobj.y - rect.y - 20;
  3895. let minw = mobj.y - rect.y - 50;
  3896. if (minb > 0 && minw > 0) {
  3897. let dlenx = 0;
  3898. let dleny = mobj.y - rect.y;
  3899. let spx = mobj.x;
  3900. let spy = rect.y - dleny;
  3901. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3902. }
  3903. minb = rect.y + rect.height - bobj.y - 20;
  3904. minw = rect.y + rect.height - mobj.y - 50;
  3905. if (minb > 0 && minw > 0) {
  3906. let dlenx = 0;
  3907. let dleny = rect.y + rect.height - mobj.y;
  3908. let spx = mobj.x;
  3909. let spy = rect.y + rect.height + dleny;
  3910. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3911. }
  3912. minb = bobj.x - rect.x - 20;
  3913. minw = mobj.x - rect.x - 50;
  3914. if (minb > 0 && minw > 0) {
  3915. let dlenx = mobj.x - rect.x;
  3916. let dleny = 0;
  3917. let spx = rect.x - dlenx;
  3918. let spy = mobj.y;
  3919. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3920. }
  3921. minb = rect.x + rect.width - bobj.x - 20;
  3922. minw = rect.x + rect.width - mobj.x - 50;
  3923. if (minb > 0 && minw > 0) {
  3924. let dlenx = rect.x + rect.width - mobj.x;
  3925. let dleny = 0;
  3926. let spx = rect.x + rect.width + dlenx;
  3927. let spy = mobj.y;
  3928. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3929. }
  3930. list.sort(function (a, b) {
  3931. return a.order - b.order;
  3932. });
  3933. for (let i = 0; i < list.length; i++) {
  3934. let data = list[i];
  3935. let mx = mobj.x - bobj.x;
  3936. let my = mobj.y - bobj.y;
  3937. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3938. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3939. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3940. if (num > 1)
  3941. num = 1;
  3942. let cos = Math.acos(num);
  3943. if (cos > 1.57)
  3944. cos = 1.57;
  3945. else if (cos < 0.01)
  3946. cos = 0.01;
  3947. let tan = Math.tan(cos);
  3948. let dx = tan * data.dleny;
  3949. let dy = tan * data.dlenx;
  3950. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3951. if (Math.abs(bx - 667) < 40)
  3952. continue;
  3953. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3954. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3955. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3956. this.forceMax = dis * 0.08;
  3957. this.destRot += mis * 0.1;
  3958. this.setKick(bx, by);
  3959. return true;
  3960. }
  3961. }
  3962. }
  3963. }
  3964. else {
  3965. ball = xGame.common.getRandArrEle(this.lineBall);
  3966. }
  3967. }
  3968. else {
  3969. for (let i = 0; i < this.scoreBall.length; i++) {
  3970. if (i < this.scoreBall.length - 1) {
  3971. let rand = 70 + this.aiLv * 10 + i * 10;
  3972. if (xGame.tools.random(0, 100) < rand) {
  3973. ball = this.scoreBall[i];
  3974. break;
  3975. }
  3976. }
  3977. else {
  3978. ball = this.scoreBall[i];
  3979. break;
  3980. }
  3981. }
  3982. score = true;
  3983. this.selectNum++;
  3984. }
  3985. if (!ball)
  3986. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3987. let dx = ball.gameObj.x;
  3988. let dy = ball.gameObj.y;
  3989. let kickAngle = 0;
  3990. if (score) {
  3991. dx = ball.kickPos.x;
  3992. dy = ball.kickPos.y;
  3993. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3994. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3995. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3996. if (adot > 1)
  3997. adot = 1;
  3998. kickAngle = Math.acos(adot) * 57.3;
  3999. if (kickAngle > 45) {
  4000. let kdx = ball.kickPos.x - ball.gameObj.x;
  4001. let kdy = ball.kickPos.y - ball.gameObj.y;
  4002. dx = ball.kickPos.x - kdx * mis * 0.3;
  4003. dy = ball.kickPos.y - kdy * mis * 0.3;
  4004. }
  4005. else
  4006. this.destRot += mis;
  4007. }
  4008. else if (ball.poleAngle != 0) {
  4009. this.destRot += ball.poleAngle;
  4010. }
  4011. if (xGame.common.gameMode == 0) {
  4012. let af = kickAngle * 0.08;
  4013. this.forceMax = ball.hard * 0.1 + af * af;
  4014. }
  4015. this.setKick(dx, dy);
  4016. return ball;
  4017. }
  4018. initHoleBall(arr) {
  4019. this.kickBall = [];
  4020. this.lineBall = [];
  4021. this.scoreBall = [];
  4022. this.holeBall = [];
  4023. this.selectNum = 0;
  4024. this.forceNum = 0;
  4025. this.forceMax = 0;
  4026. this.turnNum = 0;
  4027. let list = arr;
  4028. let holes = xGame.common.gameMgr.holePosList;
  4029. let self = xGame.common.aiPlayer;
  4030. for (let i = 0; i < list.length; i++) {
  4031. let obj = list[i];
  4032. if (!obj)
  4033. continue;
  4034. obj.kickPos.x = 0;
  4035. obj.kickPos.y = 0;
  4036. obj.poleAngle = 0;
  4037. obj.hard = 0;
  4038. obj.borderDis = 0;
  4039. obj.kickAngle = 180;
  4040. let b = obj.gameObj;
  4041. let wbp = this.rootPos;
  4042. let bx = wbp.x - b.x;
  4043. let by = wbp.y - b.y;
  4044. obj.borderDis = xGame.tools.random(0, 100);
  4045. this.kickBall.push(obj);
  4046. if (!this.isLine(wbp, obj))
  4047. continue;
  4048. obj.kickAngle = xGame.tools.random(90, 180);
  4049. obj.kickPos.x = b.x;
  4050. obj.kickPos.y = b.y;
  4051. this.lineBall.push(obj);
  4052. let minDis = 999999;
  4053. let hole = false;
  4054. for (let j = 0; j < holes.length; j++) {
  4055. let hp = holes[j];
  4056. if (bx >= 0 && hp.x > b.x + 100)
  4057. continue;
  4058. if (bx <= 0 && hp.x < b.x - 100)
  4059. continue;
  4060. if (by < -10 && hp.y < wbp.y)
  4061. continue;
  4062. if (by > 10 && hp.y > wbp.y)
  4063. continue;
  4064. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4065. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4066. if (dis < minDis) {
  4067. let dx = b.x - this.tempDir1.x * this.ballSize;
  4068. let dy = b.y - this.tempDir1.y * this.ballSize;
  4069. this.tempDir3.x = this.tempDir1.x;
  4070. this.tempDir3.y = this.tempDir1.y;
  4071. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4072. obj.kickPos.x = dx;
  4073. obj.kickPos.y = dy;
  4074. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4075. if (num > 1)
  4076. num = 1;
  4077. obj.kickAngle = Math.acos(num) * 57.3;
  4078. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4079. dis = dis * 2;
  4080. if (Math.abs(hp.x - 600) < 100)
  4081. dis += 50;
  4082. obj.hard = dis + obj.kickAngle * 3;
  4083. hole = true;
  4084. }
  4085. }
  4086. }
  4087. }
  4088. if (hole) {
  4089. this.scoreBall.push(obj);
  4090. this.holeBall.push(obj);
  4091. }
  4092. }
  4093. this.scoreBall.sort(function (a, b) {
  4094. return a.hard - b.hard;
  4095. });
  4096. this.holeBall.sort(function (a, b) {
  4097. return a.kickAngle - b.kickAngle;
  4098. });
  4099. this.kickBall.sort(function (a, b) {
  4100. return a.borderDis - b.borderDis;
  4101. });
  4102. }
  4103. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4104. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4105. let balls = xGame.common.d2World.ballArr;
  4106. let max = xGame.tools.getDis(hx, hy, bx, by);
  4107. for (let index = 0; index < balls.length; index++) {
  4108. let obj = balls[index];
  4109. if (obj.number == 0)
  4110. continue;
  4111. if (obj.number == bn || obj.number == dn)
  4112. continue;
  4113. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4114. if (dis * dis > max)
  4115. continue;
  4116. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4117. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4118. if (num > 1)
  4119. num = 1;
  4120. if (num < 0)
  4121. continue;
  4122. let gap = Math.sin(Math.acos(num)) * dis;
  4123. if (gap < this.ballSize)
  4124. return true;
  4125. }
  4126. return false;
  4127. }
  4128. isLine(xy, ball) {
  4129. let bx = xy.x;
  4130. let by = xy.y;
  4131. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4132. let dis = ball.getDestDis(xy);
  4133. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4134. let sin = Math.sin(angle);
  4135. let cos = Math.cos(angle);
  4136. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4137. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4138. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4139. let dx = bx + this.tempDir2.x * dis;
  4140. let dy = by + this.tempDir2.y * dis;
  4141. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4142. sin = Math.sin(-angle);
  4143. cos = Math.cos(-angle);
  4144. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4145. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4146. dx = bx + this.tempDir2.x * dis;
  4147. dy = by + this.tempDir2.y * dis;
  4148. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4149. if (isr && isl)
  4150. return false;
  4151. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4152. }
  4153. return true;
  4154. }
  4155. setKick(dx, dy) {
  4156. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4157. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4158. this.tempDir1.x = 0;
  4159. this.tempDir1.y = 1;
  4160. this.tempDir2.y = -this.tempDir2.y;
  4161. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4162. if (num > 1)
  4163. num = 1;
  4164. let rot = Math.acos(num) * 57.3;
  4165. if (this.tempDir2.x < 0)
  4166. rot = 360 - rot;
  4167. this.destRot += rot;
  4168. }
  4169. }
  4170. class ui_UIGame extends fgui.GComponent {
  4171. static createInstance() {
  4172. return (fgui.UIPackage.createObject("game", "UIGame"));
  4173. }
  4174. onConstruct() {
  4175. this.c1 = this.getController("c1");
  4176. this.d3Root = (this.getChild("d3Root"));
  4177. this.clickNode = (this.getChild("clickNode"));
  4178. this.d2Root = (this.getChild("d2Root"));
  4179. this.topNode = (this.getChild("topNode"));
  4180. this.n72 = (this.getChild("n72"));
  4181. this.n40 = (this.getChild("n40"));
  4182. this.rulerNode = (this.getChild("rulerNode"));
  4183. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4184. this.n50 = (this.getChild("n50"));
  4185. this.keduNode = (this.getChild("keduNode"));
  4186. this.powerTxt = (this.getChild("powerTxt"));
  4187. this.powerNode = (this.getChild("powerNode"));
  4188. this.colorNode = (this.getChild("colorNode"));
  4189. this.powerEft = (this.getChild("powerEft"));
  4190. this.myPowerNode = (this.getChild("myPowerNode"));
  4191. this.ganNode = (this.getChild("ganNode"));
  4192. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4193. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4194. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4195. this.skillRod = (this.getChild("skillRod"));
  4196. this.border = (this.getChild("border"));
  4197. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4198. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4199. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4200. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4201. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4202. this.guanyuNode = (this.getChild("guanyuNode"));
  4203. this.helpBtn = (this.getChild("helpBtn"));
  4204. this.wordsBtn = (this.getChild("wordsBtn"));
  4205. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4206. this.returnBtn = (this.getChild("returnBtn"));
  4207. this.ballNode = (this.getChild("ballNode"));
  4208. this.whiteAni = (this.getChild("whiteAni"));
  4209. this.blackAni = (this.getChild("blackAni"));
  4210. this.selfTurn = (this.getChild("selfTurn"));
  4211. this.aiTurn = (this.getChild("aiTurn"));
  4212. this.deskNode = (this.getChild("deskNode"));
  4213. this.moveNode = (this.getChild("moveNode"));
  4214. this.selfTalk = (this.getChild("selfTalk"));
  4215. this.aiTalk = (this.getChild("aiTalk"));
  4216. this.d2Node = (this.getChild("d2Node"));
  4217. this.snowNode = (this.getChild("snowNode"));
  4218. this.guide2 = (this.getChild("guide2"));
  4219. this.guide1 = (this.getChild("guide1"));
  4220. this.guide3 = (this.getChild("guide3"));
  4221. this.guideNode = (this.getChild("guideNode"));
  4222. }
  4223. }
  4224. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4225. class ui_UIGameEnd extends fgui.GComponent {
  4226. static createInstance() {
  4227. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4228. }
  4229. onConstruct() {
  4230. this.c1 = this.getController("c1");
  4231. this.n22 = (this.getChild("n22"));
  4232. this.n2 = (this.getChild("n2"));
  4233. this.n52 = (this.getChild("n52"));
  4234. this.n53 = (this.getChild("n53"));
  4235. this.coinNode = (this.getChild("coinNode"));
  4236. this.closeNode = (this.getChild("closeNode"));
  4237. this.moneyNode = (this.getChild("moneyNode"));
  4238. this.secretary = (this.getChild("secretary"));
  4239. this.n27 = (this.getChild("n27"));
  4240. this.n29 = (this.getChild("n29"));
  4241. this.talkNode = (this.getChild("talkNode"));
  4242. this.n38 = (this.getChild("n38"));
  4243. this.n39 = (this.getChild("n39"));
  4244. this.n40 = (this.getChild("n40"));
  4245. this.awardNode = (this.getChild("awardNode"));
  4246. this.starNumNode = (this.getChild("starNumNode"));
  4247. this.n47 = (this.getChild("n47"));
  4248. this.conditionNode = (this.getChild("conditionNode"));
  4249. this.isGetAward = (this.getChild("isGetAward"));
  4250. this.leftBtn = (this.getChild("leftBtn"));
  4251. this.rightBtn = (this.getChild("rightBtn"));
  4252. this.btnNode = (this.getChild("btnNode"));
  4253. }
  4254. }
  4255. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4256. class ui_UIAddCoin extends fgui.GComponent {
  4257. static createInstance() {
  4258. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4259. }
  4260. onConstruct() {
  4261. this.n11 = (this.getChild("n11"));
  4262. this.myNode = (this.getChild("myNode"));
  4263. this.t0 = this.getTransition("t0");
  4264. }
  4265. }
  4266. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4267. class UIAddCoin extends UIBase {
  4268. constructor() {
  4269. super();
  4270. this.coinNum = 2000;
  4271. }
  4272. onConstructor() {
  4273. this.ui = ui_UIAddCoin.createInstance();
  4274. this.contentPane = this.ui;
  4275. this.isEject = false;
  4276. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4277. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4278. }
  4279. show() {
  4280. super.show();
  4281. this.ui.t0.play();
  4282. }
  4283. videoAddCoin() {
  4284. console.log('zh:qjff_AD_for_UIAddCoin');
  4285. if (Laya.Browser.onAndroid) {
  4286. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4287. if (!boo) {
  4288. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4289. return;
  4290. }
  4291. }
  4292. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4293. }
  4294. else {
  4295. console.log('zh:AD 失败,直接发放奖励');
  4296. this.qjff_AD_for_UIAddCoin();
  4297. }
  4298. }
  4299. qjff_AD_for_UIAddCoin() {
  4300. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4301. this.hide();
  4302. }
  4303. }
  4304. UIAddCoin.uiName = "UIAddCoin";
  4305. class ui_UIInvitation extends fgui.GComponent {
  4306. static createInstance() {
  4307. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4308. }
  4309. onConstruct() {
  4310. this.n14 = (this.getChild("n14"));
  4311. this.myNode = (this.getChild("myNode"));
  4312. this.t0 = this.getTransition("t0");
  4313. }
  4314. }
  4315. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4316. class UIInvitation extends UIBase {
  4317. constructor() {
  4318. super();
  4319. }
  4320. onConstructor() {
  4321. this.ui = ui_UIInvitation.createInstance();
  4322. this.contentPane = this.ui;
  4323. this.isEject = false;
  4324. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4325. }
  4326. show() {
  4327. super.show();
  4328. }
  4329. enterGame() {
  4330. xGame.common.gameMode = GameMode.classic;
  4331. DataMgr.setChallengeTimes(1);
  4332. xGame.common.passAwardCoin = 2000;
  4333. let need = xGame.common.classicNiceNeddCoin;
  4334. if (DataMgr.coinEnough(need)) {
  4335. DataMgr.setCoin(-need);
  4336. xGame.eventMgr.event(RESTART_GAME, true);
  4337. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4338. }
  4339. else {
  4340. xGame.eventMgr.event(RESTART_GAME, true);
  4341. }
  4342. this.hide();
  4343. }
  4344. hide() {
  4345. super.hide();
  4346. }
  4347. }
  4348. UIInvitation.uiName = "UIInvitation";
  4349. class ui_UIMain extends fgui.GComponent {
  4350. static createInstance() {
  4351. return (fgui.UIPackage.createObject("game", "UIMain"));
  4352. }
  4353. onConstruct() {
  4354. this.n47 = (this.getChild("n47"));
  4355. this.n10 = (this.getChild("n10"));
  4356. this.secretary = (this.getChild("secretary"));
  4357. this.shopBtn = (this.getChild("shopBtn"));
  4358. this.moneyNode = (this.getChild("moneyNode"));
  4359. this.headNode = (this.getChild("headNode"));
  4360. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4361. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4362. this.classicBtn = (this.getChild("classicBtn"));
  4363. this.globalBtn = (this.getChild("globalBtn"));
  4364. this.n44 = (this.getChild("n44"));
  4365. this.signBtn = (this.getChild("signBtn"));
  4366. this.drawBtn = (this.getChild("drawBtn"));
  4367. this.settingNode = (this.getChild("settingNode"));
  4368. this.n_fuli = (this.getChild("n_fuli"));
  4369. this.n45 = (this.getChild("n45"));
  4370. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4371. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4372. this.rankBtn = (this.getChild("rankBtn"));
  4373. this.n46 = (this.getChild("n46"));
  4374. this.liucheng1 = (this.getChild("liucheng1"));
  4375. this.rightBtn = (this.getChild("rightBtn"));
  4376. this.n75 = (this.getChild("n75"));
  4377. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4378. this.liucheng2 = (this.getChild("liucheng2"));
  4379. this.guideBtn = (this.getChild("guideBtn"));
  4380. this.n73 = (this.getChild("n73"));
  4381. this.wordsNode = (this.getChild("wordsNode"));
  4382. this.enterGuide = (this.getChild("enterGuide"));
  4383. this.talkNode = (this.getChild("talkNode"));
  4384. this.n83 = (this.getChild("n83"));
  4385. this.n84 = (this.getChild("n84"));
  4386. this.n_Logout = (this.getChild("n_Logout"));
  4387. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4388. this.n_dengLu = (this.getChild("n_dengLu"));
  4389. }
  4390. }
  4391. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4392. class ui_UIMoyu extends fgui.GComponent {
  4393. static createInstance() {
  4394. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4395. }
  4396. onConstruct() {
  4397. this.ageTip = (this.getChild("ageTip"));
  4398. this.mainBg = (this.getChild("mainBg"));
  4399. this.xyNode = (this.getChild("xyNode"));
  4400. this.rnNode = (this.getChild("rnNode"));
  4401. this.fcmNode = (this.getChild("fcmNode"));
  4402. this.ageNode = (this.getChild("ageNode"));
  4403. this.tipNode = (this.getChild("tipNode"));
  4404. this.msgNode = (this.getChild("msgNode"));
  4405. }
  4406. }
  4407. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4408. class MoyuMgr {
  4409. static initMoyu() {
  4410. this.moyuView = new MoyuView();
  4411. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4412. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4413. this.moyuView.ui.displayObject.zOrder = 1000;
  4414. this.moyuView.init();
  4415. this.moyuView.showTip(true);
  4416. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4417. window['XApk'] = this;
  4418. }
  4419. static showAge(show) {
  4420. if (this.moyuView)
  4421. this.moyuView.showAge(show);
  4422. }
  4423. static onPlatMsg(idx) {
  4424. if (!MoyuMgr.moyuView)
  4425. return;
  4426. if (idx == '0') {
  4427. MoyuMgr.moyuView.showTip(false);
  4428. }
  4429. }
  4430. static showAgree(call) {
  4431. if (this.moyuView)
  4432. this.moyuView.showAgree(call);
  4433. else
  4434. call && call();
  4435. }
  4436. static showXy(type = 1) {
  4437. if (this.moyuView)
  4438. this.moyuView.showXy(type);
  4439. }
  4440. }
  4441. MoyuMgr.isAdvise = false;
  4442. class MoyuView {
  4443. constructor() {
  4444. this.ysxyNum = 1;
  4445. this.ysJson = null;
  4446. this.ui = ui_UIMoyu.createInstance();
  4447. }
  4448. init() {
  4449. this.ui.mainBg.visible = false;
  4450. this.ui.xyNode.visible = false;
  4451. this.ui.ageNode.visible = false;
  4452. this.ui.tipNode.visible = false;
  4453. this.ui.rnNode.visible = false;
  4454. this.ui.fcmNode.visible = false;
  4455. this.ui.ageTip.visible = false;
  4456. this.ui.msgNode.visible = false;
  4457. this.ui.visible = false;
  4458. this.ui.xyNode.xyList.setVirtual();
  4459. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4460. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4461. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4462. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4463. this.ui.xyNode.btnKnown.visible = false;
  4464. this.ui.xyNode.xy1.visible = false;
  4465. this.ui.xyNode.xy2.visible = false;
  4466. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4467. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4468. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4469. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4470. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4471. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4472. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4473. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4474. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4475. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4476. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4477. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4478. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4479. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4480. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4481. this.ysxyNum = 2;
  4482. }
  4483. }
  4484. onClick(obj) {
  4485. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4486. switch (obj) {
  4487. case this.ui.ageTip:
  4488. if (Moyu.isTTApk) {
  4489. this.ui.ageNode.visible = true;
  4490. this.ui.mainBg.visible = true;
  4491. }
  4492. break;
  4493. case this.ui.tipNode:
  4494. this.showTip(false);
  4495. break;
  4496. case this.ui.ageNode.btnAge:
  4497. this.ui.ageNode.visible = false;
  4498. this.ui.mainBg.visible = false;
  4499. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4500. this.ui.visible = false;
  4501. break;
  4502. case this.ui.xyNode.btnXy3:
  4503. case this.ui.xyNode.btnXy1:
  4504. this.loadXy(1);
  4505. break;
  4506. case this.ui.xyNode.btnXy2:
  4507. this.loadXy(2);
  4508. break;
  4509. case this.ui.xyNode.btnBack:
  4510. this.ui.xyNode.xy1.visible = true;
  4511. this.ui.xyNode.xy2.visible = false;
  4512. break;
  4513. case this.ui.xyNode.btnKnown:
  4514. this.ui.xyNode.visible = false;
  4515. this.ui.mainBg.visible = false;
  4516. this.ui.visible = false;
  4517. break;
  4518. case this.ui.rnNode.btnCheck:
  4519. this.check();
  4520. break;
  4521. case this.ui.rnNode.btnExit:
  4522. case this.ui.xyNode.btnNo:
  4523. this.ysxyNum--;
  4524. if (this.ysxyNum > 0)
  4525. this.showMsg("Refuse to quit the game once again");
  4526. else {
  4527. Moyu.userAgree(false);
  4528. Moyu.exit();
  4529. }
  4530. break;
  4531. case this.ui.xyNode.btnSure:
  4532. case this.ui.xyNode.btnYes:
  4533. DataMgr.userData.isAgree = true;
  4534. DataMgr.saveUserData();
  4535. this.onAgree();
  4536. break;
  4537. case this.ui.rnNode.btnDone:
  4538. this.ui.rnNode.visible = false;
  4539. this.ui.visible = false;
  4540. break;
  4541. case this.ui.fcmNode.btnRn:
  4542. this.showRn();
  4543. break;
  4544. }
  4545. }
  4546. showTip(show) {
  4547. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4548. return;
  4549. if (show) {
  4550. MoyuMgr.isAdvise = true;
  4551. this.ui.visible = true;
  4552. this.ui.tipNode.visible = true;
  4553. this.ui.tipNode.alpha = 1;
  4554. Laya.timer.once(1000, this, this.showTip, [false]);
  4555. }
  4556. else {
  4557. this.ui.tipNode.alpha = 1;
  4558. this.ui.tipNode.visible = true;
  4559. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4560. this.ui.tipNode.visible = false;
  4561. MoyuMgr.isAdvise = false;
  4562. }), 1000);
  4563. }
  4564. }
  4565. showAge(show, px = 0, py = 0) {
  4566. if (Moyu.platType > 10 && !Moyu.isIos) {
  4567. this.ui.ageTip.x = px;
  4568. this.ui.ageTip.y = py;
  4569. this.ui.ageTip.visible = show;
  4570. if (show)
  4571. this.ui.visible = true;
  4572. }
  4573. }
  4574. showAgree(call) {
  4575. this.agreeCall = call;
  4576. this.onAgree();
  4577. return;
  4578. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4579. this.showXy(0);
  4580. }
  4581. else
  4582. this.onAgree();
  4583. }
  4584. onAgree() {
  4585. if (!this.ui.ageNode.visible)
  4586. this.ui.visible = false;
  4587. this.ui.xyNode.visible = false;
  4588. Moyu.userAgree(true);
  4589. this.showAge(false);
  4590. this.agreeCall && this.agreeCall();
  4591. this.showRn();
  4592. }
  4593. showMsg(txt) {
  4594. this.ui.msgNode.txtMsg.text = txt;
  4595. this.ui.msgNode.visible = true;
  4596. this.ui.msgNode.alpha = 1;
  4597. this.ui.visible = true;
  4598. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4599. this.ui.msgNode.visible = false;
  4600. }), 2500, true);
  4601. }
  4602. showRn() {
  4603. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4604. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4605. this.ui.rnNode.rn1.visible = true;
  4606. this.ui.rnNode.rn2.visible = false;
  4607. this.ui.rnNode.rn3.visible = false;
  4608. this.ui.rnNode.rn4.visible = false;
  4609. this.ui.rnNode.visible = true;
  4610. this.ui.mainBg.visible = true;
  4611. this.ui.rnNode.btnDone.visible = false;
  4612. this.ui.rnNode.btnExit.visible = true;
  4613. this.ui.rnNode.btnCheck.visible = true;
  4614. this.ui.fcmNode.visible = false;
  4615. this.ui.visible = true;
  4616. return;
  4617. }
  4618. }
  4619. this.showFcm();
  4620. }
  4621. showFcm() {
  4622. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4623. Moyu.initFCM(true);
  4624. if (Moyu.gameTime < 1)
  4625. this.fcmLoop();
  4626. else if (Moyu.gameTime < 999)
  4627. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4628. }
  4629. }
  4630. fcmLoop() {
  4631. if (Moyu.gameTime < 1) {
  4632. this.ui.rnNode.visible = false;
  4633. this.ui.fcmNode.visible = true;
  4634. this.ui.mainBg.visible = true;
  4635. this.ui.visible = true;
  4636. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4637. Laya.timer.clear(this.ui, this.fcmLoop);
  4638. }
  4639. }
  4640. check() {
  4641. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4642. this.ui.rnNode.rn1.visible = false;
  4643. this.ui.rnNode.rn2.visible = false;
  4644. this.ui.rnNode.rn4.visible = true;
  4645. }
  4646. else if (this.ui.rnNode.rn4.visible) {
  4647. let name = this.ui.rnNode.inputName.text;
  4648. let code = this.ui.rnNode.inputCode.text;
  4649. if (code && code.length == 18) {
  4650. this.ui.rnNode.rn1.visible = false;
  4651. this.ui.rnNode.rn4.visible = false;
  4652. Moyu.authenticate(name, code, (res) => {
  4653. this.ui.rnNode.rn2.visible = !res;
  4654. this.ui.rnNode.rn3.visible = res;
  4655. this.ui.rnNode.btnDone.visible = res;
  4656. this.ui.rnNode.btnExit.visible = !res;
  4657. this.ui.rnNode.btnCheck.visible = !res;
  4658. if (res)
  4659. this.showFcm();
  4660. });
  4661. }
  4662. else
  4663. this.showMsg("信息填写不完整");
  4664. }
  4665. }
  4666. loadXy(type = 0) {
  4667. this.ui.xyNode.xy1.visible = false;
  4668. this.ui.xyNode.xy2.visible = true;
  4669. this.ui.xyNode.xyList.scrollToView(0);
  4670. if (type == 1) {
  4671. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4672. }
  4673. else if (type == 2) {
  4674. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4675. }
  4676. }
  4677. showXy(type = 0) {
  4678. this.xyBtn();
  4679. if (type == 0) {
  4680. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4681. this.ui.xyNode.btnSure.visible = true;
  4682. }
  4683. else {
  4684. this.ui.xyNode.btnYes.visible = true;
  4685. this.ui.xyNode.btnNo.visible = true;
  4686. }
  4687. }
  4688. else {
  4689. this.ui.xyNode.btnKnown.visible = true;
  4690. this.ui.mainBg.visible = true;
  4691. }
  4692. this.ui.xyNode.xy1.visible = true;
  4693. this.ui.xyNode.xy2.visible = false;
  4694. this.ui.xyNode.visible = true;
  4695. this.ui.visible = true;
  4696. }
  4697. xyBtn() {
  4698. this.ui.xyNode.btnSure.visible = false;
  4699. this.ui.xyNode.btnYes.visible = false;
  4700. this.ui.xyNode.btnNo.visible = false;
  4701. this.ui.xyNode.btnKnown.visible = false;
  4702. {
  4703. this.ui.xyNode.btnXy3.visible = false;
  4704. this.ui.xyNode.btnXy2.visible = true;
  4705. this.ui.xyNode.btnXy1.visible = true;
  4706. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4707. }
  4708. }
  4709. createXY(json) {
  4710. this.ysJson = json.content;
  4711. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4712. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4713. this.ui.xyNode.xy2.visible = true;
  4714. }
  4715. renderListItem(idx, cell) {
  4716. let xy = this.ysJson[idx];
  4717. cell.height = xy.line * 30;
  4718. cell.xyItem.text = xy.text;
  4719. }
  4720. onDestroy() {
  4721. this.agreeCall = null;
  4722. }
  4723. }
  4724. class SettingNode {
  4725. constructor(ui) {
  4726. this.showSetting = false;
  4727. this.openSound = true;
  4728. this.openShake = true;
  4729. this.ui = ui;
  4730. this.ui.soundBtn.onClick(this, this.switchSound);
  4731. this.ui.shakeBtn.onClick(this, this.switchShake);
  4732. this.ui.xyBtn.onClick(this, this.onXy);
  4733. this.ui.clickNode.onClick(this, this.changeSetting);
  4734. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4735. this.ui.xyBtn.visible = false;
  4736. this.ui.shakeBtn.visible = false;
  4737. }
  4738. changeSetting() {
  4739. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4740. this.showSetting = !this.showSetting;
  4741. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4742. }
  4743. switchSound() {
  4744. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4745. this.openSound = !this.openSound;
  4746. Moyu.onSetting(this.openSound, this.openShake);
  4747. xGame.soundMgr.onSetting(this.openSound);
  4748. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4749. }
  4750. switchShake() {
  4751. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4752. this.openShake = !this.openShake;
  4753. Moyu.onSetting(this.openSound, this.openShake);
  4754. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4755. }
  4756. onXy() {
  4757. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4758. MoyuMgr.showXy(1);
  4759. }
  4760. }
  4761. class ui_UILevelDisplay extends fgui.GComponent {
  4762. static createInstance() {
  4763. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4764. }
  4765. onConstruct() {
  4766. this.n9 = (this.getChild("n9"));
  4767. this.myNode = (this.getChild("myNode"));
  4768. this.closeNode = (this.getChild("closeNode"));
  4769. }
  4770. }
  4771. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4772. class ui_UILevelProp extends fgui.GComponent {
  4773. static createInstance() {
  4774. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4775. }
  4776. onConstruct() {
  4777. this.n16 = (this.getChild("n16"));
  4778. this.myNode = (this.getChild("myNode"));
  4779. this.closeBtn = (this.getChild("closeBtn"));
  4780. this.moneyNode = (this.getChild("moneyNode"));
  4781. this.t1 = this.getTransition("t1");
  4782. }
  4783. }
  4784. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4785. class ui_ShowItem extends fgui.GComponent {
  4786. static createInstance() {
  4787. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4788. }
  4789. onConstruct() {
  4790. this.myImg = (this.getChild("myImg"));
  4791. }
  4792. }
  4793. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4794. class ShowItem {
  4795. constructor() {
  4796. this.ui = ui_ShowItem.createInstance();
  4797. }
  4798. destroySelf() {
  4799. if (!this.ui.isDisposed) {
  4800. this.ui.removeFromParent();
  4801. this.ui.dispose();
  4802. }
  4803. }
  4804. setParent(parent) {
  4805. parent.addChild(this.ui);
  4806. }
  4807. setPos(x, y) {
  4808. this.ui.x = x;
  4809. this.ui.y = y;
  4810. }
  4811. setUrl(index) {
  4812. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4813. }
  4814. }
  4815. class ui_UIPower extends fgui.GComponent {
  4816. static createInstance() {
  4817. return (fgui.UIPackage.createObject("game", "UIPower"));
  4818. }
  4819. onConstruct() {
  4820. this.n11 = (this.getChild("n11"));
  4821. this.myNode = (this.getChild("myNode"));
  4822. this.t0 = this.getTransition("t0");
  4823. }
  4824. }
  4825. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4826. class UIPower extends UIBase {
  4827. constructor() {
  4828. super();
  4829. }
  4830. onConstructor() {
  4831. this.ui = ui_UIPower.createInstance();
  4832. this.contentPane = this.ui;
  4833. this.isEject = false;
  4834. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4835. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4836. }
  4837. show() {
  4838. super.show();
  4839. this.ui.t0.play();
  4840. }
  4841. videoGetPower() {
  4842. console.log('zh:qjff_AD_for_uipower');
  4843. if (Laya.Browser.onAndroid) {
  4844. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4845. if (!boo) {
  4846. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4847. return;
  4848. }
  4849. }
  4850. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4851. }
  4852. else {
  4853. console.log('zh:AD 失败,直接发放奖励');
  4854. this.qjff_AD_for_uipower();
  4855. }
  4856. }
  4857. qjff_AD_for_uipower() {
  4858. DataMgr.setPower(xGame.common.videoPower, true);
  4859. xGame.eventMgr.event(POWER_TIME);
  4860. this.hide();
  4861. }
  4862. }
  4863. UIPower.uiName = "UIPower";
  4864. class LocalStorageManager {
  4865. test1() {
  4866. LocalStorageManager.setItem("playerName", "Tom");
  4867. LocalStorageManager.setItem("playerLevel", 5);
  4868. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4869. const name = LocalStorageManager.getItem("playerName");
  4870. const level = LocalStorageManager.getItem("playerLevel");
  4871. const data = LocalStorageManager.getItem("playerData");
  4872. console.log(name);
  4873. console.log(level);
  4874. console.log(data);
  4875. LocalStorageManager.removeItem("playerLevel");
  4876. }
  4877. static setItem(key, value) {
  4878. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4879. }
  4880. static getItem(key) {
  4881. const data = Laya.LocalStorage.getItem(key);
  4882. if (data === null)
  4883. return null;
  4884. try {
  4885. return JSON.parse(data);
  4886. }
  4887. catch (e) {
  4888. return data;
  4889. }
  4890. }
  4891. static removeItem(key) {
  4892. Laya.LocalStorage.removeItem(key);
  4893. }
  4894. static clear() {
  4895. Laya.LocalStorage.clear();
  4896. }
  4897. static hasJosnKey(key) {
  4898. var value = Laya.LocalStorage.getJSON(key);
  4899. if (value != null) {
  4900. return true;
  4901. }
  4902. else {
  4903. return false;
  4904. }
  4905. }
  4906. static hasKey(key) {
  4907. return Laya.LocalStorage.getItem(key) !== null;
  4908. }
  4909. }
  4910. class UILevelProp extends UIBase {
  4911. constructor() {
  4912. super();
  4913. this.firstPos = 385;
  4914. this.secondPos = 467;
  4915. this.showItemArr = [];
  4916. }
  4917. onFontLoaded() {
  4918. try {
  4919. this.ui.myNode.conditionTxt.font = "arial";
  4920. console.log("zh: onFontLoaded 设置arial字体成功");
  4921. }
  4922. catch (error) {
  4923. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4924. }
  4925. }
  4926. onConstructor() {
  4927. this.ui = ui_UILevelProp.createInstance();
  4928. this.contentPane = this.ui;
  4929. this.isEject = false;
  4930. this.addUIClick(this.ui.closeBtn, this.hide);
  4931. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4932. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4933. }
  4934. show(level) {
  4935. super.show();
  4936. this.ui.t1.play();
  4937. this.level = level;
  4938. this.data = cfgTable.placeballData[this.level];
  4939. this.updateSelf();
  4940. this.showPreView();
  4941. this.moneyNode.ui.c1.selectedIndex = 2;
  4942. this.moneyNode.checkPowerTime();
  4943. this.moneyNode.powerChange();
  4944. }
  4945. showPreView() {
  4946. let item;
  4947. let data;
  4948. for (let index = 0; index < this.showItemArr.length; index++) {
  4949. item = this.showItemArr[index];
  4950. item.destroySelf();
  4951. }
  4952. this.showItemArr = [];
  4953. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4954. for (const key in cfgData) {
  4955. data = cfgData[key];
  4956. item = new ShowItem();
  4957. item.setParent(this.ui.myNode.displayRoot);
  4958. item.setPos(data.x, data.y);
  4959. item.setUrl(data.value);
  4960. this.showItemArr.push(item);
  4961. }
  4962. }
  4963. updateSelf() {
  4964. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4965. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4966. if (this.data.ball == -1) {
  4967. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4968. }
  4969. else {
  4970. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4971. }
  4972. let localData = DataMgr.getPlaceBallLevel(this.level);
  4973. let getAward = localData.getAward;
  4974. let cfg = cfgTable.placeballData[this.level];
  4975. let coin = this.data.award[0];
  4976. let diamond = this.data.award[1];
  4977. if (cfg.type == PlaceBallType.challenge) {
  4978. diamond = 0;
  4979. coin = 100;
  4980. }
  4981. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4982. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4983. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4984. if (cfg.type == PlaceBallType.challenge) {
  4985. this.ui.myNode.coinNode.numTxt.text = "";
  4986. }
  4987. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4988. if (coin > 0 && diamond > 0) {
  4989. this.ui.myNode.diamondNode.x = 385;
  4990. this.ui.myNode.coinNode.x = 467;
  4991. }
  4992. else {
  4993. this.ui.myNode.diamondNode.x = 385;
  4994. this.ui.myNode.coinNode.x = 385;
  4995. }
  4996. if (!getAward) {
  4997. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4998. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4999. }
  5000. else {
  5001. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5002. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5003. }
  5004. }
  5005. startGame() {
  5006. if (DataMgr.powerEnough()) {
  5007. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5008. this.ui.myNode.startBtn.touchable = false;
  5009. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5010. console.log('zh:startGame ');
  5011. this.ui.myNode.startBtn.touchable = true;
  5012. DataMgr.setPower(-1);
  5013. xGame.eventMgr.event(POWER_TIME);
  5014. xGame.common.gameMode = GameMode.placeBall;
  5015. xGame.common.placeBallCurLevel = this.level;
  5016. xGame.uiMgr.Show(UIGame);
  5017. this.logEventForChallenge_level_start(this.level);
  5018. xGame.uiMgr.Hide(UILevelDisplay);
  5019. xGame.uiMgr.Hide(UIMain);
  5020. this.hide();
  5021. }));
  5022. }
  5023. else {
  5024. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5025. xGame.uiMgr.Show(UIPower);
  5026. }
  5027. }
  5028. logEventForChallenge_level_start(level) {
  5029. let keyStr = 'sjmd_challenge_level_start';
  5030. let jsonStr = {
  5031. "count": 1,
  5032. "gold_balance ": DataMgr.getCoin(),
  5033. "level": level,
  5034. "diamond_balance ": DataMgr.getDiamond()
  5035. };
  5036. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5037. const d = LocalStorageManager.getItem(keyStr);
  5038. if (level > d.level) {
  5039. jsonStr.count = d.count + 1;
  5040. LocalStorageManager.setItem(keyStr, jsonStr);
  5041. }
  5042. else {
  5043. }
  5044. }
  5045. else {
  5046. LocalStorageManager.setItem(keyStr, jsonStr);
  5047. }
  5048. const reqStr = JSON.stringify(jsonStr);
  5049. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5050. }
  5051. hide() {
  5052. super.hide();
  5053. }
  5054. }
  5055. UILevelProp.uiName = "UILevelProp";
  5056. class PutBallLevelDisplay {
  5057. constructor(ui, index) {
  5058. this.index = 0;
  5059. this.ui = ui;
  5060. this.index = index;
  5061. this.ui.onClick(this, this.clickSelf);
  5062. this.updateSelf();
  5063. this.ui.levelTxt.text = (this.index + 1) + "";
  5064. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5065. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5066. }
  5067. updateSelf() {
  5068. let level = this.index + 1;
  5069. this.data = DataMgr.getPlaceBallLevel(level);
  5070. this.ui.starNode.c1.selectedIndex = this.data.star;
  5071. let isChallenge = cfgTable.placeballData[level].type;
  5072. if (this.data.isCur) {
  5073. if (isChallenge) {
  5074. this.ui.c1.selectedIndex = 5;
  5075. }
  5076. else {
  5077. this.ui.c1.selectedIndex = 2;
  5078. }
  5079. }
  5080. else {
  5081. if (this.data.play) {
  5082. if (this.data.star == 3) {
  5083. this.ui.c1.selectedIndex = 0;
  5084. }
  5085. else {
  5086. this.ui.c1.selectedIndex = 1;
  5087. }
  5088. }
  5089. else {
  5090. if (isChallenge) {
  5091. this.ui.c1.selectedIndex = 4;
  5092. }
  5093. else {
  5094. this.ui.c1.selectedIndex = 3;
  5095. }
  5096. }
  5097. }
  5098. }
  5099. clickSelf() {
  5100. if (!this.data.play)
  5101. return;
  5102. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5103. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5104. }
  5105. }
  5106. class UILevelDisplay extends UIBase {
  5107. constructor() {
  5108. super();
  5109. }
  5110. onConstructor() {
  5111. this.ui = ui_UILevelDisplay.createInstance();
  5112. this.contentPane = this.ui;
  5113. this.isEject = false;
  5114. this.myList = this.ui.myNode.myList;
  5115. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5116. this.levelItemArr = [];
  5117. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5118. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5119. this.myList.numItems = levelNum;
  5120. if (Moyu.isKs)
  5121. this.ui.closeNode.closeBtn.x += 100;
  5122. }
  5123. levelItemRender(index, target) {
  5124. let item = new PutBallLevelDisplay(target, index);
  5125. this.levelItemArr.push(item);
  5126. }
  5127. show() {
  5128. super.show();
  5129. this.updateLevel();
  5130. this.scrollToPlace();
  5131. }
  5132. updateLevel() {
  5133. let temp;
  5134. for (let index = 0; index < this.levelItemArr.length; index++) {
  5135. temp = this.levelItemArr[index];
  5136. temp.updateSelf();
  5137. }
  5138. }
  5139. scrollToPlace() {
  5140. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5141. let passArr = DataMgr.getPlaceBallLevelList();
  5142. let offest = passArr.length;
  5143. if (offest >= maxNum - 1)
  5144. offest = maxNum - 1;
  5145. this.myList.scrollToView(offest, true, true);
  5146. }
  5147. hide() {
  5148. super.hide();
  5149. }
  5150. }
  5151. UILevelDisplay.uiName = "UILevelDisplay";
  5152. class ui_UIMatching extends fgui.GComponent {
  5153. static createInstance() {
  5154. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5155. }
  5156. onConstruct() {
  5157. this.n5 = (this.getChild("n5"));
  5158. this.n49 = (this.getChild("n49"));
  5159. this.n51 = (this.getChild("n51"));
  5160. this.n64 = (this.getChild("n64"));
  5161. this.n2 = (this.getChild("n2"));
  5162. this.n53 = (this.getChild("n53"));
  5163. this.n54 = (this.getChild("n54"));
  5164. this.n56 = (this.getChild("n56"));
  5165. this.n58 = (this.getChild("n58"));
  5166. this.n59 = (this.getChild("n59"));
  5167. this.n57 = (this.getChild("n57"));
  5168. this.n60 = (this.getChild("n60"));
  5169. this.n62 = (this.getChild("n62"));
  5170. this.awardTxt = (this.getChild("awardTxt"));
  5171. this.n61 = (this.getChild("n61"));
  5172. this.selfHead = (this.getChild("selfHead"));
  5173. this.aiHead = (this.getChild("aiHead"));
  5174. this.n82 = (this.getChild("n82"));
  5175. this.n84 = (this.getChild("n84"));
  5176. this.n83 = (this.getChild("n83"));
  5177. this.t1 = this.getTransition("t1");
  5178. this.t2 = this.getTransition("t2");
  5179. this.t3 = this.getTransition("t3");
  5180. this.t4 = this.getTransition("t4");
  5181. }
  5182. }
  5183. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5184. class UIMatching extends UIBase {
  5185. constructor() {
  5186. super();
  5187. }
  5188. onConstructor() {
  5189. this.ui = ui_UIMatching.createInstance();
  5190. this.contentPane = this.ui;
  5191. this.isEject = false;
  5192. }
  5193. show(callback) {
  5194. super.show();
  5195. PlatMgr.showBanner(true);
  5196. this.callback = callback;
  5197. let user = Moyu.getUserInfo();
  5198. if (!this.selfPot) {
  5199. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5200. }
  5201. if (!this.aiPot) {
  5202. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5203. }
  5204. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5205. this.ui.selfHead.nameTxt.text = user.nickName;
  5206. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5207. this.ui.aiHead.nameTxt.text = "???";
  5208. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5209. this.ui.selfHead.c1.selectedIndex = 0;
  5210. this.ui.aiHead.c1.selectedIndex = 0;
  5211. this.ui.selfHead.x = this.selfPot.x;
  5212. this.ui.selfHead.y = this.selfPot.y;
  5213. this.ui.aiHead.x = this.aiPot.x;
  5214. this.ui.aiHead.y = this.aiPot.y;
  5215. switch (xGame.common.gameMode) {
  5216. case GameMode.classic:
  5217. break;
  5218. case GameMode.bigMove:
  5219. this.initSkillData();
  5220. break;
  5221. default:
  5222. break;
  5223. }
  5224. this.ui.t1.play(Laya.Handler.create(this, () => {
  5225. this.ui.t2.play(Laya.Handler.create(this, () => {
  5226. switch (xGame.common.gameMode) {
  5227. case GameMode.classic:
  5228. this.waitingPeople();
  5229. break;
  5230. case GameMode.bigMove:
  5231. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5232. break;
  5233. default:
  5234. break;
  5235. }
  5236. }));
  5237. }));
  5238. }
  5239. initSkillData() {
  5240. this.skillSelectData = [];
  5241. let skillUrl = xGame.common.skillIconList;
  5242. let skillName = xGame.common.skillNameList;
  5243. let skillLevel = DataMgr.getBigSkillList();
  5244. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5245. for (let index = 0; index < 5; index++) {
  5246. let obj = {};
  5247. obj.skillImg = skillUrl[index];
  5248. obj.skillName = skillName[index];
  5249. obj.skillType = skillType[index];
  5250. obj.skillLevel = skillLevel[index];
  5251. this.skillSelectData.push(obj);
  5252. }
  5253. }
  5254. getAISkillLevel(myLevel) {
  5255. let video = xGame.common.upSkillLevel;
  5256. let aiLevel;
  5257. let temp;
  5258. if (video) {
  5259. temp = xGame.common.randomNum(-2, -1);
  5260. }
  5261. else {
  5262. if (myLevel <= 5) {
  5263. temp = xGame.common.randomNum(1, 3);
  5264. }
  5265. else if (myLevel <= 9) {
  5266. temp = xGame.common.randomNum(-2, 1);
  5267. }
  5268. else {
  5269. temp = xGame.common.randomNum(-4, 0);
  5270. }
  5271. }
  5272. aiLevel = temp + myLevel;
  5273. if (aiLevel <= 1)
  5274. aiLevel = 1;
  5275. if (aiLevel >= 10)
  5276. aiLevel = 10;
  5277. return aiLevel;
  5278. }
  5279. getAISkillType() {
  5280. return xGame.common.randomNum(1, 4);
  5281. let successTimes = DataMgr.getSkillSuccessTimes();
  5282. let info = cfgTable.aiskillData[successTimes];
  5283. if (!info) {
  5284. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5285. info = cfgTable.aiskillData[max];
  5286. }
  5287. let dataArr = info.skillselect;
  5288. let myCfg = {};
  5289. for (let index = 0; index < dataArr.length; index++) {
  5290. let temp = dataArr[index].split('-');
  5291. myCfg[temp[0]] = {};
  5292. myCfg[temp[0]].id = parseInt(temp[0]);
  5293. myCfg[temp[0]].weight = parseInt(temp[1]);
  5294. }
  5295. let aiCfg = xGame.common.initWeight(myCfg);
  5296. let curData = xGame.common.getRandomWeightData(aiCfg);
  5297. return parseInt(curData.id);
  5298. }
  5299. getAISkillData(index) {
  5300. let myLevel = this.skillSelectData[index].skillLevel;
  5301. let aiLevel = this.getAISkillLevel(myLevel);
  5302. let aiType = this.getAISkillType() - 1;
  5303. return { aiLevel, aiType } = { aiLevel, aiType };
  5304. }
  5305. skillSelectFinish(index) {
  5306. let aiInfo = this.getAISkillData(index);
  5307. xGame.common.gameMgr.selfCurSkill = index;
  5308. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5309. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5310. this.ui.selfHead.c1.selectedIndex = 1;
  5311. this.ui.aiHead.c1.selectedIndex = 1;
  5312. let myData = this.skillSelectData[index];
  5313. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5314. let guide = DataMgr.getSkillGuide();
  5315. if (guide == 0) {
  5316. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5317. }
  5318. else {
  5319. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5320. }
  5321. let aiData = this.skillSelectData[aiInfo.aiType];
  5322. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5323. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5324. this.waitingPeople();
  5325. }
  5326. waitingPeople() {
  5327. let time = xGame.common.randomNum(1000, 3000);
  5328. time += 1000;
  5329. Laya.timer.once(time, this, () => {
  5330. this.matchingSuccess();
  5331. });
  5332. }
  5333. matchingSuccess() {
  5334. let gameUI = xGame.common.gameUI;
  5335. let name = gameUI.ui.topNode.aiNameTxt.text;
  5336. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5337. this.ui.aiHead.nameTxt.text = name;
  5338. this.ui.aiHead.headImg.url = url;
  5339. name = gameUI.ui.topNode.selfNameTxt.text;
  5340. url = gameUI.ui.topNode.selfHeadLoader.url;
  5341. this.ui.selfHead.nameTxt.text = name;
  5342. this.ui.selfHead.headImg.url = url;
  5343. this.ui.t3.play(Laya.Handler.create(this, () => {
  5344. this.callback && this.callback();
  5345. this.ui.t4.play(Laya.Handler.create(this, () => {
  5346. this.destroySelf();
  5347. }));
  5348. }));
  5349. }
  5350. destroySelf() {
  5351. this.callback = null;
  5352. this.skillSelectData = null;
  5353. this.selfPot = null;
  5354. this.aiPot = null;
  5355. if (!this.ui.isDisposed) {
  5356. this.ui.removeFromParent();
  5357. this.ui.dispose();
  5358. }
  5359. xGame.uiMgr.destroyUI(this);
  5360. }
  5361. }
  5362. UIMatching.uiName = "UIMatching";
  5363. class ui_UIRanking extends fgui.GComponent {
  5364. static createInstance() {
  5365. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5366. }
  5367. onConstruct() {
  5368. this.n26 = (this.getChild("n26"));
  5369. this.myNode = (this.getChild("myNode"));
  5370. }
  5371. }
  5372. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5373. class UIRanking extends UIBase {
  5374. constructor() {
  5375. super();
  5376. this.showSelf = true;
  5377. this.rankType = 1;
  5378. this.rankList = [];
  5379. this.topX = 10;
  5380. this.myIndex = this.topX + 1;
  5381. this.myStar = 0;
  5382. }
  5383. onConstructor() {
  5384. this.ui = ui_UIRanking.createInstance();
  5385. this.contentPane = this.ui;
  5386. this.isEject = false;
  5387. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5388. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5389. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5390. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5391. this.ui.myNode.myList.setVirtual();
  5392. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5393. }
  5394. show() {
  5395. super.show();
  5396. this.getPaiHangBangDataFormJosnFile();
  5397. this.updateSelf();
  5398. let self = Moyu.getUserInfo();
  5399. if (!self.isAuth) {
  5400. Moyu.initUser(this, () => {
  5401. DataMgr.upRankData();
  5402. });
  5403. }
  5404. }
  5405. getPaiHangBangDataFormJosnFile() {
  5406. const rankingList = cfgTable.paiHangBangData.list;
  5407. this.updateItemData(rankingList);
  5408. }
  5409. updateSelfItem() {
  5410. console.log('zh:Moyu.platType =' + Moyu.platType);
  5411. let self = Moyu.getUserInfo();
  5412. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5413. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5414. if (this.myIndex > this.topX) {
  5415. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5416. }
  5417. else {
  5418. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5419. }
  5420. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5421. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5422. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5423. }
  5424. updateItemData(data) {
  5425. this.myStar = xGame.common.getAllStarNum();
  5426. if (this.rankList.length < 2) {
  5427. this.rankList = data;
  5428. let self = Moyu.getUserInfo();
  5429. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5430. self.headIcon = self.headIcon;
  5431. for (let i = 0; i < data.length; i++) {
  5432. let data = this.rankList[i];
  5433. if (data.userId == self.userId) {
  5434. this.rankList.splice(i, 1);
  5435. break;
  5436. }
  5437. }
  5438. for (let i = 0; i < data.length; i++) {
  5439. let data = this.rankList[i];
  5440. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5441. this.myIndex = i + 1;
  5442. let user = { headIcon: self.headIcon, nickName: "myself" };
  5443. let ud = { user: user, data: {} };
  5444. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5445. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5446. if (Moyu.platType < 11) {
  5447. user.headIcon = self.headIcon;
  5448. user.nickName = self.nickName;
  5449. }
  5450. this.rankList.splice(i, 0, md);
  5451. break;
  5452. }
  5453. }
  5454. }
  5455. this.updateSelfItem();
  5456. this.ui.myNode.myList.numItems = this.rankList.length;
  5457. }
  5458. updateItemUI(index, obj) {
  5459. let data = this.rankList[index];
  5460. let userData = JSON.parse(data.userData).user;
  5461. obj.nameTxt.text = userData.nickName.toString();
  5462. obj.valueTxt.text = data.rankScore;
  5463. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5464. obj.rankTxt.text = index + 1;
  5465. switch (index) {
  5466. case 0:
  5467. this.setImg(obj, 1, 0, 0);
  5468. obj.rankTxt.color = "#FFC047";
  5469. break;
  5470. case 1:
  5471. this.setImg(obj, 0, 1, 0);
  5472. obj.rankTxt.color = "#ACACAC";
  5473. break;
  5474. case 2:
  5475. this.setImg(obj, 0, 0, 1);
  5476. obj.rankTxt.color = "#D09672";
  5477. break;
  5478. default:
  5479. this.setImg(obj, 0, 0, 0);
  5480. obj.rankTxt.color = "#496FAB";
  5481. break;
  5482. }
  5483. }
  5484. setImg(obj, a, b, c) {
  5485. obj.img1.visible = a ? true : false;
  5486. obj.img2.visible = b ? true : false;
  5487. obj.img3.visible = c ? true : false;
  5488. }
  5489. changeList(type) {
  5490. this.rankType = type;
  5491. this.updateSelf();
  5492. }
  5493. changeSelfNode() {
  5494. this.showSelf = !this.showSelf;
  5495. this.updateSelf();
  5496. }
  5497. updateSelf() {
  5498. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5499. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5500. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5501. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5502. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5503. }
  5504. }
  5505. UIRanking.uiName = "UIRanking";
  5506. class ui_UISecretary extends fgui.GComponent {
  5507. static createInstance() {
  5508. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5509. }
  5510. onConstruct() {
  5511. this.n0 = (this.getChild("n0"));
  5512. this.myNode = (this.getChild("myNode"));
  5513. this.closeBtn = (this.getChild("closeBtn"));
  5514. this.t0 = this.getTransition("t0");
  5515. }
  5516. }
  5517. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5518. class UISecretary extends UIBase {
  5519. constructor() {
  5520. super();
  5521. this.curIndex = 1;
  5522. }
  5523. onConstructor() {
  5524. this.ui = ui_UISecretary.createInstance();
  5525. this.contentPane = this.ui;
  5526. this.isEject = false;
  5527. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5528. this.nodeObj = { left: null, right: null, cur: null };
  5529. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5530. }
  5531. show() {
  5532. super.show();
  5533. this.ui.t0.play();
  5534. this.updateData();
  5535. }
  5536. addSecretarySpine(node, spineName) {
  5537. if (spineName == "mishu") {
  5538. if (this.secretarySpine1) {
  5539. node.displayObject.destroyChildren();
  5540. this.playWoman(this.secretarySpine1, node.displayObject);
  5541. }
  5542. else {
  5543. let spine1 = new SpineMgr("mishu", () => {
  5544. this.secretarySpine1 = spine1;
  5545. this.playWoman(this.secretarySpine1, node.displayObject);
  5546. });
  5547. }
  5548. }
  5549. else {
  5550. if (this.secretarySpine2) {
  5551. node.displayObject.destroyChildren();
  5552. this.playWoman(this.secretarySpine2, node.displayObject);
  5553. }
  5554. else {
  5555. let spine2 = new SpineMgr("xiaomishu2", () => {
  5556. this.secretarySpine2 = spine2;
  5557. this.playWoman(this.secretarySpine2, node.displayObject);
  5558. });
  5559. }
  5560. }
  5561. }
  5562. playWoman(node, parent) {
  5563. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5564. let yy = this.ui.myNode.gameNode3.secretary.height;
  5565. let scale = 1.5;
  5566. if (node == this.secretarySpine2) {
  5567. scale = 1.2;
  5568. }
  5569. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5570. node.play(data, 0, true, parent);
  5571. }
  5572. turnLeft() {
  5573. this.curIndex--;
  5574. if (this.curIndex < 1) {
  5575. this.curIndex = 2;
  5576. }
  5577. let left = this.nodeObj.left;
  5578. let right = this.nodeObj.right;
  5579. let cur = this.nodeObj.cur;
  5580. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5581. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5582. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5583. this.updateData();
  5584. }));
  5585. this.ui.myNode.setChildIndex(right, 2);
  5586. this.nodeObj.left = cur;
  5587. this.nodeObj.right = left;
  5588. this.nodeObj.cur = right;
  5589. }
  5590. turnRight() {
  5591. this.curIndex++;
  5592. if (this.curIndex > 2) {
  5593. this.curIndex = 1;
  5594. }
  5595. let left = this.nodeObj.left;
  5596. let right = this.nodeObj.right;
  5597. let cur = this.nodeObj.cur;
  5598. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5599. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5600. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5601. this.updateData();
  5602. }));
  5603. this.ui.myNode.setChildIndex(left, 2);
  5604. this.nodeObj.left = right;
  5605. this.nodeObj.right = cur;
  5606. this.nodeObj.cur = left;
  5607. }
  5608. updateData() {
  5609. console.log('zh: updateData FFFFFFFFFF');
  5610. let data = cfgTable.secretaryshopData;
  5611. let children = this.ui.myNode._children;
  5612. let temp;
  5613. let curData;
  5614. for (let index = 0; index < children.length; index++) {
  5615. temp = children[index];
  5616. curData = data[1];
  5617. temp.heightTxt.text = curData.height;
  5618. temp.foodTxt.text = curData.food;
  5619. temp.historyTxt.text = curData.history;
  5620. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5621. this.addSecretarySpine(temp.secretary, curData.spine);
  5622. let womanIndex = curData.id - 1;
  5623. let getWoman = DataMgr.getSecretary(womanIndex);
  5624. let curUse = DataMgr.getCurSecretary();
  5625. if (getWoman) {
  5626. if (curUse == womanIndex) {
  5627. temp.purchaseBtn.c1.selectedIndex = 1;
  5628. }
  5629. else {
  5630. temp.purchaseBtn.c1.selectedIndex = 2;
  5631. }
  5632. }
  5633. else {
  5634. temp.purchaseBtn.c1.selectedIndex = 0;
  5635. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5636. }
  5637. temp.purchaseBtn.visible = false;
  5638. }
  5639. }
  5640. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5641. console.log('zh: 点击了clickSecretary ');
  5642. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5643. if (getWoman) {
  5644. if (curUse != womanIndex) {
  5645. console.log();
  5646. DataMgr.setCurSecretary(womanIndex);
  5647. this.updateData();
  5648. }
  5649. }
  5650. else {
  5651. console.log('zh:点击购买了');
  5652. let need = needDiamond;
  5653. if (DataMgr.diamondEnough(need)) {
  5654. DataMgr.setDiamond(-need);
  5655. DataMgr.setSecretary(womanIndex, 1);
  5656. DataMgr.setCurSecretary(womanIndex);
  5657. this.updateData();
  5658. }
  5659. else {
  5660. xGame.uiMgr.Show(UIAddProp, 1);
  5661. }
  5662. }
  5663. }
  5664. closeSelf() {
  5665. this.hide();
  5666. }
  5667. }
  5668. UISecretary.uiName = "UISecretary";
  5669. class ui_UIShop extends fgui.GComponent {
  5670. static createInstance() {
  5671. return (fgui.UIPackage.createObject("game", "UIShop"));
  5672. }
  5673. onConstruct() {
  5674. this.n48 = (this.getChild("n48"));
  5675. this.n0 = (this.getChild("n0"));
  5676. this.secretary = (this.getChild("secretary"));
  5677. this.talkNode = (this.getChild("talkNode"));
  5678. this.closeNode = (this.getChild("closeNode"));
  5679. this.moneyNode = (this.getChild("moneyNode"));
  5680. this.myNode = (this.getChild("myNode"));
  5681. }
  5682. }
  5683. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5684. class BallRodDisplay {
  5685. constructor(ui, index) {
  5686. this.index = 0;
  5687. this.uiIndex = 0;
  5688. this.ui = ui;
  5689. this.index = index;
  5690. this.initData();
  5691. }
  5692. initData() {
  5693. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5694. let data = cfgTable.ballrodData[this.index + 1];
  5695. this.ui.nameTxt.text = data.name;
  5696. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5697. this.ui.levelNode.c1.selectedIndex = data.quality;
  5698. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5699. if (data.spine) {
  5700. this.mySpine = new SpineMgr(data.spine, () => {
  5701. let xx = 150;
  5702. let yy = 70;
  5703. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5704. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5705. });
  5706. }
  5707. }
  5708. updateSelf() {
  5709. console.log('zh:updateSelf -------------- ');
  5710. let get = DataMgr.getBallRod(this.index);
  5711. if (get == null)
  5712. get = 1;
  5713. let curUse = DataMgr.getCurBallRod();
  5714. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5715. if (get) {
  5716. if (curUse == this.index) {
  5717. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5718. }
  5719. else {
  5720. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5721. }
  5722. }
  5723. else {
  5724. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5725. }
  5726. }
  5727. buyBallRod() {
  5728. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5729. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5730. switch (selectedIndex) {
  5731. case 0:
  5732. break;
  5733. case 1:
  5734. console.log('zh:点击了 USE THIS');
  5735. DataMgr.setCurBallRod(this.index);
  5736. let curUse = DataMgr.getCurBallRod();
  5737. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5738. let ui = xGame.uiMgr.getUI(UIShop);
  5739. ui.updateBallRod();
  5740. break;
  5741. case 2:
  5742. let data = cfgTable.ballrodData[this.index + 1];
  5743. let need = data.price;
  5744. if (DataMgr.diamondEnough(need)) {
  5745. DataMgr.setDiamond(-need);
  5746. DataMgr.setBallRod(this.index, 1);
  5747. DataMgr.setCurBallRod(this.index);
  5748. let ui = xGame.uiMgr.getUI(UIShop);
  5749. ui.updateBallRod();
  5750. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5751. }
  5752. else {
  5753. xGame.uiMgr.Show(UIAddProp, 1);
  5754. }
  5755. break;
  5756. default:
  5757. break;
  5758. }
  5759. }
  5760. logEventForGouMaiGan(qiuGanName) {
  5761. const ev = {
  5762. value: qiuGanName
  5763. };
  5764. const jsonStr = JSON.stringify(ev);
  5765. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5766. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5767. }
  5768. }
  5769. class DaoJuDisplay {
  5770. constructor(ui, index) {
  5771. this.index = 0;
  5772. this.uiIndex = 0;
  5773. this.ui = ui;
  5774. this.index = index;
  5775. this.initData();
  5776. }
  5777. initData() {
  5778. this.ui.btn_buy.onClick(this, this.buySp);
  5779. this.ui.btn_buy.onClick(this, this.buyDj);
  5780. let data = cfgTable.daoJuData[this.index + 1];
  5781. console.log('zh:' + JSON.stringify(data));
  5782. this.ui.nameTxt.text = data.spbt;
  5783. this.ui.n_jiaGe.text = data.spjg + "";
  5784. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5785. let baseUrl = "asset/sound/ogg/";
  5786. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5787. }
  5788. buyDj() {
  5789. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5790. }
  5791. buySp() {
  5792. let data = cfgTable.daoJuData[this.index + 1];
  5793. console.log('zh:点击购买 data =' + JSON.stringify(data));
  5794. }
  5795. }
  5796. class ui_UIMsg extends fgui.GComponent {
  5797. static createInstance() {
  5798. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5799. }
  5800. onConstruct() {
  5801. this.tipsNode = (this.getChild("tipsNode"));
  5802. }
  5803. }
  5804. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5805. class UIMsg extends UIBase {
  5806. constructor() {
  5807. super();
  5808. }
  5809. onConstructor() {
  5810. this.ui = ui_UIMsg.createInstance();
  5811. this.contentPane = this.ui;
  5812. this.isEject = false;
  5813. this.isMuti = true;
  5814. }
  5815. show(msg, callback) {
  5816. super.show();
  5817. this.ui.tipsNode.msgTxt.text = msg;
  5818. this.ui.alpha = 1;
  5819. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5820. this.hide();
  5821. callback && callback();
  5822. }), 1000);
  5823. }
  5824. }
  5825. UIMsg.uiName = "UIMsg";
  5826. class UIShop extends UIBase {
  5827. constructor() {
  5828. super();
  5829. this.itemNums = 0;
  5830. this.itemNumsForDj = 0;
  5831. this.curType = "";
  5832. }
  5833. onConstructor() {
  5834. this.ui = ui_UIShop.createInstance();
  5835. this.contentPane = this.ui;
  5836. this.isEject = false;
  5837. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5838. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5839. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  5840. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  5841. this.addUIClick(this.ui, this.interuptSecretary);
  5842. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5843. this.ballRodArr = [];
  5844. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5845. this.ui.myNode.myList.numItems = this.itemNums;
  5846. this.loadDjdata_old();
  5847. }
  5848. loadDjdata_old() {
  5849. let fff = cfgTable.daoJuData;
  5850. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  5851. this.daoJuArr = [];
  5852. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  5853. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  5854. }
  5855. getProductList() {
  5856. let reqData = xGame.httpMgr.getReqData();
  5857. let pd = JSON.parse(reqData);
  5858. pd.splx = "Consumable";
  5859. reqData = JSON.stringify(pd);
  5860. xGame.httpMgr.sendPost2025('getProductList', reqData, (res) => {
  5861. try {
  5862. let code = res.code;
  5863. let msg = res.msg;
  5864. if (code == 200) {
  5865. let data = res.data;
  5866. for (let index = 0; index < data.length; index++) {
  5867. let element = data[index];
  5868. cfgTable.daoJuData[element.spid] = element;
  5869. }
  5870. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  5871. }
  5872. else {
  5873. xGame.uiMgr.Show(UIMsg, msg);
  5874. }
  5875. }
  5876. catch (error) {
  5877. console.log('error=' + error);
  5878. alert(error);
  5879. }
  5880. finally {
  5881. }
  5882. });
  5883. }
  5884. show(type) {
  5885. super.show();
  5886. this.curType = type == 0 ? "qiugan" : "daoju";
  5887. this.switchBtn("qiugan");
  5888. this.playSecretaryIdle();
  5889. this.updateBallRod();
  5890. }
  5891. test123() {
  5892. console.log('zh:test123 ');
  5893. }
  5894. switchBtn(type) {
  5895. console.log('zh:1111切換 sel type=' + type);
  5896. if (type == "") {
  5897. type = this.curType;
  5898. }
  5899. else {
  5900. if (this.curType == type) {
  5901. return;
  5902. }
  5903. else {
  5904. this.curType = type;
  5905. }
  5906. }
  5907. if (type == "qiugan") {
  5908. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  5909. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  5910. this.ui.myNode.c1.selectedIndex = 0;
  5911. this.ui.myNode.myList.visible = true;
  5912. this.ui.myNode.djList.visible = false;
  5913. }
  5914. else {
  5915. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  5916. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  5917. this.ui.myNode.c1.selectedIndex = 1;
  5918. this.ui.myNode.myList.visible = false;
  5919. this.ui.myNode.djList.visible = true;
  5920. }
  5921. }
  5922. updateBallRod() {
  5923. for (let index = 0; index < this.ballRodArr.length; index++) {
  5924. this.ballRodArr[index].updateSelf();
  5925. }
  5926. }
  5927. renderBallRod(sort, obj) {
  5928. let index = this.getIndexBySort(sort + 1) - 1;
  5929. let ballRod = new BallRodDisplay(obj, index);
  5930. this.ballRodArr.push(ballRod);
  5931. }
  5932. renderDaoJu(idx, obj) {
  5933. let index = this.getIndexBySortForDj(idx + 1) - 1;
  5934. let b = new DaoJuDisplay(obj, index);
  5935. this.daoJuArr.push(b);
  5936. }
  5937. getIndexBySort(sort) {
  5938. let object = cfgTable.ballrodData;
  5939. for (const key in object) {
  5940. if (object[key].sort == sort) {
  5941. return parseInt(key);
  5942. }
  5943. }
  5944. }
  5945. getIndexBySortForDj(idx) {
  5946. let object = cfgTable.daoJuData;
  5947. for (const key in object) {
  5948. if (object[key].idx == idx) {
  5949. return parseInt(key);
  5950. }
  5951. }
  5952. }
  5953. playSecretaryIdle() {
  5954. let parent = this.ui.secretary.displayObject;
  5955. parent.destroyChildren();
  5956. let xx = this.ui.secretary.width / 2;
  5957. let yy = this.ui.secretary.height;
  5958. let scale = xGame.common.getSecretaryScale();
  5959. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5960. xGame.common.secretary.play(data, 0, true, parent);
  5961. }
  5962. interuptSecretary() {
  5963. Laya.timer.clearAll(this);
  5964. this.playSecretaryRandomSound();
  5965. }
  5966. playSecretaryRandomSound() {
  5967. if (this.isHide)
  5968. return;
  5969. let time = xGame.common.randomNum(45000, 60000);
  5970. Laya.timer.once(time, this, () => {
  5971. if (this.isHide)
  5972. return;
  5973. let index = xGame.common.randomNum(4, 7);
  5974. xGame.soundMgr.playSound("s_main0" + index);
  5975. let words = 1;
  5976. switch (index) {
  5977. case 4:
  5978. words = 5;
  5979. break;
  5980. case 5:
  5981. words = 3;
  5982. break;
  5983. case 6:
  5984. words = 6;
  5985. break;
  5986. case 7:
  5987. words = 7;
  5988. break;
  5989. default:
  5990. break;
  5991. }
  5992. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5993. this.playSecretaryRandomSound();
  5994. });
  5995. }
  5996. closeSelf() {
  5997. this.hide();
  5998. }
  5999. }
  6000. UIShop.uiName = "UIShop";
  6001. class ui_UISign extends fgui.GComponent {
  6002. static createInstance() {
  6003. return (fgui.UIPackage.createObject("game", "UISign"));
  6004. }
  6005. onConstruct() {
  6006. this.n6 = (this.getChild("n6"));
  6007. this.closeNode = (this.getChild("closeNode"));
  6008. this.myNode = (this.getChild("myNode"));
  6009. this.moneyNode = (this.getChild("moneyNode"));
  6010. this.secretary = (this.getChild("secretary"));
  6011. this.talkNode = (this.getChild("talkNode"));
  6012. this.tripleBtn = (this.getChild("tripleBtn"));
  6013. this.normalBtn = (this.getChild("normalBtn"));
  6014. this.tipsNode = (this.getChild("tipsNode"));
  6015. this.againBtn = (this.getChild("againBtn"));
  6016. this.t0 = this.getTransition("t0");
  6017. }
  6018. }
  6019. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6020. class SignMax {
  6021. constructor(ui) {
  6022. this.ui = ui;
  6023. }
  6024. updateSelf(index, sameDay, curDayIndex) {
  6025. let data = cfgTable.signData[index + 1];
  6026. this.ui.titleTxt.text = data.title;
  6027. let arr1 = data.award[0].split('-');
  6028. let arr2 = data.award[1].split('-');
  6029. let num1 = parseInt(arr1[1]);
  6030. let num2 = parseInt(arr2[1]);
  6031. this.ui.numTxt1.text = num1 + "";
  6032. this.ui.numTxt2.text = num2 + "";
  6033. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6034. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6035. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6036. this.ui.numTxt1.visible = false;
  6037. }
  6038. else {
  6039. this.ui.numTxt1.visible = true;
  6040. }
  6041. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6042. this.ui.numTxt2.visible = false;
  6043. }
  6044. else {
  6045. this.ui.numTxt2.visible = true;
  6046. }
  6047. if (index < curDayIndex) {
  6048. this.ui.c1.selectedIndex = 1;
  6049. }
  6050. else if (index == curDayIndex) {
  6051. if (sameDay) {
  6052. this.ui.c1.selectedIndex = 2;
  6053. }
  6054. else {
  6055. this.ui.c1.selectedIndex = 2;
  6056. }
  6057. }
  6058. else {
  6059. this.ui.c1.selectedIndex = 0;
  6060. }
  6061. }
  6062. }
  6063. class SignNormal {
  6064. constructor(ui) {
  6065. this.ui = ui;
  6066. }
  6067. updateSelf(index, sameDay, curDayIndex) {
  6068. let data = cfgTable.signData[index + 1];
  6069. this.ui.titleTxt.text = data.title;
  6070. let arr = data.award[0].split('-');
  6071. let type = parseInt(arr[0]);
  6072. let num = parseInt(arr[1]);
  6073. this.ui.numTxt.text = num + "";
  6074. if (type > 2) {
  6075. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6076. this.ui.myIcon.rotation = 0;
  6077. }
  6078. else {
  6079. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6080. this.ui.myIcon.rotation = 0;
  6081. }
  6082. if (xGame.common.signAwardContainsRod(data.award)) {
  6083. this.ui.numTxt.visible = false;
  6084. }
  6085. else {
  6086. this.ui.numTxt.visible = true;
  6087. }
  6088. if (index < curDayIndex) {
  6089. this.ui.c1.selectedIndex = 1;
  6090. }
  6091. else if (index == curDayIndex) {
  6092. if (sameDay) {
  6093. this.ui.c1.selectedIndex = 2;
  6094. }
  6095. else {
  6096. this.ui.c1.selectedIndex = 2;
  6097. }
  6098. }
  6099. else {
  6100. this.ui.c1.selectedIndex = 0;
  6101. }
  6102. }
  6103. }
  6104. class UISign extends UIBase {
  6105. constructor() {
  6106. super();
  6107. this.curDayIndex = 0;
  6108. this.starX = 0;
  6109. }
  6110. onConstructor() {
  6111. this.ui = ui_UISign.createInstance();
  6112. this.contentPane = this.ui;
  6113. this.isEject = false;
  6114. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6115. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6116. this.initSignItem();
  6117. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6118. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6119. }
  6120. show() {
  6121. super.show();
  6122. this.ui.t0.play();
  6123. this.playSecretaryIdle();
  6124. this.updateSign();
  6125. }
  6126. initSignItem() {
  6127. this.signArr = [];
  6128. for (let index = 0; index < 6; index++) {
  6129. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6130. this.signArr.push(temp);
  6131. }
  6132. this.signMax = new SignMax(this.ui.myNode.day7);
  6133. if (Moyu.isKs)
  6134. this.ui.closeNode.closeBtn.x += 100;
  6135. }
  6136. updateSign() {
  6137. let sameDay = xGame.common.judgeSameDay();
  6138. let max = 7;
  6139. this.curDayIndex = DataMgr.getSignData();
  6140. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6141. this.curDayIndex = 0;
  6142. if (!sameDay) {
  6143. this.ui.normalBtn.visible = true;
  6144. this.ui.tipsNode.visible = false;
  6145. this.ui.againBtn.visible = false;
  6146. }
  6147. else {
  6148. this.ui.normalBtn.visible = false;
  6149. let again = DataMgr.getExtraSign();
  6150. let isCurrency = false;
  6151. let index = this.curDayIndex;
  6152. if (index == 0)
  6153. index = 7;
  6154. let award = cfgTable.signData[index].award;
  6155. let num = award[0].split("-")[0];
  6156. if (num == "1" || num == "2")
  6157. isCurrency = true;
  6158. let showAgain = again == 0 && isCurrency;
  6159. this.ui.againBtn.visible = showAgain;
  6160. this.ui.tipsNode.visible = !showAgain;
  6161. }
  6162. for (let index = 0; index < this.signArr.length; index++) {
  6163. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6164. }
  6165. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6166. }
  6167. playSecretaryIdle() {
  6168. let parent = this.ui.secretary.displayObject;
  6169. parent.destroyChildren();
  6170. let xx = this.ui.secretary.width / 2;
  6171. let yy = this.ui.secretary.height;
  6172. let scale = xGame.common.getSecretaryScale();
  6173. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6174. xGame.common.secretary.play(data, 0, true, parent);
  6175. }
  6176. closeSelf() {
  6177. this.hide();
  6178. }
  6179. normalGetAward() {
  6180. let sameDay = xGame.common.judgeSameDay();
  6181. if (!sameDay) {
  6182. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6183. let temp;
  6184. let type;
  6185. let num;
  6186. let arr = [];
  6187. for (let index = 0; index < award.length; index++) {
  6188. temp = award[index].split("-");
  6189. type = parseInt(temp[0]);
  6190. num = parseInt(temp[1]);
  6191. let awardType = new AwardType();
  6192. awardType.num = num;
  6193. awardType.type = type;
  6194. arr.push(awardType);
  6195. }
  6196. xGame.common.getAward(arr, (watchVideo) => {
  6197. this.curDayIndex++;
  6198. if (this.curDayIndex > 7)
  6199. this.curDayIndex = 0;
  6200. DataMgr.setSignData(this.curDayIndex);
  6201. DataMgr.setSignTime(new Date().getTime());
  6202. if (watchVideo) {
  6203. DataMgr.setExtraSign(1);
  6204. Moyu.sendDataEvent("signIn1");
  6205. }
  6206. this.updateSign();
  6207. });
  6208. }
  6209. }
  6210. againGetAward() {
  6211. Moyu.sendDataEvent("signIn2");
  6212. console.log('zh:qjff_AD_for_uisign');
  6213. if (Laya.Browser.onAndroid) {
  6214. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6215. if (!boo) {
  6216. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6217. return;
  6218. }
  6219. }
  6220. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6221. }
  6222. else {
  6223. console.log('zh:AD 失败,直接发放奖励');
  6224. this.qjff_AD_for_uisign();
  6225. }
  6226. }
  6227. qjff_AD_for_uisign() {
  6228. let index = this.curDayIndex;
  6229. if (index == 0)
  6230. index = 7;
  6231. let award = cfgTable.signData[index].award;
  6232. let temp;
  6233. let type;
  6234. let num;
  6235. for (let index = 0; index < award.length; index++) {
  6236. temp = award[index].split("-");
  6237. type = parseInt(temp[0]);
  6238. num = parseInt(temp[1]) * 3;
  6239. xGame.common.playObjFlyAnim(num, type);
  6240. }
  6241. DataMgr.setExtraSign(1);
  6242. this.updateSign();
  6243. }
  6244. }
  6245. UISign.uiName = "UISign";
  6246. class ui_UISkill extends fgui.GComponent {
  6247. static createInstance() {
  6248. return (fgui.UIPackage.createObject("game", "UISkill"));
  6249. }
  6250. onConstruct() {
  6251. this.n48 = (this.getChild("n48"));
  6252. this.n0 = (this.getChild("n0"));
  6253. this.secretary = (this.getChild("secretary"));
  6254. this.talkNode = (this.getChild("talkNode"));
  6255. this.closeNode = (this.getChild("closeNode"));
  6256. this.moneyNode = (this.getChild("moneyNode"));
  6257. this.skillNode = (this.getChild("skillNode"));
  6258. this.guideNode = (this.getChild("guideNode"));
  6259. }
  6260. }
  6261. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6262. class SkillDisplay {
  6263. constructor(ui, data, uiIndex) {
  6264. this.starX = 0;
  6265. this.starY = 0;
  6266. this.index = 0;
  6267. this.ui = ui;
  6268. this.data = data;
  6269. this.index = uiIndex;
  6270. this.initSelf();
  6271. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6272. }
  6273. initSelf() {
  6274. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6275. this.ui.nameTxt.text = this.data.name;
  6276. this.ui.describeTxt.text = this.data.describe;
  6277. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6278. this.ui.startBtn.onClick(this, this.startGame);
  6279. this.updateSelf();
  6280. }
  6281. updateSelf() {
  6282. this.checkTry();
  6283. let level = DataMgr.getBigSkillByIndex(this.index);
  6284. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6285. }
  6286. checkTry() {
  6287. let index = this.index;
  6288. let level = DataMgr.getBigSkillByIndex(index);
  6289. if (level == null) {
  6290. DataMgr.setBigSkill(index, 1, false);
  6291. level = 1;
  6292. }
  6293. this.ui.levelTxt.text = "LV." + level;
  6294. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6295. this.ui.tryNode.visible = true;
  6296. else
  6297. this.ui.tryNode.visible = false;
  6298. }
  6299. clickAddLevel() {
  6300. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6301. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6302. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6303. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6304. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6305. }
  6306. else {
  6307. console.log('zh:AD 失败,直接发放奖励');
  6308. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6309. }
  6310. }
  6311. qjff_AD_for_skilldisplay_clickAddLevel() {
  6312. DataMgr.setBigSkill(this.data.index, 1);
  6313. this.updateSelf();
  6314. xGame.common.upSkillLevel = true;
  6315. }
  6316. startGame() {
  6317. console.log('zh:rod skill startgame');
  6318. if (this.data.index == 3) {
  6319. alert('Coming soon!');
  6320. return;
  6321. }
  6322. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6323. let needCoin = xGame.common.bigMoveNeedCoin;
  6324. xGame.common.passAwardCoin = 2000;
  6325. let guide = DataMgr.getSkillGuide();
  6326. console.log('zh:startGame guide=' + guide);
  6327. xGame.common.temSelfLevel = 0;
  6328. if (guide == 0) {
  6329. needCoin = 0;
  6330. xGame.common.temSelfLevel = 100;
  6331. }
  6332. if (DataMgr.coinEnough(needCoin)) {
  6333. DataMgr.setCoin(-needCoin);
  6334. xGame.common.curPlayerSkillType = this.index;
  6335. if (guide == 0)
  6336. xGame.common.curPlayerSkillType = 0;
  6337. console.log('zh: skilldisplay 1');
  6338. xGame.uiMgr.Show(UIGame);
  6339. xGame.uiMgr.Hide(UIMain);
  6340. xGame.uiMgr.Show(UIMatching, () => {
  6341. xGame.common.gameUI.ui.alpha = 1;
  6342. xGame.common.gameUI.startGame();
  6343. xGame.uiMgr.Hide(UISkill);
  6344. });
  6345. this.logEventForRod_start();
  6346. }
  6347. else {
  6348. console.log('zh: skilldisplay 2');
  6349. xGame.uiMgr.Show(UIAddProp, 0);
  6350. Moyu.sendDataEvent("AddCoinVideo");
  6351. }
  6352. }
  6353. logEventForRod_start() {
  6354. let gfmsIdx = xGame.common.curPlayerSkillType;
  6355. console.log('zh:选择的技能=' + gfmsIdx);
  6356. let gfmc = 'Skyfall Shot';
  6357. if (gfmsIdx == 0) {
  6358. gfmc = 'Skyfall Shot';
  6359. }
  6360. if (gfmsIdx == 1) {
  6361. gfmc = 'Surging break';
  6362. }
  6363. if (gfmsIdx == 2) {
  6364. gfmc = 'Frost Lock';
  6365. }
  6366. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6367. let jsonStr = {
  6368. "count": 0,
  6369. "name": gfmc
  6370. };
  6371. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6372. const d = LocalStorageManager.getItem(keyStr);
  6373. jsonStr.count = d.count + 1;
  6374. LocalStorageManager.setItem(keyStr, jsonStr);
  6375. }
  6376. else {
  6377. LocalStorageManager.setItem(keyStr, jsonStr);
  6378. }
  6379. const reqStr = JSON.stringify(jsonStr);
  6380. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6381. }
  6382. }
  6383. class UISkill extends UIBase {
  6384. constructor() {
  6385. super();
  6386. this.skillData = [];
  6387. }
  6388. onConstructor() {
  6389. this.ui = ui_UISkill.createInstance();
  6390. this.contentPane = this.ui;
  6391. this.isEject = false;
  6392. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6393. this.initSkillData();
  6394. console.log('zh:aaaaaa1111111111');
  6395. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6396. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6397. console.log('zh:aaaaaa22222222');
  6398. this.displayList = [];
  6399. this.ui.skillNode.skillList.numItems = 3;
  6400. this.addUIClick(this.ui, this.interuptSecretary);
  6401. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6402. this.ui.talkNode.visible = false;
  6403. if (Moyu.isKs)
  6404. this.ui.closeNode.closeBtn.x += 100;
  6405. }
  6406. show() {
  6407. super.show();
  6408. this.playSecretaryIdle();
  6409. this.moneyNode.ui.c1.selectedIndex = 1;
  6410. Laya.timer.clearAll(this);
  6411. xGame.soundMgr.playSound("s_start");
  6412. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6413. let guide = DataMgr.getSkillGuide();
  6414. this.ui.guideNode.visible = guide == 0;
  6415. let item = this.getSkillItemByUIIndex(0);
  6416. if (guide == 0) {
  6417. item.ui.c1.selectedIndex = 1;
  6418. }
  6419. else {
  6420. item.ui.c1.selectedIndex = 0;
  6421. }
  6422. this.ui.guideNode.guideBtn.visible = guide == 0;
  6423. for (let index = 0; index < this.displayList.length; index++) {
  6424. this.displayList[index].checkTry();
  6425. }
  6426. }
  6427. getSkillItemByUIIndex(cur) {
  6428. for (let index = 0; index < this.displayList.length; index++) {
  6429. if (this.displayList[index].index == cur) {
  6430. return this.displayList[index];
  6431. }
  6432. }
  6433. }
  6434. enterGuideLevel() {
  6435. let item = this.getSkillItemByUIIndex(0);
  6436. item.startGame();
  6437. if (DataMgr.getNewUser())
  6438. Moyu.sendDataEvent("gameStart1");
  6439. }
  6440. initSkillData() {
  6441. this.skillData = [];
  6442. let nameList = xGame.common.skillNameList;
  6443. let iconList = xGame.common.skillIconList;
  6444. let describeList = [
  6445. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6446. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6447. "The power of frost descends—freezing the flow and taking full control of the game!"
  6448. ];
  6449. console.log('zh:initSkillData 111111111');
  6450. let data;
  6451. for (let index = 0; index < nameList.length; index++) {
  6452. data = {};
  6453. data.name = nameList[index];
  6454. data.icon = iconList[index];
  6455. data.describe = describeList[index];
  6456. data.index = index;
  6457. this.skillData.push(data);
  6458. }
  6459. }
  6460. updateSkillItem(index, target) {
  6461. if (this.displayList[index] == null) {
  6462. let uiIndex;
  6463. switch (index) {
  6464. case 0:
  6465. uiIndex = 1;
  6466. break;
  6467. case 1:
  6468. uiIndex = 0;
  6469. break;
  6470. case 2:
  6471. uiIndex = 2;
  6472. break;
  6473. case 3:
  6474. uiIndex = 3;
  6475. break;
  6476. default:
  6477. break;
  6478. }
  6479. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6480. this.displayList.push(temp);
  6481. }
  6482. }
  6483. playSecretaryIdle() {
  6484. let parent = this.ui.secretary.displayObject;
  6485. parent.destroyChildren();
  6486. let xx = this.ui.secretary.width / 2;
  6487. let yy = this.ui.secretary.height;
  6488. let scale = xGame.common.getSecretaryScale();
  6489. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6490. xGame.common.secretary.play(data, 0, true, parent);
  6491. }
  6492. returnUIMain() {
  6493. this.hide();
  6494. xGame.common.stopGirlPop(this.ui.talkNode);
  6495. xGame.uiMgr.Show(UIMain);
  6496. }
  6497. interuptSecretary() {
  6498. Laya.timer.clearAll(this);
  6499. this.playSecretaryRandomSound();
  6500. }
  6501. playSecretaryRandomSound() {
  6502. if (this.isHide)
  6503. return;
  6504. let time = xGame.common.randomNum(45000, 60000);
  6505. Laya.timer.once(time, this, () => {
  6506. if (this.isHide)
  6507. return;
  6508. let index = xGame.common.randomNum(4, 7);
  6509. xGame.soundMgr.playSound("s_main0" + index);
  6510. let words = 1;
  6511. switch (index) {
  6512. case 4:
  6513. words = 5;
  6514. break;
  6515. case 5:
  6516. words = 3;
  6517. break;
  6518. case 6:
  6519. words = 6;
  6520. break;
  6521. case 7:
  6522. words = 7;
  6523. break;
  6524. default:
  6525. break;
  6526. }
  6527. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6528. this.playSecretaryRandomSound();
  6529. });
  6530. }
  6531. }
  6532. UISkill.uiName = "UISkill";
  6533. class ui_UIModeSelection extends fgui.GComponent {
  6534. static createInstance() {
  6535. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6536. }
  6537. onConstruct() {
  6538. this.n19 = (this.getChild("n19"));
  6539. this.closeBtn = (this.getChild("closeBtn"));
  6540. this.myNode = (this.getChild("myNode"));
  6541. this.t0 = this.getTransition("t0");
  6542. }
  6543. }
  6544. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6545. class UIModeSelection extends UIBase {
  6546. constructor() {
  6547. super();
  6548. }
  6549. onConstructor() {
  6550. this.ui = ui_UIModeSelection.createInstance();
  6551. this.contentPane = this.ui;
  6552. this.isEject = false;
  6553. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6554. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6555. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6556. this.addUIClick(this.ui.closeBtn, this.hide);
  6557. this.peopleArr = [65, 990, 580];
  6558. this.peopleOffest = [5, 10, 10];
  6559. }
  6560. show(callback) {
  6561. this.updateSelf();
  6562. super.show();
  6563. this.ui.t0.play();
  6564. this.callback = callback;
  6565. }
  6566. updateSelf() {
  6567. let cfg = cfgTable.modeselectData;
  6568. for (let index = 1; index <= 3; index++) {
  6569. let node = this.ui.myNode["type" + index];
  6570. node.need.text = cfg[index].need;
  6571. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6572. node.peopleTxt.text = this.getRandPeople(index - 1);
  6573. }
  6574. }
  6575. enterGame(type) {
  6576. console.log('zh: 进入经典模式 type: ' + type);
  6577. xGame.common.classicRoomType = type;
  6578. let cfg = cfgTable.modeselectData[type];
  6579. let need = cfg.need;
  6580. xGame.common.passAwardCoin = cfg.award;
  6581. if (DataMgr.coinEnough(need)) {
  6582. DataMgr.setCoin(-need);
  6583. this.ui.myNode["type" + type].t0.play();
  6584. Laya.timer.once(200, this, () => {
  6585. this.callback && this.callback();
  6586. });
  6587. this.logEventForClassic_start();
  6588. }
  6589. else {
  6590. Moyu.sendDataEvent("AddCoinVideo");
  6591. xGame.uiMgr.Show(UIAddProp, 0);
  6592. }
  6593. }
  6594. getRandPeople(index) {
  6595. let rand = this.peopleOffest[index];
  6596. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6597. }
  6598. logEventForClassic_start() {
  6599. let rtype = xGame.common.classicRoomType;
  6600. let msmc = '';
  6601. if (rtype == 1) {
  6602. msmc = 'beginner';
  6603. }
  6604. if (rtype == 2) {
  6605. msmc = 'expert';
  6606. }
  6607. if (rtype == 3) {
  6608. msmc = 'master';
  6609. }
  6610. let keyStr = 'sjmd_classic_start_' + rtype;
  6611. let jsonStr = {
  6612. "difficulty": msmc,
  6613. "classic_count": 1,
  6614. "difficulty_count": 1
  6615. };
  6616. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6617. const d = LocalStorageManager.getItem(keyStr);
  6618. jsonStr.classic_count = d.classic_count + 1;
  6619. jsonStr.difficulty_count = d.difficulty_count + 1;
  6620. LocalStorageManager.setItem(keyStr, jsonStr);
  6621. }
  6622. else {
  6623. LocalStorageManager.setItem(keyStr, jsonStr);
  6624. }
  6625. const reqStr = JSON.stringify(jsonStr);
  6626. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6627. }
  6628. }
  6629. UIModeSelection.uiName = "UIModeSelection";
  6630. class ui_UIReg extends fgui.GComponent {
  6631. static createInstance() {
  6632. return (fgui.UIPackage.createObject("game", "UIReg"));
  6633. }
  6634. onConstruct() {
  6635. this.n38 = (this.getChild("n38"));
  6636. this.n9 = (this.getChild("n9"));
  6637. this.n14 = (this.getChild("n14"));
  6638. this.n15 = (this.getChild("n15"));
  6639. this.n34 = (this.getChild("n34"));
  6640. this.closeBtn = (this.getChild("closeBtn"));
  6641. this.lab_tip = (this.getChild("lab_tip"));
  6642. this.n43 = (this.getChild("n43"));
  6643. this.txt_ua = (this.getChild("txt_ua"));
  6644. this.n44 = (this.getChild("n44"));
  6645. this.txt_up1 = (this.getChild("txt_up1"));
  6646. this.n45 = (this.getChild("n45"));
  6647. this.txt_up2 = (this.getChild("txt_up2"));
  6648. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6649. this.btn_reg = (this.getChild("btn_reg"));
  6650. this.n50 = (this.getChild("n50"));
  6651. }
  6652. }
  6653. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6654. class ui_UILogin extends fgui.GComponent {
  6655. static createInstance() {
  6656. return (fgui.UIPackage.createObject("game", "UILogin"));
  6657. }
  6658. onConstruct() {
  6659. this.c1 = this.getController("c1");
  6660. this.n18 = (this.getChild("n18"));
  6661. this.n7 = (this.getChild("n7"));
  6662. this.n5 = (this.getChild("n5"));
  6663. this.n6 = (this.getChild("n6"));
  6664. this.closeBtn = (this.getChild("closeBtn"));
  6665. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6666. this.btn_login = (this.getChild("btn_login"));
  6667. this.n30 = (this.getChild("n30"));
  6668. this.n31 = (this.getChild("n31"));
  6669. this.txt_up = (this.getChild("txt_up"));
  6670. this.n32 = (this.getChild("n32"));
  6671. this.txt_ua = (this.getChild("txt_ua"));
  6672. }
  6673. }
  6674. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6675. class UILogin extends UIBase {
  6676. constructor() {
  6677. super();
  6678. }
  6679. onConstructor() {
  6680. this.ui = ui_UILogin.createInstance();
  6681. this.contentPane = this.ui;
  6682. this.isEject = false;
  6683. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6684. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6685. this.addUIClick(this.ui.btn_login, this.userLogin);
  6686. }
  6687. show() {
  6688. super.show();
  6689. this.x = (Laya.stage.width - this.width) / 2;
  6690. this.y = (Laya.stage.height - this.height) / 2;
  6691. }
  6692. closeSelf() {
  6693. this.hide();
  6694. }
  6695. userLogin() {
  6696. let ua = this.ui.txt_ua.text;
  6697. let up = this.ui.txt_up.text;
  6698. if (ua && up) {
  6699. let reqData = JSON.stringify({
  6700. username: ua.trim(),
  6701. password: up.trim(),
  6702. fromMark: 'app_game'
  6703. });
  6704. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6705. try {
  6706. console.log('zh:res = ' + JSON.stringify(res));
  6707. let code = res.code;
  6708. let msg = res.msg;
  6709. if (code == 200) {
  6710. let keyStr = 'userInfo';
  6711. let jsonStr = {
  6712. "username": res.username,
  6713. "token": res.token
  6714. };
  6715. LocalStorageManager.setItem(keyStr, jsonStr);
  6716. xGame.uiMgr.Show(UIMsg, msg);
  6717. this.closeSelf();
  6718. }
  6719. else {
  6720. xGame.uiMgr.Show(UIMsg, msg);
  6721. }
  6722. }
  6723. catch (error) {
  6724. console.log('error=' + error);
  6725. alert(error);
  6726. }
  6727. finally {
  6728. }
  6729. });
  6730. }
  6731. else {
  6732. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6733. }
  6734. }
  6735. gotoRegPage() {
  6736. this.closeSelf();
  6737. xGame.uiMgr.Show(UIReg);
  6738. }
  6739. }
  6740. UILogin.uiName = "UILogin";
  6741. class UIReg extends UIBase {
  6742. constructor() {
  6743. super();
  6744. }
  6745. onConstructor() {
  6746. this.ui = ui_UIReg.createInstance();
  6747. this.contentPane = this.ui;
  6748. this.isEject = false;
  6749. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6750. this.addUIClick(this.ui.btn_reg, this.regUser);
  6751. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6752. }
  6753. show() {
  6754. super.show();
  6755. this.x = (Laya.stage.width - this.width) / 2;
  6756. this.y = (Laya.stage.height - this.height) / 2;
  6757. }
  6758. closeSelf() {
  6759. this.hide();
  6760. }
  6761. regUser() {
  6762. this.ui.lab_tip.visible = false;
  6763. let ua = this.ui.txt_ua.text;
  6764. let up1 = this.ui.txt_up1.text;
  6765. let up2 = this.ui.txt_up2.text;
  6766. if (ua && up1 && up2 && up1 == up2) {
  6767. let reqData = JSON.stringify({
  6768. username: ua.trim(),
  6769. password: up1.trim(),
  6770. fromMark: 'app_game'
  6771. });
  6772. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6773. try {
  6774. console.log('zh:res = ' + JSON.stringify(res));
  6775. let code = res.code;
  6776. let msg = res.msg;
  6777. xGame.uiMgr.Show(UIMsg, msg);
  6778. if (code == 200) {
  6779. this.ui.lab_tip.color = "#FFFFFF";
  6780. xGame.uiMgr.Show(UIMsg, msg);
  6781. this.closeSelf();
  6782. }
  6783. else {
  6784. this.ui.lab_tip.color = "#FF0000";
  6785. xGame.uiMgr.Show(UIMsg, msg);
  6786. }
  6787. }
  6788. catch (error) {
  6789. console.log('error=' + error);
  6790. alert(error);
  6791. }
  6792. finally {
  6793. }
  6794. });
  6795. }
  6796. else {
  6797. if (up1 != up2) {
  6798. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6799. }
  6800. else {
  6801. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6802. }
  6803. }
  6804. }
  6805. gotoLogin() {
  6806. this.closeSelf();
  6807. xGame.uiMgr.Show(UILogin);
  6808. }
  6809. }
  6810. UIReg.uiName = "UIReg";
  6811. class ui_UIFuli1 extends fgui.GComponent {
  6812. static createInstance() {
  6813. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  6814. }
  6815. onConstruct() {
  6816. this.n1 = (this.getChild("n1"));
  6817. this.n2 = (this.getChild("n2"));
  6818. }
  6819. }
  6820. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  6821. class UIFuli1 extends UIBase {
  6822. constructor() {
  6823. super();
  6824. }
  6825. onConstructor() {
  6826. this.ui = ui_UIFuli1.createInstance();
  6827. this.contentPane = this.ui;
  6828. this.isEject = false;
  6829. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  6830. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  6831. }
  6832. show() {
  6833. super.show();
  6834. this.x = (Laya.stage.width - this.width) / 2;
  6835. this.y = (Laya.stage.height - this.height) / 2;
  6836. }
  6837. closeSelf() {
  6838. this.hide();
  6839. }
  6840. gotoBuy() {
  6841. this.hide();
  6842. }
  6843. }
  6844. UIFuli1.uiName = "UIFuli1";
  6845. class ui_UIFuli2 extends fgui.GComponent {
  6846. static createInstance() {
  6847. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  6848. }
  6849. onConstruct() {
  6850. this.n1 = (this.getChild("n1"));
  6851. this.n0 = (this.getChild("n0"));
  6852. }
  6853. }
  6854. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  6855. class UIFuli2 extends UIBase {
  6856. constructor() {
  6857. super();
  6858. }
  6859. onConstructor() {
  6860. this.ui = ui_UIFuli2.createInstance();
  6861. this.contentPane = this.ui;
  6862. this.isEject = false;
  6863. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  6864. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  6865. }
  6866. show() {
  6867. super.show();
  6868. this.x = (Laya.stage.width - this.width) / 2;
  6869. this.y = (Laya.stage.height - this.height) / 2;
  6870. }
  6871. closeSelf() {
  6872. this.hide();
  6873. }
  6874. gotoBuy() {
  6875. this.hide();
  6876. }
  6877. }
  6878. UIFuli2.uiName = "UIFuli2";
  6879. class ui_UIGetAward extends fgui.GComponent {
  6880. static createInstance() {
  6881. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6882. }
  6883. onConstruct() {
  6884. this.n4 = (this.getChild("n4"));
  6885. this.n0 = (this.getChild("n0"));
  6886. this.myList = (this.getChild("myList"));
  6887. this.n1 = (this.getChild("n1"));
  6888. this.eftNode = (this.getChild("eftNode"));
  6889. this.btnNode = (this.getChild("btnNode"));
  6890. this.t0 = this.getTransition("t0");
  6891. }
  6892. }
  6893. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6894. class UIGetAward extends UIBase {
  6895. constructor() {
  6896. super();
  6897. this.showTriple = true;
  6898. }
  6899. onConstructor() {
  6900. this.ui = ui_UIGetAward.createInstance();
  6901. this.contentPane = this.ui;
  6902. this.isEject = false;
  6903. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6904. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6905. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6906. }
  6907. show(arr, showTriple, callback) {
  6908. super.show();
  6909. this.ui.t0.play();
  6910. this.ui.eftNode.visible = true;
  6911. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6912. this.ui.eftNode.visible = false;
  6913. }), 1, 0, 0, 0.9);
  6914. this.awardArr = arr;
  6915. this.showTriple = showTriple;
  6916. this.callback = callback;
  6917. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6918. this.ui.myList.numItems = arr.length;
  6919. xGame.soundMgr.playSound("getaward");
  6920. }
  6921. updateSelf(index, obj) {
  6922. let temp = this.awardArr[index];
  6923. let icon = this.getIcon(temp.type);
  6924. let str = icon;
  6925. if (temp.type > 2) {
  6926. str = "s" + icon;
  6927. }
  6928. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6929. obj.myIcon.rotation = 0;
  6930. obj.numTxt.text = temp.num + "";
  6931. obj.numTxt.visible = temp.type > 2 ? false : true;
  6932. obj.nameTxt.text = this.getNameStr(temp.type);
  6933. }
  6934. renderItem(index, obj) {
  6935. this.updateSelf(index, obj);
  6936. }
  6937. tripleGetAward() {
  6938. console.log('zh:qjff_AD_for_uigetAward');
  6939. if (Laya.Browser.onAndroid) {
  6940. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6941. if (!boo) {
  6942. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6943. return;
  6944. }
  6945. }
  6946. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6947. }
  6948. else {
  6949. console.log('zh:AD 失败,直接发放奖励');
  6950. this.qjff_AD_for_uigetAward();
  6951. }
  6952. }
  6953. qjff_AD_for_uigetAward() {
  6954. this.getAward(3);
  6955. }
  6956. normalGetAward() {
  6957. if (PlatMgr.isMisVideo())
  6958. this.tripleGetAward();
  6959. else
  6960. this.getAward();
  6961. }
  6962. getAward(times = 1) {
  6963. this.hide();
  6964. for (let index = 0; index < this.awardArr.length; index++) {
  6965. this.awardArr[index].num *= times;
  6966. }
  6967. this.callback && this.callback(times != 1);
  6968. }
  6969. getIcon(type) {
  6970. switch (type) {
  6971. case Prop.diamond:
  6972. return "ty_zs";
  6973. case Prop.coin:
  6974. return "ty_jb";
  6975. case Prop.gan1:
  6976. return "qg1";
  6977. case Prop.gan2:
  6978. return "qg2";
  6979. case Prop.gan3:
  6980. return "qg3";
  6981. case Prop.gan4:
  6982. return "qg4";
  6983. default:
  6984. break;
  6985. }
  6986. }
  6987. getNameStr(type) {
  6988. switch (type) {
  6989. case Prop.diamond:
  6990. return "Diamond";
  6991. case Prop.coin:
  6992. return "Coins";
  6993. case Prop.gan1:
  6994. case Prop.gan2:
  6995. case Prop.gan3:
  6996. case Prop.gan4:
  6997. return cfgTable.ballrodData[type - 1].name;
  6998. default:
  6999. break;
  7000. }
  7001. }
  7002. }
  7003. UIGetAward.uiName = "UIGetAward";
  7004. class ui_UIRepentProp extends fgui.GComponent {
  7005. static createInstance() {
  7006. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7007. }
  7008. onConstruct() {
  7009. this.c1 = this.getController("c1");
  7010. this.n11 = (this.getChild("n11"));
  7011. this.regretNode = (this.getChild("regretNode"));
  7012. this.helpLineNode = (this.getChild("helpLineNode"));
  7013. this.t0 = this.getTransition("t0");
  7014. }
  7015. }
  7016. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7017. class UIRepentProp extends UIBase {
  7018. constructor() {
  7019. super();
  7020. this.viewType = 0;
  7021. this.regretType = 0;
  7022. }
  7023. onConstructor() {
  7024. this.ui = ui_UIRepentProp.createInstance();
  7025. this.contentPane = this.ui;
  7026. this.isEject = false;
  7027. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7028. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7029. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7030. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7031. }
  7032. show(viewType, regretType, callback) {
  7033. PlatMgr.showInsert(true);
  7034. this.viewType = viewType;
  7035. this.regretType = regretType;
  7036. this.callback = callback;
  7037. super.show();
  7038. this.ui.t0.play();
  7039. this.ui.c1.selectedIndex = this.viewType;
  7040. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7041. if (this.viewType == 0) {
  7042. let guide = DataMgr.getGuideHelpLine();
  7043. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7044. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7045. }
  7046. xGame.common.gameMgr.gamePause = true;
  7047. }
  7048. hideSelf() {
  7049. xGame.common.gameMgr.gamePause = false;
  7050. this.callback && this.callback(false);
  7051. this.hide();
  7052. }
  7053. videoRegret() {
  7054. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7055. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7056. }
  7057. else {
  7058. console.log('zh:AD 失败,直接发放奖励');
  7059. this.qjff_AD_for_UIrepentProp_videoRegret();
  7060. }
  7061. }
  7062. qjff_AD_for_UIrepentProp_videoRegret() {
  7063. this.callback && this.callback(true);
  7064. this.hideSelf();
  7065. }
  7066. videoAddHelpLine() {
  7067. let guide = DataMgr.getGuideHelpLine();
  7068. if (guide == 0) {
  7069. this.callback && this.callback(true);
  7070. this.hideSelf();
  7071. DataMgr.setGuideHelpLine();
  7072. xGame.common.gameUI.ui.guideNode.visible = false;
  7073. }
  7074. else {
  7075. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7076. if (Laya.Browser.onAndroid) {
  7077. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7078. if (!boo) {
  7079. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7080. return;
  7081. }
  7082. }
  7083. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7084. }
  7085. else {
  7086. console.log('zh:AD 失败,直接发放奖励');
  7087. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7088. }
  7089. }
  7090. }
  7091. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7092. this.callback && this.callback(true);
  7093. this.hideSelf();
  7094. }
  7095. }
  7096. UIRepentProp.uiName = "UIRepentProp";
  7097. class UIMain extends UIBase {
  7098. constructor() {
  7099. super();
  7100. this.firstEnter = true;
  7101. }
  7102. nativeCallJs(msg) {
  7103. let t = msg;
  7104. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7105. switch (t) {
  7106. case 'qjff_chouJiang':
  7107. let dui = xGame.uiMgr.getUI(UIDraw);
  7108. dui.qjff_chouJiang();
  7109. break;
  7110. case 'qjff_AD_for_uisign':
  7111. let dui2 = xGame.uiMgr.getUI(UISign);
  7112. dui2.qjff_AD_for_uisign();
  7113. break;
  7114. case 'qjff_AD_for_uitry':
  7115. let dui3 = xGame.uiMgr.getUI(UITry);
  7116. dui3.qjff_AD_for_uitry();
  7117. break;
  7118. case 'qjff_AD_for_uipower':
  7119. let dui4 = xGame.uiMgr.getUI(UIPower);
  7120. dui4.qjff_AD_for_uipower();
  7121. break;
  7122. case 'qjff_AD_for_uigetAward':
  7123. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7124. dui5.qjff_AD_for_uigetAward();
  7125. break;
  7126. case 'qjff_AD_for_uiGameEnd':
  7127. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7128. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7129. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7130. break;
  7131. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7132. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7133. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7134. break;
  7135. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7136. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7137. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7138. break;
  7139. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7140. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7141. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7142. break;
  7143. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7144. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7145. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7146. break;
  7147. case 'qjff_AD_for_UIBOX_onOpenBox':
  7148. let dui11 = xGame.uiMgr.getUI(UIBox);
  7149. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7150. break;
  7151. case 'qjff_AD_for_UIAddCoin':
  7152. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7153. dui12.qjff_AD_for_UIAddCoin();
  7154. break;
  7155. case '111a':
  7156. let dui14 = xGame.uiMgr.getUI(UISign);
  7157. dui14.qjff_AD_for_uisign();
  7158. break;
  7159. case '222a':
  7160. let dui15 = xGame.uiMgr.getUI(UISign);
  7161. dui15.qjff_AD_for_uisign();
  7162. break;
  7163. case '333a':
  7164. let dui16 = xGame.uiMgr.getUI(UISign);
  7165. dui16.qjff_AD_for_uisign();
  7166. break;
  7167. default:
  7168. console.log('zh:未知的方法名字' + t);
  7169. break;
  7170. }
  7171. }
  7172. onConstructor() {
  7173. console.log('zh: UIMain onConstructor');
  7174. this.ui = ui_UIMain.createInstance();
  7175. this.contentPane = this.ui;
  7176. this.isEject = false;
  7177. this.addEvent();
  7178. this.addClickSpine();
  7179. this.settingNode = new SettingNode(this.ui.settingNode);
  7180. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7181. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7182. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7183. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7184. let curUse = DataMgr.getCurSecretary();
  7185. this.changeSecretary(curUse);
  7186. this.ui.talkNode.visible = false;
  7187. let guide = DataMgr.getSkillGuide();
  7188. if (xGame.common.isNewDay && guide == 1) {
  7189. xGame.common.isNewDay = false;
  7190. xGame.soundMgr.playSound("s_main01");
  7191. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7192. console.log("zh:播放小秘书每天语音");
  7193. }
  7194. this.onGetUserInfo();
  7195. this.ui.n83.visible = false;
  7196. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7197. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7198. let ua = d.username;
  7199. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7200. }
  7201. this.c_btn_for_user();
  7202. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7203. }
  7204. Logout() {
  7205. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7206. LocalStorageManager.removeItem(keyForLoginInfo);
  7207. this.freshUser();
  7208. }
  7209. }
  7210. gotoLogin() {
  7211. xGame.uiMgr.Show(UILogin);
  7212. }
  7213. gotoRegUser() {
  7214. xGame.uiMgr.Show(UIReg);
  7215. }
  7216. showFuLi() {
  7217. console.log('zh:福利2');
  7218. xGame.uiMgr.Show(UIFuli1);
  7219. xGame.uiMgr.Show(UIFuli2);
  7220. console.log('zh:福利2222');
  7221. }
  7222. c_btn_for_user() {
  7223. this.ui.n_Logout.visible = false;
  7224. this.ui.n_dengLu.visible = false;
  7225. this.ui.n_zhuCe.visible = false;
  7226. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7227. this.ui.n_Logout.visible = true;
  7228. }
  7229. else {
  7230. this.ui.n_dengLu.visible = true;
  7231. }
  7232. }
  7233. changeSecretary(curUse) {
  7234. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7235. xGame.common.secretary && xGame.common.secretary.dispose();
  7236. this.addSecretarySpine(name);
  7237. }
  7238. addSecretarySpine(name) {
  7239. let spine = new SpineMgr(name, () => {
  7240. this.playSecretaryIdle();
  7241. });
  7242. xGame.common.secretary = spine;
  7243. }
  7244. addClickSpine() {
  7245. let clickSpine = new SpineMgr("dianji", () => {
  7246. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7247. let parent = Laya.stage;
  7248. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7249. clickSpine.play(data, 0, false, parent, (spine) => {
  7250. spine.destroy(true);
  7251. });
  7252. });
  7253. });
  7254. }
  7255. addEvent() {
  7256. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7257. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7258. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7259. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7260. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7261. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7262. this.addUIClick(this.ui, this.interuptSecretary);
  7263. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7264. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7265. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7266. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7267. this.addUIClick(this.ui.signBtn, this.openSignView);
  7268. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7269. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7270. this.addUIClick(this.ui.n_Logout, this.Logout);
  7271. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7272. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7273. this.addUIClick(this.ui.n_fuli, this.showFuLi);
  7274. }
  7275. show(showFailWords) {
  7276. super.show();
  7277. this.moneyNode.ui.c1.selectedIndex = 1;
  7278. this.playSecretaryIdle();
  7279. xGame.soundMgr.playMusic("caromhall01", 0);
  7280. Laya.timer.clearAll(this);
  7281. this.playSecretaryRandomSound();
  7282. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7283. if (showFailWords) {
  7284. console.log('zh:uimain.ts ');
  7285. setTimeout(() => {
  7286. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7287. let words = -1;
  7288. if (str == "s_main02") {
  7289. words = 2;
  7290. }
  7291. else {
  7292. words = 3;
  7293. }
  7294. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7295. xGame.soundMgr.playSound(str);
  7296. }, 300);
  7297. }
  7298. this.showGuide();
  7299. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7300. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7301. let guide = DataMgr.getSkillGuide();
  7302. if (guide == 1) {
  7303. let randTime = xGame.common.randomNum(300, 800);
  7304. if (this.firstEnter) {
  7305. console.log("zh: firstEnter");
  7306. this.firstEnter = false;
  7307. randTime += 900;
  7308. }
  7309. else {
  7310. console.log("zh: no firstEnter");
  7311. }
  7312. Laya.timer.once(randTime, this, () => {
  7313. xGame.common.autoPopUIView();
  7314. });
  7315. }
  7316. }
  7317. checkActive(show) {
  7318. }
  7319. showGuide() {
  7320. let guide = DataMgr.getSkillGuide();
  7321. this.ui.guideBtn.visible = guide == 0;
  7322. this.ui.enterGuide.visible = false;
  7323. this.ui.secretaryGuide.visible = guide == 0;
  7324. if (guide == 0) {
  7325. console.log("zh:显示引导");
  7326. xGame.soundMgr.playSound("s_guide");
  7327. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7328. }
  7329. else {
  7330. console.log("zh:不需要显示引导");
  7331. }
  7332. }
  7333. ensureSecretary() {
  7334. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7335. this.ui.secretaryGuide.visible = false;
  7336. this.ui.enterGuide.visible = true;
  7337. this.ui.wordsNode.t0.play();
  7338. if (DataMgr.getNewUser())
  7339. Moyu.sendDataEvent("gameReady");
  7340. }
  7341. playSecretaryIdle() {
  7342. let parent = this.ui.secretary.displayObject;
  7343. parent.destroyChildren();
  7344. let xx = this.ui.secretary.width / 2;
  7345. let yy = this.ui.secretary.height;
  7346. let scale = xGame.common.getSecretaryScale();
  7347. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7348. xGame.common.secretary.play(data, 0, true, parent);
  7349. }
  7350. startGame(type) {
  7351. if (!this.isReadyForLoadNetSource()) {
  7352. return;
  7353. }
  7354. xGame.common.gameMode = type;
  7355. Moyu.sendDataEvent("PlayGame", { type: type });
  7356. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7357. switch (xGame.common.gameMode) {
  7358. case GameMode.classic:
  7359. console.log('zh:进入经典模式111111111');
  7360. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7361. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7362. console.log('zh:classic db_over_lev=', db_over_lev);
  7363. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7364. console.log('zh:判断是否可以玩该模式classic =NO');
  7365. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7366. xGame.uiMgr.Show(UIMsg, tipStr);
  7367. return;
  7368. }
  7369. else {
  7370. console.log('zh:可以玩该模式classic 66666666666666');
  7371. this.beginGame();
  7372. }
  7373. }
  7374. else {
  7375. console.log('zh:不需要判断是否可以玩该classic');
  7376. let challengeTimes = DataMgr.getChallengeTimes();
  7377. if (challengeTimes == 0) {
  7378. xGame.uiMgr.Show(UIInvitation);
  7379. }
  7380. else {
  7381. this.beginGame();
  7382. }
  7383. break;
  7384. }
  7385. case GameMode.bigMove:
  7386. console.error('zh:bigMove check');
  7387. let guide = DataMgr.getSkillGuide();
  7388. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7389. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7390. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7391. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7392. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7393. xGame.uiMgr.Show(UIMsg, tipStr);
  7394. return;
  7395. }
  7396. else {
  7397. console.log('zh:可以玩该模式 bigMove');
  7398. this.beginGame();
  7399. if (DataMgr.getNewUser())
  7400. Moyu.sendDataEvent("gameStart0");
  7401. }
  7402. }
  7403. else {
  7404. this.beginGame();
  7405. if (DataMgr.getNewUser())
  7406. Moyu.sendDataEvent("gameStart0");
  7407. }
  7408. break;
  7409. default:
  7410. console.error('zh:未知错误!!!!');
  7411. break;
  7412. }
  7413. }
  7414. beginGame(isNice = false) {
  7415. console.log('zh:beginGame ');
  7416. let guide = DataMgr.getSkillGuide();
  7417. if (guide == 1) {
  7418. console.log('zh:非新手引导,showInternAd ');
  7419. JSBridgeUtils.instance.showInternAd('beginGame');
  7420. }
  7421. else {
  7422. console.log('zh:新手引导,不显示AD ');
  7423. }
  7424. console.log('zh:beginGame 2 go');
  7425. if (xGame.common.gameMode == GameMode.classic) {
  7426. if (isNice) {
  7427. this.enterClassic();
  7428. }
  7429. else {
  7430. xGame.uiMgr.Show(UIModeSelection, () => {
  7431. console.log('zh:BBBBBBBBBBBBBBB');
  7432. this.enterClassic();
  7433. });
  7434. }
  7435. }
  7436. else if (xGame.common.gameMode == GameMode.bigMove) {
  7437. this.ui.enterGuide.visible = false;
  7438. xGame.uiMgr.Show(UISkill);
  7439. }
  7440. }
  7441. enterClassic() {
  7442. xGame.uiMgr.Show(UIGame);
  7443. xGame.uiMgr.Show(UIMatching, () => {
  7444. if (!this.isHide)
  7445. this.hide();
  7446. xGame.common.gameUI.ui.alpha = 1;
  7447. xGame.common.gameUI.startGame();
  7448. xGame.uiMgr.Hide(UIGameEnd);
  7449. });
  7450. }
  7451. startGlobal() {
  7452. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7453. }
  7454. startWeekly() {
  7455. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7456. }
  7457. zhouSaiMonth() {
  7458. console.log('zh: zhouSaiMonth 被调用');
  7459. }
  7460. isReadyForLoadNetSource() {
  7461. let reqCount = xGame.cfgMgr.httpReqCount;
  7462. let ok = xGame.cfgMgr.httpReqOkCount;
  7463. if (reqCount > ok) {
  7464. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7465. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7466. Laya.timer.once(5000, this, () => {
  7467. xGame.cfgMgr.getConfigFromServer();
  7468. });
  7469. return false;
  7470. }
  7471. return true;
  7472. }
  7473. startPlaceBall() {
  7474. if (!this.isReadyForLoadNetSource()) {
  7475. return;
  7476. }
  7477. xGame.uiMgr.Show(UILevelDisplay);
  7478. }
  7479. hide() {
  7480. console.log('zh:uimain hide ...');
  7481. super.hide();
  7482. xGame.common.stopGirlPop(this.ui.talkNode);
  7483. }
  7484. onGetUserInfo(force = false) {
  7485. if (Moyu.isWx) {
  7486. let info = Moyu.getSystemInfo();
  7487. if (info)
  7488. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7489. }
  7490. else {
  7491. Moyu.initUser(this, this.freshUser, force);
  7492. }
  7493. this.freshUser();
  7494. }
  7495. freshUser() {
  7496. let user = Moyu.getUserInfo();
  7497. if (!user.isAuth) {
  7498. user.headIcon = 'res/ty_touxiang.png';
  7499. }
  7500. else {
  7501. DataMgr.upRankData();
  7502. }
  7503. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7504. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7505. let keyStr = keyForLoginInfo;
  7506. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7507. const d = LocalStorageManager.getItem(keyStr);
  7508. let ua = d.username;
  7509. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7510. }
  7511. else {
  7512. }
  7513. this.c_btn_for_user();
  7514. }
  7515. interuptSecretary() {
  7516. Laya.timer.clearAll(this);
  7517. this.playSecretaryRandomSound();
  7518. }
  7519. playSecretaryRandomSound() {
  7520. if (this.isHide)
  7521. return;
  7522. let time = xGame.common.randomNum(45000, 60000);
  7523. Laya.timer.once(time, this, () => {
  7524. if (this.isHide)
  7525. return;
  7526. let index = xGame.common.randomNum(4, 7);
  7527. xGame.soundMgr.playSound("s_main0" + index);
  7528. let words = 1;
  7529. switch (index) {
  7530. case 4:
  7531. words = 5;
  7532. break;
  7533. case 5:
  7534. words = 3;
  7535. break;
  7536. case 6:
  7537. words = 6;
  7538. break;
  7539. case 7:
  7540. words = 7;
  7541. break;
  7542. default:
  7543. break;
  7544. }
  7545. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7546. this.playSecretaryRandomSound();
  7547. });
  7548. }
  7549. openSecretaryView() {
  7550. xGame.uiMgr.Show(UISecretary);
  7551. Moyu.sendDataEvent("secretary");
  7552. }
  7553. openShopView() {
  7554. xGame.uiMgr.Show(UIShop, 0);
  7555. }
  7556. openSignView() {
  7557. xGame.uiMgr.Show(UISign);
  7558. }
  7559. openDrawView() {
  7560. xGame.uiMgr.Show(UIDraw);
  7561. }
  7562. openRanking() {
  7563. console.log('zh:phb openRanking');
  7564. xGame.uiMgr.Show(UIRanking);
  7565. Moyu.sendDataEvent("rankingList");
  7566. }
  7567. }
  7568. UIMain.uiName = "UIMain";
  7569. class UIGameEnd extends UIBase {
  7570. constructor() {
  7571. super();
  7572. this.success = false;
  7573. this.awardCoinNum = 1000;
  7574. this.awardDiamondNum = 10;
  7575. }
  7576. onConstructor() {
  7577. this.ui = ui_UIGameEnd.createInstance();
  7578. this.contentPane = this.ui;
  7579. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7580. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7581. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7582. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7583. this.ui.talkNode.visible = false;
  7584. if (Moyu.isKs)
  7585. this.ui.closeNode.closeBtn.x += 100;
  7586. }
  7587. updateType() {
  7588. switch (xGame.common.gameMode) {
  7589. case GameMode.classic:
  7590. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7591. this.ui.coinNode.visible = this.success;
  7592. if (!this.success) {
  7593. Laya.timer.once(500, this, () => {
  7594. xGame.uiMgr.Show(UIAddCoin);
  7595. });
  7596. }
  7597. else {
  7598. this.logEventForClassic_win();
  7599. }
  7600. this.logEventForClassic_complete();
  7601. this.ui.isGetAward.visible = false;
  7602. this.ui.leftBtn.c1.selectedIndex = 3;
  7603. this.ui.rightBtn.c1.selectedIndex = 0;
  7604. this.moneyNode.ui.c1.selectedIndex = 1;
  7605. break;
  7606. case GameMode.bigMove:
  7607. console.log('zh:招法模式 aaaaaa bigMove');
  7608. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7609. this.ui.coinNode.visible = this.success;
  7610. if (xGame.common.gameMode == GameMode.bigMove) {
  7611. if (this.success) {
  7612. DataMgr.setSkillSuccessTimes(1, true);
  7613. DataMgr.setSkillAccTimes(1);
  7614. }
  7615. else {
  7616. DataMgr.setSkillSuccessTimes(0, false);
  7617. }
  7618. }
  7619. this.logEventForRod_complete_N();
  7620. if (!this.success) {
  7621. Laya.timer.once(500, this, () => {
  7622. xGame.uiMgr.Show(UIAddCoin);
  7623. });
  7624. }
  7625. else {
  7626. this.logEventForRod_win();
  7627. }
  7628. this.ui.isGetAward.visible = false;
  7629. this.ui.leftBtn.c1.selectedIndex = 3;
  7630. this.ui.rightBtn.c1.selectedIndex = 0;
  7631. this.moneyNode.ui.c1.selectedIndex = 1;
  7632. break;
  7633. case GameMode.placeBall:
  7634. this.ui.coinNode.visible = false;
  7635. if (this.success) {
  7636. if (xGame.common.placeBallStarNum == 3) {
  7637. this.ui.c1.selectedIndex = 2;
  7638. }
  7639. else {
  7640. this.ui.c1.selectedIndex = 3;
  7641. }
  7642. let level = xGame.common.placeBallCurLevel;
  7643. if (level > 59) {
  7644. this.logEventForChallenge_level_complete(level);
  7645. }
  7646. else {
  7647. this.logEventForChallenge_level_N(level);
  7648. }
  7649. }
  7650. else {
  7651. this.ui.c1.selectedIndex = 4;
  7652. }
  7653. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7654. if (cfg.type == PlaceBallType.challenge) {
  7655. this.ui.c1.selectedIndex = 2;
  7656. }
  7657. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7658. this.updatePlaceBallBtn();
  7659. this.updatePlaceBallStarNum();
  7660. this.updatePlaceBallAwardState();
  7661. this.moneyNode.ui.c1.selectedIndex = 2;
  7662. this.moneyNode.checkPowerTime();
  7663. this.moneyNode.powerChange();
  7664. DataMgr.upRankData();
  7665. break;
  7666. default:
  7667. break;
  7668. }
  7669. }
  7670. logEventForRod_complete_N() {
  7671. let gfmsIdx = xGame.common.curPlayerSkillType;
  7672. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7673. let gfmc = 'Skyfall Shot';
  7674. if (gfmsIdx == 0) {
  7675. gfmc = 'Skyfall Shot';
  7676. }
  7677. if (gfmsIdx == 1) {
  7678. gfmc = 'Surging break';
  7679. }
  7680. if (gfmsIdx == 2) {
  7681. gfmc = 'Frost Lock';
  7682. }
  7683. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7684. console.log('zh:logEventForRod_complete_N level = ' + level);
  7685. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7686. let jsonStr = {
  7687. "count": 0,
  7688. "name": gfmc
  7689. };
  7690. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7691. const d = LocalStorageManager.getItem(keyStr);
  7692. jsonStr.count = d.count + 1;
  7693. LocalStorageManager.setItem(keyStr, jsonStr);
  7694. }
  7695. else {
  7696. LocalStorageManager.setItem(keyStr, jsonStr);
  7697. }
  7698. const d2 = LocalStorageManager.getItem(keyStr);
  7699. let count = d2.count;
  7700. console.log('zh:logEventForRod_complete_N count = ' + count);
  7701. if (count % 5 == 0) {
  7702. const reqStr = JSON.stringify(jsonStr);
  7703. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7704. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7705. }
  7706. }
  7707. logEventForRod_win() {
  7708. console.log('zh:logEventForRod_win,胜利');
  7709. let gfmsIdx = xGame.common.curPlayerSkillType;
  7710. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7711. let gfmc = 'Skyfall Shot';
  7712. if (gfmsIdx == 0) {
  7713. gfmc = 'Skyfall Shot';
  7714. }
  7715. if (gfmsIdx == 1) {
  7716. gfmc = 'Surging break';
  7717. }
  7718. if (gfmsIdx == 2) {
  7719. gfmc = 'Frost Lock';
  7720. }
  7721. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7722. console.log('zh:logEventForRod_win level = ' + level);
  7723. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7724. let jsonStr = {
  7725. "count": 1,
  7726. "name": gfmc + ' Lev' + level
  7727. };
  7728. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7729. const d = LocalStorageManager.getItem(keyStr);
  7730. jsonStr.count = d.count + 1;
  7731. LocalStorageManager.setItem(keyStr, jsonStr);
  7732. }
  7733. else {
  7734. LocalStorageManager.setItem(keyStr, jsonStr);
  7735. }
  7736. const reqStr = JSON.stringify(jsonStr);
  7737. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7738. }
  7739. logEventForClassic_win() {
  7740. console.log('zh:logEventForClassic_win,胜利');
  7741. let rtype = xGame.common.classicRoomType;
  7742. let msmc = '';
  7743. if (rtype == 1) {
  7744. msmc = 'beginner';
  7745. }
  7746. if (rtype == 2) {
  7747. msmc = 'expert';
  7748. }
  7749. if (rtype == 3) {
  7750. msmc = 'master';
  7751. }
  7752. let keyStr = 'sjmd_classic_win_' + rtype;
  7753. let jsonStr = {
  7754. "difficulty": msmc,
  7755. "classic_count": 1,
  7756. "difficulty_count": 1
  7757. };
  7758. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7759. const d = LocalStorageManager.getItem(keyStr);
  7760. jsonStr.classic_count = d.classic_count + 1;
  7761. jsonStr.difficulty_count = d.difficulty_count + 1;
  7762. LocalStorageManager.setItem(keyStr, jsonStr);
  7763. }
  7764. else {
  7765. LocalStorageManager.setItem(keyStr, jsonStr);
  7766. }
  7767. const reqStr = JSON.stringify(jsonStr);
  7768. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7769. }
  7770. logEventForClassic_complete() {
  7771. console.log('zh:logEventForClassic_complete,胜利');
  7772. let rtype = xGame.common.classicRoomType;
  7773. let msmc = '';
  7774. if (rtype == 1) {
  7775. msmc = 'beginner';
  7776. }
  7777. if (rtype == 2) {
  7778. msmc = 'expert';
  7779. }
  7780. if (rtype == 3) {
  7781. msmc = 'master';
  7782. }
  7783. let keyStr = 'sjmd_classic_complete_' + rtype;
  7784. let jsonStr = {
  7785. "msmc": msmc,
  7786. "count": 0
  7787. };
  7788. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7789. const d = LocalStorageManager.getItem(keyStr);
  7790. jsonStr.count = d.count + 1;
  7791. LocalStorageManager.setItem(keyStr, jsonStr);
  7792. }
  7793. else {
  7794. LocalStorageManager.setItem(keyStr, jsonStr);
  7795. }
  7796. if (jsonStr.count % 5 == 0) {
  7797. const reqStr = JSON.stringify(jsonStr);
  7798. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7799. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  7800. }
  7801. }
  7802. updatePlaceBallBtn() {
  7803. this.ui.leftBtn.c1.selectedIndex = 5;
  7804. if (this.success) {
  7805. this.ui.rightBtn.c1.selectedIndex = 14;
  7806. }
  7807. else {
  7808. if (xGame.common.placeBallStarNum == 3) {
  7809. this.ui.rightBtn.c1.selectedIndex = 14;
  7810. }
  7811. else {
  7812. this.ui.rightBtn.c1.selectedIndex = 1;
  7813. }
  7814. }
  7815. }
  7816. updatePlaceBallStarNum() {
  7817. let starNum = xGame.common.placeBallStarNum;
  7818. if (starNum == 0)
  7819. this.ui.starNumNode.c1.selectedIndex = 3;
  7820. else {
  7821. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7822. }
  7823. }
  7824. updatePlaceBallAwardState() {
  7825. let level = xGame.common.placeBallCurLevel;
  7826. let starNum = xGame.common.placeBallStarNum;
  7827. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7828. let data = cfgTable.placeballData[level].award;
  7829. let cfg = cfgTable.placeballData[level];
  7830. this.awardDiamondNum = data[1];
  7831. this.awardCoinNum = data[0];
  7832. if (cfg.type == PlaceBallType.challenge) {
  7833. this.awardDiamondNum = 0;
  7834. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7835. }
  7836. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7837. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7838. if (cfg.type == PlaceBallType.challenge) {
  7839. this.ui.awardNode.coinNode.visible = true;
  7840. }
  7841. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7842. this.ui.awardNode.diamondNode.x = 265;
  7843. this.ui.awardNode.coinNode.x = 354;
  7844. }
  7845. else {
  7846. this.ui.awardNode.diamondNode.x = 291;
  7847. this.ui.awardNode.coinNode.x = 291;
  7848. }
  7849. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7850. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7851. if (this.awardCoinNum == 0) {
  7852. this.ui.awardNode.coinNode.numTxt.text = "";
  7853. }
  7854. if (getAward) {
  7855. this.ui.isGetAward.visible = true;
  7856. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7857. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7858. }
  7859. else {
  7860. this.ui.isGetAward.visible = false;
  7861. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7862. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7863. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7864. }
  7865. else {
  7866. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7867. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7868. }
  7869. }
  7870. }
  7871. show(success) {
  7872. super.show();
  7873. xGame.eventMgr.event(RESET_GAME);
  7874. this.success = success;
  7875. Laya.timer.clearAll(this);
  7876. this.playSecretaryAni();
  7877. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7878. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7879. offsetTime = Math.floor(offsetTime / 1000);
  7880. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7881. this.updateType();
  7882. Laya.timer.once(200, this, () => {
  7883. this.addAward(() => {
  7884. this.updateType();
  7885. Laya.timer.once(500, this, () => {
  7886. this.showChallengeLevel();
  7887. });
  7888. });
  7889. });
  7890. if (this.success) {
  7891. JSBridgeUtils.instance.showInternAd('gameend_success');
  7892. console.log('zh:game end 成功');
  7893. xGame.soundMgr.playSound('slots_roll01');
  7894. xGame.soundMgr.playSound("s_win");
  7895. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7896. this.diyGameDataUtilForGameWin();
  7897. }
  7898. else {
  7899. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7900. console.log('zh:game end失败');
  7901. xGame.soundMgr.playSound('matchwin01');
  7902. xGame.soundMgr.playSound("s_lose");
  7903. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7904. }
  7905. let challengeNum = DataMgr.getChallengeTimes();
  7906. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7907. DataMgr.setChallengeTimes(1);
  7908. }
  7909. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7910. DataMgr.setClassicTimes();
  7911. }
  7912. }
  7913. diyGameDataUtilForGameWin() {
  7914. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7915. switch (xGame.common.gameMode) {
  7916. case GameMode.classic:
  7917. console.log('zh:DiyGameDataUtilForGameWin 111');
  7918. case GameMode.bigMove:
  7919. console.log('zh:DiyGameDataUtilForGameWin 222');
  7920. this.restartGame();
  7921. break;
  7922. case GameMode.placeBall:
  7923. console.log('zh:DiyGameDataUtilForGameWin 333');
  7924. var level = xGame.common.placeBallCurLevel;
  7925. console.log('zh:练习模式 联系了多少LEV=' + level);
  7926. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7927. if (level > db_over_lev) {
  7928. DataMgr.setChallengeMode_overLev(level);
  7929. }
  7930. break;
  7931. default:
  7932. console.log('zh:DiyGameDataUtilForGameWin 444');
  7933. break;
  7934. }
  7935. }
  7936. showChallengeLevel() {
  7937. if (DataMgr.getChallengeTimes() != 0)
  7938. return;
  7939. let skill = DataMgr.getSkillAccTimes();
  7940. let put = DataMgr.getPlaceBallLevelList().length;
  7941. if (skill >= 3 || put >= 5) {
  7942. xGame.uiMgr.Show(UIInvitation);
  7943. this.hide();
  7944. }
  7945. }
  7946. addAward(callback) {
  7947. if (!this.success) {
  7948. callback && callback();
  7949. return;
  7950. }
  7951. switch (xGame.common.gameMode) {
  7952. case GameMode.classic:
  7953. this.awardCoinNum = xGame.common.passAwardCoin;
  7954. this.awardDiamondNum = 0;
  7955. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7956. break;
  7957. case GameMode.bigMove:
  7958. this.awardCoinNum = xGame.common.passAwardCoin;
  7959. this.awardDiamondNum = 0;
  7960. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7961. callback && callback();
  7962. break;
  7963. case GameMode.placeBall:
  7964. let level = xGame.common.placeBallCurLevel;
  7965. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7966. if (xGame.common.placeBallStarNum != 3) {
  7967. callback && callback();
  7968. return;
  7969. }
  7970. else {
  7971. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7972. if (getAward) {
  7973. callback && callback();
  7974. return;
  7975. }
  7976. }
  7977. let cfg = cfgTable.placeballData[level];
  7978. let data = cfgTable.placeballData[level].award;
  7979. this.awardCoinNum = data[0];
  7980. this.awardDiamondNum = data[1];
  7981. if (cfg.type == PlaceBallType.challenge) {
  7982. this.awardDiamondNum = 0;
  7983. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7984. }
  7985. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7986. let diamondAward;
  7987. if (this.awardDiamondNum > 0) {
  7988. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7989. xGame.common.getAward([diamondAward, coinAward], callback);
  7990. }
  7991. else {
  7992. xGame.common.getAward([coinAward], callback);
  7993. }
  7994. if (cfg.type == PlaceBallType.normal) {
  7995. DataMgr.setPlaceBallAward(level);
  7996. }
  7997. break;
  7998. default:
  7999. break;
  8000. }
  8001. }
  8002. playSecretaryAni_old() {
  8003. let parent = this.ui.secretary.displayObject;
  8004. parent.destroyChildren();
  8005. let xx = this.ui.secretary.width / 2;
  8006. let yy = this.ui.secretary.height;
  8007. let scale = xGame.common.getSecretaryScale();
  8008. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8009. if (this.success) {
  8010. let rand = Math.random() <= 0.5 ? 2 : 3;
  8011. xGame.common.secretary.play(data, rand, false, parent, () => {
  8012. xGame.common.secretary.play(data, 1, true, parent);
  8013. });
  8014. }
  8015. else {
  8016. xGame.common.secretary.play(data, 0, true, parent);
  8017. }
  8018. }
  8019. playSecretaryAni() {
  8020. let parent = this.ui.secretary.displayObject;
  8021. parent.destroyChildren();
  8022. let xx = this.ui.secretary.width / 2;
  8023. let yy = this.ui.secretary.height;
  8024. let scale = xGame.common.getSecretaryScale();
  8025. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8026. if (this.success) {
  8027. let rand = 0;
  8028. xGame.common.secretary.play(data, 0, true, parent);
  8029. }
  8030. else {
  8031. xGame.common.secretary.play(data, 0, true, parent);
  8032. }
  8033. }
  8034. restartGame() {
  8035. switch (xGame.common.gameMode) {
  8036. case GameMode.classic:
  8037. xGame.eventMgr.event(RESTART_GAME);
  8038. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8039. break;
  8040. case GameMode.bigMove:
  8041. this.hide();
  8042. xGame.eventMgr.event(RESTART_GAME);
  8043. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8044. break;
  8045. default:
  8046. break;
  8047. }
  8048. }
  8049. hide() {
  8050. super.hide();
  8051. xGame.common.stopGirlPop(this.ui.talkNode);
  8052. PlatMgr.showBanner(false);
  8053. }
  8054. returnHome() {
  8055. this.hide();
  8056. let showFailWords = !this.success;
  8057. xGame.uiMgr.Show(UIMain, showFailWords);
  8058. }
  8059. clickLeftBtn() {
  8060. switch (xGame.common.gameMode) {
  8061. case GameMode.classic:
  8062. case GameMode.bigMove:
  8063. this.returnHome();
  8064. break;
  8065. case GameMode.placeBall:
  8066. let level = xGame.common.placeBallCurLevel;
  8067. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8068. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8069. break;
  8070. default:
  8071. break;
  8072. }
  8073. }
  8074. powerStartPlaceBallLevel(level, btn) {
  8075. if (DataMgr.powerEnough()) {
  8076. btn.touchable = false;
  8077. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8078. btn.touchable = true;
  8079. DataMgr.setPower(-1);
  8080. xGame.eventMgr.event(POWER_TIME);
  8081. this.startPlaceBallLevel(level);
  8082. this.logEventForChallenge_level_start(level);
  8083. }));
  8084. }
  8085. else {
  8086. xGame.uiMgr.Show(UIPower, 0);
  8087. }
  8088. }
  8089. clickRightBtn() {
  8090. switch (xGame.common.gameMode) {
  8091. case GameMode.classic:
  8092. console.log('zh:clickRightBtn 111');
  8093. case GameMode.bigMove:
  8094. console.log('zh:clickRightBtn 222');
  8095. this.restartGame();
  8096. break;
  8097. case GameMode.placeBall:
  8098. console.log('zh:clickRightBtn 333');
  8099. let level = xGame.common.placeBallCurLevel;
  8100. let data = DataMgr.getPlaceBallLevel(level);
  8101. let curPss = data.play && !data.isCur;
  8102. if (curPss) {
  8103. console.log('zh:clickRightBtn 333-111');
  8104. console.log('zh:当前LV=' + level);
  8105. if (level == 60) {
  8106. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8107. Laya.timer.once(3000, this, () => {
  8108. this.returnHome();
  8109. });
  8110. }
  8111. else {
  8112. let lev = level + 1;
  8113. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8114. }
  8115. }
  8116. else {
  8117. console.log('zh:clickRightBtn 333-000');
  8118. Moyu.sendDataEvent("placeBallNextLevel");
  8119. console.log('zh:qjff_AD_for_uiGameEnd');
  8120. if (Laya.Browser.onAndroid) {
  8121. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8122. if (!boo) {
  8123. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8124. return;
  8125. }
  8126. }
  8127. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8128. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8129. }
  8130. else {
  8131. console.log('zh:AD 失败,直接发放奖励');
  8132. this.qjff_AD_for_uiGameEnd(level);
  8133. }
  8134. }
  8135. break;
  8136. default:
  8137. console.log('zh:clickRightBtn 444');
  8138. break;
  8139. }
  8140. }
  8141. logEventForChallenge_level_start(level) {
  8142. let keyStr = 'sjmd_challenge_level_start';
  8143. let jsonStr = {
  8144. "count": 0,
  8145. "gold_balance ": DataMgr.getCoin(),
  8146. "level": level,
  8147. "diamond_balance ": DataMgr.getDiamond()
  8148. };
  8149. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8150. const d = LocalStorageManager.getItem(keyStr);
  8151. if (level > d.level) {
  8152. jsonStr.count = d.count + 1;
  8153. LocalStorageManager.setItem(keyStr, jsonStr);
  8154. }
  8155. else {
  8156. }
  8157. }
  8158. else {
  8159. LocalStorageManager.setItem(keyStr, jsonStr);
  8160. }
  8161. const reqStr = JSON.stringify(jsonStr);
  8162. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8163. }
  8164. qjff_AD_for_uiGameEnd(level) {
  8165. DataMgr.setPlaceBallLevel(level, 1);
  8166. this.startPlaceBallLevel(level + 1);
  8167. }
  8168. startPlaceBallLevel(level) {
  8169. xGame.common.gameMode = GameMode.placeBall;
  8170. xGame.common.placeBallCurLevel = level;
  8171. xGame.uiMgr.Show(UIGame);
  8172. this.hide();
  8173. }
  8174. logEventForChallenge_level_complete(level) {
  8175. let keyStr = 'sjmd_challenge_level_complete';
  8176. let jsonStr = {
  8177. "count": 1,
  8178. "gold_balance ": DataMgr.getCoin(),
  8179. "level": level,
  8180. "diamond_balance ": DataMgr.getDiamond()
  8181. };
  8182. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8183. const d = LocalStorageManager.getItem(keyStr);
  8184. jsonStr.count = d.count + 1;
  8185. LocalStorageManager.setItem(keyStr, jsonStr);
  8186. }
  8187. else {
  8188. LocalStorageManager.setItem(keyStr, jsonStr);
  8189. }
  8190. const reqStr = JSON.stringify(jsonStr);
  8191. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8192. }
  8193. logEventForChallenge_level_N(level) {
  8194. console.log('zh:logEventForChallenge_level_N ' + level);
  8195. let keyStr = 'sjmd_challenge_level_N';
  8196. if (LocalStorageManager.hasKey(keyStr)) {
  8197. let lev = LocalStorageManager.getItem(keyStr);
  8198. if (level > lev) {
  8199. LocalStorageManager.setItem(keyStr, level);
  8200. }
  8201. if ((level) % 5 == 0) {
  8202. console.log('zh:每5关上报1次');
  8203. let sjmc = 'challenge_level_' + level;
  8204. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8205. let sjmcForFirebase = 'challenge_level_' + level;
  8206. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8207. }
  8208. else {
  8209. console.log('zh:5 no 上报');
  8210. }
  8211. }
  8212. else {
  8213. LocalStorageManager.setItem(keyStr, level);
  8214. }
  8215. }
  8216. }
  8217. UIGameEnd.uiName = "UIGameEnd";
  8218. class ui_UIVideoShare extends fgui.GComponent {
  8219. static createInstance() {
  8220. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8221. }
  8222. onConstruct() {
  8223. this.n10 = (this.getChild("n10"));
  8224. this.myNode = (this.getChild("myNode"));
  8225. this.t0 = this.getTransition("t0");
  8226. }
  8227. }
  8228. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8229. class UIVideoShare extends UIBase {
  8230. constructor() {
  8231. super();
  8232. this.success = false;
  8233. this.awardNum = 0;
  8234. this.isShared = true;
  8235. }
  8236. onConstructor() {
  8237. this.ui = ui_UIVideoShare.createInstance();
  8238. this.contentPane = this.ui;
  8239. this.isEject = false;
  8240. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8241. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8242. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8243. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8244. }
  8245. show(success) {
  8246. super.show();
  8247. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8248. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8249. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8250. this.success = success;
  8251. let time = xGame.common.randomNum(600, 1500);
  8252. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8253. if (success)
  8254. xGame.soundMgr.playSound("applause");
  8255. this.ui.t0.play();
  8256. this.checkShareState();
  8257. let times = DataMgr.getDailyVideoShareTimes();
  8258. this.awardNum = times == 0 ? 2000 : 200;
  8259. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8260. }
  8261. checkShareState() {
  8262. if (PlatMgr.forceShare == 0) {
  8263. this.ui.myNode.closeBtn.visible = true;
  8264. this.ui.myNode.tipsNode.visible = false;
  8265. this.ui.myNode.closeBtn.x = 90;
  8266. this.ui.myNode.shareBtn.x = 342;
  8267. }
  8268. else if (PlatMgr.forceShare == 1) {
  8269. this.ui.myNode.closeBtn.visible = false;
  8270. this.ui.myNode.tipsNode.visible = true;
  8271. this.ui.myNode.shareBtn.x = 218;
  8272. this.isShared = true;
  8273. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8274. }
  8275. }
  8276. checkForceShare() {
  8277. this.isShared = !this.isShared;
  8278. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8279. }
  8280. videoShare() {
  8281. if (PlatMgr.forceShare == 1) {
  8282. if (this.isShared) {
  8283. this.shareGame();
  8284. }
  8285. else {
  8286. this.hideSelf();
  8287. }
  8288. }
  8289. else {
  8290. this.shareGame();
  8291. }
  8292. }
  8293. shareGame() {
  8294. Moyu.sendDataEvent("VideoShare");
  8295. if (Moyu.canShare() > 100) {
  8296. Moyu.shareGame((success) => {
  8297. if (success) {
  8298. DataMgr.setDailyVideoShareTimes(1);
  8299. DataMgr.setCoin(this.awardNum);
  8300. }
  8301. this.hideSelf();
  8302. }, this);
  8303. }
  8304. else {
  8305. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8306. this.hideSelf();
  8307. }
  8308. }
  8309. hideSelf() {
  8310. this.hide();
  8311. xGame.uiMgr.Show(UIGameEnd, this.success);
  8312. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8313. xGame.common.screenImg.destroy();
  8314. xGame.common.screenImg = null;
  8315. }
  8316. }
  8317. }
  8318. UIVideoShare.uiName = "UIVideoShare";
  8319. class ui_UITips extends fgui.GComponent {
  8320. static createInstance() {
  8321. return (fgui.UIPackage.createObject("game", "UITips"));
  8322. }
  8323. onConstruct() {
  8324. this.n0 = (this.getChild("n0"));
  8325. this.myNode = (this.getChild("myNode"));
  8326. this.t0 = this.getTransition("t0");
  8327. }
  8328. }
  8329. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8330. class UITips extends UIBase {
  8331. constructor() {
  8332. super();
  8333. this.type = 0;
  8334. }
  8335. onConstructor() {
  8336. this.ui = ui_UITips.createInstance();
  8337. this.contentPane = this.ui;
  8338. this.isEject = false;
  8339. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8340. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8341. }
  8342. show(tipsTxt, womanTxt, type) {
  8343. super.show();
  8344. this.ui.t0.play();
  8345. this.ui.myNode.tipsTxt.text = tipsTxt;
  8346. this.ui.myNode.womanTxt.text = womanTxt;
  8347. PlatMgr.showInsert(true);
  8348. this.ui.myNode.c1.selectedIndex = type;
  8349. this.type = type;
  8350. switch (this.type) {
  8351. case TipsType.exitGame:
  8352. xGame.common.gameMgr.gamePause = true;
  8353. break;
  8354. case TipsType.foul:
  8355. Laya.timer.once(200, this, () => {
  8356. xGame.common.gameMgr.gamePause = true;
  8357. });
  8358. break;
  8359. default:
  8360. break;
  8361. }
  8362. }
  8363. clickLeftBtn() {
  8364. this.hide();
  8365. xGame.common.gameMgr.gamePause = false;
  8366. switch (this.type) {
  8367. case TipsType.exitGame:
  8368. break;
  8369. case TipsType.foul:
  8370. break;
  8371. default:
  8372. break;
  8373. }
  8374. }
  8375. clickRightBtn() {
  8376. this.hide();
  8377. switch (this.type) {
  8378. case TipsType.exitGame:
  8379. xGame.eventMgr.event(RESET_GAME);
  8380. xGame.uiMgr.Show(UIMain);
  8381. Moyu.recordEnd(this, null);
  8382. xGame.common.longHelpLine = false;
  8383. break;
  8384. case TipsType.foul:
  8385. xGame.common.gameMgr.gamePause = false;
  8386. Laya.timer.clearAll(this);
  8387. break;
  8388. default:
  8389. break;
  8390. }
  8391. }
  8392. }
  8393. UITips.uiName = "UITips";
  8394. class GameMgr {
  8395. constructor() {
  8396. this.selfCamp = "";
  8397. this.selfFoulNum = 0;
  8398. this.selfBallArr = [];
  8399. this.selfTimer = 0;
  8400. this.selfScore = 0;
  8401. this.aiCamp = "";
  8402. this.aiFoulNum = 0;
  8403. this.aiBallArr = [];
  8404. this.aiTimer = 0;
  8405. this.aiScore = 0;
  8406. this.aiSkillLevelNum = 1;
  8407. this.targertScore = 0;
  8408. this.setTime = 30;
  8409. this.selfTurnRate = 0.5;
  8410. this.accTime = 0;
  8411. this.curFoul = "";
  8412. this.maxFoulTimes = 3;
  8413. this.isFirstInGame = true;
  8414. this.firstColliObj = null;
  8415. this.inHoleBalls = [];
  8416. this.blackNum = 8;
  8417. this.success = false;
  8418. this.holePosList = [];
  8419. this.posObj = {};
  8420. this._selfTurn = false;
  8421. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8422. this.ensureBallType = false;
  8423. this.isOpenBall = true;
  8424. this.finishOneShoot = true;
  8425. this.isEnd = false;
  8426. this.isChangeTurn = false;
  8427. this.isInterrupt = false;
  8428. this.aiPlayedBreakArmy = false;
  8429. this.isTouchedBall = false;
  8430. this.finishBalls = 0;
  8431. this.needBalls = 0;
  8432. this.allBallNum = 0;
  8433. this.placeBallPosData = {};
  8434. this.curHP = 0;
  8435. this.showLongView = false;
  8436. this.firstShoot = true;
  8437. this._gamePause = false;
  8438. this.trunCount = 0;
  8439. this.isBlackInHole = false;
  8440. this.isEnter = true;
  8441. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8442. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8443. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8444. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8445. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8446. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8447. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8448. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8449. }
  8450. get gamePause() {
  8451. return this._gamePause;
  8452. }
  8453. set gamePause(v) {
  8454. if (v) {
  8455. Laya.physicsTimer.pause();
  8456. }
  8457. else {
  8458. Laya.physicsTimer.resume();
  8459. }
  8460. this._gamePause = v;
  8461. }
  8462. get selfTurn() {
  8463. return this._selfTurn;
  8464. }
  8465. set selfTurn(val) {
  8466. this.trunCount++;
  8467. this._selfTurn = val;
  8468. if (val) {
  8469. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8470. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8471. }
  8472. else {
  8473. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8474. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8475. if (this.trunCount > 1)
  8476. PlatMgr.openBox();
  8477. }
  8478. }
  8479. resetGame() {
  8480. this.inHoleBalls = [];
  8481. this.isFirstInGame = true;
  8482. this.firstColliObj = null;
  8483. this.aiCamp = "";
  8484. this.selfCamp = "";
  8485. this.aiFoulNum = 0;
  8486. this.selfFoulNum = 0;
  8487. this.selfBallArr = [];
  8488. this.aiBallArr = [];
  8489. this.gamePause = false;
  8490. this.ensureBallType = false;
  8491. this.isInterrupt = false;
  8492. this.updateLeftBall();
  8493. this.clearTime();
  8494. this.aiPlayedBreakArmy = false;
  8495. this.isBlackInHole = false;
  8496. this.placeBallPosData = {};
  8497. if (xGame.common.d3World.knifeRoot) {
  8498. xGame.common.d3World.knifeRoot.destroyChildren();
  8499. }
  8500. }
  8501. gameReady() {
  8502. this.trunCount = 0;
  8503. this.firstColliObj = null;
  8504. this.isFirstInGame = true;
  8505. this.selfTurn = Math.random() <= this.selfTurnRate;
  8506. let challengeNum = DataMgr.getChallengeTimes();
  8507. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8508. this.selfTurn = true;
  8509. }
  8510. if (xGame.common.gameMode == GameMode.placeBall)
  8511. this.selfTurn = true;
  8512. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8513. this.selfTurn = true;
  8514. }
  8515. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8516. this.checkGuide();
  8517. if (xGame.common.uiRodMethod)
  8518. xGame.common.uiRodMethod.resetRod();
  8519. xGame.common.d2World.getHelpLine();
  8520. this.isOpenBall = true;
  8521. this.isTouchedBall = false;
  8522. xGame.common.aiPlayer.stopRun();
  8523. this.setTime = 30;
  8524. let ui = xGame.common.gameUI.ui;
  8525. switch (xGame.common.gameMode) {
  8526. case GameMode.classic:
  8527. xGame.common.aiPlayer.init();
  8528. this.blackNum = 8;
  8529. this.placeRootBall();
  8530. this.peoplePlay(9, 10);
  8531. ui.wordsBtn.visible = true;
  8532. ui.aiWordsBtn.visible = true;
  8533. xGame.common.talkMgr.changeAIState(true);
  8534. DataMgr.gameData.gameCount++;
  8535. DataMgr.saveGameData();
  8536. break;
  8537. case GameMode.bigMove:
  8538. this.blackNum = -1;
  8539. this.selfScore = 0;
  8540. this.aiScore = 0;
  8541. xGame.common.aiPlayer.init();
  8542. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8543. this.updateSelfScore();
  8544. this.updateAIScore();
  8545. this.updateTargetSroce();
  8546. this.placeRootBall();
  8547. this.peoplePlay(9, 10);
  8548. ui.wordsBtn.visible = true;
  8549. ui.aiWordsBtn.visible = true;
  8550. xGame.common.talkMgr.changeAIState(true);
  8551. if (DataMgr.getSkillGuide() < 1)
  8552. DataMgr.gameData.gameCount = 0;
  8553. else {
  8554. DataMgr.gameData.gameCount++;
  8555. DataMgr.saveGameData();
  8556. PlatMgr.openTry();
  8557. }
  8558. if (xGame.common.d3World.knifeRoot) {
  8559. xGame.common.d3World.knifeRoot.destroyChildren();
  8560. }
  8561. break;
  8562. case GameMode.placeBall:
  8563. this.blackNum = -1;
  8564. this.selfTurn = true;
  8565. this.setTime = 10000;
  8566. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8567. this.curHP = this.placeBallData.hp;
  8568. if (this.placeBallData.ball == -1)
  8569. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8570. else
  8571. this.needBalls = this.placeBallData.ball;
  8572. console.log("需要的进球数目", this.needBalls);
  8573. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8574. this.finishBalls = 0;
  8575. this.placeBallPosData = {};
  8576. this.updatePlaceBallPos();
  8577. this.updatePlaceBallState();
  8578. this.finishOneShoot = true;
  8579. xGame.common.gameUI.ui.moveNode.visible = false;
  8580. this.isOpenBall = false;
  8581. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8582. ui.wordsBtn.visible = false;
  8583. ui.aiWordsBtn.visible = false;
  8584. xGame.common.talkMgr.changeAIState(false);
  8585. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8586. PlatMgr.openBox();
  8587. });
  8588. break;
  8589. default:
  8590. break;
  8591. }
  8592. this.showLongView = false;
  8593. xGame.common.wordsMgr.comboTimes = 1;
  8594. let guide = DataMgr.getSkillGuide();
  8595. if (guide)
  8596. xGame.eventMgr.event(WAIT_SHOOT);
  8597. xGame.common.upSkillLevel = false;
  8598. xGame.common.gameStartTime = new Date().getTime();
  8599. this.firstShoot = true;
  8600. }
  8601. checkGuide() {
  8602. let guide = DataMgr.getSkillGuide();
  8603. let gameUI = xGame.common.gameUI.ui;
  8604. gameUI.guide1.visible = false;
  8605. gameUI.guide2.visible = false;
  8606. gameUI.guide3.visible = false;
  8607. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8608. this.selfTurn = true;
  8609. }
  8610. else {
  8611. return;
  8612. }
  8613. let oneBall = this.getOneBall();
  8614. gameUI.guide1.visible = true;
  8615. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8616. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8617. }
  8618. getOneBall() {
  8619. let arr = xGame.common.d2World.ballArr;
  8620. for (let index = 0; index < arr.length; index++) {
  8621. if (arr[index].number == 0)
  8622. continue;
  8623. return arr[index];
  8624. }
  8625. }
  8626. updateSelfScore() {
  8627. let ui = xGame.common.gameUI.ui.topNode;
  8628. ui.selfScoreTxt.text = this.selfScore + "";
  8629. }
  8630. updateAIScore() {
  8631. let ui = xGame.common.gameUI.ui.topNode;
  8632. ui.aiScoreTxt.text = this.aiScore + "";
  8633. }
  8634. updateTargetSroce() {
  8635. let ui = xGame.common.gameUI.ui.topNode;
  8636. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8637. }
  8638. updateLeftBall() {
  8639. let topUI = xGame.common.gameUI.ui.topNode;
  8640. topUI.selfBallList.numItems = this.selfBallArr.length;
  8641. topUI.aiBallList.numItems = this.aiBallArr.length;
  8642. }
  8643. ballShoot() {
  8644. this.clearTime();
  8645. this.finishOneShoot = false;
  8646. xGame.common.gameUI.ui.moveNode.visible = false;
  8647. if (xGame.common.gameUI.ui.guideNode.visible) {
  8648. xGame.common.gameUI.ui.guideNode.visible = false;
  8649. }
  8650. if (this.firstShoot) {
  8651. this.firstShoot = false;
  8652. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8653. }
  8654. }
  8655. ensureCamp(number) {
  8656. this.ensureBallType = true;
  8657. this.isOpenBall = false;
  8658. if (xGame.common.gameMode != GameMode.classic)
  8659. return;
  8660. let full = [1, 2, 3, 4, 5, 6, 7];
  8661. let flower = [9, 10, 11, 12, 13, 14, 15];
  8662. let sayWords = "";
  8663. if (this.selfTurn) {
  8664. if (number <= 7) {
  8665. this.selfCamp = ballCamp.full;
  8666. this.selfBallArr = full;
  8667. this.aiCamp = ballCamp.flower;
  8668. this.aiBallArr = flower;
  8669. sayWords = cfgTable.wordsData[3].msg;
  8670. }
  8671. else {
  8672. this.selfCamp = ballCamp.flower;
  8673. this.selfBallArr = flower;
  8674. this.aiCamp = ballCamp.full;
  8675. this.aiBallArr = full;
  8676. sayWords = cfgTable.wordsData[4].msg;
  8677. }
  8678. }
  8679. else {
  8680. if (number <= 7) {
  8681. this.selfCamp = ballCamp.flower;
  8682. this.selfBallArr = flower;
  8683. this.aiCamp = ballCamp.full;
  8684. this.aiBallArr = full;
  8685. sayWords = cfgTable.wordsData[2].msg;
  8686. }
  8687. else {
  8688. this.selfCamp = ballCamp.full;
  8689. this.selfBallArr = full;
  8690. this.aiCamp = ballCamp.flower;
  8691. this.aiBallArr = flower;
  8692. sayWords = cfgTable.wordsData[1].msg;
  8693. }
  8694. }
  8695. this.updateLeftBall();
  8696. xGame.uiMgr.Show(UIMsg, sayWords);
  8697. }
  8698. updatePlaceBallState() {
  8699. let ui = xGame.common.gameUI.ui;
  8700. switch (this.placeBallData.type) {
  8701. case PlaceBallType.normal:
  8702. let normal = ui.placeNormalNode;
  8703. normal.hpTxt.text = this.curHP + "";
  8704. this.updatePlaceBallStar(normal);
  8705. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8706. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8707. break;
  8708. case PlaceBallType.challenge:
  8709. let challenge = ui.placeChallengeNode;
  8710. challenge.hpTxt.text = "Shots:" + this.curHP;
  8711. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8712. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8713. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8714. break;
  8715. default:
  8716. break;
  8717. }
  8718. }
  8719. playSubHpAni() {
  8720. let ui = xGame.common.gameUI.ui;
  8721. switch (this.placeBallData.type) {
  8722. case PlaceBallType.normal:
  8723. let normal = ui.placeNormalNode;
  8724. normal.hpTxt.visible = false;
  8725. normal.starAni.c1.selectedIndex = 1;
  8726. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8727. normal.hpTxt.visible = true;
  8728. normal.starAni.c1.selectedIndex = 0;
  8729. }));
  8730. break;
  8731. default:
  8732. break;
  8733. }
  8734. }
  8735. getEndStarNum() {
  8736. let num;
  8737. let level = xGame.common.placeBallCurLevel;
  8738. if (this.curHP == this.placeBallData.hp) {
  8739. num = 3;
  8740. }
  8741. else if (this.curHP <= 1) {
  8742. num = 1;
  8743. }
  8744. else {
  8745. num = 2;
  8746. }
  8747. if (!this.success) {
  8748. num = 0;
  8749. }
  8750. else {
  8751. DataMgr.setPlaceBallLevel(level, num);
  8752. }
  8753. let myType = cfgTable.placeballData[level].type;
  8754. if (this.success && myType == 1) {
  8755. num = 3;
  8756. }
  8757. xGame.common.placeBallStarNum = num;
  8758. }
  8759. updatePlaceBallStar(node) {
  8760. let star = 0;
  8761. if (this.curHP == this.placeBallData.hp) {
  8762. star = 3;
  8763. }
  8764. else if (this.curHP >= 2) {
  8765. star = 2;
  8766. }
  8767. else if (this.curHP == 1) {
  8768. star = 1;
  8769. }
  8770. else {
  8771. star = 0;
  8772. }
  8773. let temp;
  8774. for (let index = 1; index <= 3; index++) {
  8775. temp = node["star" + index];
  8776. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8777. }
  8778. node.myProgress.value = (star / 3) * 100;
  8779. }
  8780. openRegretView(isFoul, GoalNum, challenge = false) {
  8781. let regretType = -1;
  8782. if (isFoul) {
  8783. regretType = 1;
  8784. }
  8785. else {
  8786. if (GoalNum <= 0) {
  8787. regretType = 0;
  8788. }
  8789. }
  8790. if (challenge) {
  8791. regretType = 1;
  8792. }
  8793. if (regretType != -1) {
  8794. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8795. if (success) {
  8796. this.curHP++;
  8797. this.updatePlaceBallState();
  8798. this.setPlaceBallAllPos();
  8799. xGame.common.gameUI.ui.moveNode.visible = false;
  8800. }
  8801. else {
  8802. if (this.curHP <= 0) {
  8803. this.success = false;
  8804. this.gameEnd();
  8805. }
  8806. this.playSubHpAni();
  8807. }
  8808. this.updatePlaceBallState();
  8809. this.updatePlaceBallPos();
  8810. });
  8811. }
  8812. }
  8813. setPlaceBallAllPos() {
  8814. let allBall = xGame.common.d2World.ballArr;
  8815. let cfgArr = this.placeBallPosData;
  8816. let temp;
  8817. let obj;
  8818. for (let index = 0; index < allBall.length; index++) {
  8819. temp = allBall[index];
  8820. if (temp.destroyed)
  8821. continue;
  8822. obj = cfgArr[temp.myUNID];
  8823. if (obj && obj.src && !obj.src.destroyed) {
  8824. temp.gameObj.x = obj.posX;
  8825. temp.gameObj.y = obj.posY;
  8826. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8827. }
  8828. }
  8829. xGame.common.d2World.getHelpLine();
  8830. }
  8831. updatePlaceBallPos() {
  8832. let arr = xGame.common.d2World.ballArr;
  8833. let temp;
  8834. for (let index = 0; index < arr.length; index++) {
  8835. temp = arr[index];
  8836. if (!this.placeBallPosData[temp.myUNID]) {
  8837. this.placeBallPosData[temp.myUNID] = {
  8838. src: temp,
  8839. posX: temp.gameObj.x,
  8840. posY: temp.gameObj.y
  8841. };
  8842. }
  8843. else {
  8844. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8845. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8846. }
  8847. }
  8848. let check;
  8849. for (const key in this.placeBallPosData) {
  8850. check = this.placeBallPosData[key];
  8851. if (check.src.destroyed) {
  8852. delete this.placeBallPosData[key];
  8853. }
  8854. }
  8855. }
  8856. gameRun(type) {
  8857. if (this.gamePause)
  8858. return;
  8859. this.curFoul = this.getFoulType();
  8860. if (type) {
  8861. xGame.common.d2World.d2Gan.shoot();
  8862. xGame.common.gameUI.forceCancel();
  8863. this.curFoul = type;
  8864. }
  8865. this.isEnd = false;
  8866. this.isChangeTurn = true;
  8867. if (xGame.common.gameMode == GameMode.classic) {
  8868. this.judgeClassic(this.curFoul);
  8869. this.checkClassicWords(() => {
  8870. xGame.common.destroyClassicEmotion();
  8871. if (this.isEnd) {
  8872. if (this.isBlackInHole) {
  8873. xGame.common.gameUI.ui.blackAni.visible = true;
  8874. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8875. xGame.common.gameUI.ui.blackAni.visible = false;
  8876. this.gameEnd();
  8877. }));
  8878. }
  8879. else {
  8880. this.gameEnd();
  8881. }
  8882. }
  8883. else {
  8884. this.waitShoot();
  8885. xGame.eventMgr.event(WAIT_SHOOT);
  8886. }
  8887. });
  8888. }
  8889. else if (xGame.common.gameMode == GameMode.bigMove) {
  8890. xGame.common.aiPlayer.stopRun();
  8891. let scoreArr = this.getScore(this.curFoul);
  8892. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8893. this.isEnd = true;
  8894. }
  8895. this.checkBigSkillWords(() => {
  8896. if (this.isEnd) {
  8897. this.gameEnd();
  8898. }
  8899. else {
  8900. this.waitShoot();
  8901. xGame.eventMgr.event(WAIT_SHOOT);
  8902. }
  8903. });
  8904. }
  8905. else if (xGame.common.gameMode == GameMode.placeBall) {
  8906. xGame.common.destroyAwardSpine();
  8907. let isFoul = this.curFoul == FoulType.rootHole;
  8908. let GoalNum = this.inHoleBalls.length;
  8909. if (this.inHoleBalls.indexOf(0) > -1)
  8910. GoalNum -= 1;
  8911. if (isFoul) {
  8912. this.placeRootBall();
  8913. }
  8914. console.log("neeballs", this.needBalls);
  8915. console.log("当前完成的goalNum", GoalNum);
  8916. this.finishBalls += GoalNum;
  8917. console.log("当前完成的finishballs", this.finishBalls);
  8918. let need = this.needBalls;
  8919. if (this.placeBallData.type == PlaceBallType.challenge) {
  8920. need += 100;
  8921. }
  8922. if (this.finishBalls >= need) {
  8923. this.success = true;
  8924. this.gameEnd();
  8925. }
  8926. else {
  8927. switch (this.placeBallData.type) {
  8928. case PlaceBallType.normal:
  8929. if (!isFoul && GoalNum > 0) {
  8930. this.updatePlaceBallPos();
  8931. this.updatePlaceBallState();
  8932. }
  8933. else {
  8934. this.curHP--;
  8935. this.openRegretView(isFoul, GoalNum);
  8936. }
  8937. this.waitShoot();
  8938. xGame.eventMgr.event(WAIT_SHOOT);
  8939. break;
  8940. case PlaceBallType.challenge:
  8941. this.curHP--;
  8942. this.updatePlaceBallState();
  8943. if (isFoul) {
  8944. this.openRegretView(isFoul, GoalNum, true);
  8945. }
  8946. else {
  8947. this.updatePlaceBallPos();
  8948. if (this.curHP <= 0) {
  8949. this.success = true;
  8950. this.gameEnd();
  8951. }
  8952. }
  8953. this.waitShoot();
  8954. xGame.eventMgr.event(WAIT_SHOOT);
  8955. break;
  8956. default:
  8957. break;
  8958. }
  8959. }
  8960. }
  8961. }
  8962. checkClassicWords(callback) {
  8963. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8964. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8965. let type = this.getClassicWordsType();
  8966. if (condition && type != -1) {
  8967. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8968. xGame.soundMgr.playSound(str);
  8969. xGame.common.wordsMgr.playClassicWords(type, callback);
  8970. }
  8971. else {
  8972. Laya.timer.once(300, this, () => {
  8973. callback && callback();
  8974. });
  8975. }
  8976. }
  8977. getClassicWordsType() {
  8978. let d2world = xGame.common.d2World;
  8979. let type = -1;
  8980. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8981. type = ClassicWordsType.perfectShow;
  8982. return type;
  8983. }
  8984. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8985. type = ClassicWordsType.directShoot;
  8986. return type;
  8987. }
  8988. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8989. type = ClassicWordsType.anotherShoot;
  8990. return type;
  8991. }
  8992. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8993. type = ClassicWordsType.bigPower;
  8994. return type;
  8995. }
  8996. let minSpeed = 1;
  8997. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8998. type = ClassicWordsType.hardShoot;
  8999. return type;
  9000. }
  9001. if (this.inHoleBalls.length > 0) {
  9002. type = ClassicWordsType.directShoot;
  9003. return type;
  9004. }
  9005. return type;
  9006. }
  9007. checkBigSkillWords(callback) {
  9008. if (this.curFoul == FoulType.timeOut) {
  9009. callback && callback();
  9010. }
  9011. else {
  9012. let playSkill = false;
  9013. if (this.selfTurn) {
  9014. playSkill = true;
  9015. }
  9016. else {
  9017. if (!this.aiPlayedBreakArmy) {
  9018. this.aiPlayedBreakArmy = true;
  9019. playSkill = true;
  9020. }
  9021. if (this.aiCurSkill != SkillType.breakArmy) {
  9022. playSkill = true;
  9023. }
  9024. }
  9025. if (xGame.common.skillMgr.playedLastSkill) {
  9026. xGame.common.skillMgr.playedLastSkill = false;
  9027. playSkill = false;
  9028. }
  9029. if (playSkill) {
  9030. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9031. let selfExtra = 0;
  9032. let aiExtra = 0;
  9033. if (this.selfTurn)
  9034. selfExtra += extraScore;
  9035. else
  9036. aiExtra += extraScore;
  9037. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9038. this.isEnd = true;
  9039. }
  9040. this.playBigSkillTimes(callback);
  9041. });
  9042. }
  9043. else {
  9044. this.playBigSkillTimes(callback);
  9045. }
  9046. }
  9047. }
  9048. playBigSkillTimes(callback) {
  9049. let length = this.inHoleBalls.length;
  9050. if (this.inHoleBalls.indexOf(0) > -1) {
  9051. length = this.inHoleBalls.length - 1;
  9052. }
  9053. if (length <= 0) {
  9054. callback && callback();
  9055. return;
  9056. }
  9057. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9058. callback && callback();
  9059. });
  9060. }
  9061. playSkillTips() {
  9062. let levelNum = 0;
  9063. let curType;
  9064. if (this.selfTurn) {
  9065. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9066. curType = this.selfCurSkill;
  9067. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9068. levelNum += 5;
  9069. }
  9070. }
  9071. else {
  9072. levelNum = this.aiSkillLevelNum;
  9073. curType = this.aiCurSkill;
  9074. }
  9075. let str = ``;
  9076. switch (curType) {
  9077. case SkillType.highSpace:
  9078. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9079. break;
  9080. case SkillType.breakArmy:
  9081. str = `You pocketed ${levelNum} extra balls`;
  9082. break;
  9083. case SkillType.ice:
  9084. str = `${levelNum * 2} extra balls were frozen`;
  9085. break;
  9086. case SkillType.fireworks:
  9087. str = `${levelNum} extra balls exploded `;
  9088. break;
  9089. case SkillType.GuanYu:
  9090. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9091. break;
  9092. default:
  9093. break;
  9094. }
  9095. xGame.uiMgr.Show(UIMsg, str);
  9096. }
  9097. getFoulType() {
  9098. let foulType = "";
  9099. if (this.firstColliObj == null) {
  9100. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9101. return FoulType.rootHole;
  9102. }
  9103. return FoulType.notTouch;
  9104. }
  9105. else {
  9106. if (this.selfTurn) {
  9107. if (this.selfBallArr.length > 0) {
  9108. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9109. foulType = FoulType.wrongTouch;
  9110. }
  9111. }
  9112. else {
  9113. if (this.ensureBallType) {
  9114. }
  9115. else {
  9116. if (this.firstColliObj == this.blackNum) {
  9117. foulType = FoulType.wrongTouch;
  9118. }
  9119. }
  9120. }
  9121. }
  9122. else {
  9123. if (this.aiBallArr.length > 0) {
  9124. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9125. foulType = FoulType.wrongTouch;
  9126. }
  9127. }
  9128. else {
  9129. if (this.ensureBallType) {
  9130. }
  9131. else {
  9132. if (this.firstColliObj == this.blackNum) {
  9133. foulType = FoulType.wrongTouch;
  9134. }
  9135. }
  9136. }
  9137. }
  9138. if (this.inHoleBalls.length <= 0) {
  9139. return foulType;
  9140. }
  9141. let temp;
  9142. if (this.inHoleBalls.indexOf(0) > -1) {
  9143. foulType = FoulType.rootHole;
  9144. }
  9145. else {
  9146. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9147. temp = this.inHoleBalls[index];
  9148. if (this.selfTurn) {
  9149. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9150. foulType = FoulType.wrongHole;
  9151. break;
  9152. }
  9153. }
  9154. else {
  9155. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9156. foulType = FoulType.wrongHole;
  9157. break;
  9158. }
  9159. }
  9160. }
  9161. }
  9162. let foo;
  9163. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9164. temp = this.inHoleBalls[index];
  9165. foo = this.selfBallArr.indexOf(temp);
  9166. if (foo > -1) {
  9167. this.selfBallArr.splice(foo, 1);
  9168. }
  9169. foo = this.aiBallArr.indexOf(temp);
  9170. if (foo > -1) {
  9171. this.aiBallArr.splice(foo, 1);
  9172. }
  9173. }
  9174. this.updateLeftBall();
  9175. }
  9176. return foulType;
  9177. }
  9178. judgeGameEndByBlack(arr) {
  9179. if (this.selfTurn) {
  9180. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9181. this.selfFoulNum = this.maxFoulTimes;
  9182. return true;
  9183. }
  9184. }
  9185. else {
  9186. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9187. this.aiFoulNum = this.maxFoulTimes;
  9188. return true;
  9189. }
  9190. }
  9191. }
  9192. judgeClassic(type) {
  9193. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9194. xGame.common.aiPlayer.stopRun();
  9195. if (this.judgeNormalSuccess()) {
  9196. this.isEnd = true;
  9197. return;
  9198. }
  9199. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9200. if (this.selfTurn) {
  9201. if (isFoul) {
  9202. this.selfFoulNum++;
  9203. }
  9204. if (this.selfFoulNum >= this.maxFoulTimes) {
  9205. this.success = false;
  9206. this.isEnd = true;
  9207. return;
  9208. }
  9209. }
  9210. else {
  9211. if (isFoul)
  9212. this.aiFoulNum++;
  9213. if (this.aiFoulNum >= this.maxFoulTimes) {
  9214. this.success = true;
  9215. this.isEnd = true;
  9216. return;
  9217. }
  9218. }
  9219. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9220. this.isChangeTurn = false;
  9221. }
  9222. else {
  9223. this.isInterrupt = true;
  9224. }
  9225. }
  9226. waitShoot() {
  9227. if (xGame.common.gameMode == GameMode.classic) {
  9228. switch (this.curFoul) {
  9229. case FoulType.timeOut:
  9230. case FoulType.rootHole:
  9231. this.selfTurn = !this.selfTurn;
  9232. this.peoplePlay(5, 6, true);
  9233. break;
  9234. case FoulType.notTouch:
  9235. this.selfTurn = !this.selfTurn;
  9236. this.peoplePlay(7, 7);
  9237. break;
  9238. case FoulType.wrongHole:
  9239. this.selfTurn = !this.selfTurn;
  9240. this.peoplePlay(11, 11);
  9241. break;
  9242. default:
  9243. if (this.inHoleBalls.length > 0) {
  9244. this.peoplePlay(0, 0, false, false);
  9245. }
  9246. else {
  9247. this.selfTurn = !this.selfTurn;
  9248. this.peoplePlay(7, 7);
  9249. }
  9250. break;
  9251. }
  9252. }
  9253. else if (xGame.common.gameMode == GameMode.bigMove) {
  9254. if (this.curFoul == FoulType.timeOut) {
  9255. this.selfTurn = !this.selfTurn;
  9256. this.peoplePlay(14, 15);
  9257. this.placeRootBall();
  9258. }
  9259. else {
  9260. this.selfTurn = !this.selfTurn;
  9261. if (this.curFoul == FoulType.rootHole) {
  9262. this.peoplePlay(12, 13);
  9263. this.placeRootBall();
  9264. }
  9265. else {
  9266. this.peoplePlay(0, 0, false, false);
  9267. }
  9268. }
  9269. }
  9270. else if (xGame.common.gameMode == GameMode.placeBall) {
  9271. this.finishOneShoot = true;
  9272. }
  9273. this.gameResult();
  9274. }
  9275. gameResult() {
  9276. this.firstColliObj = null;
  9277. this.inHoleBalls = [];
  9278. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9279. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9280. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9281. if (xGame.common.uiRodMethod)
  9282. xGame.common.uiRodMethod.resetRod();
  9283. xGame.common.d2World.rootBall.showSelf();
  9284. this.clearIceSkill();
  9285. if (this.selfTurn) {
  9286. PlatMgr.gameInsert();
  9287. }
  9288. xGame.common.d3World.knifeRoot.destroyChildren();
  9289. if (this.selfTurn) {
  9290. xGame.common.gameUI.showHelpLineGuide();
  9291. xGame.common.gameUI.setTurnAlpha(true);
  9292. }
  9293. else {
  9294. xGame.common.gameUI.setTurnAlpha(false);
  9295. }
  9296. }
  9297. getScore(type) {
  9298. let selfAdd = 0;
  9299. let aiAdd = 0;
  9300. if (type == FoulType.timeOut) {
  9301. if (this.selfTurn)
  9302. aiAdd += 3;
  9303. else
  9304. selfAdd += 3;
  9305. }
  9306. else {
  9307. if (this.inHoleBalls.length > 0) {
  9308. if (this.selfTurn) {
  9309. if (type == FoulType.rootHole) {
  9310. aiAdd += 3;
  9311. if (this.inHoleBalls.length - 1 > 0) {
  9312. selfAdd += this.inHoleBalls.length - 1;
  9313. }
  9314. }
  9315. else {
  9316. selfAdd += this.inHoleBalls.length;
  9317. }
  9318. }
  9319. else {
  9320. if (type == FoulType.rootHole) {
  9321. selfAdd += 3;
  9322. if (this.inHoleBalls.length - 1 > 0) {
  9323. aiAdd += this.inHoleBalls.length - 1;
  9324. }
  9325. }
  9326. else {
  9327. aiAdd += this.inHoleBalls.length;
  9328. }
  9329. }
  9330. }
  9331. }
  9332. return [selfAdd, aiAdd];
  9333. }
  9334. judgeScoreEnd(selfAdd, aiAdd) {
  9335. this.selfScore += selfAdd;
  9336. this.aiScore += aiAdd;
  9337. this.updateAIScore();
  9338. this.updateSelfScore();
  9339. if (this.selfScore >= this.targertScore) {
  9340. this.success = true;
  9341. return true;
  9342. }
  9343. if (this.aiScore >= this.targertScore) {
  9344. this.success = false;
  9345. return true;
  9346. }
  9347. let ballArr = xGame.common.d2World.ballArr;
  9348. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9349. if (this.selfScore > this.aiScore) {
  9350. this.success = true;
  9351. return true;
  9352. }
  9353. else if (this.selfScore < this.aiScore) {
  9354. this.success = false;
  9355. return true;
  9356. }
  9357. else {
  9358. if (this.selfTurn) {
  9359. this.success = false;
  9360. }
  9361. else {
  9362. this.success = true;
  9363. }
  9364. return true;
  9365. }
  9366. }
  9367. }
  9368. clearIceSkill() {
  9369. let arr = xGame.common.d2World.ballArr;
  9370. let temp;
  9371. if (this.selfTurn) {
  9372. if (this.selfCurSkill == SkillType.ice) {
  9373. for (let index = 0; index < arr.length; index++) {
  9374. temp = arr[index];
  9375. if (temp.ballFunc == "ice") {
  9376. temp.setBallFunc("normal", "self");
  9377. }
  9378. }
  9379. }
  9380. }
  9381. else {
  9382. if (this.aiCurSkill == SkillType.ice) {
  9383. for (let index = 0; index < arr.length; index++) {
  9384. temp = arr[index];
  9385. if (temp.ballFunc == "ice") {
  9386. temp.setBallFunc("normal", "ai");
  9387. }
  9388. }
  9389. }
  9390. }
  9391. }
  9392. judgeNormalSuccess() {
  9393. if (this.selfTurn) {
  9394. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9395. this.success = true;
  9396. return true;
  9397. }
  9398. }
  9399. else {
  9400. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9401. this.success = false;
  9402. return true;
  9403. }
  9404. }
  9405. }
  9406. gameEnd() {
  9407. if (Moyu.isTT) {
  9408. xGame.common.screenImg = getScreenImg();
  9409. }
  9410. console.log("游戏结束", this.success);
  9411. xGame.common.aiPlayer.stopRun();
  9412. if (xGame.common.gameMode == GameMode.placeBall) {
  9413. this.getEndStarNum();
  9414. this.updatePlaceBallState();
  9415. }
  9416. this.isEnter = false;
  9417. Moyu.recordEnd(this, () => {
  9418. if (this.isEnter)
  9419. return;
  9420. this.isEnter = true;
  9421. console.log("进入录结束回调");
  9422. this.enterNext();
  9423. });
  9424. Laya.timer.once(1000, this, () => {
  9425. if (this.isEnter)
  9426. return;
  9427. this.isEnter = true;
  9428. this.enterNext();
  9429. });
  9430. xGame.common.longHelpLine = false;
  9431. }
  9432. enterNext() {
  9433. Laya.timer.clearAll(this);
  9434. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9435. xGame.uiMgr.Show(UIVideoShare, this.success);
  9436. }
  9437. else {
  9438. xGame.uiMgr.Show(UIGameEnd, this.success);
  9439. }
  9440. }
  9441. aiLeave() {
  9442. let ui = xGame.common.gameUI.ui;
  9443. ui.topNode.aiNameTxt.text = "offline";
  9444. }
  9445. aiGameEnd(suc) {
  9446. this.success = suc;
  9447. xGame.common.aiPlayer.stopRun();
  9448. if (this.success) {
  9449. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9450. Laya.timer.once(1000, this, () => {
  9451. this.clearTime();
  9452. this.gameEnd();
  9453. });
  9454. }
  9455. }
  9456. openTimer() {
  9457. let src = xGame.common.gameUI;
  9458. if (this.selfTurn) {
  9459. src.ui.topNode.selfProgress.visible = true;
  9460. src.ui.topNode.aiProgress.visible = false;
  9461. this.curTimer = src.ui.topNode.selfProgress;
  9462. }
  9463. else {
  9464. src.ui.topNode.selfProgress.visible = false;
  9465. src.ui.topNode.aiProgress.visible = true;
  9466. this.curTimer = src.ui.topNode.aiProgress;
  9467. }
  9468. this.accTime = 0;
  9469. Laya.timer.clearAll(this);
  9470. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9471. this.curTimer.value = 100;
  9472. }
  9473. updateTime(dt) {
  9474. if (this.gamePause)
  9475. return;
  9476. this.accTime += dt;
  9477. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9478. if (this.accTime >= this.setTime) {
  9479. this.clearTime();
  9480. console.log("时钟进入了gameRun");
  9481. this.gameRun(FoulType.timeOut);
  9482. }
  9483. }
  9484. clearTime() {
  9485. let src = xGame.common.gameUI;
  9486. src.ui.topNode.selfProgress.visible = false;
  9487. src.ui.topNode.aiProgress.visible = false;
  9488. Laya.timer.clearAll(this);
  9489. }
  9490. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9491. let ui = xGame.common.gameUI.ui;
  9492. let selfMsg, aiMsg;
  9493. if (sayWords) {
  9494. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9495. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9496. if (Foul) {
  9497. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9498. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9499. this.placeRootBall();
  9500. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9501. if (this.curFoul == FoulType.rootHole) {
  9502. if (!DataMgr.getRootBallFoul()) {
  9503. DataMgr.setRootBallFoul();
  9504. aiMsg = "";
  9505. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9506. let woman = "Boss, pay attention next time~";
  9507. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9508. }
  9509. }
  9510. else if (this.curFoul == FoulType.timeOut) {
  9511. if (!DataMgr.getTimeoutFoul()) {
  9512. DataMgr.setTimeoutFoul();
  9513. aiMsg = "";
  9514. let tips = "Game timeout, 3 fouls, this game failed.";
  9515. let woman = "Boss, pay attention to the timeline~";
  9516. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9517. }
  9518. }
  9519. }
  9520. }
  9521. }
  9522. if (this.selfTurn) {
  9523. if (sayWords) {
  9524. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9525. ui.selfTurn.visible = true;
  9526. ui.aiTurn.visible = false;
  9527. ui.selfTurn.t0.play();
  9528. Moyu.vibration();
  9529. });
  9530. }
  9531. }
  9532. else {
  9533. let aiNum = xGame.tools.random(1, 11);
  9534. let challengeNum = DataMgr.getChallengeTimes();
  9535. let delay = false;
  9536. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9537. aiNum = 9;
  9538. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9539. aiNum = 3;
  9540. if (challengeNum == 3) {
  9541. if (!this.showLongView) {
  9542. this.showLongView = true;
  9543. delay = true;
  9544. }
  9545. }
  9546. }
  9547. }
  9548. if (delay) {
  9549. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9550. if (success) {
  9551. xGame.common.longHelpLine = true;
  9552. xGame.common.d2World.getHelpLine();
  9553. }
  9554. else {
  9555. aiNum = 10;
  9556. }
  9557. xGame.common.aiPlayer.setAiLevel(aiNum);
  9558. if (sayWords) {
  9559. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9560. xGame.common.aiPlayer.runAI();
  9561. ui.selfTurn.visible = false;
  9562. ui.aiTurn.visible = true;
  9563. ui.aiTurn.t0.play();
  9564. });
  9565. }
  9566. else {
  9567. xGame.common.aiPlayer.runAI();
  9568. }
  9569. this.openTimer();
  9570. this.finishOneShoot = true;
  9571. if (this.selfTurn) {
  9572. ui.topNode.selfKuang.visible = true;
  9573. ui.topNode.aiKuang.visible = false;
  9574. ui.topNode.selfTips.visible = true;
  9575. ui.topNode.aiTips.visible = false;
  9576. }
  9577. else {
  9578. ui.topNode.selfKuang.visible = false;
  9579. ui.topNode.aiKuang.visible = true;
  9580. ui.topNode.selfTips.visible = false;
  9581. ui.topNode.aiTips.visible = true;
  9582. }
  9583. });
  9584. return;
  9585. }
  9586. if (xGame.common.gameMode == GameMode.classic) {
  9587. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9588. if (cfg) {
  9589. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9590. aiNum = aiLevel;
  9591. }
  9592. }
  9593. xGame.common.aiPlayer.setAiLevel(aiNum);
  9594. if (sayWords) {
  9595. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9596. xGame.common.aiPlayer.runAI();
  9597. ui.selfTurn.visible = false;
  9598. ui.aiTurn.visible = true;
  9599. ui.aiTurn.t0.play();
  9600. });
  9601. }
  9602. else {
  9603. xGame.common.aiPlayer.runAI();
  9604. }
  9605. }
  9606. this.openTimer();
  9607. this.finishOneShoot = true;
  9608. if (this.selfTurn) {
  9609. ui.topNode.selfKuang.visible = true;
  9610. ui.topNode.aiKuang.visible = false;
  9611. ui.topNode.selfTips.visible = true;
  9612. ui.topNode.aiTips.visible = false;
  9613. }
  9614. else {
  9615. ui.topNode.selfKuang.visible = false;
  9616. ui.topNode.aiKuang.visible = true;
  9617. ui.topNode.selfTips.visible = false;
  9618. ui.topNode.aiTips.visible = true;
  9619. }
  9620. }
  9621. placeRootBall() {
  9622. let rootBall = xGame.common.d2World.rootBall;
  9623. if (!rootBall)
  9624. return;
  9625. rootBall.gameObj.x = this.lastRootBallPos.x;
  9626. rootBall.gameObj.y = this.lastRootBallPos.y;
  9627. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9628. let moveNode = xGame.common.gameUI.ui.moveNode;
  9629. moveNode.visible = true;
  9630. moveNode.x = this.lastRootBallPos.x;
  9631. moveNode.y = this.lastRootBallPos.y;
  9632. if (!this.selfTurn) {
  9633. xGame.common.aiPlayer.resetRoot();
  9634. }
  9635. }
  9636. }
  9637. class ui_guanyuAni extends fgui.GComponent {
  9638. static createInstance() {
  9639. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9640. }
  9641. onConstruct() {
  9642. this.n0 = (this.getChild("n0"));
  9643. }
  9644. }
  9645. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9646. class UIFireworks extends UIBase {
  9647. constructor() {
  9648. super();
  9649. }
  9650. onConstructor() {
  9651. this.isEject = false;
  9652. }
  9653. show(callback) {
  9654. super.show();
  9655. }
  9656. }
  9657. UIFireworks.uiName = "UIFireworks";
  9658. class ui_UIGuanYu extends fgui.GComponent {
  9659. static createInstance() {
  9660. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9661. }
  9662. onConstruct() {
  9663. this.n2 = (this.getChild("n2"));
  9664. this.n1 = (this.getChild("n1"));
  9665. this.n3 = (this.getChild("n3"));
  9666. this.n4 = (this.getChild("n4"));
  9667. this.n5 = (this.getChild("n5"));
  9668. this.n6 = (this.getChild("n6"));
  9669. this.n8 = (this.getChild("n8"));
  9670. this.n7 = (this.getChild("n7"));
  9671. this.t0 = this.getTransition("t0");
  9672. }
  9673. }
  9674. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9675. class UIGuanYu extends UIBase {
  9676. constructor() {
  9677. super();
  9678. }
  9679. onConstructor() {
  9680. this.ui = ui_UIGuanYu.createInstance();
  9681. this.contentPane = this.ui;
  9682. this.isEject = false;
  9683. }
  9684. show(callback) {
  9685. super.show();
  9686. this.ui.t0.play(Laya.Handler.create(this, () => {
  9687. callback && callback();
  9688. this.hide();
  9689. }));
  9690. }
  9691. }
  9692. UIGuanYu.uiName = "UIGuanYu";
  9693. class SkillMgr {
  9694. constructor() {
  9695. this.leveNum = 0;
  9696. this.extraScore = 0;
  9697. this.selfTurn = false;
  9698. this.playedLastSkill = false;
  9699. this.tweenArr = [];
  9700. this._finishNum = 0;
  9701. this._curFinish = 0;
  9702. this._rootX = 0;
  9703. this._rootY = 0;
  9704. this.knifeTimes = 0;
  9705. this.knifeV2 = new Laya.Vector2();
  9706. this.knifeV3 = new Laya.Vector3();
  9707. this.rtStarX = 0;
  9708. this.rtStarY = 0;
  9709. this.addBigSkillSpine();
  9710. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9711. }
  9712. addBigSkillSpine() {
  9713. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9714. console.log("extra2 success");
  9715. });
  9716. }
  9717. runBigSkill(callback) {
  9718. this.tweenArr = [];
  9719. this.callback = callback;
  9720. this.judgeSkill();
  9721. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9722. let guide = DataMgr.getSkillGuide();
  9723. if (!xGame.common.gameMgr.selfTurn) {
  9724. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9725. }
  9726. else {
  9727. if (xGame.common.temSelfLevel != 0) {
  9728. this.leveNum = xGame.common.temSelfLevel;
  9729. }
  9730. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9731. this.leveNum += 5;
  9732. }
  9733. }
  9734. if (guide == 0) {
  9735. DataMgr.setSkillGuide(1);
  9736. if (DataMgr.getNewUser()) {
  9737. Moyu.sendDataEvent("gameFirstPlay");
  9738. DataMgr.setNewUser();
  9739. }
  9740. }
  9741. this.playSpineAni(() => {
  9742. switch (this.curSkill) {
  9743. case SkillType.highSpace:
  9744. this.runHighSpace();
  9745. break;
  9746. case SkillType.breakArmy:
  9747. this.runBreakArmy();
  9748. break;
  9749. case SkillType.ice:
  9750. this.runIce();
  9751. break;
  9752. case SkillType.fireworks:
  9753. this.runFireworks();
  9754. break;
  9755. case SkillType.GuanYu:
  9756. this.runGuanYu();
  9757. break;
  9758. default:
  9759. break;
  9760. }
  9761. });
  9762. }
  9763. judgeSkill() {
  9764. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9765. let gameMgr = xGame.common.gameMgr;
  9766. let type;
  9767. for (let index = 0; index < typeArr.length; index++) {
  9768. type = typeArr[index];
  9769. if (gameMgr.selfTurn) {
  9770. if (gameMgr.selfCurSkill == type) {
  9771. this.selfTurn = true;
  9772. this.curSkill = type;
  9773. return;
  9774. }
  9775. }
  9776. else {
  9777. if (gameMgr.aiCurSkill == type) {
  9778. this.selfTurn = false;
  9779. this.curSkill = type;
  9780. return;
  9781. }
  9782. }
  9783. }
  9784. }
  9785. playSpineAni(callback) {
  9786. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9787. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9788. parent.destroyChildren();
  9789. let aniIndex = 0;
  9790. let skillSpine;
  9791. switch (this.curSkill) {
  9792. case SkillType.highSpace:
  9793. aniIndex = 1;
  9794. xGame.soundMgr.playSound("skill01");
  9795. skillSpine = this.skillSpine2;
  9796. data.scaleX = 0.5;
  9797. data.scaleY = 0.5;
  9798. skillSpine.play(data, 1, false, parent, () => {
  9799. callback && callback();
  9800. });
  9801. break;
  9802. case SkillType.breakArmy:
  9803. aniIndex = 2;
  9804. xGame.soundMgr.playSound("skill02");
  9805. skillSpine = this.skillSpine2;
  9806. data.scaleX = 0.5;
  9807. data.scaleY = 0.5;
  9808. skillSpine.play(data, 2, false, parent, () => {
  9809. callback && callback();
  9810. });
  9811. break;
  9812. case SkillType.ice:
  9813. aniIndex = 0;
  9814. xGame.soundMgr.playSound("skill03");
  9815. skillSpine = this.skillSpine2;
  9816. data.scaleX = 0.5;
  9817. data.scaleY = 0.5;
  9818. skillSpine.play(data, 0, false, parent, () => {
  9819. callback && callback();
  9820. });
  9821. break;
  9822. case SkillType.fireworks:
  9823. xGame.soundMgr.playSound("skill_04_01");
  9824. xGame.soundMgr.playSound("skill04");
  9825. xGame.uiMgr.Show(UIFireworks, callback);
  9826. break;
  9827. case SkillType.GuanYu:
  9828. xGame.soundMgr.playSound("skill05_1");
  9829. xGame.soundMgr.playSound("skill05");
  9830. xGame.uiMgr.Show(UIGuanYu, callback);
  9831. break;
  9832. default:
  9833. break;
  9834. }
  9835. }
  9836. getAllBallArr() {
  9837. let arr = xGame.common.d2World.ballArr;
  9838. let outArr = [];
  9839. for (let index = 0; index < arr.length; index++) {
  9840. if (arr[index] instanceof D2RootBallSrc)
  9841. continue;
  9842. if (arr[index].ballFunc == "ice")
  9843. continue;
  9844. if (arr[index].destroyed)
  9845. continue;
  9846. outArr.push(arr[index]);
  9847. }
  9848. return outArr;
  9849. }
  9850. getOneArr(deletObj) {
  9851. let allArr = this.getAllBallArr();
  9852. let temp;
  9853. for (let index = 0; index < allArr.length; index++) {
  9854. temp = allArr[index];
  9855. if (temp.id == deletObj.id) {
  9856. allArr.splice(index, 1);
  9857. break;
  9858. }
  9859. }
  9860. return allArr;
  9861. }
  9862. getNearBallBag(ball) {
  9863. let ui = xGame.common.gameUI.ui;
  9864. let circleArr = [];
  9865. for (let index = 1; index <= 6; index++) {
  9866. circleArr.push(ui.border["circle" + index]);
  9867. }
  9868. let outIndex = 0;
  9869. let temp;
  9870. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9871. ;
  9872. let dis = 0;
  9873. for (let index = 1; index < circleArr.length; index++) {
  9874. temp = circleArr[index];
  9875. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9876. if (dis < min) {
  9877. min = dis;
  9878. outIndex = index;
  9879. }
  9880. }
  9881. return [circleArr[outIndex], outIndex];
  9882. }
  9883. ballFlyToBag(ballArr, time = 300) {
  9884. let temp;
  9885. let hole;
  9886. this._finishNum = ballArr.length;
  9887. this._curFinish = 0;
  9888. let holeObj = {};
  9889. let holeCfg = {
  9890. "1": 0,
  9891. "2": 0,
  9892. "3": 0,
  9893. "4": 0,
  9894. "5": 0,
  9895. "6": 0
  9896. };
  9897. for (let index = 0; index < ballArr.length; index++) {
  9898. temp = ballArr[index];
  9899. temp.outColli.isSensor = true;
  9900. temp.innerColli.isSensor = true;
  9901. temp.isRunSkillAni = true;
  9902. let holeArr = this.getNearBallBag(temp);
  9903. hole = holeArr[0];
  9904. holeObj[index] = holeArr[1];
  9905. temp.d3BallSrc.scaleXYZ = 0.5;
  9906. this.tweenArr.push(temp.d3BallSrc, temp);
  9907. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9908. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9909. }));
  9910. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9911. let mIndex = holeObj[this._curFinish];
  9912. let isDone = holeCfg[mIndex];
  9913. if (isDone) {
  9914. ballArr[this._curFinish].checkWrongBall(false);
  9915. }
  9916. else {
  9917. holeCfg[mIndex] = 1;
  9918. ballArr[this._curFinish].checkWrongBall();
  9919. }
  9920. this._curFinish++;
  9921. if (this._curFinish >= this._finishNum) {
  9922. if (this.curSkill == SkillType.highSpace) {
  9923. }
  9924. else if (this.curSkill == SkillType.breakArmy) {
  9925. let rootBall = xGame.common.d2World.rootBall;
  9926. rootBall.gameObj.x = this._rootX;
  9927. rootBall.gameObj.y = this._rootY;
  9928. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9929. xGame.common.d2World.d2Gan.ui.visible = true;
  9930. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9931. xGame.common.d2World.getHelpLine();
  9932. this.callback && this.callback(this.extraScore);
  9933. }
  9934. }
  9935. }));
  9936. }
  9937. }
  9938. runHighSpace() {
  9939. let rootBall = xGame.common.d2World.rootBall;
  9940. rootBall.showSelf();
  9941. let d3Src = rootBall.d3BallSrc;
  9942. let allArr = this.getAllBallArr();
  9943. if (allArr.length <= 0) {
  9944. this.callback && this.callback(0);
  9945. return;
  9946. }
  9947. let selectBall = xGame.common.d2World.targetBall;
  9948. let wrong = selectBall && selectBall.destroyed;
  9949. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9950. selectBall = xGame.common.getRandArrEle(allArr);
  9951. }
  9952. let targetD3Src = selectBall.d3BallSrc;
  9953. xGame.common.d2World.d2Gan.ui.visible = false;
  9954. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9955. d3Src.scaleXYZ = 0.5;
  9956. this.tweenArr.push(d3Src);
  9957. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9958. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9959. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9960. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9961. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9962. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9963. let outArr = [selectBall];
  9964. let other = this.leveNum - 1;
  9965. if (other > 0) {
  9966. let nearArr = this.getOneArr(selectBall);
  9967. if (nearArr.length > 0) {
  9968. xGame.common.botherArr(nearArr);
  9969. if (other >= nearArr.length)
  9970. other = nearArr.length;
  9971. for (let index = 0; index < other; index++) {
  9972. outArr.push(nearArr[index]);
  9973. }
  9974. }
  9975. }
  9976. xGame.common.extraMoveNum = other + 1;
  9977. this.extraScore = other + 1;
  9978. this._rootX = selectBall.gameObj.x;
  9979. this._rootY = selectBall.gameObj.y;
  9980. rootBall.gameObj.x = this._rootX;
  9981. rootBall.gameObj.y = this._rootY;
  9982. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9983. Laya.Tween.clearAll(d3Src);
  9984. this.addRandomForce(outArr);
  9985. }));
  9986. }));
  9987. }
  9988. addRandomForce(outArr) {
  9989. if (outArr.length > 0) {
  9990. xGame.common.d2World.openCheckStill = true;
  9991. this.playedLastSkill = true;
  9992. }
  9993. let temp;
  9994. for (let index = 0; index < outArr.length; index++) {
  9995. let angle = xGame.common.randomNum(0, 360);
  9996. let linearPercent = xGame.common.randomNum(65, 100);
  9997. temp = outArr[index];
  9998. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9999. }
  10000. }
  10001. setLinearSpeed(angle, rigy, linearPercent) {
  10002. let sin = Math.sin(angle * Math.PI / 180);
  10003. let cos = Math.cos(angle * Math.PI / 180);
  10004. let maxSpeed = 4;
  10005. let speed = new Laya.Vector2();
  10006. speed.x = maxSpeed * linearPercent * sin;
  10007. speed.y = -maxSpeed * linearPercent * cos;
  10008. rigy.applyLinearImpulseToCenter(speed);
  10009. }
  10010. runBreakArmy() {
  10011. xGame.common.d2World.d2Gan.ui.visible = false;
  10012. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10013. let gameUI = xGame.common.gameUI.ui;
  10014. gameUI.skillRod.visible = true;
  10015. gameUI.skillRod.rotation = 110;
  10016. let outArr = this.getAllBallArr();
  10017. if (outArr.length <= 0) {
  10018. gameUI.skillRod.visible = false;
  10019. this.callback && this.callback(0);
  10020. return;
  10021. }
  10022. xGame.common.botherArr(outArr);
  10023. if (this.leveNum >= outArr.length)
  10024. this.leveNum = outArr.length;
  10025. let deleteNum = outArr.length - this.leveNum;
  10026. outArr.splice(0, deleteNum);
  10027. this.extraScore = this.leveNum;
  10028. let potX = gameUI.skillRod.x;
  10029. let potY = gameUI.skillRod.y;
  10030. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10031. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10032. let disArr = [];
  10033. for (let index = 0; index < outArr.length; index++) {
  10034. let obj = outArr[index];
  10035. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10036. dis = Math.pow(dis, 0.5);
  10037. disArr.push(dis);
  10038. }
  10039. this.tweenArr.push(gameUI.skillRod);
  10040. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10041. })).update = Laya.Handler.create(this, (e, t, c) => {
  10042. let angle = gameUI.skillRod.rotation;
  10043. let xx;
  10044. let yy;
  10045. let temp;
  10046. for (let index = 0; index < outArr.length; index++) {
  10047. temp = outArr[index];
  10048. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10049. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10050. yy -= 20;
  10051. temp.gameObj.x = xx;
  10052. temp.gameObj.y = yy;
  10053. temp.d3BallSrc.setTransPos(xx, yy);
  10054. }
  10055. if (angle <= 60) {
  10056. Laya.Tween.clearAll(gameUI.skillRod);
  10057. this.ballFlyToBag(outArr, 150);
  10058. gameUI.skillRod.visible = false;
  10059. }
  10060. }, null, false);
  10061. }
  10062. runIce() {
  10063. let ballArr = xGame.common.d2World.ballArr;
  10064. this.leveNum *= 2;
  10065. if (this.leveNum >= ballArr.length - 1)
  10066. this.leveNum = ballArr.length - 1;
  10067. let tempArr = [];
  10068. let outArr = [];
  10069. for (let index = 0; index < ballArr.length; index++) {
  10070. if (ballArr[index] instanceof D2RootBallSrc)
  10071. continue;
  10072. tempArr.push(ballArr[index]);
  10073. }
  10074. if (tempArr.length <= 0) {
  10075. this.callback && this.callback(0);
  10076. return;
  10077. }
  10078. xGame.common.botherArr(tempArr);
  10079. for (let index = 0; index < this.leveNum; index++) {
  10080. outArr.push(tempArr[index]);
  10081. }
  10082. this.extraScore = this.leveNum;
  10083. let temp;
  10084. for (let index = 0; index < outArr.length; index++) {
  10085. temp = outArr[index];
  10086. temp.d3BallSrc.playIceEft();
  10087. }
  10088. Laya.timer.once(2000, this, () => {
  10089. for (let index = 0; index < outArr.length; index++) {
  10090. temp = outArr[index];
  10091. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10092. temp.setBallFunc("ice", str);
  10093. }
  10094. this.callback && this.callback(0);
  10095. });
  10096. }
  10097. runFireworks() {
  10098. let allArr = this.getAllBallArr();
  10099. if (allArr.length <= 0) {
  10100. this.callback && this.callback(0);
  10101. return;
  10102. }
  10103. xGame.common.d2World.d2Gan.ui.visible = false;
  10104. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10105. let outArr = [];
  10106. let other = this.leveNum;
  10107. if (other > 0) {
  10108. if (allArr.length > 0) {
  10109. xGame.common.botherArr(allArr);
  10110. if (other >= allArr.length)
  10111. other = allArr.length;
  10112. for (let index = 0; index < other; index++) {
  10113. outArr.push(allArr[index]);
  10114. }
  10115. }
  10116. }
  10117. xGame.common.extraMoveNum = other;
  10118. this.extraScore = other;
  10119. this.addRandmomFireworks(outArr);
  10120. }
  10121. addRandmomFireworks(outArr) {
  10122. Laya.timer.once(1100, this, () => {
  10123. if (outArr.length > 0) {
  10124. xGame.common.d2World.openCheckStill = true;
  10125. this.playedLastSkill = true;
  10126. }
  10127. });
  10128. xGame.soundMgr.playSound("skill_04_02");
  10129. let temp;
  10130. let delay = -200;
  10131. for (let index = 0; index < outArr.length; index++) {
  10132. temp = outArr[index];
  10133. delay += 200;
  10134. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10135. let angle = xGame.common.randomNum(0, 360);
  10136. angle = this.getFireworksAngle(obj);
  10137. let linearPercent = xGame.common.randomNum(45, 80);
  10138. if (!obj.destroyed)
  10139. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10140. });
  10141. }
  10142. }
  10143. getFireworksAngle(obj) {
  10144. let rootBall = xGame.common.d2World.rootBall;
  10145. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10146. }
  10147. resetGame() {
  10148. Laya.timer.clearAll(this);
  10149. if (this.tweenArr) {
  10150. for (let index = 0; index < this.tweenArr.length; index++) {
  10151. Laya.Tween.clearAll(this.tweenArr[index]);
  10152. }
  10153. }
  10154. this.tweenArr = null;
  10155. }
  10156. runGuanYu() {
  10157. xGame.common.d2World.d2Gan.ui.visible = false;
  10158. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10159. let rootBall = xGame.common.d2World.rootBall;
  10160. if (rootBall.isInHole) {
  10161. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10162. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10163. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10164. rootBall.showSelf();
  10165. }
  10166. this.rtStarX = rootBall.gameObj.x;
  10167. this.rtStarY = rootBall.gameObj.y;
  10168. this.knifeTimes = 0;
  10169. this.playedLastSkill = true;
  10170. rootBall.forceRun = true;
  10171. rootBall.rigy.type = "static";
  10172. xGame.common.d2World.openCheckStill = true;
  10173. this.guanyuRandomKnife();
  10174. }
  10175. guanyuRandomKnife() {
  10176. let rootBall = xGame.common.d2World.rootBall;
  10177. let dir = this.getRandDir();
  10178. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10179. console.log("当前angle", angle);
  10180. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10181. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10182. let dis = 324;
  10183. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10184. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10185. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10186. this.rtStarX = rootBall.gameObj.x;
  10187. this.rtStarY = rootBall.gameObj.y;
  10188. this.knifeTimes++;
  10189. let skillLevel;
  10190. if (xGame.common.gameMgr.selfTurn) {
  10191. skillLevel = DataMgr.getBigSkillByIndex(4);
  10192. }
  10193. else {
  10194. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10195. }
  10196. if (!skillLevel)
  10197. skillLevel = 1;
  10198. skillLevel += 2;
  10199. if (this.knifeTimes < skillLevel) {
  10200. Laya.timer.once(400, this, () => {
  10201. this.guanyuRandomKnife();
  10202. });
  10203. }
  10204. else {
  10205. rootBall.forceRun = false;
  10206. rootBall.rigy.type = "dynamic";
  10207. xGame.common.extraMoveNum = skillLevel;
  10208. }
  10209. }));
  10210. }
  10211. getRandDir() {
  10212. let rootBall = xGame.common.d2World.rootBall;
  10213. let allBall = this.getAllBallArr();
  10214. let target = xGame.common.getRandArrEle(allBall);
  10215. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10216. return this.knifeV2;
  10217. }
  10218. cloneKnife(x, y, rotation) {
  10219. let parent = xGame.common.d3World.knifeRoot;
  10220. let prefab = xGame.common.d3World.knife;
  10221. let clone = prefab.clone();
  10222. parent.addChild(clone);
  10223. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10224. clone.transform.localPositionX = this.knifeV3.x;
  10225. clone.transform.localPositionY = 0;
  10226. clone.transform.localPositionZ = this.knifeV3.z;
  10227. clone.transform.localRotationEulerX = 0;
  10228. clone.transform.localRotationEulerY = rotation;
  10229. clone.transform.localRotationEulerZ = 0;
  10230. clone.active = true;
  10231. return clone;
  10232. }
  10233. cloneGuanYuEft(x, y, angle) {
  10234. return;
  10235. let parent = xGame.common.gameUI.ui.guanyuNode;
  10236. let eft = new ui_guanyuAni();
  10237. eft.parent = parent;
  10238. eft.x = x;
  10239. eft.y = y;
  10240. eft.rotation = angle;
  10241. }
  10242. }
  10243. class ui_UIWordsList extends fgui.GComponent {
  10244. static createInstance() {
  10245. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10246. }
  10247. onConstruct() {
  10248. this.c1 = this.getController("c1");
  10249. this.n74 = (this.getChild("n74"));
  10250. this.clickNode = (this.getChild("clickNode"));
  10251. this.myNode = (this.getChild("myNode"));
  10252. this.n68 = (this.getChild("n68"));
  10253. this.n66 = (this.getChild("n66"));
  10254. this.n55 = (this.getChild("n55"));
  10255. this.wordsBtn = (this.getChild("wordsBtn"));
  10256. this.emotionBtn = (this.getChild("emotionBtn"));
  10257. this.mybggg = (this.getChild("mybggg"));
  10258. this.wordsList = (this.getChild("wordsList"));
  10259. this.emotionList = (this.getChild("emotionList"));
  10260. this.myRoot = (this.getChild("myRoot"));
  10261. }
  10262. }
  10263. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10264. class EmotionDisplay {
  10265. constructor(index, ui) {
  10266. this.ui = ui;
  10267. this.index = index;
  10268. this.ui.onClick(this, this.clickSelf);
  10269. this.updateSelf();
  10270. }
  10271. updateSelf() {
  10272. let data = cfgTable.emotionData[this.index + 1];
  10273. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10274. }
  10275. clickSelf() {
  10276. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10277. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10278. xGame.common.talkMgr.closeTalkView();
  10279. }
  10280. }
  10281. class WordsDisplay {
  10282. constructor(index, ui) {
  10283. this.ui = ui;
  10284. this.index = index;
  10285. this.ui.onClick(this, this.clickSelf);
  10286. this.updateSelf();
  10287. }
  10288. updateSelf() {
  10289. let data = cfgTable.talkwordsData[this.index + 1];
  10290. this.ui.txt.text = data.msg;
  10291. }
  10292. clickSelf() {
  10293. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10294. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10295. xGame.common.talkMgr.closeTalkView();
  10296. }
  10297. }
  10298. class UIWordsList extends UIBase {
  10299. constructor() {
  10300. super();
  10301. }
  10302. onConstructor() {
  10303. this.ui = ui_UIWordsList.createInstance();
  10304. this.contentPane = this.ui;
  10305. this.isEject = false;
  10306. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10307. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10308. this.addUIClick(this.ui.clickNode, this.hide);
  10309. this.initTalkList();
  10310. this.initEmotionList();
  10311. }
  10312. show() {
  10313. super.show();
  10314. }
  10315. initTalkList() {
  10316. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10317. let data = cfgTable.talkwordsData;
  10318. let length = Object.keys(data).length;
  10319. this.ui.wordsList.numItems = length;
  10320. }
  10321. initEmotionList() {
  10322. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10323. let data = cfgTable.emotionData;
  10324. let length = Object.keys(data).length;
  10325. this.ui.emotionList.numItems = length;
  10326. }
  10327. renderTalkItem(index, obj) {
  10328. let temp = new WordsDisplay(index, obj);
  10329. }
  10330. renderEmotionItem(index, obj) {
  10331. let temp = new EmotionDisplay(index, obj);
  10332. }
  10333. openTalkList() {
  10334. this.ui.c1.selectedIndex = 0;
  10335. }
  10336. openEmotionList() {
  10337. this.ui.c1.selectedIndex = 1;
  10338. }
  10339. }
  10340. UIWordsList.uiName = "UIWordsList";
  10341. class TalkMgr {
  10342. constructor() {
  10343. this.aiSpeak = true;
  10344. this.emotionList = [];
  10345. this.talkList = [];
  10346. this.addEvent();
  10347. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10348. this.emotionList = [];
  10349. this.talkList = [];
  10350. for (let k in cfgTable.emotionData) {
  10351. this.emotionList.push(cfgTable.emotionData[k].id);
  10352. }
  10353. for (let k in cfgTable.talkwordsData) {
  10354. this.talkList.push(cfgTable.talkwordsData[k].id);
  10355. }
  10356. }
  10357. addEvent() {
  10358. let ui = xGame.common.gameUI.ui;
  10359. ui.wordsBtn.visible = true;
  10360. ui.wordsBtn.onClick(this, this.openTalkView);
  10361. ui.aiWordsBtn.visible = true;
  10362. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10363. }
  10364. openTalkView() {
  10365. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10366. xGame.uiMgr.Show(UIWordsList);
  10367. }
  10368. closeTalkView() {
  10369. xGame.uiMgr.Hide(UIWordsList);
  10370. }
  10371. clickAIState() {
  10372. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10373. this.aiSpeak = !this.aiSpeak;
  10374. this.changeAIState(this.aiSpeak);
  10375. }
  10376. changeAIState(speak) {
  10377. this.aiSpeak = speak;
  10378. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10379. if (speak) {
  10380. btn.c1.selectedIndex = 0;
  10381. }
  10382. else {
  10383. btn.c1.selectedIndex = 1;
  10384. }
  10385. }
  10386. showSelfTalk(wordsId) {
  10387. let ui = xGame.common.gameUI.ui;
  10388. ui.selfTalk.visible = true;
  10389. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10390. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10391. ui.selfTalk.t0.play();
  10392. }
  10393. showSelfEmotion(emotionId) {
  10394. let ui = xGame.common.gameUI.ui;
  10395. ui.selfTalk.visible = true;
  10396. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10397. this.selfSpine && this.selfSpine.dispose();
  10398. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10399. let spineData = cfgTable.emotionData[emotionId].spine;
  10400. this.selfSpine = new SpineMgr(spineData, () => {
  10401. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10402. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10403. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10404. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10405. });
  10406. ui.selfTalk.t0.play();
  10407. }
  10408. showAITalk(wordsId) {
  10409. if (!this.aiSpeak)
  10410. return;
  10411. if (DataMgr.gameData.gameCount < 2)
  10412. return;
  10413. if (wordsId < 1)
  10414. wordsId = this.getRandTalk();
  10415. let ui = xGame.common.gameUI.ui;
  10416. ui.aiTalk.visible = true;
  10417. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10418. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10419. ui.aiTalk.t0.play();
  10420. }
  10421. getRandTalk() {
  10422. let rand = xGame.tools.random(0, this.talkList.length);
  10423. return this.emotionList[rand];
  10424. }
  10425. getRandEmotion() {
  10426. let rand = xGame.tools.random(0, this.emotionList.length);
  10427. return this.emotionList[rand];
  10428. }
  10429. showAIEmotion(emotionId) {
  10430. if (!this.aiSpeak)
  10431. return;
  10432. if (DataMgr.gameData.gameCount < 2)
  10433. return;
  10434. if (emotionId < 1)
  10435. emotionId = this.getRandEmotion();
  10436. let ui = xGame.common.gameUI.ui;
  10437. ui.aiTalk.visible = true;
  10438. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10439. this.aiSpine && this.aiSpine.dispose();
  10440. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10441. let spineData = cfgTable.emotionData[emotionId].spine;
  10442. this.aiSpine = new SpineMgr(spineData, () => {
  10443. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10444. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10445. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10446. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10447. });
  10448. ui.aiTalk.t0.play();
  10449. }
  10450. resetGame() {
  10451. let ui = xGame.common.gameUI.ui;
  10452. ui.aiTalk.visible = false;
  10453. ui.selfTalk.visible = false;
  10454. this.aiSpine && this.aiSpine.dispose();
  10455. this.selfSpine && this.selfSpine.dispose();
  10456. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10457. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10458. this.closeTalkView();
  10459. }
  10460. }
  10461. class WordsMgr {
  10462. constructor() {
  10463. this.comboTimes = 1;
  10464. this.skillTimes = 0;
  10465. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10466. this.comboSpine = new SpineMgr("yxz_liangan");
  10467. this.skillSpine = new SpineMgr("yiganxqiu");
  10468. this.scoreSpine = new SpineMgr("defen");
  10469. }
  10470. setClassicCombo(isInterrupt) {
  10471. if (isInterrupt) {
  10472. this.comboTimes = 0;
  10473. }
  10474. }
  10475. playClassicWords(type, callback) {
  10476. this.callback = callback;
  10477. let aniIndex = type;
  10478. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10479. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10480. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10481. mySpine.destroy(true);
  10482. this.playClassicTimes();
  10483. });
  10484. }
  10485. playClassicTimes() {
  10486. this.comboTimes++;
  10487. if (this.comboTimes <= 1) {
  10488. this.callback && this.callback();
  10489. }
  10490. else {
  10491. let aniIndex = this.comboTimes - 1;
  10492. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10493. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10494. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10495. mySpine.destroy(true);
  10496. this.callback && this.callback();
  10497. });
  10498. }
  10499. }
  10500. playBigSkillTimes(times, callback) {
  10501. if (times <= 0) {
  10502. callback && callback();
  10503. return;
  10504. }
  10505. this.callback = callback;
  10506. let pre = "sz_0";
  10507. let aniIndex = 0;
  10508. this.getWordsImg(times, pre, () => {
  10509. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10510. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10511. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10512. let r1 = ``;
  10513. let r2 = ``;
  10514. if (times <= 9) {
  10515. r1 = `res/d2Res/${pre}${times}.png`;
  10516. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10517. aniIndex = 0;
  10518. }
  10519. else {
  10520. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10521. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10522. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10523. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10524. aniIndex = 1;
  10525. }
  10526. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10527. mySpine.destroy(true);
  10528. xGame.common.gameMgr.playSkillTips();
  10529. this.playScore(times);
  10530. xGame.common.playRandomMutiBallBigSkillSound();
  10531. }, mySpine);
  10532. });
  10533. }
  10534. playScore(score) {
  10535. let pre = "sz_";
  10536. let aniIndex = 0;
  10537. this.getWordsImg(score, pre, () => {
  10538. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10539. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10540. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10541. let r1 = ``;
  10542. let r2 = ``;
  10543. if (score <= 9) {
  10544. r1 = `res/d2Res/${pre}${score}.png`;
  10545. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10546. aniIndex = 0;
  10547. }
  10548. else {
  10549. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10550. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10551. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10552. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10553. aniIndex = 1;
  10554. }
  10555. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10556. mySpine.destroy(true);
  10557. this.callback && this.callback();
  10558. }, mySpine);
  10559. });
  10560. }
  10561. getWordsImg(number, pre = "", callback) {
  10562. let arr = [];
  10563. if (number <= 9) {
  10564. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10565. }
  10566. else {
  10567. 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 });
  10568. }
  10569. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10570. callback && callback();
  10571. }));
  10572. }
  10573. }
  10574. class ui_UIRodMethod extends fgui.GComponent {
  10575. static createInstance() {
  10576. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10577. }
  10578. onConstruct() {
  10579. this.n24 = (this.getChild("n24"));
  10580. this.white = (this.getChild("white"));
  10581. this.dot = (this.getChild("dot"));
  10582. this.sureBtn = (this.getChild("sureBtn"));
  10583. this.n20 = (this.getChild("n20"));
  10584. this.n21 = (this.getChild("n21"));
  10585. this.n22 = (this.getChild("n22"));
  10586. this.n23 = (this.getChild("n23"));
  10587. this.n5 = (this.getChild("n5"));
  10588. this.n14 = (this.getChild("n14"));
  10589. this.t0 = this.getTransition("t0");
  10590. }
  10591. }
  10592. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10593. class UIRodMethod extends UIBase {
  10594. constructor() {
  10595. super();
  10596. this.isPressd = false;
  10597. }
  10598. onConstructor() {
  10599. this.ui = ui_UIRodMethod.createInstance();
  10600. this.contentPane = this.ui;
  10601. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10602. this.moveDir = new Laya.Vector2();
  10603. this.moveDest = new Laya.Vector2();
  10604. this.centerPos = new Laya.Vector2();
  10605. xGame.common.uiRodMethod = this;
  10606. }
  10607. show() {
  10608. super.show();
  10609. xGame.common.gameMgr.gamePause = true;
  10610. this.openPressDotEvent();
  10611. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10612. this.centerPos.x = this.ui.white.x;
  10613. this.centerPos.y = this.ui.white.y;
  10614. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10615. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10616. this.setDot();
  10617. }
  10618. setDot() {
  10619. this.ui.dot.x = this.moveDest.x;
  10620. this.ui.dot.y = this.moveDest.y;
  10621. }
  10622. closeSelf() {
  10623. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10624. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10625. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10626. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10627. xGame.common.gameMgr.gamePause = false;
  10628. this.hide();
  10629. }
  10630. openPressDotEvent() {
  10631. this.closePressDotEvent();
  10632. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10633. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10634. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10635. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10636. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10637. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10638. }
  10639. closePressDotEvent() {
  10640. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10641. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10642. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10643. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10644. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10645. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10646. }
  10647. onDown(e) {
  10648. if (e.type == Laya.Event.MOUSE_DOWN)
  10649. this.isPressd = true;
  10650. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10651. this.isPressd = false;
  10652. if (!this.isPressd)
  10653. return;
  10654. this.moveDest.x = e.stageX;
  10655. this.moveDest.y = e.stageY;
  10656. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10657. if (dis > 6724) {
  10658. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10659. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10660. }
  10661. this.setDot();
  10662. }
  10663. resetRod() {
  10664. this.ui.dot.x = this.ui.white.x;
  10665. this.ui.dot.y = this.ui.white.y;
  10666. this.gameRod.dot.x = this.gameRod.bg.x;
  10667. this.gameRod.dot.y = this.gameRod.bg.y;
  10668. xGame.common.rodOffest.x = 0;
  10669. xGame.common.rodOffest.y = 0;
  10670. }
  10671. }
  10672. UIRodMethod.uiName = "UIRodMethod";
  10673. class UIGame extends UIBase {
  10674. constructor() {
  10675. super();
  10676. this.powerNum = 0;
  10677. this.isD3Inited = false;
  10678. this.isPrePlay = false;
  10679. this.isMoveRod = false;
  10680. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10681. this.rulerDis = 20;
  10682. this.rulerOffset = 0;
  10683. }
  10684. onConstructor() {
  10685. this.ui = ui_UIGame.createInstance();
  10686. this.contentPane = this.ui;
  10687. this.ui.x += xGame.common.sysOffestNum;
  10688. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10689. this.isEject = false;
  10690. xGame.common.gameUI = this;
  10691. this.initSelf();
  10692. }
  10693. isTurnSelf() {
  10694. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10695. return true;
  10696. }
  10697. }
  10698. initSelf() {
  10699. let topUI = this.ui.topNode;
  10700. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10701. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10702. this.barInfo = {};
  10703. this.barInfo.curY = 0;
  10704. this.barInfo.height = this.ui.powerNode.height;
  10705. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10706. this.barInfo.powerStartY = this.ui.powerNode.y;
  10707. xGame.common.aiPlayer = new AIPlayer();
  10708. xGame.common.gameMgr = new GameMgr();
  10709. xGame.common.skillMgr = new SkillMgr();
  10710. xGame.common.wordsMgr = new WordsMgr();
  10711. xGame.common.talkMgr = new TalkMgr();
  10712. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10713. console.log("加载经典模式表情文件chenggon !");
  10714. });
  10715. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10716. console.log("挑战模式奖励模式spine加载成功!");
  10717. });
  10718. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10719. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10720. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10721. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10722. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10723. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10724. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10725. }
  10726. getGanZiImg() {
  10727. let index = DataMgr.getCurBallRod();
  10728. let data = cfgTable.ballrodData[index + 1];
  10729. let gan_url = xGame.common.getGameIconUrl(data.img);
  10730. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10731. this.ui.powerNode.showImg.url = gan_url;
  10732. console.log('zh:修改杆子图标O K');
  10733. }
  10734. returnHome() {
  10735. let tips = "Are you sure to exit the game?";
  10736. let woman = "Boss, why don't you play for a while longer?";
  10737. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10738. }
  10739. addRodMethodClick() {
  10740. if (this.isTurnSelf()) {
  10741. xGame.uiMgr.Show(UIRodMethod);
  10742. }
  10743. }
  10744. clickHelpLineBtn(force = false) {
  10745. if (!this.isTurnSelf())
  10746. return;
  10747. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10748. if (success) {
  10749. xGame.common.longHelpLine = true;
  10750. xGame.common.d2World.getHelpLine();
  10751. Moyu.sendDataEvent("guideNum");
  10752. }
  10753. else {
  10754. }
  10755. });
  10756. }
  10757. renderSelfDisplayBalls(index, target) {
  10758. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10759. target.myImg.url = xGame.common.getGameIconUrl(str);
  10760. }
  10761. renderAIDisplayBalls(index, target) {
  10762. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10763. target.myImg.url = xGame.common.getGameIconUrl(str);
  10764. ;
  10765. }
  10766. updateMode() {
  10767. if (xGame.common.gameMode == GameMode.classic) {
  10768. this.ui.topNode.scoreNode.visible = false;
  10769. }
  10770. else if (xGame.common.gameMode == GameMode.bigMove) {
  10771. this.ui.topNode.scoreNode.visible = true;
  10772. }
  10773. }
  10774. show() {
  10775. super.show();
  10776. console.log("zh:uigame show AADD");
  10777. this.ui.alpha = 0;
  10778. this.updateSelf();
  10779. xGame.common.gameMgr.gamePause = false;
  10780. xGame.common.gameUI.ui.blackAni.visible = false;
  10781. xGame.common.gameUI.ui.whiteAni.visible = false;
  10782. this.ui.powerEft.visible = false;
  10783. this.ui.colorNode.visible = false;
  10784. this.updateHead();
  10785. let curUse = DataMgr.getCurBallRod();
  10786. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10787. this.getGanZiImg();
  10788. }
  10789. updateSelf() {
  10790. if (xGame.common.gameMode == GameMode.classic) {
  10791. this.ui.c1.selectedIndex = 0;
  10792. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10793. this.ui.topNode.middleNode.visible = true;
  10794. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10795. }
  10796. else if (xGame.common.gameMode == GameMode.bigMove) {
  10797. this.ui.c1.selectedIndex = 0;
  10798. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10799. this.ui.topNode.middleNode.visible = false;
  10800. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10801. let rand = xGame.common.randomNum(1, max);
  10802. let guide = DataMgr.getSkillGuide();
  10803. if (guide == 0)
  10804. rand = 1;
  10805. xGame.common.bigMoveLevelIndex = rand;
  10806. }
  10807. else if (xGame.common.gameMode == GameMode.placeBall) {
  10808. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10809. this.ui.c1.selectedIndex = 1 + data.type;
  10810. this.ui.alpha = 1;
  10811. this.startGame();
  10812. }
  10813. this.updateMode();
  10814. this.initD3world();
  10815. this.initD2world();
  10816. }
  10817. startGame() {
  10818. this.ui.snowNode.visible = Math.random() <= 0.1;
  10819. this.ui.d2Node.visible = false;
  10820. xGame.common.d3World.d3Hand.gameObj.active = false;
  10821. xGame.common.d3World.tableSrc.init();
  10822. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10823. this.cameraViewChange(() => {
  10824. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10825. switch (xGame.common.gameMode) {
  10826. case GameMode.classic:
  10827. xGame.common.d3World.d3Hand.gameObj.active = true;
  10828. this.playPutBallD3Ani();
  10829. break;
  10830. case GameMode.bigMove:
  10831. this.enterGame();
  10832. Laya.timer.once(500, this, () => {
  10833. this.ui.topNode.middleNode.visible = true;
  10834. this.ui.topNode.middleNode.t0.play();
  10835. });
  10836. break;
  10837. case GameMode.placeBall:
  10838. this.enterGame();
  10839. break;
  10840. default:
  10841. break;
  10842. }
  10843. });
  10844. PlatMgr.showBanner(false);
  10845. }
  10846. enterGame() {
  10847. this.ui.d2Node.visible = true;
  10848. xGame.common.d3World.d3Hand.gameObj.active = false;
  10849. xGame.common.showOneCamera("mainCamera");
  10850. Moyu.recordGame(30, true);
  10851. if (!this.isPrePlay) {
  10852. this.isPrePlay = true;
  10853. xGame.common.d3World.prePlayEft();
  10854. }
  10855. xGame.common.gameMgr.gameReady();
  10856. this.openAllEvent();
  10857. this.ui.snowNode.visible = false;
  10858. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10859. this.ui.helpBtn.visible = condition;
  10860. }
  10861. showHelpLineGuide() {
  10862. let longGuide = DataMgr.getGuideHelpLine();
  10863. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10864. this.ui.helpBtn.visible = true;
  10865. this.ui.guideNode.visible = true;
  10866. }
  10867. }
  10868. setTurnAlpha(alpha) {
  10869. this.ui.keduNode.alpha = alpha;
  10870. this.ui.ganNode.alpha = alpha;
  10871. this.ui.rodMethodNode.alpha = alpha;
  10872. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10873. }
  10874. cameraViewChange(callback) {
  10875. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10876. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10877. xGame.common.showOneCamera("visitAngle");
  10878. cameraSrc.localRotationEulerY = 180;
  10879. cameraSrc.localRotationEulerZ = 0;
  10880. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10881. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10882. callback && callback();
  10883. }));
  10884. }));
  10885. }
  10886. playPutBallD3Ani() {
  10887. xGame.common.showOneCamera("mainCamera");
  10888. let handSrc = xGame.common.d3World.d3Hand;
  10889. handSrc.gameObj.active = true;
  10890. handSrc.transform.localPositionZ = 3;
  10891. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10892. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10893. handSrc.gameObj.active = false;
  10894. this.enterGame();
  10895. }), 400);
  10896. }));
  10897. }
  10898. updateHead() {
  10899. let user = Moyu.getUserInfo();
  10900. this.ui.topNode.selfNameTxt.text = user.nickName;
  10901. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10902. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10903. if (DataMgr.getSkillGuide() < 1) {
  10904. this.ui.topNode.aiNameTxt.text = 'billiards';
  10905. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10906. }
  10907. else {
  10908. this.ui.topNode.aiNameTxt.text = aiData.name;
  10909. let randNo = Math.floor(Math.random() * 10) + 1;
  10910. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10911. }
  10912. }
  10913. initD2world() {
  10914. let node = this.ui.d2Root.displayObject;
  10915. let src = node.getComponent(D2World);
  10916. if (!src) {
  10917. xGame.common.d2World = node.addComponent(D2World);
  10918. }
  10919. xGame.common.d2World.initSelf();
  10920. }
  10921. initD3world() {
  10922. if (this.isD3Inited)
  10923. return;
  10924. this.isD3Inited = true;
  10925. let scene3D = xGame.common.d3Scene;
  10926. this.ui.d3Root.displayObject.addChild(scene3D);
  10927. scene3D.active = true;
  10928. xGame.common.d3World.tableSrc.setBorderPos();
  10929. }
  10930. onRootMove(e) {
  10931. let rootBall = xGame.common.d2World.rootBall;
  10932. this.ui.moveNode.x = e.x;
  10933. this.ui.moveNode.y = e.y;
  10934. rootBall.gameObj.x = e.x;
  10935. rootBall.gameObj.y = e.y;
  10936. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10937. }
  10938. aiRootMove(move) {
  10939. if (move)
  10940. this.hideBallUI();
  10941. else {
  10942. this.showBallUI();
  10943. xGame.common.d2World.getHelpLine();
  10944. }
  10945. }
  10946. aiForce(type, force = 0) {
  10947. this.pressTarget = PressType.powerNode;
  10948. if (type == 1)
  10949. this.onEventUp({ force: true });
  10950. else if (type == 2)
  10951. this.onEventMove({ stageY: force, force: true });
  10952. }
  10953. onEventPress(e) {
  10954. if (e.stopPropagation)
  10955. e.stopPropagation();
  10956. if (!this.isTurnSelf())
  10957. return;
  10958. let target = e.target;
  10959. switch (target) {
  10960. case this.ui.myPowerNode.displayObject:
  10961. this.pressTarget = PressType.powerNode;
  10962. this.barInfo.curY = e.stageY;
  10963. this.updateBarInfo();
  10964. break;
  10965. case this.ui.moveNode.displayObject:
  10966. this.pressTarget = PressType.moveNode;
  10967. this.hideBallUI();
  10968. this.eventObj.curX = this.ui.moveNode.x;
  10969. this.eventObj.curY = this.ui.moveNode.y;
  10970. this.ui.moveNode.finger.visible = false;
  10971. this.eventObj.lastX = e.stageX;
  10972. this.eventObj.lastY = e.stageY;
  10973. break;
  10974. case this.ui.rulerClickNode.displayObject:
  10975. this.pressTarget = PressType.rulerNode;
  10976. this.eventObj.lastY = e.stageY;
  10977. break;
  10978. case this.ui.d2Root.displayObject:
  10979. this.pressTarget = PressType.d2Root;
  10980. this.eventObj.lastX = e.stageX;
  10981. this.eventObj.lastY = e.stageY;
  10982. this.eventObj.starX = e.stageX;
  10983. this.eventObj.starY = e.stageY;
  10984. this.eventObj.curX = 0;
  10985. this.eventObj.curY = 0;
  10986. xGame.common.d2World.d2Gan.setGanLastInfo();
  10987. this.rulerOffset = 0;
  10988. break;
  10989. default:
  10990. break;
  10991. }
  10992. }
  10993. onEventMove(e) {
  10994. if (e.stopPropagation)
  10995. e.stopPropagation();
  10996. if (e && e.force) {
  10997. }
  10998. else {
  10999. if (!this.isTurnSelf())
  11000. return;
  11001. }
  11002. switch (this.pressTarget) {
  11003. case PressType.powerNode:
  11004. this.barInfo.curY = e.stageY;
  11005. this.updateBarInfo();
  11006. this.isMoveRod = true;
  11007. break;
  11008. case PressType.moveNode:
  11009. let rootBall = xGame.common.d2World.rootBall;
  11010. let radius = rootBall.gameObj.width / 2;
  11011. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11012. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11013. let border = xGame.common.d2World.borderRect;
  11014. if (curX <= border.x + radius)
  11015. curX = border.x + radius;
  11016. else if (curX >= border.x + border.width - radius)
  11017. curX = border.x + border.width - radius;
  11018. if (curY <= border.y + radius)
  11019. curY = border.y + radius;
  11020. else if (curY >= border.y + border.height - radius)
  11021. curY = border.y + border.height - radius;
  11022. if (xGame.common.gameMgr.isOpenBall) {
  11023. if (curX >= border.x + border.openBallW - radius)
  11024. curX = border.x + border.openBallW - radius;
  11025. }
  11026. this.ui.moveNode.x = curX;
  11027. this.ui.moveNode.y = curY;
  11028. rootBall.gameObj.x = curX;
  11029. rootBall.gameObj.y = curY;
  11030. rootBall.d3BallSrc.setTransPos(curX, curY);
  11031. this.isMoveRod = true;
  11032. break;
  11033. case PressType.rulerNode:
  11034. let yy = e.stageY - this.eventObj.lastY;
  11035. this.eventObj.lastY = e.stageY;
  11036. let ruler1 = this.ui.rulerNode.img1;
  11037. let ruler2 = this.ui.rulerNode.img2;
  11038. ruler1.y += yy;
  11039. ruler2.y += yy;
  11040. this.rulerOffset += yy;
  11041. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11042. this.rulerOffset = 0;
  11043. xGame.soundMgr.playSound("inch", 1, 10);
  11044. }
  11045. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11046. let h = ruler1.height;
  11047. this.checkGuide();
  11048. this.isMoveRod = true;
  11049. if (ruler1.y >= h) {
  11050. ruler1.y = -h;
  11051. ruler2.y = 0;
  11052. return;
  11053. }
  11054. else if (ruler1.y <= -h) {
  11055. ruler1.y = h;
  11056. ruler2.y = 0;
  11057. return;
  11058. }
  11059. if (ruler2.y >= h) {
  11060. ruler2.y = -h;
  11061. ruler1.y = 0;
  11062. return;
  11063. }
  11064. else if (ruler2.y <= -h) {
  11065. ruler2.y = h;
  11066. ruler1.y = 0;
  11067. return;
  11068. }
  11069. break;
  11070. case PressType.d2Root:
  11071. this.eventObj.curX = e.stageX;
  11072. this.eventObj.curY = e.stageY;
  11073. let offset = this.checkRodMoveDir();
  11074. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11075. this.eventObj.lastX = e.stageX;
  11076. this.eventObj.lastY = e.stageY;
  11077. break;
  11078. default:
  11079. break;
  11080. }
  11081. }
  11082. onEventUp(e) {
  11083. if (e.stopPropagation)
  11084. e.stopPropagation();
  11085. if (e && e.force) {
  11086. }
  11087. else {
  11088. if (!this.isTurnSelf())
  11089. return;
  11090. }
  11091. switch (this.pressTarget) {
  11092. case PressType.powerNode:
  11093. this.ui.powerNode.value = 0;
  11094. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11095. this.ui.powerTxt.text = "";
  11096. if (this.powerNum > 0) {
  11097. xGame.eventMgr.event(BALL_SHOOT);
  11098. xGame.common.d2World.shoot(this.powerNum);
  11099. xGame.common.d2World.d2Gan.shoot();
  11100. xGame.common.d2World.d2HelpLine.shoot();
  11101. this.finishGuide();
  11102. this.ui.powerEft.visible = false;
  11103. this.ui.colorNode.visible = false;
  11104. let ganStr = "";
  11105. if (this.powerNum <= 30) {
  11106. ganStr = "gan_30";
  11107. }
  11108. else if (this.powerNum <= 60) {
  11109. ganStr = "gan_50";
  11110. }
  11111. else {
  11112. ganStr = "gan_80";
  11113. }
  11114. xGame.soundMgr.playSound(ganStr);
  11115. }
  11116. break;
  11117. case PressType.moveNode:
  11118. let rootBall = xGame.common.d2World.rootBall;
  11119. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11120. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11121. let isIntersect = this.judgeBallIntersect();
  11122. if (isIntersect) {
  11123. this.ui.moveNode.x = lastX;
  11124. this.ui.moveNode.y = lastY;
  11125. rootBall.gameObj.x = lastX;
  11126. rootBall.gameObj.y = lastY;
  11127. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11128. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11129. }
  11130. else {
  11131. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11132. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11133. }
  11134. this.showBallUI();
  11135. this.ui.moveNode.finger.visible = true;
  11136. xGame.common.d2World.getHelpLine();
  11137. break;
  11138. case PressType.rulerNode:
  11139. break;
  11140. case PressType.d2Root:
  11141. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11142. if (dis <= 25) {
  11143. this.moveToClickDot(e);
  11144. }
  11145. break;
  11146. default:
  11147. break;
  11148. }
  11149. this.pressTarget = -1;
  11150. }
  11151. checkGuide() {
  11152. let guide = DataMgr.getSkillGuide();
  11153. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11154. xGame.common.guideStep++;
  11155. xGame.common.gameUI.ui.guide2.visible = false;
  11156. xGame.common.gameUI.ui.guide3.visible = true;
  11157. }
  11158. }
  11159. finishGuide() {
  11160. let guide = DataMgr.getSkillGuide();
  11161. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11162. xGame.common.guideStep = 10;
  11163. this.closeAllGuide();
  11164. console.log('zh: 新手引导完毕');
  11165. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11166. }
  11167. }
  11168. closeAllGuide() {
  11169. xGame.common.gameUI.ui.guide1.visible = false;
  11170. xGame.common.gameUI.ui.guide2.visible = false;
  11171. xGame.common.gameUI.ui.guide3.visible = false;
  11172. }
  11173. updateBarInfo() {
  11174. let star = this.ui.powerNode.y;
  11175. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11176. if (rate >= 1)
  11177. rate = 1;
  11178. if (rate <= 0)
  11179. rate = 0;
  11180. this.powerNum = Math.ceil(rate * 100);
  11181. this.ui.powerNode.value = this.powerNum;
  11182. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11183. this.ui.colorNode.value = this.powerNum;
  11184. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11185. this.ui.powerEft.visible = this.powerNum != 0;
  11186. this.ui.colorNode.visible = this.powerNum != 0;
  11187. this.ui.powerTxt.text = this.powerNum + "";
  11188. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11189. }
  11190. forceCancel() {
  11191. this.ui.powerNode.value = 0;
  11192. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11193. this.ui.powerTxt.text = "";
  11194. }
  11195. checkRodMoveDir() {
  11196. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11197. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11198. if (tempX >= 0 && tempY <= 0) {
  11199. return this.checkDir();
  11200. }
  11201. else if (tempX < 0 && tempY < 0) {
  11202. return this.checkDir(1, -1);
  11203. }
  11204. else if (tempX < 0 && tempY > 0) {
  11205. return this.checkDir(-1, -1);
  11206. }
  11207. else {
  11208. return this.checkDir(-1, 1);
  11209. }
  11210. }
  11211. checkDir(flagX = 1, flagY = 1) {
  11212. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11213. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11214. if (offsetY == 0) {
  11215. return offsetX * flagX;
  11216. }
  11217. if (offsetX == 0) {
  11218. return offsetY * flagY;
  11219. }
  11220. let angle = offsetY / offsetX;
  11221. if (Math.abs(angle) >= 1) {
  11222. return offsetY * flagY;
  11223. }
  11224. else {
  11225. return offsetX * flagX;
  11226. }
  11227. }
  11228. judgeBallIntersect() {
  11229. let rootBall = xGame.common.d2World.rootBall;
  11230. let ballArr = xGame.common.d2World.ballArr;
  11231. let radius = rootBall.gameObj.width / 2;
  11232. let temp;
  11233. let isIntersect = false;
  11234. for (let index = 0; index < ballArr.length; index++) {
  11235. temp = ballArr[index];
  11236. if (temp.number == rootBall.number)
  11237. continue;
  11238. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11239. if (isIntersect) {
  11240. break;
  11241. }
  11242. }
  11243. return isIntersect;
  11244. }
  11245. hideBallUI() {
  11246. let d2Gan = xGame.common.d2World.d2Gan;
  11247. if (!d2Gan.ui.isDisposed)
  11248. d2Gan.ui.visible = false;
  11249. let d2Help = xGame.common.d2World.d2HelpLine;
  11250. if (!d2Help.ui.isDisposed)
  11251. d2Help.ui.visible = false;
  11252. let rootBall = xGame.common.d2World.rootBall;
  11253. if (!rootBall.destroyed) {
  11254. rootBall.gameObj.active = false;
  11255. }
  11256. }
  11257. showBallUI() {
  11258. let d2Gan = xGame.common.d2World.d2Gan;
  11259. if (!d2Gan.ui.isDisposed)
  11260. d2Gan.ui.visible = true;
  11261. let d2Help = xGame.common.d2World.d2HelpLine;
  11262. if (!d2Help.ui.isDisposed)
  11263. d2Help.ui.visible = true;
  11264. let rootBall = xGame.common.d2World.rootBall;
  11265. if (!rootBall.destroyed) {
  11266. rootBall.gameObj.active = true;
  11267. }
  11268. }
  11269. moveToClickDot(e) {
  11270. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11271. let root = xGame.common.d2World.rootBall.gameObj;
  11272. let xx = e.stageX - xGame.common.sysOffestNum;
  11273. let yy = e.stageY;
  11274. let x = xx - root.x;
  11275. let y = yy - root.y;
  11276. let angle = xGame.common.getfguiRotation(x, y);
  11277. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11278. xGame.common.d2World.getHelpLine();
  11279. }
  11280. this.isMoveRod = false;
  11281. xGame.common.clickedBall = false;
  11282. }
  11283. openAllEvent() {
  11284. this.closeAllEvent();
  11285. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11286. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11287. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11288. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11289. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11290. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11291. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11292. }
  11293. closeAllEvent() {
  11294. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11295. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11296. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11297. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11298. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11299. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11300. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11301. }
  11302. resetGame() {
  11303. this.closeAllEvent();
  11304. this.hideBallUI();
  11305. xGame.common.gameMgr.gamePause = true;
  11306. }
  11307. }
  11308. UIGame.uiName = "UIGame";
  11309. class UIAddProp extends UIBase {
  11310. constructor() {
  11311. super();
  11312. this.curType = "";
  11313. }
  11314. onConstructor() {
  11315. this.ui = ui_UIAddProp.createInstance();
  11316. this.contentPane = this.ui;
  11317. this.isEject = false;
  11318. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11319. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11320. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11321. this.updateUI();
  11322. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11323. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11324. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11325. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11326. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11327. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11328. }
  11329. show(type) {
  11330. super.show();
  11331. this.curType = type == 0 ? "coin" : "diamond";
  11332. this.switchBtn("");
  11333. this.ui.t0.play();
  11334. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11335. PlatMgr.showInsert(true);
  11336. }
  11337. closeSelf() {
  11338. this.hide();
  11339. }
  11340. updateUI() {
  11341. let data = cfgTable.moneyData;
  11342. let temp;
  11343. let obj;
  11344. for (const key in data) {
  11345. temp = data[key];
  11346. obj = this.ui.myNode["node" + key];
  11347. if (parseInt(key) <= 2) {
  11348. obj.diamondTxt.text = "+" + temp.num;
  11349. }
  11350. else {
  11351. obj.coinTxt.text = temp.num;
  11352. obj.diamondTxt.text = temp.get.split('_')[1];
  11353. }
  11354. }
  11355. this.updateDiamondShare();
  11356. }
  11357. updateDiamondShare() {
  11358. let data = DataMgr.getShareDiamondTimes();
  11359. if (data >= xGame.common.maxShareDiamondTimes) {
  11360. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11361. this.ui.myNode.node1.touchable = false;
  11362. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11363. }
  11364. else {
  11365. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11366. this.ui.myNode.node1.touchable = true;
  11367. }
  11368. }
  11369. switchBtn(type) {
  11370. if (type == "")
  11371. type = this.curType;
  11372. else {
  11373. if (this.curType == type) {
  11374. return;
  11375. }
  11376. else {
  11377. this.curType = type;
  11378. }
  11379. }
  11380. if (type == "coin") {
  11381. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11382. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11383. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11384. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11385. this.ui.myNode.c1.selectedIndex = 0;
  11386. }
  11387. else {
  11388. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11389. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11390. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11391. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11392. this.ui.myNode.c1.selectedIndex = 1;
  11393. }
  11394. }
  11395. convertCoin(index) {
  11396. let data = cfgTable.moneyData[index];
  11397. let coinNum = data.num;
  11398. let str = data.get.split('_')[1];
  11399. let needDiamond = parseInt(str);
  11400. if (DataMgr.diamondEnough(needDiamond)) {
  11401. DataMgr.setDiamond(-needDiamond);
  11402. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11403. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11404. }
  11405. else {
  11406. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11407. this.switchBtn("diamond");
  11408. }
  11409. }
  11410. videoGetDiamond() {
  11411. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11412. if (Laya.Browser.onAndroid) {
  11413. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11414. if (!boo) {
  11415. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11416. return;
  11417. }
  11418. }
  11419. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11420. }
  11421. else {
  11422. console.log('zh:AD 失败,直接发放奖励');
  11423. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11424. }
  11425. }
  11426. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11427. let num = cfgTable.moneyData[2].num;
  11428. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11429. this.closeSelf();
  11430. }
  11431. videoGetCoin() {
  11432. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11433. if (Laya.Browser.onAndroid) {
  11434. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11435. if (!boo) {
  11436. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11437. return;
  11438. }
  11439. }
  11440. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11441. }
  11442. else {
  11443. console.log('zh:AD 失败,直接发放奖励');
  11444. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11445. }
  11446. }
  11447. qjff_AD_for_uiAddProp_videoGetCoin() {
  11448. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11449. this.closeSelf();
  11450. }
  11451. shareGetDiamond() {
  11452. let times = DataMgr.getShareDiamondTimes();
  11453. if (times >= xGame.common.maxShareDiamondTimes) {
  11454. console.log('zh: 233333333333 maxShareDiamondTimes');
  11455. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11456. }
  11457. else {
  11458. console.log('zh:33333333333333ad');
  11459. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11460. if (Laya.Browser.onAndroid) {
  11461. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11462. if (!boo) {
  11463. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11464. return;
  11465. }
  11466. }
  11467. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11468. }
  11469. else {
  11470. console.log('zh:AD 失败,直接发放奖励');
  11471. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11472. }
  11473. }
  11474. }
  11475. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11476. let diamond = xGame.common.randomNum(50, 100);
  11477. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11478. DataMgr.setShareDiamondTimes(1);
  11479. this.updateDiamondShare();
  11480. }
  11481. openPutBallView() {
  11482. let end = xGame.uiMgr.getUI(UIGameEnd);
  11483. let skill = xGame.uiMgr.getUI(UISkill);
  11484. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11485. let uigame = xGame.uiMgr.getUI(UIGame);
  11486. if (end && !end.isHide) {
  11487. xGame.uiMgr.Hide(UIGameEnd);
  11488. xGame.uiMgr.Show(UIMain);
  11489. }
  11490. if (skill && !skill.isHide)
  11491. xGame.uiMgr.Hide(UISkill);
  11492. if (uigame && !uigame.isHide)
  11493. xGame.uiMgr.Hide(UIGame);
  11494. if (level && !level.isHide) {
  11495. }
  11496. else {
  11497. xGame.uiMgr.Show(UILevelDisplay);
  11498. }
  11499. this.closeSelf();
  11500. }
  11501. }
  11502. UIAddProp.uiName = "UIAddProp";
  11503. class MoneyNode {
  11504. constructor(ui) {
  11505. this.leftTime = 0;
  11506. this.ui = ui;
  11507. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11508. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11509. this.ui.addPowerBtn.onClick(this, this.addPower);
  11510. this.ui.c1.selectedIndex = 1;
  11511. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11512. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11513. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11514. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11515. this.coinChange();
  11516. this.diamondChange();
  11517. this.powerChange();
  11518. }
  11519. addPower() {
  11520. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11521. xGame.uiMgr.Show(UIPower);
  11522. }
  11523. powerChange() {
  11524. let powerNum = DataMgr.getPower();
  11525. this.ui.powerTxt.text = powerNum + "";
  11526. }
  11527. checkPowerTime() {
  11528. let cur = new Date().getTime();
  11529. let last = DataMgr.getPowerTime();
  11530. if (last == 0) {
  11531. last = cur;
  11532. DataMgr.setPowerTime(cur);
  11533. }
  11534. let power = DataMgr.getPower();
  11535. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11536. Laya.timer.clearAll(this);
  11537. if (power >= xGame.common.natureMaxPower) {
  11538. this.ui.powerTimeTxt.text = "";
  11539. DataMgr.setPowerTime(cur);
  11540. return;
  11541. }
  11542. if (power + offset >= xGame.common.natureMaxPower) {
  11543. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11544. this.ui.powerTimeTxt.text = "";
  11545. DataMgr.setPowerTime(cur);
  11546. }
  11547. else {
  11548. if (offset > 0) {
  11549. DataMgr.setPower(offset);
  11550. DataMgr.setPowerTime(cur);
  11551. }
  11552. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11553. this.leftTime = xGame.common.powerRecoverNum - time;
  11554. if (this.leftTime <= 0)
  11555. this.leftTime = 0;
  11556. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11557. Laya.timer.loop(1000, this, this.updatePowerTime);
  11558. }
  11559. }
  11560. updatePowerTime() {
  11561. this.leftTime -= 1;
  11562. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11563. if (this.leftTime <= 0) {
  11564. this.checkPowerTime();
  11565. }
  11566. }
  11567. coinChange() {
  11568. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11569. }
  11570. diamondChange() {
  11571. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11572. }
  11573. addCoin() {
  11574. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11575. Moyu.sendDataEvent("AddCoinBtn");
  11576. xGame.uiMgr.Show(UIAddProp, 0);
  11577. }
  11578. addDiamond() {
  11579. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11580. Moyu.sendDataEvent("AddDiamondBtn");
  11581. xGame.uiMgr.Show(UIAddProp, 1);
  11582. }
  11583. }
  11584. class UIDraw extends UIBase {
  11585. constructor() {
  11586. super();
  11587. this.curKey = 0;
  11588. }
  11589. onConstructor() {
  11590. this.ui = ui_UIDraw.createInstance();
  11591. this.contentPane = this.ui;
  11592. this.isEject = false;
  11593. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11594. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11595. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11596. this.initDraw();
  11597. this.initUI();
  11598. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11599. if (Moyu.isKs)
  11600. this.ui.closeNode.closeBtn.x += 100;
  11601. }
  11602. show() {
  11603. super.show();
  11604. this.ui.t0.play();
  11605. this.playSecretaryIdle();
  11606. this.updateDraw();
  11607. this.checkFree();
  11608. if (PlatMgr.bannerDelay > 0) {
  11609. this.ui.closeNode.closeBtn.visible = false;
  11610. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11611. this.ui.closeNode.closeBtn.visible = true;
  11612. });
  11613. }
  11614. PlatMgr.showRateBanner();
  11615. }
  11616. hide() {
  11617. Laya.timer.clearAll(this);
  11618. super.hide();
  11619. }
  11620. checkFree() {
  11621. let isFree = DataMgr.getDailyfreeDrawTimes();
  11622. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11623. }
  11624. initDraw() {
  11625. this.drawObj = [];
  11626. let data = cfgTable.drawData;
  11627. let temp;
  11628. let weight = 0;
  11629. for (const key in data) {
  11630. temp = data[key];
  11631. weight += temp.weight;
  11632. this.drawObj.push(weight);
  11633. }
  11634. this.allWeight = weight;
  11635. }
  11636. initUI() {
  11637. let data = cfgTable.drawData;
  11638. let temp;
  11639. let img;
  11640. let txt;
  11641. for (const key in data) {
  11642. temp = data[key];
  11643. img = this.ui.myNode.rotNode["img" + key];
  11644. txt = this.ui.myNode.rotNode["txt" + key];
  11645. img.url = xGame.common.getGameIconUrl(temp.icon);
  11646. txt.visible = true;
  11647. if (temp.award > 2) {
  11648. img.rotation = 0;
  11649. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11650. }
  11651. else {
  11652. img.rotation = temp.rotation;
  11653. txt.text = temp.num;
  11654. }
  11655. }
  11656. }
  11657. getCurkey() {
  11658. let rand = Math.random() * this.allWeight;
  11659. let temp;
  11660. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11661. temp = this.drawObj[index];
  11662. if (index == 0) {
  11663. if (rand < temp) {
  11664. return index + 1;
  11665. }
  11666. }
  11667. else {
  11668. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11669. return index + 1;
  11670. }
  11671. }
  11672. }
  11673. return 2;
  11674. }
  11675. startDraw() {
  11676. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11677. if (freeTimes > 0) {
  11678. this.beginDraw();
  11679. DataMgr.setDailyfreeDrawTimes(0);
  11680. this.checkFree();
  11681. }
  11682. else {
  11683. if (Laya.Browser.onAndroid) {
  11684. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11685. if (!boo) {
  11686. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11687. return;
  11688. }
  11689. }
  11690. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11691. }
  11692. else {
  11693. console.log('zh:AD 失败,直接发放奖励');
  11694. this.qjff_chouJiang();
  11695. }
  11696. }
  11697. }
  11698. qjff_chouJiang() {
  11699. this.beginDraw();
  11700. }
  11701. beginDraw() {
  11702. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11703. this.ui.drawBtn.touchable = false;
  11704. this.curKey = this.getCurkey();
  11705. console.log("当前key", this.curKey);
  11706. let cell = 60;
  11707. let lap = 3;
  11708. let angle = cell * (this.curKey - 1) + lap * 360;
  11709. let target = this.ui.myNode.rotNode;
  11710. target.rotation = 0;
  11711. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11712. console.log("旋转完成");
  11713. this.ui.drawBtn.touchable = true;
  11714. this.getAward();
  11715. }));
  11716. }
  11717. getAward() {
  11718. let data = cfgTable.drawData[this.curKey];
  11719. let temp = new AwardType();
  11720. temp.type = data.award;
  11721. temp.num = data.num;
  11722. xGame.common.getAward([temp], () => {
  11723. DataMgr.setDrawTimes(1);
  11724. this.updateDraw();
  11725. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11726. });
  11727. }
  11728. updateDraw() {
  11729. let drawTimes = DataMgr.getDrawTimes();
  11730. let awardTimes = DataMgr.getDrawAwardTimes();
  11731. if (Math.floor(drawTimes / 3) > awardTimes) {
  11732. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11733. this.ui.extraNode.boxBtn.touchable = true;
  11734. this.ui.extraNode.tipsTxt.text = "3/3";
  11735. this.ui.extraNode.barNode.width = 265;
  11736. this.getExtraAward();
  11737. }
  11738. else {
  11739. this.ui.extraNode.boxBtn.t0.stop();
  11740. this.ui.extraNode.boxBtn.touchable = false;
  11741. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11742. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11743. }
  11744. let data = cfgTable.drawData[1];
  11745. if (awardTimes == 0) {
  11746. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11747. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11748. this.ui.myNode.rotNode.img1.rotation = 0;
  11749. }
  11750. else {
  11751. let award = data.nextid;
  11752. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11753. this.ui.myNode.rotNode.txt1.text = award[1];
  11754. this.ui.myNode.rotNode.img1.rotation = 0;
  11755. }
  11756. }
  11757. getExtraAward() {
  11758. let drawTimes = DataMgr.getDrawTimes();
  11759. let awardTimes = DataMgr.getDrawAwardTimes();
  11760. let data = cfgTable.drawData[1];
  11761. let award = new AwardType();
  11762. if (awardTimes == 0) {
  11763. award.num = data.num;
  11764. award.type = data.award;
  11765. xGame.common.getAward([award], () => {
  11766. let all = Math.floor(drawTimes / 3);
  11767. DataMgr.setDrawAwardTimes(all);
  11768. this.updateDraw();
  11769. });
  11770. }
  11771. else {
  11772. award.num = parseInt(data.nextid[1]);
  11773. award.type = parseInt(data.nextid[0]);
  11774. xGame.common.getAward([award], () => {
  11775. let all = Math.floor(drawTimes / 3);
  11776. DataMgr.setDrawAwardTimes(all);
  11777. this.updateDraw();
  11778. });
  11779. }
  11780. }
  11781. closeSelf() {
  11782. this.hide();
  11783. }
  11784. playSecretaryIdle() {
  11785. let parent = this.ui.secretary.displayObject;
  11786. parent.destroyChildren();
  11787. let xx = this.ui.secretary.width / 2;
  11788. let yy = this.ui.secretary.height;
  11789. let scale = xGame.common.getSecretaryScale();
  11790. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11791. xGame.common.secretary.play(data, 0, true, parent);
  11792. }
  11793. }
  11794. UIDraw.uiName = "UIDraw";
  11795. class ui_UIFlyEft extends fgui.GComponent {
  11796. static createInstance() {
  11797. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11798. }
  11799. onConstruct() {
  11800. this.n0 = (this.getChild("n0"));
  11801. this.n1 = (this.getChild("n1"));
  11802. this.n2 = (this.getChild("n2"));
  11803. this.n3 = (this.getChild("n3"));
  11804. this.n4 = (this.getChild("n4"));
  11805. this.n5 = (this.getChild("n5"));
  11806. this.n6 = (this.getChild("n6"));
  11807. this.n7 = (this.getChild("n7"));
  11808. this.iconNode = (this.getChild("iconNode"));
  11809. this.txt = (this.getChild("txt"));
  11810. this.txtNode = (this.getChild("txtNode"));
  11811. }
  11812. }
  11813. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11814. class UIFlyEft extends UIBase {
  11815. constructor() {
  11816. super();
  11817. this.max = 8;
  11818. this.delay = 0;
  11819. }
  11820. onConstructor() {
  11821. this.ui = ui_UIFlyEft.createInstance();
  11822. this.contentPane = this.ui;
  11823. this.isEject = false;
  11824. this.isMuti = true;
  11825. this.ui.x += xGame.common.sysOffestNum;
  11826. }
  11827. getArrPos() {
  11828. if (this.iconPos && this.iconPos.length > 0)
  11829. return;
  11830. this.iconPos = [];
  11831. let temp;
  11832. for (let index = 0; index < this.max; index++) {
  11833. temp = this.ui["n" + index];
  11834. this.iconPos.push([temp.x, temp.y]);
  11835. }
  11836. }
  11837. show(stPos, edPos, num, type, callback) {
  11838. super.show();
  11839. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11840. this.getArrPos();
  11841. this.updateUI(type);
  11842. this.updatePos();
  11843. this.runFly(edPos, callback);
  11844. this.runWorlds(stPos, num);
  11845. }
  11846. updateUI(type) {
  11847. let temp;
  11848. let str;
  11849. for (let index = 0; index < this.max; index++) {
  11850. temp = this.ui["n" + index];
  11851. str = this.getIconStr(type);
  11852. temp.url = xGame.common.getGameIconUrl(str);
  11853. }
  11854. }
  11855. getIconStr(type) {
  11856. switch (type) {
  11857. case Prop.diamond:
  11858. return "ty_zs";
  11859. case Prop.coin:
  11860. return "ty_jb";
  11861. default:
  11862. break;
  11863. }
  11864. }
  11865. updatePos() {
  11866. let temp;
  11867. for (let index = 0; index < this.max; index++) {
  11868. temp = this.ui["n" + index];
  11869. temp.x = this.iconPos[index][0];
  11870. temp.y = this.iconPos[index][1];
  11871. }
  11872. }
  11873. runFly(endPos, callback) {
  11874. let all = 0;
  11875. let temp;
  11876. for (let index = 0; index < this.max; index++) {
  11877. temp = this.ui["n" + index];
  11878. temp.visible = true;
  11879. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11880. temp.visible = false;
  11881. all++;
  11882. if (all >= this.max) {
  11883. callback && callback();
  11884. }
  11885. }), 20 * index);
  11886. }
  11887. }
  11888. runWorlds(stPos, num) {
  11889. let str = "+" + num;
  11890. this.ui.txt.text = str;
  11891. let starX = stPos.x;
  11892. let starY = stPos.y + 50;
  11893. this.ui.txt.x = starX;
  11894. this.ui.txt.y = starY;
  11895. this.ui.txt.visible = true;
  11896. this.ui.txt.alpha = 1;
  11897. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11898. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11899. this.ui.txt.visible = false;
  11900. this.hide();
  11901. }));
  11902. }));
  11903. }
  11904. }
  11905. UIFlyEft.uiName = "UIFlyEft";
  11906. class Common {
  11907. constructor() {
  11908. this.convertNum = 0.025;
  11909. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11910. this.scaleV3One = new Laya.Vector3();
  11911. this.scaleV3Two = new Laya.Vector3();
  11912. this.posV4 = new Laya.Vector4();
  11913. this.showDebug = false;
  11914. this.openGuide = true;
  11915. this.rodOffest = new Laya.Vector2(0, 0);
  11916. this.rodAngle = 0;
  11917. this.gameMode = GameMode.classic;
  11918. this.bigMoveLevelIndex = 1;
  11919. this.bigMoveNeedCoin = 1000;
  11920. this.classicNiceNeddCoin = 1000;
  11921. this.passAwardCoin = 2000;
  11922. this.classicRoomType = 1;
  11923. this.maxPower = 20;
  11924. this.natureMaxPower = 5;
  11925. this.videoPower = 2;
  11926. this.powerRecoverNum = 900;
  11927. this.curPlayerSkillType = 0;
  11928. this.isNewDay = false;
  11929. this.clickedBall = false;
  11930. this.placeBallCurLevel = 0;
  11931. this.placeBallStarNum = 0;
  11932. this.longHelpLine = false;
  11933. this.maxShareDiamondTimes = 3;
  11934. this.guideStep = 0;
  11935. this.temSelfLevel = 0;
  11936. this.extraMoveNum = 0;
  11937. this.curRankID = 0;
  11938. this.rankID = {
  11939. normalStar: 12000,
  11940. wxStar: 12001
  11941. };
  11942. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  11943. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  11944. this.btnClickStr = "buttonclick";
  11945. this.maxSkillLevel = 10;
  11946. this.upSkillLevel = false;
  11947. this.gameStartTime = 0;
  11948. this._sysOffestNum = 0;
  11949. this.angleV2 = new Laya.Vector2();
  11950. this.rootV = new Laya.Vector2(0, 1);
  11951. this.tempDir1 = new Laya.Vector2();
  11952. this.tempDir2 = new Laya.Vector2();
  11953. this.ballSize = 33;
  11954. this.stPos = new Laya.Point();
  11955. this.edPos = new Laya.Point();
  11956. Common._instance = this;
  11957. window["common"] = this;
  11958. }
  11959. static getInstance() {
  11960. if (!this._instance) {
  11961. this._instance = new Common();
  11962. }
  11963. return this._instance;
  11964. }
  11965. get sysOffestNum() {
  11966. if (this._sysOffestNum == 0) {
  11967. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11968. }
  11969. return this._sysOffestNum;
  11970. }
  11971. testShader() {
  11972. let test = new LightShader();
  11973. test.texture = "res/d3Res/ballTexture/ball1.png";
  11974. Laya.stage.addChild(test);
  11975. }
  11976. playScale(node) {
  11977. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11978. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11979. }));
  11980. }));
  11981. }
  11982. setGroup(colli, ...group) {
  11983. let out = 0;
  11984. for (let index = 0; index < group.length; index++) {
  11985. if (index == 0) {
  11986. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11987. }
  11988. else {
  11989. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11990. }
  11991. }
  11992. colli.collisionGroup = out;
  11993. }
  11994. setCanGroupWith(colli, ...group) {
  11995. let out = 0;
  11996. for (let index = 0; index < group.length; index++) {
  11997. if (index == 0) {
  11998. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11999. }
  12000. else {
  12001. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12002. }
  12003. }
  12004. colli.canCollideWith = out;
  12005. }
  12006. loadPrefab(name, callback) {
  12007. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12008. let prefab = new Laya.Prefab();
  12009. prefab.json = obj;
  12010. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12011. callback && callback(img);
  12012. }));
  12013. }
  12014. pos2to3Convert(x, y, d3Pos) {
  12015. x = x + this.sysOffestNum;
  12016. d3Pos.setValue(x, y, 0);
  12017. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12018. if (success) {
  12019. }
  12020. else {
  12021. console.error("转换出错了。。。。。。。。");
  12022. }
  12023. }
  12024. scale2to3Convert(num) {
  12025. this.scaleV3One.setValue(0, 0, 0);
  12026. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12027. this.scaleV3Two.setValue(0, num, 0);
  12028. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12029. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12030. return outNum;
  12031. }
  12032. pos3to2Convert(d3Pos) {
  12033. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12034. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12035. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12036. d3Pos.x -= this.sysOffestNum;
  12037. }
  12038. scale3to2Convert(num) {
  12039. let scale = this.scale2to3Convert(1);
  12040. let d2Out = num / scale;
  12041. return d2Out;
  12042. }
  12043. getCollider(type, restitution = 0.9, density = 10) {
  12044. let colli;
  12045. if (type == "box")
  12046. colli = new Laya.BoxCollider();
  12047. else
  12048. colli = new Laya.CircleCollider();
  12049. colli.friction = 0;
  12050. colli.restitution = restitution;
  12051. colli.density = density;
  12052. return colli;
  12053. }
  12054. getRigbody() {
  12055. let rigy = new Laya.RigidBody();
  12056. rigy.bullet = true;
  12057. rigy.allowRotation = false;
  12058. rigy.allowSleep = false;
  12059. rigy.gravityScale = 0;
  12060. return rigy;
  12061. }
  12062. getfguiRotation(x, y) {
  12063. this.angleV2.setValue(x, y);
  12064. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12065. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12066. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12067. angle = -angle;
  12068. }
  12069. return 180 + angle;
  12070. }
  12071. getAngle(x, y) {
  12072. this.angleV2.setValue(x, y);
  12073. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12074. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12075. return angle;
  12076. }
  12077. randomNum(a, b) {
  12078. return a + Math.floor((b - a + 1) * Math.random());
  12079. }
  12080. getRandArrEle(arr) {
  12081. return arr[Math.floor(arr.length * Math.random())];
  12082. }
  12083. getSign(val) {
  12084. return val >= 0 ? 1 : -1;
  12085. }
  12086. botherArr(arr) {
  12087. let times = arr.length + 2;
  12088. let length = arr.length;
  12089. let a;
  12090. let b;
  12091. let temp;
  12092. for (let index = 0; index < times; index++) {
  12093. a = Math.floor(Math.random() * length);
  12094. b = Math.floor(Math.random() * length);
  12095. temp = arr[a];
  12096. arr[a] = arr[b];
  12097. arr[b] = temp;
  12098. }
  12099. }
  12100. getGameIconUrl(id) {
  12101. return "ui://game/" + id;
  12102. }
  12103. getComponentUrl(id) {
  12104. return "ui://game/" + id;
  12105. }
  12106. getAnimation() {
  12107. }
  12108. judgeSkillType(type = SkillType.highSpace) {
  12109. if (this.gameMode == GameMode.classic)
  12110. return;
  12111. let gameMgr = this.gameMgr;
  12112. if (gameMgr.selfTurn) {
  12113. if (gameMgr.selfCurSkill == type) {
  12114. return true;
  12115. }
  12116. }
  12117. else {
  12118. if (gameMgr.aiCurSkill == type) {
  12119. return true;
  12120. }
  12121. }
  12122. }
  12123. ballColliHole(collider) {
  12124. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12125. xGame.common.gameMgr.isFirstInGame = false;
  12126. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12127. }
  12128. collider.owner.mySrc.checkWrongBall();
  12129. }
  12130. getArrMaxEle(arr) {
  12131. let max = -Infinity;
  12132. for (let index = 0; index < arr.length; index++) {
  12133. max = Math.max(arr[index], max);
  12134. }
  12135. return max;
  12136. }
  12137. getArrMinEle(arr) {
  12138. let min = Infinity;
  12139. for (let index = 0; index < arr.length; index++) {
  12140. min = Math.min(arr[index], min);
  12141. }
  12142. return min;
  12143. }
  12144. playRandomMutiBallBigSkillSound() {
  12145. if (Math.random() <= 0.5)
  12146. return;
  12147. let rand = this.randomNum(1, 6);
  12148. let str = "ganfa0" + rand;
  12149. xGame.soundMgr.playSound(str);
  12150. }
  12151. showOneCamera(type) {
  12152. let object = xGame.common.d3World.cameraObj;
  12153. for (const key in object) {
  12154. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12155. object[key].init();
  12156. object[key].owner.active = key == type;
  12157. }
  12158. }
  12159. }
  12160. checkBallOverBorder(x, y) {
  12161. let radius = 17;
  12162. let condition = this._checkBorder(x + radius, y) ||
  12163. this._checkBorder(x - radius, y) ||
  12164. this._checkBorder(x, y + radius) ||
  12165. this._checkBorder(x, y - radius);
  12166. if (condition) {
  12167. return true;
  12168. }
  12169. }
  12170. _checkBorder(x, y) {
  12171. let borderRect = this.d2World.borderRect;
  12172. let xOffest = 20;
  12173. let yOffest = 20;
  12174. if (y <= borderRect.y - yOffest) {
  12175. return true;
  12176. }
  12177. if (y >= borderRect.y + borderRect.height + yOffest) {
  12178. return true;
  12179. }
  12180. if (x <= borderRect.x - xOffest) {
  12181. return true;
  12182. }
  12183. if (x >= borderRect.x + borderRect.width + xOffest) {
  12184. return true;
  12185. }
  12186. }
  12187. initWeight(cfg) {
  12188. let allCfgData = { data: {}, allWeightNum: 0 };
  12189. let weightCfg = allCfgData.data;
  12190. let weight = 0;
  12191. for (const key in cfg) {
  12192. weightCfg[key] = {};
  12193. weightCfg[key].id = cfg[key].id;
  12194. weightCfg[key].minWeight = weight;
  12195. weight += cfg[key].weight;
  12196. weightCfg[key].maxWeight = weight;
  12197. }
  12198. allCfgData.allWeightNum = weight;
  12199. return allCfgData;
  12200. }
  12201. getRandomWeightData(cfg) {
  12202. let weightCfg = cfg.data;
  12203. let allWeightNum = cfg.allWeightNum;
  12204. let rand = Math.floor(Math.random() * allWeightNum);
  12205. for (const key in weightCfg) {
  12206. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12207. return weightCfg[key];
  12208. }
  12209. }
  12210. return weightCfg[1];
  12211. }
  12212. showGirlTalkPop(wordsIndex, node, msgNode) {
  12213. node.visible = true;
  12214. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12215. node.t0.play(Laya.Handler.create(this, () => {
  12216. node.visible = false;
  12217. }));
  12218. }
  12219. stopGirlPop(node) {
  12220. node.t0.stop();
  12221. node.visible = false;
  12222. }
  12223. createHead(loader, url, size = 107) {
  12224. if (Laya.Browser.name == "Browser") {
  12225. loader.url = url;
  12226. return;
  12227. }
  12228. else {
  12229. console.log('zh:url=', url);
  12230. loader.url = url;
  12231. }
  12232. }
  12233. addTestCoin(num) {
  12234. DataMgr.setCoin(num);
  12235. }
  12236. addTestDiamond(num) {
  12237. DataMgr.setDiamond(num);
  12238. }
  12239. addTestSkill() {
  12240. DataMgr.setBigSkill(0, 99);
  12241. DataMgr.setBigSkill(1, 99);
  12242. DataMgr.setBigSkill(2, 99);
  12243. }
  12244. playClassicEmotion(number, x, y) {
  12245. if (this.gameMode == GameMode.bigMove)
  12246. return;
  12247. let randIndex = this.randomNum(0, 2);
  12248. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12249. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12250. if (this.gameMgr.selfTurn) {
  12251. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12252. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12253. }
  12254. else {
  12255. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12256. }
  12257. else {
  12258. if (number == this.gameMgr.blackNum) {
  12259. if (this.gameMgr.selfBallArr.length == 0) {
  12260. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12261. }
  12262. else {
  12263. }
  12264. }
  12265. else {
  12266. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12267. }
  12268. }
  12269. }
  12270. }
  12271. else {
  12272. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12273. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12274. }
  12275. else {
  12276. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12277. }
  12278. else {
  12279. if (number == this.gameMgr.blackNum) {
  12280. if (this.gameMgr.aiBallArr.length == 0) {
  12281. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12282. }
  12283. else {
  12284. }
  12285. }
  12286. else {
  12287. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12288. }
  12289. }
  12290. }
  12291. }
  12292. }
  12293. playHappySound(number) {
  12294. if (this.gameMode != GameMode.classic)
  12295. return;
  12296. if (number == 8)
  12297. return;
  12298. let play = false;
  12299. if (this.gameMgr.selfTurn) {
  12300. if (this.gameMgr.ensureBallType) {
  12301. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12302. play = true;
  12303. }
  12304. }
  12305. else {
  12306. play = true;
  12307. }
  12308. }
  12309. else {
  12310. if (this.gameMgr.ensureBallType) {
  12311. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12312. play = true;
  12313. }
  12314. }
  12315. else {
  12316. play = true;
  12317. }
  12318. }
  12319. if (play)
  12320. xGame.soundMgr.playSound("applause");
  12321. }
  12322. destroyClassicEmotion() {
  12323. if (this.gameMode == GameMode.bigMove)
  12324. return;
  12325. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12326. parent.destroyChildren();
  12327. }
  12328. playAwardSpine(x, y) {
  12329. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12330. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12331. this.awardSpine.play(data, 0, false, parent);
  12332. }
  12333. destroyAwardSpine() {
  12334. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12335. parent.destroyChildren();
  12336. }
  12337. isBlock(bx, by, hx, hy, except = null) {
  12338. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12339. let balls = xGame.common.d2World.ballArr;
  12340. let outArr = [];
  12341. for (let index = 0; index < balls.length; index++) {
  12342. let obj = balls[index];
  12343. if (obj.number == 0)
  12344. continue;
  12345. if (obj == except)
  12346. continue;
  12347. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12348. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12349. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12350. if (num >= 1)
  12351. num = 1;
  12352. if (num < 0)
  12353. continue;
  12354. let gap = Math.sin(Math.acos(num)) * dis;
  12355. if (gap < this.ballSize) {
  12356. outArr.push({
  12357. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12358. disHon: Math.cos(Math.acos(num)) * dis,
  12359. disVer: Math.sin(Math.acos(num)) * dis,
  12360. src: balls[index],
  12361. dir: this.tempDir1
  12362. });
  12363. }
  12364. }
  12365. if (outArr.length > 0) {
  12366. outArr.sort((a, b) => { return a.dis - b.dis; });
  12367. return outArr[0];
  12368. }
  12369. }
  12370. AngleBetween(vector1, vector2) {
  12371. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12372. return rad * (180 / Math.PI);
  12373. }
  12374. getSecretaryScale() {
  12375. if (this.secretary.spineName == "mishu") {
  12376. return 1.28;
  12377. }
  12378. else {
  12379. return 1.024;
  12380. }
  12381. }
  12382. signAwardContainsRod(arr) {
  12383. let temp;
  12384. for (let index = 0; index < arr.length; index++) {
  12385. temp = arr[index].split('-')[0];
  12386. if (parseInt(temp) > 2) {
  12387. return true;
  12388. }
  12389. }
  12390. }
  12391. judgeSameDay() {
  12392. let lastTime = DataMgr.getSignTime();
  12393. let curTime = new Date().getTime();
  12394. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12395. return true;
  12396. }
  12397. return false;
  12398. }
  12399. getAward(arr, callback) {
  12400. let showTriple = arr[0].type <= 2;
  12401. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12402. let temp;
  12403. for (let index = 0; index < arr.length; index++) {
  12404. temp = arr[index];
  12405. switch (temp.type) {
  12406. case 1:
  12407. this.playObjFlyAnim(temp.num, temp.type);
  12408. break;
  12409. case 2:
  12410. this.playObjFlyAnim(temp.num, temp.type);
  12411. break;
  12412. case 3:
  12413. case 4:
  12414. case 5:
  12415. case 6:
  12416. DataMgr.setBallRod(temp.type - 2, 1);
  12417. DataMgr.setCurBallRod(temp.type - 2);
  12418. break;
  12419. default:
  12420. break;
  12421. }
  12422. }
  12423. callback && callback(watchVideo);
  12424. });
  12425. }
  12426. getMoneyNode() {
  12427. let moneyNode;
  12428. let sign = xGame.uiMgr.getUI(UISign);
  12429. let draw = xGame.uiMgr.getUI(UIDraw);
  12430. let end = xGame.uiMgr.getUI(UIGameEnd);
  12431. let skill = xGame.uiMgr.getUI(UISkill);
  12432. if (sign && !sign.isHide)
  12433. moneyNode = sign.ui.moneyNode;
  12434. if (draw && !draw.isHide)
  12435. moneyNode = draw.ui.moneyNode;
  12436. if (end && !end.isHide)
  12437. moneyNode = end.ui.moneyNode;
  12438. if (skill && !skill.isHide)
  12439. moneyNode = skill.ui.moneyNode;
  12440. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12441. let main = xGame.uiMgr.getUI(UIMain);
  12442. if (condition1 && main && !main.isHide) {
  12443. moneyNode = main.ui.moneyNode;
  12444. }
  12445. return moneyNode;
  12446. }
  12447. playObjFlyAnim(num, type, callback = null) {
  12448. this.stPos.x = Laya.stage.width / 2;
  12449. this.stPos.y = Laya.stage.height / 2;
  12450. let moneyNode = this.getMoneyNode();
  12451. switch (type) {
  12452. case Prop.diamond:
  12453. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12454. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12455. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12456. this.edPos.x /= 2;
  12457. this.edPos.y /= 2;
  12458. break;
  12459. case Prop.coin:
  12460. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12461. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12462. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12463. this.edPos.x /= 2;
  12464. this.edPos.y /= 2;
  12465. break;
  12466. default:
  12467. break;
  12468. }
  12469. xGame.soundMgr.playSound("coinbag");
  12470. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12471. switch (type) {
  12472. case Prop.diamond:
  12473. DataMgr.setDiamond(num);
  12474. break;
  12475. case Prop.coin:
  12476. DataMgr.setCoin(num);
  12477. break;
  12478. default:
  12479. break;
  12480. }
  12481. callback && callback();
  12482. });
  12483. }
  12484. autoPopUIView() {
  12485. let arr = [];
  12486. let sign = this.judgeSameDay() ? false : true;
  12487. if (sign)
  12488. arr.push("sign");
  12489. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12490. if (draw)
  12491. arr.push("draw");
  12492. if (arr.length <= 0)
  12493. return;
  12494. let str = this.getRandArrEle(arr);
  12495. switch (str) {
  12496. case "sign":
  12497. xGame.uiMgr.Show(UISign);
  12498. break;
  12499. case "draw":
  12500. xGame.uiMgr.Show(UIDraw);
  12501. break;
  12502. default:
  12503. break;
  12504. }
  12505. }
  12506. getMSTime(time) {
  12507. let min = Math.floor(time / 60);
  12508. let sec = Math.floor((time - min * 60));
  12509. if (sec < 10)
  12510. sec = "0" + sec;
  12511. if (min < 10)
  12512. min = "0" + min;
  12513. return `${min}:${sec}`;
  12514. }
  12515. testPower() {
  12516. DataMgr.setPower(0, false);
  12517. }
  12518. getAllStarNum() {
  12519. let data = DataMgr.getPlaceBallLevelList();
  12520. let out = 0;
  12521. for (let index = 0; index < data.length; index++) {
  12522. out += data[index].star;
  12523. }
  12524. return out;
  12525. }
  12526. recoverCameraView() {
  12527. Laya.timer.once(900, this, () => {
  12528. xGame.common.showOneCamera("mainCamera");
  12529. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12530. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12531. xGame.common.gameUI.ui.border.alpha = 0;
  12532. if (Laya.physicsTimer.scale < 1) {
  12533. Laya.physicsTimer.scale = 1;
  12534. }
  12535. }
  12536. });
  12537. }
  12538. getClassicLevel() {
  12539. let successTimes = DataMgr.getClassicTimes();
  12540. let needKey = "";
  12541. let lastKey = "";
  12542. let cfg = cfgTable.classictimesData;
  12543. let data;
  12544. for (const key in cfg) {
  12545. data = cfg[key];
  12546. if (successTimes <= data.times) {
  12547. needKey = key;
  12548. }
  12549. lastKey = key;
  12550. }
  12551. if (needKey == "")
  12552. needKey = lastKey;
  12553. return cfg[needKey];
  12554. }
  12555. }
  12556. Common._instance = null;
  12557. class ui_Component92 extends fgui.GComponent {
  12558. static createInstance() {
  12559. return (fgui.UIPackage.createObject("game", "Component92"));
  12560. }
  12561. onConstruct() {
  12562. this.n0 = (this.getChild("n0"));
  12563. }
  12564. }
  12565. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12566. class ui_Component129 extends fgui.GProgressBar {
  12567. static createInstance() {
  12568. return (fgui.UIPackage.createObject("game", "Component129"));
  12569. }
  12570. onConstruct() {
  12571. this.bar_v = (this.getChild("bar_v"));
  12572. this.n84 = (this.getChild("n84"));
  12573. }
  12574. }
  12575. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12576. class ui_Component130 extends fgui.GComponent {
  12577. static createInstance() {
  12578. return (fgui.UIPackage.createObject("game", "Component130"));
  12579. }
  12580. onConstruct() {
  12581. this.ani = (this.getChild("ani"));
  12582. this.t0 = this.getTransition("t0");
  12583. }
  12584. }
  12585. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12586. class ui_powerEft extends fgui.GComponent {
  12587. static createInstance() {
  12588. return (fgui.UIPackage.createObject("game", "powerEft"));
  12589. }
  12590. onConstruct() {
  12591. this.ani = (this.getChild("ani"));
  12592. this.n88 = (this.getChild("n88"));
  12593. this.n89 = (this.getChild("n89"));
  12594. }
  12595. }
  12596. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12597. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12598. static createInstance() {
  12599. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12600. }
  12601. onConstruct() {
  12602. this.c1 = this.getController("c1");
  12603. this.n2 = (this.getChild("n2"));
  12604. this.n22 = (this.getChild("n22"));
  12605. this.n23 = (this.getChild("n23"));
  12606. this.n15 = (this.getChild("n15"));
  12607. this.challenge = (this.getChild("challenge"));
  12608. this.n17 = (this.getChild("n17"));
  12609. this.n3 = (this.getChild("n3"));
  12610. this.starNode = (this.getChild("starNode"));
  12611. this.levelTxt = (this.getChild("levelTxt"));
  12612. this.n14 = (this.getChild("n14"));
  12613. this.n19 = (this.getChild("n19"));
  12614. this.n20 = (this.getChild("n20"));
  12615. this.n21 = (this.getChild("n21"));
  12616. this.special = (this.getChild("special"));
  12617. }
  12618. }
  12619. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12620. class ui_Component79 extends fgui.GComponent {
  12621. static createInstance() {
  12622. return (fgui.UIPackage.createObject("game", "Component79"));
  12623. }
  12624. onConstruct() {
  12625. this.c1 = this.getController("c1");
  12626. this.n7 = (this.getChild("n7"));
  12627. this.n8 = (this.getChild("n8"));
  12628. this.n9 = (this.getChild("n9"));
  12629. this.n10 = (this.getChild("n10"));
  12630. this.n11 = (this.getChild("n11"));
  12631. this.n12 = (this.getChild("n12"));
  12632. }
  12633. }
  12634. ui_Component79.URL = "ui://isxx5ak7avag477";
  12635. class ui_Component80 extends fgui.GComponent {
  12636. static createInstance() {
  12637. return (fgui.UIPackage.createObject("game", "Component80"));
  12638. }
  12639. onConstruct() {
  12640. this.n0 = (this.getChild("n0"));
  12641. this.n1 = (this.getChild("n1"));
  12642. this.myList = (this.getChild("myList"));
  12643. this.t0 = this.getTransition("t0");
  12644. }
  12645. }
  12646. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12647. class ui_SignNormal extends fgui.GComponent {
  12648. static createInstance() {
  12649. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12650. }
  12651. onConstruct() {
  12652. this.c1 = this.getController("c1");
  12653. this.n7 = (this.getChild("n7"));
  12654. this.n15 = (this.getChild("n15"));
  12655. this.titleTxt = (this.getChild("titleTxt"));
  12656. this.n8 = (this.getChild("n8"));
  12657. this.myIcon = (this.getChild("myIcon"));
  12658. this.numTxt = (this.getChild("numTxt"));
  12659. this.n12 = (this.getChild("n12"));
  12660. this.n13 = (this.getChild("n13"));
  12661. this.n17 = (this.getChild("n17"));
  12662. this.n14 = (this.getChild("n14"));
  12663. }
  12664. }
  12665. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12666. class ui_Button_reg extends fgui.GButton {
  12667. static createInstance() {
  12668. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12669. }
  12670. onConstruct() {
  12671. this.button = this.getController("button");
  12672. this.n6 = (this.getChild("n6"));
  12673. this.n4 = (this.getChild("n4"));
  12674. }
  12675. }
  12676. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12677. class ui_screenNode extends fgui.GComponent {
  12678. static createInstance() {
  12679. return (fgui.UIPackage.createObject("game", "screenNode"));
  12680. }
  12681. onConstruct() {
  12682. this.n9 = (this.getChild("n9"));
  12683. this.screenImg = (this.getChild("screenImg"));
  12684. }
  12685. }
  12686. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12687. class ui_GetAwrad_com1 extends fgui.GComponent {
  12688. static createInstance() {
  12689. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12690. }
  12691. onConstruct() {
  12692. this.n38 = (this.getChild("n38"));
  12693. this.n39 = (this.getChild("n39"));
  12694. this.n40 = (this.getChild("n40"));
  12695. this.t0 = this.getTransition("t0");
  12696. this.t1 = this.getTransition("t1");
  12697. }
  12698. }
  12699. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12700. class ui_GetAwrad_com2 extends fgui.GComponent {
  12701. static createInstance() {
  12702. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12703. }
  12704. onConstruct() {
  12705. this.n39 = (this.getChild("n39"));
  12706. this.n40 = (this.getChild("n40"));
  12707. this.t0 = this.getTransition("t0");
  12708. }
  12709. }
  12710. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12711. class ui_Component128 extends fgui.GComponent {
  12712. static createInstance() {
  12713. return (fgui.UIPackage.createObject("game", "Component128"));
  12714. }
  12715. onConstruct() {
  12716. this.n38 = (this.getChild("n38"));
  12717. this.n40 = (this.getChild("n40"));
  12718. }
  12719. }
  12720. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12721. class ui_Component100_1 extends fgui.GComponent {
  12722. static createInstance() {
  12723. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12724. }
  12725. onConstruct() {
  12726. this.myNode = (this.getChild("myNode"));
  12727. this.t0 = this.getTransition("t0");
  12728. }
  12729. }
  12730. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12731. class ui_Component142 extends fgui.GComponent {
  12732. static createInstance() {
  12733. return (fgui.UIPackage.createObject("game", "Component142"));
  12734. }
  12735. onConstruct() {
  12736. this.n41 = (this.getChild("n41"));
  12737. this.n42 = (this.getChild("n42"));
  12738. }
  12739. }
  12740. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12741. class ui_main_guang extends fgui.GComponent {
  12742. static createInstance() {
  12743. return (fgui.UIPackage.createObject("game", "main_guang"));
  12744. }
  12745. onConstruct() {
  12746. this.n1 = (this.getChild("n1"));
  12747. this.n2 = (this.getChild("n2"));
  12748. this.n3 = (this.getChild("n3"));
  12749. this.n4 = (this.getChild("n4"));
  12750. this.n5 = (this.getChild("n5"));
  12751. this.n6 = (this.getChild("n6"));
  12752. this.n8 = (this.getChild("n8"));
  12753. this.t0 = this.getTransition("t0");
  12754. }
  12755. }
  12756. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12757. class ui_try_com1 extends fgui.GComponent {
  12758. static createInstance() {
  12759. return (fgui.UIPackage.createObject("game", "try_com1"));
  12760. }
  12761. onConstruct() {
  12762. this.c1 = this.getController("c1");
  12763. this.n0 = (this.getChild("n0"));
  12764. this.n2 = (this.getChild("n2"));
  12765. this.cancelBtn = (this.getChild("cancelBtn"));
  12766. this.videoBtn = (this.getChild("videoBtn"));
  12767. this.n9 = (this.getChild("n9"));
  12768. this.n24 = (this.getChild("n24"));
  12769. this.titleTxt = (this.getChild("titleTxt"));
  12770. this.n32 = (this.getChild("n32"));
  12771. this.n29 = (this.getChild("n29"));
  12772. this.n36 = (this.getChild("n36"));
  12773. this.txtTime = (this.getChild("txtTime"));
  12774. this.t0 = this.getTransition("t0");
  12775. }
  12776. }
  12777. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12778. class ui_try_com2 extends fgui.GComponent {
  12779. static createInstance() {
  12780. return (fgui.UIPackage.createObject("game", "try_com2"));
  12781. }
  12782. onConstruct() {
  12783. this.skillicon = (this.getChild("skillicon"));
  12784. this.n35 = (this.getChild("n35"));
  12785. this.n31 = (this.getChild("n31"));
  12786. this.n32 = (this.getChild("n32"));
  12787. this.n33 = (this.getChild("n33"));
  12788. this.n34 = (this.getChild("n34"));
  12789. }
  12790. }
  12791. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12792. class ui_try_com3 extends fgui.GComponent {
  12793. static createInstance() {
  12794. return (fgui.UIPackage.createObject("game", "try_com3"));
  12795. }
  12796. onConstruct() {
  12797. this.n33 = (this.getChild("n33"));
  12798. this.n34 = (this.getChild("n34"));
  12799. this.n35 = (this.getChild("n35"));
  12800. this.t0 = this.getTransition("t0");
  12801. }
  12802. }
  12803. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12804. class ui_huihe1 extends fgui.GComponent {
  12805. static createInstance() {
  12806. return (fgui.UIPackage.createObject("game", "huihe1"));
  12807. }
  12808. onConstruct() {
  12809. this.n0 = (this.getChild("n0"));
  12810. this.n1 = (this.getChild("n1"));
  12811. this.t0 = this.getTransition("t0");
  12812. }
  12813. }
  12814. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12815. class ui_huihe2 extends fgui.GComponent {
  12816. static createInstance() {
  12817. return (fgui.UIPackage.createObject("game", "huihe2"));
  12818. }
  12819. onConstruct() {
  12820. this.n0 = (this.getChild("n0"));
  12821. this.n1 = (this.getChild("n1"));
  12822. this.t0 = this.getTransition("t0");
  12823. }
  12824. }
  12825. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12826. class ui_Component143 extends fgui.GComponent {
  12827. static createInstance() {
  12828. return (fgui.UIPackage.createObject("game", "Component143"));
  12829. }
  12830. onConstruct() {
  12831. this.n3 = (this.getChild("n3"));
  12832. this.n4 = (this.getChild("n4"));
  12833. this.n5 = (this.getChild("n5"));
  12834. this.n6 = (this.getChild("n6"));
  12835. this.n7 = (this.getChild("n7"));
  12836. this.n8 = (this.getChild("n8"));
  12837. this.n9 = (this.getChild("n9"));
  12838. this.n10 = (this.getChild("n10"));
  12839. this.t0 = this.getTransition("t0");
  12840. }
  12841. }
  12842. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12843. class ui_dh_jingbi2 extends fgui.GComponent {
  12844. static createInstance() {
  12845. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12846. }
  12847. onConstruct() {
  12848. this.n0 = (this.getChild("n0"));
  12849. this.n1 = (this.getChild("n1"));
  12850. this.n2 = (this.getChild("n2"));
  12851. this.n3 = (this.getChild("n3"));
  12852. this.n4 = (this.getChild("n4"));
  12853. this.n5 = (this.getChild("n5"));
  12854. this.n6 = (this.getChild("n6"));
  12855. this.n8 = (this.getChild("n8"));
  12856. this.n10 = (this.getChild("n10"));
  12857. this.t0 = this.getTransition("t0");
  12858. }
  12859. }
  12860. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12861. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12862. static createInstance() {
  12863. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12864. }
  12865. onConstruct() {
  12866. this.n1 = (this.getChild("n1"));
  12867. this.n4 = (this.getChild("n4"));
  12868. this.t0 = this.getTransition("t0");
  12869. }
  12870. }
  12871. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12872. class ui_dh_jingbi3 extends fgui.GComponent {
  12873. static createInstance() {
  12874. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12875. }
  12876. onConstruct() {
  12877. this.n0 = (this.getChild("n0"));
  12878. this.n1 = (this.getChild("n1"));
  12879. this.n2 = (this.getChild("n2"));
  12880. this.n3 = (this.getChild("n3"));
  12881. this.n4 = (this.getChild("n4"));
  12882. this.n5 = (this.getChild("n5"));
  12883. this.n6 = (this.getChild("n6"));
  12884. this.n8 = (this.getChild("n8"));
  12885. this.n10 = (this.getChild("n10"));
  12886. this.t0 = this.getTransition("t0");
  12887. }
  12888. }
  12889. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12890. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12891. static createInstance() {
  12892. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12893. }
  12894. onConstruct() {
  12895. this.n3 = (this.getChild("n3"));
  12896. this.n1 = (this.getChild("n1"));
  12897. this.t0 = this.getTransition("t0");
  12898. }
  12899. }
  12900. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12901. class ui_hb_jinbi1 extends fgui.GButton {
  12902. static createInstance() {
  12903. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12904. }
  12905. onConstruct() {
  12906. this.n20 = (this.getChild("n20"));
  12907. this.n25 = (this.getChild("n25"));
  12908. this.coinTxt = (this.getChild("coinTxt"));
  12909. this.n28 = (this.getChild("n28"));
  12910. this.n32 = (this.getChild("n32"));
  12911. this.n38 = (this.getChild("n38"));
  12912. this.n45 = (this.getChild("n45"));
  12913. this.getTips = (this.getChild("getTips"));
  12914. this.n39 = (this.getChild("n39"));
  12915. this.diamondTxt = (this.getChild("diamondTxt"));
  12916. this.n41 = (this.getChild("n41"));
  12917. this.n42 = (this.getChild("n42"));
  12918. this.n46 = (this.getChild("n46"));
  12919. this.n47 = (this.getChild("n47"));
  12920. this.n48 = (this.getChild("n48"));
  12921. this.t0 = this.getTransition("t0");
  12922. }
  12923. }
  12924. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12925. class ui_hb_jinbi2 extends fgui.GButton {
  12926. static createInstance() {
  12927. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12928. }
  12929. onConstruct() {
  12930. this.n20 = (this.getChild("n20"));
  12931. this.n25 = (this.getChild("n25"));
  12932. this.coinTxt = (this.getChild("coinTxt"));
  12933. this.n28 = (this.getChild("n28"));
  12934. this.n32 = (this.getChild("n32"));
  12935. this.n38 = (this.getChild("n38"));
  12936. this.n39 = (this.getChild("n39"));
  12937. this.diamondTxt = (this.getChild("diamondTxt"));
  12938. this.n41 = (this.getChild("n41"));
  12939. this.n42 = (this.getChild("n42"));
  12940. this.n43 = (this.getChild("n43"));
  12941. this.n44 = (this.getChild("n44"));
  12942. this.n45 = (this.getChild("n45"));
  12943. this.t0 = this.getTransition("t0");
  12944. }
  12945. }
  12946. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  12947. class ui_hb_jinbi3 extends fgui.GButton {
  12948. static createInstance() {
  12949. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12950. }
  12951. onConstruct() {
  12952. this.n20 = (this.getChild("n20"));
  12953. this.n25 = (this.getChild("n25"));
  12954. this.coinTxt = (this.getChild("coinTxt"));
  12955. this.n28 = (this.getChild("n28"));
  12956. this.n32 = (this.getChild("n32"));
  12957. this.n38 = (this.getChild("n38"));
  12958. this.n39 = (this.getChild("n39"));
  12959. this.diamondTxt = (this.getChild("diamondTxt"));
  12960. this.n41 = (this.getChild("n41"));
  12961. this.n42 = (this.getChild("n42"));
  12962. this.n43 = (this.getChild("n43"));
  12963. this.n44 = (this.getChild("n44"));
  12964. this.n45 = (this.getChild("n45"));
  12965. this.t0 = this.getTransition("t0");
  12966. }
  12967. }
  12968. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12969. class ui_Component104 extends fgui.GComponent {
  12970. static createInstance() {
  12971. return (fgui.UIPackage.createObject("game", "Component104"));
  12972. }
  12973. onConstruct() {
  12974. this.c1 = this.getController("c1");
  12975. this.n12 = (this.getChild("n12"));
  12976. this.coinBtn = (this.getChild("coinBtn"));
  12977. this.diamondBtn = (this.getChild("diamondBtn"));
  12978. this.node3 = (this.getChild("node3"));
  12979. this.node4 = (this.getChild("node4"));
  12980. this.node5 = (this.getChild("node5"));
  12981. this.node1 = (this.getChild("node1"));
  12982. this.node2 = (this.getChild("node2"));
  12983. this.node6 = (this.getChild("node6"));
  12984. this.t0 = this.getTransition("t0");
  12985. }
  12986. }
  12987. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12988. class ui_Component105 extends fgui.GButton {
  12989. static createInstance() {
  12990. return (fgui.UIPackage.createObject("game", "Component105"));
  12991. }
  12992. onConstruct() {
  12993. this.c1 = this.getController("c1");
  12994. this.n49 = (this.getChild("n49"));
  12995. this.n18 = (this.getChild("n18"));
  12996. this.n46 = (this.getChild("n46"));
  12997. this.n48 = (this.getChild("n48"));
  12998. }
  12999. }
  13000. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13001. class ui_Component106 extends fgui.GButton {
  13002. static createInstance() {
  13003. return (fgui.UIPackage.createObject("game", "Component106"));
  13004. }
  13005. onConstruct() {
  13006. this.c1 = this.getController("c1");
  13007. this.n49 = (this.getChild("n49"));
  13008. this.n18 = (this.getChild("n18"));
  13009. this.n46 = (this.getChild("n46"));
  13010. this.n48 = (this.getChild("n48"));
  13011. }
  13012. }
  13013. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13014. class ui_hb_zs1 extends fgui.GButton {
  13015. static createInstance() {
  13016. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13017. }
  13018. onConstruct() {
  13019. this.c1 = this.getController("c1");
  13020. this.n20 = (this.getChild("n20"));
  13021. this.n21 = (this.getChild("n21"));
  13022. this.n26 = (this.getChild("n26"));
  13023. this.n27 = (this.getChild("n27"));
  13024. this.shareTxt = (this.getChild("shareTxt"));
  13025. this.n32 = (this.getChild("n32"));
  13026. this.n38 = (this.getChild("n38"));
  13027. this.n39 = (this.getChild("n39"));
  13028. this.n44 = (this.getChild("n44"));
  13029. this.diamondTxt = (this.getChild("diamondTxt"));
  13030. this.n41 = (this.getChild("n41"));
  13031. this.n45 = (this.getChild("n45"));
  13032. this.n47 = (this.getChild("n47"));
  13033. this.n48 = (this.getChild("n48"));
  13034. this.randTxt = (this.getChild("randTxt"));
  13035. this.n50 = (this.getChild("n50"));
  13036. this.t0 = this.getTransition("t0");
  13037. }
  13038. }
  13039. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13040. class ui_dh_zs1 extends fgui.GComponent {
  13041. static createInstance() {
  13042. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13043. }
  13044. onConstruct() {
  13045. this.n10 = (this.getChild("n10"));
  13046. this.n9 = (this.getChild("n9"));
  13047. this.n1 = (this.getChild("n1"));
  13048. this.n2 = (this.getChild("n2"));
  13049. this.n3 = (this.getChild("n3"));
  13050. this.n4 = (this.getChild("n4"));
  13051. this.n5 = (this.getChild("n5"));
  13052. this.n6 = (this.getChild("n6"));
  13053. this.n8 = (this.getChild("n8"));
  13054. this.n11 = (this.getChild("n11"));
  13055. this.t0 = this.getTransition("t0");
  13056. }
  13057. }
  13058. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13059. class ui_dh_zs1_1 extends fgui.GComponent {
  13060. static createInstance() {
  13061. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13062. }
  13063. onConstruct() {
  13064. this.n3 = (this.getChild("n3"));
  13065. this.n1 = (this.getChild("n1"));
  13066. this.t0 = this.getTransition("t0");
  13067. }
  13068. }
  13069. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13070. class ui_hb_zs2 extends fgui.GButton {
  13071. static createInstance() {
  13072. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13073. }
  13074. onConstruct() {
  13075. this.n20 = (this.getChild("n20"));
  13076. this.n21 = (this.getChild("n21"));
  13077. this.n26 = (this.getChild("n26"));
  13078. this.n27 = (this.getChild("n27"));
  13079. this.n32 = (this.getChild("n32"));
  13080. this.n38 = (this.getChild("n38"));
  13081. this.n39 = (this.getChild("n39"));
  13082. this.n44 = (this.getChild("n44"));
  13083. this.diamondTxt = (this.getChild("diamondTxt"));
  13084. this.n41 = (this.getChild("n41"));
  13085. this.n45 = (this.getChild("n45"));
  13086. this.t0 = this.getTransition("t0");
  13087. }
  13088. }
  13089. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13090. class ui_hb_zs3 extends fgui.GButton {
  13091. static createInstance() {
  13092. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13093. }
  13094. onConstruct() {
  13095. this.n20 = (this.getChild("n20"));
  13096. this.n21 = (this.getChild("n21"));
  13097. this.n26 = (this.getChild("n26"));
  13098. this.n27 = (this.getChild("n27"));
  13099. this.n32 = (this.getChild("n32"));
  13100. this.n38 = (this.getChild("n38"));
  13101. this.n47 = (this.getChild("n47"));
  13102. this.t0 = this.getTransition("t0");
  13103. }
  13104. }
  13105. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13106. class ui_dh_zs2 extends fgui.GComponent {
  13107. static createInstance() {
  13108. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13109. }
  13110. onConstruct() {
  13111. this.n10 = (this.getChild("n10"));
  13112. this.n9 = (this.getChild("n9"));
  13113. this.n1 = (this.getChild("n1"));
  13114. this.n2 = (this.getChild("n2"));
  13115. this.n3 = (this.getChild("n3"));
  13116. this.n4 = (this.getChild("n4"));
  13117. this.n5 = (this.getChild("n5"));
  13118. this.n6 = (this.getChild("n6"));
  13119. this.n8 = (this.getChild("n8"));
  13120. this.n11 = (this.getChild("n11"));
  13121. this.t0 = this.getTransition("t0");
  13122. }
  13123. }
  13124. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13125. class ui_dh_zs2_1 extends fgui.GComponent {
  13126. static createInstance() {
  13127. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13128. }
  13129. onConstruct() {
  13130. this.n3 = (this.getChild("n3"));
  13131. this.n1 = (this.getChild("n1"));
  13132. this.t0 = this.getTransition("t0");
  13133. }
  13134. }
  13135. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13136. class ui_dh_zs3 extends fgui.GComponent {
  13137. static createInstance() {
  13138. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13139. }
  13140. onConstruct() {
  13141. this.n10 = (this.getChild("n10"));
  13142. this.n9 = (this.getChild("n9"));
  13143. this.n1 = (this.getChild("n1"));
  13144. this.n2 = (this.getChild("n2"));
  13145. this.n3 = (this.getChild("n3"));
  13146. this.n4 = (this.getChild("n4"));
  13147. this.n5 = (this.getChild("n5"));
  13148. this.n6 = (this.getChild("n6"));
  13149. this.n8 = (this.getChild("n8"));
  13150. this.n11 = (this.getChild("n11"));
  13151. this.t0 = this.getTransition("t0");
  13152. }
  13153. }
  13154. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13155. class ui_dh_zs3_1 extends fgui.GComponent {
  13156. static createInstance() {
  13157. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13158. }
  13159. onConstruct() {
  13160. this.n3 = (this.getChild("n3"));
  13161. this.n1 = (this.getChild("n1"));
  13162. this.t0 = this.getTransition("t0");
  13163. }
  13164. }
  13165. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13166. class ui_Component107 extends fgui.GComponent {
  13167. static createInstance() {
  13168. return (fgui.UIPackage.createObject("game", "Component107"));
  13169. }
  13170. onConstruct() {
  13171. this.n18 = (this.getChild("n18"));
  13172. this.n19 = (this.getChild("n19"));
  13173. this.n20 = (this.getChild("n20"));
  13174. this.n21 = (this.getChild("n21"));
  13175. this.n22 = (this.getChild("n22"));
  13176. this.levelTxt = (this.getChild("levelTxt"));
  13177. this.t0 = this.getTransition("t0");
  13178. }
  13179. }
  13180. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13181. class ui_box_com1 extends fgui.GComponent {
  13182. static createInstance() {
  13183. return (fgui.UIPackage.createObject("game", "box_com1"));
  13184. }
  13185. onConstruct() {
  13186. this.n14 = (this.getChild("n14"));
  13187. this.n6 = (this.getChild("n6"));
  13188. this.t0 = this.getTransition("t0");
  13189. }
  13190. }
  13191. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13192. class ui_box_com2 extends fgui.GProgressBar {
  13193. static createInstance() {
  13194. return (fgui.UIPackage.createObject("game", "box_com2"));
  13195. }
  13196. onConstruct() {
  13197. this.bg0 = (this.getChild("bg0"));
  13198. this.bg = (this.getChild("bg"));
  13199. this.bar = (this.getChild("bar"));
  13200. this.n7 = (this.getChild("n7"));
  13201. this.n8 = (this.getChild("n8"));
  13202. this.n10 = (this.getChild("n10"));
  13203. this.n11 = (this.getChild("n11"));
  13204. this.n12 = (this.getChild("n12"));
  13205. }
  13206. }
  13207. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13208. class ui_box_com4 extends fgui.GComponent {
  13209. static createInstance() {
  13210. return (fgui.UIPackage.createObject("game", "box_com4"));
  13211. }
  13212. onConstruct() {
  13213. this.n8 = (this.getChild("n8"));
  13214. this.t0 = this.getTransition("t0");
  13215. }
  13216. }
  13217. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13218. class ui_box_com3 extends fgui.GComponent {
  13219. static createInstance() {
  13220. return (fgui.UIPackage.createObject("game", "box_com3"));
  13221. }
  13222. onConstruct() {
  13223. this.n2 = (this.getChild("n2"));
  13224. this.n3 = (this.getChild("n3"));
  13225. this.n4 = (this.getChild("n4"));
  13226. this.n5 = (this.getChild("n5"));
  13227. this.t0 = this.getTransition("t0");
  13228. this.t1 = this.getTransition("t1");
  13229. }
  13230. }
  13231. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13232. class ui_Component97 extends fgui.GComponent {
  13233. static createInstance() {
  13234. return (fgui.UIPackage.createObject("game", "Component97"));
  13235. }
  13236. onConstruct() {
  13237. this.c1 = this.getController("c1");
  13238. this.n46 = (this.getChild("n46"));
  13239. this.diamondNode = (this.getChild("diamondNode"));
  13240. this.coinNode = (this.getChild("coinNode"));
  13241. this.t0 = this.getTransition("t0");
  13242. }
  13243. }
  13244. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13245. class ui_Component98 extends fgui.GButton {
  13246. static createInstance() {
  13247. return (fgui.UIPackage.createObject("game", "Component98"));
  13248. }
  13249. onConstruct() {
  13250. this.n8 = (this.getChild("n8"));
  13251. this.n40 = (this.getChild("n40"));
  13252. }
  13253. }
  13254. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13255. class ui_Component28_11 extends fgui.GButton {
  13256. static createInstance() {
  13257. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13258. }
  13259. onConstruct() {
  13260. this.c1 = this.getController("c1");
  13261. this.n12 = (this.getChild("n12"));
  13262. this.n17 = (this.getChild("n17"));
  13263. this.n13 = (this.getChild("n13"));
  13264. this.diamondTxt = (this.getChild("diamondTxt"));
  13265. this.n15 = (this.getChild("n15"));
  13266. this.n16 = (this.getChild("n16"));
  13267. }
  13268. }
  13269. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13270. class ui_Component58_11 extends fgui.GComponent {
  13271. static createInstance() {
  13272. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13273. }
  13274. onConstruct() {
  13275. this.c1 = this.getController("c1");
  13276. this.n23 = (this.getChild("n23"));
  13277. this.n41 = (this.getChild("n41"));
  13278. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13279. this.n_daoju = (this.getChild("n_daoju"));
  13280. this.myList = (this.getChild("myList"));
  13281. this.djList = (this.getChild("djList"));
  13282. this.t0 = this.getTransition("t0");
  13283. }
  13284. }
  13285. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13286. class ui_Component100 extends fgui.GComponent {
  13287. static createInstance() {
  13288. return (fgui.UIPackage.createObject("game", "Component100"));
  13289. }
  13290. onConstruct() {
  13291. this.c1 = this.getController("c1");
  13292. this.n75 = (this.getChild("n75"));
  13293. this.n76 = (this.getChild("n76"));
  13294. this.n80 = (this.getChild("n80"));
  13295. this.txt = (this.getChild("txt"));
  13296. this.spineRoot = (this.getChild("spineRoot"));
  13297. }
  13298. }
  13299. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13300. class ui_Component101 extends fgui.GComponent {
  13301. static createInstance() {
  13302. return (fgui.UIPackage.createObject("game", "Component101"));
  13303. }
  13304. onConstruct() {
  13305. this.c1 = this.getController("c1");
  13306. this.n36 = (this.getChild("n36"));
  13307. this.n35 = (this.getChild("n35"));
  13308. this.n33 = (this.getChild("n33"));
  13309. this.n34 = (this.getChild("n34"));
  13310. }
  13311. }
  13312. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13313. class ui_Component53 extends fgui.GComponent {
  13314. static createInstance() {
  13315. return (fgui.UIPackage.createObject("game", "Component53"));
  13316. }
  13317. onConstruct() {
  13318. this.n0 = (this.getChild("n0"));
  13319. this.n1 = (this.getChild("n1"));
  13320. this.n2 = (this.getChild("n2"));
  13321. this.n3 = (this.getChild("n3"));
  13322. this.n4 = (this.getChild("n4"));
  13323. this.n5 = (this.getChild("n5"));
  13324. this.n6 = (this.getChild("n6"));
  13325. this.n7 = (this.getChild("n7"));
  13326. this.n8 = (this.getChild("n8"));
  13327. this.n9 = (this.getChild("n9"));
  13328. this.n10 = (this.getChild("n10"));
  13329. this.n11 = (this.getChild("n11"));
  13330. this.n12 = (this.getChild("n12"));
  13331. this.n13 = (this.getChild("n13"));
  13332. this.n14 = (this.getChild("n14"));
  13333. this.n15 = (this.getChild("n15"));
  13334. this.n16 = (this.getChild("n16"));
  13335. this.n19 = (this.getChild("n19"));
  13336. this.n20 = (this.getChild("n20"));
  13337. this.n21 = (this.getChild("n21"));
  13338. this.n22 = (this.getChild("n22"));
  13339. this.n23 = (this.getChild("n23"));
  13340. this.n24 = (this.getChild("n24"));
  13341. this.n25 = (this.getChild("n25"));
  13342. this.n26 = (this.getChild("n26"));
  13343. this.n27 = (this.getChild("n27"));
  13344. this.n28 = (this.getChild("n28"));
  13345. this.n29 = (this.getChild("n29"));
  13346. this.n30 = (this.getChild("n30"));
  13347. this.n31 = (this.getChild("n31"));
  13348. this.n32 = (this.getChild("n32"));
  13349. this.n33 = (this.getChild("n33"));
  13350. this.n34 = (this.getChild("n34"));
  13351. this.n35 = (this.getChild("n35"));
  13352. this.t0 = this.getTransition("t0");
  13353. }
  13354. }
  13355. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13356. class ui_Component58 extends fgui.GComponent {
  13357. static createInstance() {
  13358. return (fgui.UIPackage.createObject("game", "Component58"));
  13359. }
  13360. onConstruct() {
  13361. this.n23 = (this.getChild("n23"));
  13362. this.n41 = (this.getChild("n41"));
  13363. this.n8 = (this.getChild("n8"));
  13364. this.skillList = (this.getChild("skillList"));
  13365. this.t0 = this.getTransition("t0");
  13366. }
  13367. }
  13368. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13369. class ui_Component59 extends fgui.GComponent {
  13370. static createInstance() {
  13371. return (fgui.UIPackage.createObject("game", "Component59"));
  13372. }
  13373. onConstruct() {
  13374. this.n3 = (this.getChild("n3"));
  13375. this.msgTxt = (this.getChild("msgTxt"));
  13376. this.t0 = this.getTransition("t0");
  13377. }
  13378. }
  13379. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13380. class ui_RulerNode extends fgui.GComponent {
  13381. static createInstance() {
  13382. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13383. }
  13384. onConstruct() {
  13385. this.n6 = (this.getChild("n6"));
  13386. this.n4 = (this.getChild("n4"));
  13387. this.img1 = (this.getChild("img1"));
  13388. this.img2 = (this.getChild("img2"));
  13389. }
  13390. }
  13391. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13392. class ui_Component108 extends fgui.GComponent {
  13393. static createInstance() {
  13394. return (fgui.UIPackage.createObject("game", "Component108"));
  13395. }
  13396. onConstruct() {
  13397. this.n19 = (this.getChild("n19"));
  13398. this.t0 = this.getTransition("t0");
  13399. }
  13400. }
  13401. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13402. class ui_Component63 extends fgui.GComponent {
  13403. static createInstance() {
  13404. return (fgui.UIPackage.createObject("game", "Component63"));
  13405. }
  13406. onConstruct() {
  13407. this.n66 = (this.getChild("n66"));
  13408. this.n56 = (this.getChild("n56"));
  13409. this.n63 = (this.getChild("n63"));
  13410. this.n65 = (this.getChild("n65"));
  13411. this.t0 = this.getTransition("t0");
  13412. }
  13413. }
  13414. ui_Component63.URL = "ui://isxx5ak7h657452";
  13415. class ui_topNode extends fgui.GComponent {
  13416. static createInstance() {
  13417. return (fgui.UIPackage.createObject("game", "topNode"));
  13418. }
  13419. onConstruct() {
  13420. this.selfProgress = (this.getChild("selfProgress"));
  13421. this.aiProgress = (this.getChild("aiProgress"));
  13422. this.selfKuang = (this.getChild("selfKuang"));
  13423. this.aiKuang = (this.getChild("aiKuang"));
  13424. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13425. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13426. this.n33 = (this.getChild("n33"));
  13427. this.n34 = (this.getChild("n34"));
  13428. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13429. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13430. this.selfBallList = (this.getChild("selfBallList"));
  13431. this.aiBallList = (this.getChild("aiBallList"));
  13432. this.middleNode = (this.getChild("middleNode"));
  13433. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13434. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13435. this.scoreNode = (this.getChild("scoreNode"));
  13436. this.selfTips = (this.getChild("selfTips"));
  13437. this.aiTips = (this.getChild("aiTips"));
  13438. }
  13439. }
  13440. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13441. class ui_selfProgress extends fgui.GProgressBar {
  13442. static createInstance() {
  13443. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13444. }
  13445. onConstruct() {
  13446. this.n3 = (this.getChild("n3"));
  13447. this.bar = (this.getChild("bar"));
  13448. }
  13449. }
  13450. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13451. class ui_aiProgress extends fgui.GProgressBar {
  13452. static createInstance() {
  13453. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13454. }
  13455. onConstruct() {
  13456. this.n3 = (this.getChild("n3"));
  13457. this.bar = (this.getChild("bar"));
  13458. }
  13459. }
  13460. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13461. class ui_ballDisplay extends fgui.GComponent {
  13462. static createInstance() {
  13463. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13464. }
  13465. onConstruct() {
  13466. this.myImg = (this.getChild("myImg"));
  13467. }
  13468. }
  13469. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13470. class ui_moveNode extends fgui.GComponent {
  13471. static createInstance() {
  13472. return (fgui.UIPackage.createObject("game", "moveNode"));
  13473. }
  13474. onConstruct() {
  13475. this.n8 = (this.getChild("n8"));
  13476. this.finger = (this.getChild("finger"));
  13477. }
  13478. }
  13479. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13480. class ui_cancelBtn extends fgui.GButton {
  13481. static createInstance() {
  13482. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13483. }
  13484. onConstruct() {
  13485. this.c1 = this.getController("c1");
  13486. this.n0 = (this.getChild("n0"));
  13487. this.n1 = (this.getChild("n1"));
  13488. }
  13489. }
  13490. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13491. class ui_shareBtn extends fgui.GButton {
  13492. static createInstance() {
  13493. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13494. }
  13495. onConstruct() {
  13496. this.c1 = this.getController("c1");
  13497. this.n2 = (this.getChild("n2"));
  13498. this.n1 = (this.getChild("n1"));
  13499. this.n3 = (this.getChild("n3"));
  13500. this.n4 = (this.getChild("n4"));
  13501. this.n5 = (this.getChild("n5"));
  13502. this.n6 = (this.getChild("n6"));
  13503. }
  13504. }
  13505. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13506. class ui_share2Btn extends fgui.GButton {
  13507. static createInstance() {
  13508. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13509. }
  13510. onConstruct() {
  13511. this.n3 = (this.getChild("n3"));
  13512. }
  13513. }
  13514. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13515. class ui_rodMethodNode extends fgui.GComponent {
  13516. static createInstance() {
  13517. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13518. }
  13519. onConstruct() {
  13520. this.bg = (this.getChild("bg"));
  13521. this.dot = (this.getChild("dot"));
  13522. }
  13523. }
  13524. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13525. class ui_sureBtn extends fgui.GButton {
  13526. static createInstance() {
  13527. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13528. }
  13529. onConstruct() {
  13530. this.n2 = (this.getChild("n2"));
  13531. this.n1 = (this.getChild("n1"));
  13532. }
  13533. }
  13534. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13535. class ui_Component18 extends fgui.GComponent {
  13536. static createInstance() {
  13537. return (fgui.UIPackage.createObject("game", "Component18"));
  13538. }
  13539. onConstruct() {
  13540. this.c1 = this.getController("c1");
  13541. this.nameTxt = (this.getChild("nameTxt"));
  13542. this.headImg = (this.getChild("headImg"));
  13543. this.n24 = (this.getChild("n24"));
  13544. this.skillImg = (this.getChild("skillImg"));
  13545. this.skillTxt = (this.getChild("skillTxt"));
  13546. }
  13547. }
  13548. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13549. class ui_Component45 extends fgui.GComponent {
  13550. static createInstance() {
  13551. return (fgui.UIPackage.createObject("game", "Component45"));
  13552. }
  13553. onConstruct() {
  13554. this.c1 = this.getController("c1");
  13555. this.n40 = (this.getChild("n40"));
  13556. this.n41 = (this.getChild("n41"));
  13557. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13558. this.n42 = (this.getChild("n42"));
  13559. this.awardTxt = (this.getChild("awardTxt"));
  13560. this.n44 = (this.getChild("n44"));
  13561. this.t0 = this.getTransition("t0");
  13562. }
  13563. }
  13564. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13565. class ui_emotionDisplay extends fgui.GButton {
  13566. static createInstance() {
  13567. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13568. }
  13569. onConstruct() {
  13570. this.myIcon = (this.getChild("myIcon"));
  13571. }
  13572. }
  13573. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13574. class ui_Component49 extends fgui.GButton {
  13575. static createInstance() {
  13576. return (fgui.UIPackage.createObject("game", "Component49"));
  13577. }
  13578. onConstruct() {
  13579. this.n69 = (this.getChild("n69"));
  13580. this.n56 = (this.getChild("n56"));
  13581. }
  13582. }
  13583. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13584. class ui_Component50 extends fgui.GButton {
  13585. static createInstance() {
  13586. return (fgui.UIPackage.createObject("game", "Component50"));
  13587. }
  13588. onConstruct() {
  13589. this.n54 = (this.getChild("n54"));
  13590. this.n65 = (this.getChild("n65"));
  13591. }
  13592. }
  13593. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13594. class ui_Component51 extends fgui.GButton {
  13595. static createInstance() {
  13596. return (fgui.UIPackage.createObject("game", "Component51"));
  13597. }
  13598. onConstruct() {
  13599. this.c1 = this.getController("c1");
  13600. this.n51 = (this.getChild("n51"));
  13601. this.n54 = (this.getChild("n54"));
  13602. }
  13603. }
  13604. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13605. class ui_Button5 extends fgui.GButton {
  13606. static createInstance() {
  13607. return (fgui.UIPackage.createObject("game", "Button5"));
  13608. }
  13609. onConstruct() {
  13610. this.c1 = this.getController("c1");
  13611. this.n0 = (this.getChild("n0"));
  13612. this.n2 = (this.getChild("n2"));
  13613. }
  13614. }
  13615. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13616. class ui_Component124 extends fgui.GComponent {
  13617. static createInstance() {
  13618. return (fgui.UIPackage.createObject("game", "Component124"));
  13619. }
  13620. onConstruct() {
  13621. this.n22 = (this.getChild("n22"));
  13622. this.shareNode = (this.getChild("shareNode"));
  13623. }
  13624. }
  13625. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13626. class ui_Component125 extends fgui.GComponent {
  13627. static createInstance() {
  13628. return (fgui.UIPackage.createObject("game", "Component125"));
  13629. }
  13630. onConstruct() {
  13631. this.n29 = (this.getChild("n29"));
  13632. this.coinTxt = (this.getChild("coinTxt"));
  13633. }
  13634. }
  13635. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13636. class ui_Component52 extends fgui.GButton {
  13637. static createInstance() {
  13638. return (fgui.UIPackage.createObject("game", "Component52"));
  13639. }
  13640. onConstruct() {
  13641. this.n35 = (this.getChild("n35"));
  13642. this.n36 = (this.getChild("n36"));
  13643. }
  13644. }
  13645. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13646. class ui_Component_fl_1 extends fgui.GComponent {
  13647. static createInstance() {
  13648. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  13649. }
  13650. onConstruct() {
  13651. this.n0 = (this.getChild("n0"));
  13652. this.n6 = (this.getChild("n6"));
  13653. this.n7 = (this.getChild("n7"));
  13654. this.n8 = (this.getChild("n8"));
  13655. this.n5 = (this.getChild("n5"));
  13656. this.n9 = (this.getChild("n9"));
  13657. this.n10 = (this.getChild("n10"));
  13658. this.txt_price = (this.getChild("txt_price"));
  13659. this.n_no = (this.getChild("n_no"));
  13660. this.n_buy = (this.getChild("n_buy"));
  13661. }
  13662. }
  13663. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  13664. class ui_Component_fl_2 extends fgui.GComponent {
  13665. static createInstance() {
  13666. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  13667. }
  13668. onConstruct() {
  13669. this.n0 = (this.getChild("n0"));
  13670. this.txt_price = (this.getChild("txt_price"));
  13671. this.n4 = (this.getChild("n4"));
  13672. this.n6 = (this.getChild("n6"));
  13673. this.n7 = (this.getChild("n7"));
  13674. this.n5 = (this.getChild("n5"));
  13675. this.n8 = (this.getChild("n8"));
  13676. this.n9 = (this.getChild("n9"));
  13677. this.n_no = (this.getChild("n_no"));
  13678. this.n_buy = (this.getChild("n_buy"));
  13679. }
  13680. }
  13681. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  13682. class ui_drawBtn extends fgui.GButton {
  13683. static createInstance() {
  13684. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13685. }
  13686. onConstruct() {
  13687. this.c1 = this.getController("c1");
  13688. this.n2 = (this.getChild("n2"));
  13689. this.n1 = (this.getChild("n1"));
  13690. this.n5 = (this.getChild("n5"));
  13691. }
  13692. }
  13693. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13694. class ui_Component43 extends fgui.GButton {
  13695. static createInstance() {
  13696. return (fgui.UIPackage.createObject("game", "Component43"));
  13697. }
  13698. onConstruct() {
  13699. this.n49 = (this.getChild("n49"));
  13700. }
  13701. }
  13702. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13703. class ui_wordsDisplay extends fgui.GComponent {
  13704. static createInstance() {
  13705. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13706. }
  13707. onConstruct() {
  13708. this.txt = (this.getChild("txt"));
  13709. this.n63 = (this.getChild("n63"));
  13710. }
  13711. }
  13712. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13713. class ui_Component_phb extends fgui.GComponent {
  13714. static createInstance() {
  13715. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13716. }
  13717. onConstruct() {
  13718. this.n3 = (this.getChild("n3"));
  13719. this.n4 = (this.getChild("n4"));
  13720. }
  13721. }
  13722. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13723. class ui_Component3 extends fgui.GComponent {
  13724. static createInstance() {
  13725. return (fgui.UIPackage.createObject("game", "Component3"));
  13726. }
  13727. onConstruct() {
  13728. this.n26 = (this.getChild("n26"));
  13729. this.n24 = (this.getChild("n24"));
  13730. this.nameTxt = (this.getChild("nameTxt"));
  13731. this.headRoot = (this.getChild("headRoot"));
  13732. }
  13733. }
  13734. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13735. class ui_Component4 extends fgui.GComponent {
  13736. static createInstance() {
  13737. return (fgui.UIPackage.createObject("game", "Component4"));
  13738. }
  13739. onConstruct() {
  13740. this.headImg = (this.getChild("headImg"));
  13741. }
  13742. }
  13743. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13744. class ui_Component7 extends fgui.GButton {
  13745. static createInstance() {
  13746. return (fgui.UIPackage.createObject("game", "Component7"));
  13747. }
  13748. onConstruct() {
  13749. this.n17 = (this.getChild("n17"));
  13750. }
  13751. }
  13752. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13753. class ui_Component8 extends fgui.GButton {
  13754. static createInstance() {
  13755. return (fgui.UIPackage.createObject("game", "Component8"));
  13756. }
  13757. onConstruct() {
  13758. this.n19 = (this.getChild("n19"));
  13759. }
  13760. }
  13761. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13762. class ui_Component10 extends fgui.GButton {
  13763. static createInstance() {
  13764. return (fgui.UIPackage.createObject("game", "Component10"));
  13765. }
  13766. onConstruct() {
  13767. this.c1 = this.getController("c1");
  13768. this.n40 = (this.getChild("n40"));
  13769. }
  13770. }
  13771. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13772. class ui_Component11 extends fgui.GButton {
  13773. static createInstance() {
  13774. return (fgui.UIPackage.createObject("game", "Component11"));
  13775. }
  13776. onConstruct() {
  13777. this.n34 = (this.getChild("n34"));
  13778. }
  13779. }
  13780. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13781. class ui_Component12 extends fgui.GButton {
  13782. static createInstance() {
  13783. return (fgui.UIPackage.createObject("game", "Component12"));
  13784. }
  13785. onConstruct() {
  13786. this.n35 = (this.getChild("n35"));
  13787. }
  13788. }
  13789. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13790. class ui_Component13 extends fgui.GButton {
  13791. static createInstance() {
  13792. return (fgui.UIPackage.createObject("game", "Component13"));
  13793. }
  13794. onConstruct() {
  13795. this.n27 = (this.getChild("n27"));
  13796. this.n36 = (this.getChild("n36"));
  13797. }
  13798. }
  13799. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13800. class ui_dh_js_tuowei extends fgui.GComponent {
  13801. static createInstance() {
  13802. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13803. }
  13804. onConstruct() {
  13805. this.n19 = (this.getChild("n19"));
  13806. this.n18 = (this.getChild("n18"));
  13807. this.n0 = (this.getChild("n0"));
  13808. this.n3 = (this.getChild("n3"));
  13809. this.n4 = (this.getChild("n4"));
  13810. this.n5 = (this.getChild("n5"));
  13811. this.n6 = (this.getChild("n6"));
  13812. this.n8 = (this.getChild("n8"));
  13813. this.n9 = (this.getChild("n9"));
  13814. this.n10 = (this.getChild("n10"));
  13815. this.n11 = (this.getChild("n11"));
  13816. this.n12 = (this.getChild("n12"));
  13817. this.n13 = (this.getChild("n13"));
  13818. this.n14 = (this.getChild("n14"));
  13819. this.n15 = (this.getChild("n15"));
  13820. this.n20 = (this.getChild("n20"));
  13821. this.t0 = this.getTransition("t0");
  13822. this.t1 = this.getTransition("t1");
  13823. }
  13824. }
  13825. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13826. class ui_dh_js_tw_g extends fgui.GComponent {
  13827. static createInstance() {
  13828. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13829. }
  13830. onConstruct() {
  13831. this.n0 = (this.getChild("n0"));
  13832. this.n1 = (this.getChild("n1"));
  13833. this.t0 = this.getTransition("t0");
  13834. }
  13835. }
  13836. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13837. class ui_dh_js_xingxing extends fgui.GComponent {
  13838. static createInstance() {
  13839. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13840. }
  13841. onConstruct() {
  13842. this.n1 = (this.getChild("n1"));
  13843. this.n2 = (this.getChild("n2"));
  13844. this.n3 = (this.getChild("n3"));
  13845. this.n4 = (this.getChild("n4"));
  13846. this.n0 = (this.getChild("n0"));
  13847. this.t2 = this.getTransition("t2");
  13848. this.t1 = this.getTransition("t1");
  13849. }
  13850. }
  13851. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13852. class ui_dh_zy_jiazai extends fgui.GComponent {
  13853. static createInstance() {
  13854. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13855. }
  13856. onConstruct() {
  13857. this.c1 = this.getController("c1");
  13858. this.n0 = (this.getChild("n0"));
  13859. this.n1 = (this.getChild("n1"));
  13860. this.n2 = (this.getChild("n2"));
  13861. this.n4 = (this.getChild("n4"));
  13862. this.n5 = (this.getChild("n5"));
  13863. this.n6 = (this.getChild("n6"));
  13864. this.n8 = (this.getChild("n8"));
  13865. this.n7 = (this.getChild("n7"));
  13866. this.t0 = this.getTransition("t0");
  13867. }
  13868. }
  13869. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13870. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13871. static createInstance() {
  13872. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13873. }
  13874. onConstruct() {
  13875. this.c1 = this.getController("c1");
  13876. this.n3 = (this.getChild("n3"));
  13877. this.n5 = (this.getChild("n5"));
  13878. this.n4 = (this.getChild("n4"));
  13879. this.n0 = (this.getChild("n0"));
  13880. this.n1 = (this.getChild("n1"));
  13881. this.n2 = (this.getChild("n2"));
  13882. }
  13883. }
  13884. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13885. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13886. static createInstance() {
  13887. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13888. }
  13889. onConstruct() {
  13890. this.n19 = (this.getChild("n19"));
  13891. this.n21 = (this.getChild("n21"));
  13892. this.n0 = (this.getChild("n0"));
  13893. this.n3 = (this.getChild("n3"));
  13894. this.n4 = (this.getChild("n4"));
  13895. this.n5 = (this.getChild("n5"));
  13896. this.n6 = (this.getChild("n6"));
  13897. this.n8 = (this.getChild("n8"));
  13898. this.n9 = (this.getChild("n9"));
  13899. this.n10 = (this.getChild("n10"));
  13900. this.n11 = (this.getChild("n11"));
  13901. this.n12 = (this.getChild("n12"));
  13902. this.n13 = (this.getChild("n13"));
  13903. this.n14 = (this.getChild("n14"));
  13904. this.n15 = (this.getChild("n15"));
  13905. this.n23 = (this.getChild("n23"));
  13906. this.t0 = this.getTransition("t0");
  13907. this.t1 = this.getTransition("t1");
  13908. }
  13909. }
  13910. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13911. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13912. static createInstance() {
  13913. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13914. }
  13915. onConstruct() {
  13916. this.n1 = (this.getChild("n1"));
  13917. this.n2 = (this.getChild("n2"));
  13918. this.t0 = this.getTransition("t0");
  13919. }
  13920. }
  13921. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13922. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13923. static createInstance() {
  13924. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13925. }
  13926. onConstruct() {
  13927. this.n4 = (this.getChild("n4"));
  13928. this.n2 = (this.getChild("n2"));
  13929. this.n3 = (this.getChild("n3"));
  13930. this.idle = this.getTransition("idle");
  13931. this.attack = this.getTransition("attack");
  13932. }
  13933. }
  13934. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13935. class ui_special extends fgui.GComponent {
  13936. static createInstance() {
  13937. return (fgui.UIPackage.createObject("game", "special"));
  13938. }
  13939. onConstruct() {
  13940. this.n18 = (this.getChild("n18"));
  13941. this.n19 = (this.getChild("n19"));
  13942. this.n20 = (this.getChild("n20"));
  13943. this.n21 = (this.getChild("n21"));
  13944. this.n22 = (this.getChild("n22"));
  13945. this.levelTxt = (this.getChild("levelTxt"));
  13946. this.n24 = (this.getChild("n24"));
  13947. this.n25 = (this.getChild("n25"));
  13948. this.t0 = this.getTransition("t0");
  13949. }
  13950. }
  13951. ui_special.URL = "ui://isxx5ak7j979v4i6";
  13952. class ui_Component145 extends fgui.GComponent {
  13953. static createInstance() {
  13954. return (fgui.UIPackage.createObject("game", "Component145"));
  13955. }
  13956. onConstruct() {
  13957. this.guanyuNode = (this.getChild("guanyuNode"));
  13958. }
  13959. }
  13960. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  13961. class ui_longBtn extends fgui.GButton {
  13962. static createInstance() {
  13963. return (fgui.UIPackage.createObject("game", "longBtn"));
  13964. }
  13965. onConstruct() {
  13966. this.c1 = this.getController("c1");
  13967. this.n2 = (this.getChild("n2"));
  13968. this.n1 = (this.getChild("n1"));
  13969. this.n4 = (this.getChild("n4"));
  13970. }
  13971. }
  13972. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  13973. class ui_Component146 extends fgui.GComponent {
  13974. static createInstance() {
  13975. return (fgui.UIPackage.createObject("game", "Component146"));
  13976. }
  13977. onConstruct() {
  13978. this.n89 = (this.getChild("n89"));
  13979. this.n90 = (this.getChild("n90"));
  13980. this.guideBtn = (this.getChild("guideBtn"));
  13981. }
  13982. }
  13983. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  13984. class ui_Component146_11 extends fgui.GComponent {
  13985. static createInstance() {
  13986. return (fgui.UIPackage.createObject("game", "Component146_11"));
  13987. }
  13988. onConstruct() {
  13989. this.n89 = (this.getChild("n89"));
  13990. this.n90 = (this.getChild("n90"));
  13991. this.guideBtn = (this.getChild("guideBtn"));
  13992. }
  13993. }
  13994. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  13995. class ui_Component111_1 extends fgui.GComponent {
  13996. static createInstance() {
  13997. return (fgui.UIPackage.createObject("game", "Component111_1"));
  13998. }
  13999. onConstruct() {
  14000. this.n68 = (this.getChild("n68"));
  14001. this.myMask = (this.getChild("myMask"));
  14002. }
  14003. }
  14004. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14005. class ui_Component64_1 extends fgui.GComponent {
  14006. static createInstance() {
  14007. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14008. }
  14009. onConstruct() {
  14010. this.n57 = (this.getChild("n57"));
  14011. this.n54 = (this.getChild("n54"));
  14012. this.n55 = (this.getChild("n55"));
  14013. this.n56 = (this.getChild("n56"));
  14014. this.t1 = this.getTransition("t1");
  14015. }
  14016. }
  14017. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14018. class ui_ModeSelection_com123 extends fgui.GComponent {
  14019. static createInstance() {
  14020. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14021. }
  14022. onConstruct() {
  14023. this.type1 = (this.getChild("type1"));
  14024. this.type2 = (this.getChild("type2"));
  14025. this.type3 = (this.getChild("type3"));
  14026. this.n38 = (this.getChild("n38"));
  14027. this.t0 = this.getTransition("t0");
  14028. }
  14029. }
  14030. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14031. class ui_Component132_2 extends fgui.GComponent {
  14032. static createInstance() {
  14033. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14034. }
  14035. onConstruct() {
  14036. this.n25 = (this.getChild("n25"));
  14037. this.n26 = (this.getChild("n26"));
  14038. this.n27 = (this.getChild("n27"));
  14039. this.t0 = this.getTransition("t0");
  14040. }
  14041. }
  14042. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14043. class ui_UIPower$1 extends fgui.GComponent {
  14044. static createInstance() {
  14045. return (fgui.UIPackage.createObject("game", "UIPower"));
  14046. }
  14047. onConstruct() {
  14048. this.n11 = (this.getChild("n11"));
  14049. this.myNode = (this.getChild("myNode"));
  14050. this.t0 = this.getTransition("t0");
  14051. }
  14052. }
  14053. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14054. class ui_Component133 extends fgui.GComponent {
  14055. static createInstance() {
  14056. return (fgui.UIPackage.createObject("game", "Component133"));
  14057. }
  14058. onConstruct() {
  14059. this.n29 = (this.getChild("n29"));
  14060. this.n30 = (this.getChild("n30"));
  14061. }
  14062. }
  14063. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14064. class ui_Component134 extends fgui.GComponent {
  14065. static createInstance() {
  14066. return (fgui.UIPackage.createObject("game", "Component134"));
  14067. }
  14068. onConstruct() {
  14069. this.n30 = (this.getChild("n30"));
  14070. this.n31 = (this.getChild("n31"));
  14071. this.t0 = this.getTransition("t0");
  14072. }
  14073. }
  14074. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14075. class ui_Component135 extends fgui.GComponent {
  14076. static createInstance() {
  14077. return (fgui.UIPackage.createObject("game", "Component135"));
  14078. }
  14079. onConstruct() {
  14080. this.n30 = (this.getChild("n30"));
  14081. this.t0 = this.getTransition("t0");
  14082. }
  14083. }
  14084. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14085. class ui_Component137 extends fgui.GComponent {
  14086. static createInstance() {
  14087. return (fgui.UIPackage.createObject("game", "Component137"));
  14088. }
  14089. onConstruct() {
  14090. this.n28 = (this.getChild("n28"));
  14091. this.n29 = (this.getChild("n29"));
  14092. this.n30 = (this.getChild("n30"));
  14093. this.n32 = (this.getChild("n32"));
  14094. }
  14095. }
  14096. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14097. class ui_dh_zuanshi extends fgui.GButton {
  14098. static createInstance() {
  14099. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14100. }
  14101. onConstruct() {
  14102. this.n1 = (this.getChild("n1"));
  14103. this.n2 = (this.getChild("n2"));
  14104. this.n0 = (this.getChild("n0"));
  14105. this.n3 = (this.getChild("n3"));
  14106. this.n4 = (this.getChild("n4"));
  14107. }
  14108. }
  14109. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14110. class ui_Component138 extends fgui.GComponent {
  14111. static createInstance() {
  14112. return (fgui.UIPackage.createObject("game", "Component138"));
  14113. }
  14114. onConstruct() {
  14115. this.n1 = (this.getChild("n1"));
  14116. this.n2 = (this.getChild("n2"));
  14117. this.t0 = this.getTransition("t0");
  14118. }
  14119. }
  14120. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14121. class ui_Component139 extends fgui.GComponent {
  14122. static createInstance() {
  14123. return (fgui.UIPackage.createObject("game", "Component139"));
  14124. }
  14125. onConstruct() {
  14126. this.n0 = (this.getChild("n0"));
  14127. this.t0 = this.getTransition("t0");
  14128. }
  14129. }
  14130. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14131. class ui_Component140 extends fgui.GComponent {
  14132. static createInstance() {
  14133. return (fgui.UIPackage.createObject("game", "Component140"));
  14134. }
  14135. onConstruct() {
  14136. this.n2 = (this.getChild("n2"));
  14137. this.n3 = (this.getChild("n3"));
  14138. this.t0 = this.getTransition("t0");
  14139. }
  14140. }
  14141. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14142. class ui_Component141 extends fgui.GComponent {
  14143. static createInstance() {
  14144. return (fgui.UIPackage.createObject("game", "Component141"));
  14145. }
  14146. onConstruct() {
  14147. this.n0 = (this.getChild("n0"));
  14148. this.t0 = this.getTransition("t0");
  14149. }
  14150. }
  14151. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14152. class ui_powerNode extends fgui.GProgressBar {
  14153. static createInstance() {
  14154. return (fgui.UIPackage.createObject("game", "powerNode"));
  14155. }
  14156. onConstruct() {
  14157. this.n2 = (this.getChild("n2"));
  14158. this.bar_v = (this.getChild("bar_v"));
  14159. this.showImg = (this.getChild("showImg"));
  14160. this.n12 = (this.getChild("n12"));
  14161. }
  14162. }
  14163. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14164. class ui_dh_jingbi1 extends fgui.GComponent {
  14165. static createInstance() {
  14166. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14167. }
  14168. onConstruct() {
  14169. this.n0 = (this.getChild("n0"));
  14170. this.n1 = (this.getChild("n1"));
  14171. this.n2 = (this.getChild("n2"));
  14172. this.n3 = (this.getChild("n3"));
  14173. this.n4 = (this.getChild("n4"));
  14174. this.n5 = (this.getChild("n5"));
  14175. this.n6 = (this.getChild("n6"));
  14176. this.n8 = (this.getChild("n8"));
  14177. this.t0 = this.getTransition("t0");
  14178. }
  14179. }
  14180. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14181. class ui_Component94 extends fgui.GButton {
  14182. static createInstance() {
  14183. return (fgui.UIPackage.createObject("game", "Component94"));
  14184. }
  14185. onConstruct() {
  14186. this.n77 = (this.getChild("n77"));
  14187. }
  14188. }
  14189. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14190. class ui_Component95 extends fgui.GButton {
  14191. static createInstance() {
  14192. return (fgui.UIPackage.createObject("game", "Component95"));
  14193. }
  14194. onConstruct() {
  14195. this.n77 = (this.getChild("n77"));
  14196. }
  14197. }
  14198. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14199. class ui_Component126 extends fgui.GComponent {
  14200. static createInstance() {
  14201. return (fgui.UIPackage.createObject("game", "Component126"));
  14202. }
  14203. onConstruct() {
  14204. this.c1 = this.getController("c1");
  14205. this.normalBtn = (this.getChild("normalBtn"));
  14206. this.tripleBtn = (this.getChild("tripleBtn"));
  14207. }
  14208. }
  14209. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14210. class ui_Component60 extends fgui.GComponent {
  14211. static createInstance() {
  14212. return (fgui.UIPackage.createObject("game", "Component60"));
  14213. }
  14214. onConstruct() {
  14215. this.c1 = this.getController("c1");
  14216. this.n48 = (this.getChild("n48"));
  14217. this.womanTxt = (this.getChild("womanTxt"));
  14218. this.t0 = this.getTransition("t0");
  14219. }
  14220. }
  14221. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14222. class ui_Component_fuli1 extends fgui.GComponent {
  14223. static createInstance() {
  14224. return (fgui.UIPackage.createObject("game", "Component_fuli1"));
  14225. }
  14226. onConstruct() {
  14227. this.n0 = (this.getChild("n0"));
  14228. }
  14229. }
  14230. ui_Component_fuli1.URL = "ui://isxx5ak7loypv59q";
  14231. class ui_Button_h extends fgui.GButton {
  14232. static createInstance() {
  14233. return (fgui.UIPackage.createObject("game", "Button_h"));
  14234. }
  14235. onConstruct() {
  14236. this.button = this.getController("button");
  14237. this.n0 = (this.getChild("n0"));
  14238. this.n1 = (this.getChild("n1"));
  14239. }
  14240. }
  14241. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14242. class ui_Button_lv extends fgui.GButton {
  14243. static createInstance() {
  14244. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14245. }
  14246. onConstruct() {
  14247. this.button = this.getController("button");
  14248. this.n0 = (this.getChild("n0"));
  14249. this.n1 = (this.getChild("n1"));
  14250. }
  14251. }
  14252. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14253. class ui_Component98_3 extends fgui.GButton {
  14254. static createInstance() {
  14255. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14256. }
  14257. onConstruct() {
  14258. this.c1 = this.getController("c1");
  14259. this.n8 = (this.getChild("n8"));
  14260. this.n41 = (this.getChild("n41"));
  14261. this.n40 = (this.getChild("n40"));
  14262. }
  14263. }
  14264. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14265. class ui_ModeSelection_com1 extends fgui.GButton {
  14266. static createInstance() {
  14267. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14268. }
  14269. onConstruct() {
  14270. this.n34 = (this.getChild("n34"));
  14271. this.n36 = (this.getChild("n36"));
  14272. this.n22 = (this.getChild("n22"));
  14273. this.n20 = (this.getChild("n20"));
  14274. this.n23 = (this.getChild("n23"));
  14275. this.n24 = (this.getChild("n24"));
  14276. this.n26 = (this.getChild("n26"));
  14277. this.n33 = (this.getChild("n33"));
  14278. this.coinImg = (this.getChild("coinImg"));
  14279. this.need = (this.getChild("need"));
  14280. this.n35 = (this.getChild("n35"));
  14281. this.n29 = (this.getChild("n29"));
  14282. this.tipsTxt = (this.getChild("tipsTxt"));
  14283. this.n30 = (this.getChild("n30"));
  14284. this.peopleTxt = (this.getChild("peopleTxt"));
  14285. this.t0 = this.getTransition("t0");
  14286. }
  14287. }
  14288. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14289. class ui_ModeSelection_com2 extends fgui.GButton {
  14290. static createInstance() {
  14291. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14292. }
  14293. onConstruct() {
  14294. this.n36 = (this.getChild("n36"));
  14295. this.n34 = (this.getChild("n34"));
  14296. this.n22 = (this.getChild("n22"));
  14297. this.n20 = (this.getChild("n20"));
  14298. this.n23 = (this.getChild("n23"));
  14299. this.n24 = (this.getChild("n24"));
  14300. this.n26 = (this.getChild("n26"));
  14301. this.n33 = (this.getChild("n33"));
  14302. this.coinImg = (this.getChild("coinImg"));
  14303. this.need = (this.getChild("need"));
  14304. this.n35 = (this.getChild("n35"));
  14305. this.n29 = (this.getChild("n29"));
  14306. this.tipsTxt = (this.getChild("tipsTxt"));
  14307. this.n30 = (this.getChild("n30"));
  14308. this.peopleTxt = (this.getChild("peopleTxt"));
  14309. this.t0 = this.getTransition("t0");
  14310. }
  14311. }
  14312. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14313. class ui_ModeSelection_com3 extends fgui.GButton {
  14314. static createInstance() {
  14315. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14316. }
  14317. onConstruct() {
  14318. this.n34 = (this.getChild("n34"));
  14319. this.n36 = (this.getChild("n36"));
  14320. this.n22 = (this.getChild("n22"));
  14321. this.n20 = (this.getChild("n20"));
  14322. this.n23 = (this.getChild("n23"));
  14323. this.n24 = (this.getChild("n24"));
  14324. this.n26 = (this.getChild("n26"));
  14325. this.n33 = (this.getChild("n33"));
  14326. this.coinImg = (this.getChild("coinImg"));
  14327. this.need = (this.getChild("need"));
  14328. this.n35 = (this.getChild("n35"));
  14329. this.n29 = (this.getChild("n29"));
  14330. this.tipsTxt = (this.getChild("tipsTxt"));
  14331. this.n30 = (this.getChild("n30"));
  14332. this.peopleTxt = (this.getChild("peopleTxt"));
  14333. this.t0 = this.getTransition("t0");
  14334. }
  14335. }
  14336. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14337. class ui_Invitation_com1 extends fgui.GComponent {
  14338. static createInstance() {
  14339. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14340. }
  14341. onConstruct() {
  14342. this.n14 = (this.getChild("n14"));
  14343. this.n13 = (this.getChild("n13"));
  14344. this.n3 = (this.getChild("n3"));
  14345. this.n1 = (this.getChild("n1"));
  14346. this.n6 = (this.getChild("n6"));
  14347. this.n7 = (this.getChild("n7"));
  14348. this.enterBtn = (this.getChild("enterBtn"));
  14349. this.n11 = (this.getChild("n11"));
  14350. this.n12 = (this.getChild("n12"));
  14351. this.n15 = (this.getChild("n15"));
  14352. this.t0 = this.getTransition("t0");
  14353. this.t1 = this.getTransition("t1");
  14354. }
  14355. }
  14356. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14357. class ui_Component87_1 extends fgui.GComponent {
  14358. static createInstance() {
  14359. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14360. }
  14361. onConstruct() {
  14362. this.n74 = (this.getChild("n74"));
  14363. this.n73 = (this.getChild("n73"));
  14364. this.ballTxt = (this.getChild("ballTxt"));
  14365. this.n76 = (this.getChild("n76"));
  14366. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14367. this.levelTxt = (this.getChild("levelTxt"));
  14368. this.n87 = (this.getChild("n87"));
  14369. this.n84 = (this.getChild("n84"));
  14370. this.hpTxt = (this.getChild("hpTxt"));
  14371. this.n89 = (this.getChild("n89"));
  14372. this.tipsTxt = (this.getChild("tipsTxt"));
  14373. }
  14374. }
  14375. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14376. class ui_sqg1 extends fgui.GComponent {
  14377. static createInstance() {
  14378. return (fgui.UIPackage.createObject("game", "sqg1"));
  14379. }
  14380. onConstruct() {
  14381. this.n1 = (this.getChild("n1"));
  14382. this.n0 = (this.getChild("n0"));
  14383. }
  14384. }
  14385. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14386. class ui_sqg2 extends fgui.GComponent {
  14387. static createInstance() {
  14388. return (fgui.UIPackage.createObject("game", "sqg2"));
  14389. }
  14390. onConstruct() {
  14391. this.n1 = (this.getChild("n1"));
  14392. this.n0 = (this.getChild("n0"));
  14393. }
  14394. }
  14395. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14396. class ui_sqg3 extends fgui.GComponent {
  14397. static createInstance() {
  14398. return (fgui.UIPackage.createObject("game", "sqg3"));
  14399. }
  14400. onConstruct() {
  14401. this.n1 = (this.getChild("n1"));
  14402. this.n0 = (this.getChild("n0"));
  14403. }
  14404. }
  14405. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14406. class ui_sqg4 extends fgui.GComponent {
  14407. static createInstance() {
  14408. return (fgui.UIPackage.createObject("game", "sqg4"));
  14409. }
  14410. onConstruct() {
  14411. this.n1 = (this.getChild("n1"));
  14412. this.n0 = (this.getChild("n0"));
  14413. }
  14414. }
  14415. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14416. class ui_Component36 extends fgui.GButton {
  14417. static createInstance() {
  14418. return (fgui.UIPackage.createObject("game", "Component36"));
  14419. }
  14420. onConstruct() {
  14421. this.c1 = this.getController("c1");
  14422. this.n53 = (this.getChild("n53"));
  14423. this.n56 = (this.getChild("n56"));
  14424. }
  14425. }
  14426. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14427. class ui_Component37 extends fgui.GButton {
  14428. static createInstance() {
  14429. return (fgui.UIPackage.createObject("game", "Component37"));
  14430. }
  14431. onConstruct() {
  14432. this.c1 = this.getController("c1");
  14433. this.n52 = (this.getChild("n52"));
  14434. this.n54 = (this.getChild("n54"));
  14435. }
  14436. }
  14437. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14438. class ui_UISetting extends fgui.GComponent {
  14439. static createInstance() {
  14440. return (fgui.UIPackage.createObject("game", "UISetting"));
  14441. }
  14442. onConstruct() {
  14443. this.c1 = this.getController("c1");
  14444. this.n4 = (this.getChild("n4"));
  14445. this.soundBtn = (this.getChild("soundBtn"));
  14446. this.shakeBtn = (this.getChild("shakeBtn"));
  14447. this.clickNode = (this.getChild("clickNode"));
  14448. this.xyBtn = (this.getChild("xyBtn"));
  14449. }
  14450. }
  14451. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14452. class ui_Component39 extends fgui.GComponent {
  14453. static createInstance() {
  14454. return (fgui.UIPackage.createObject("game", "Component39"));
  14455. }
  14456. onConstruct() {
  14457. this.n5 = (this.getChild("n5"));
  14458. this.n6 = (this.getChild("n6"));
  14459. this.n7 = (this.getChild("n7"));
  14460. this.t0 = this.getTransition("t0");
  14461. }
  14462. }
  14463. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14464. class ui_Component40 extends fgui.GButton {
  14465. static createInstance() {
  14466. return (fgui.UIPackage.createObject("game", "Component40"));
  14467. }
  14468. onConstruct() {
  14469. this.n46 = (this.getChild("n46"));
  14470. this.n47 = (this.getChild("n47"));
  14471. }
  14472. }
  14473. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14474. class ui_Component41 extends fgui.GComponent {
  14475. static createInstance() {
  14476. return (fgui.UIPackage.createObject("game", "Component41"));
  14477. }
  14478. onConstruct() {
  14479. this.c1 = this.getController("c1");
  14480. this.n0 = (this.getChild("n0"));
  14481. this.titleTxt = (this.getChild("titleTxt"));
  14482. this.n2 = (this.getChild("n2"));
  14483. this.msgTips = (this.getChild("msgTips"));
  14484. this.numTxt = (this.getChild("numTxt"));
  14485. this.n18 = (this.getChild("n18"));
  14486. this.cancelBtn = (this.getChild("cancelBtn"));
  14487. this.videoBtn = (this.getChild("videoBtn"));
  14488. this.n10 = (this.getChild("n10"));
  14489. }
  14490. }
  14491. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14492. class ui_Component42 extends fgui.GComponent {
  14493. static createInstance() {
  14494. return (fgui.UIPackage.createObject("game", "Component42"));
  14495. }
  14496. onConstruct() {
  14497. this.c1 = this.getController("c1");
  14498. this.n1 = (this.getChild("n1"));
  14499. this.n2 = (this.getChild("n2"));
  14500. this.n3 = (this.getChild("n3"));
  14501. this.tipsTxt = (this.getChild("tipsTxt"));
  14502. this.cancelBtn = (this.getChild("cancelBtn"));
  14503. this.sureBtn = (this.getChild("sureBtn"));
  14504. this.n11 = (this.getChild("n11"));
  14505. this.n13 = (this.getChild("n13"));
  14506. this.n14 = (this.getChild("n14"));
  14507. this.womanTxt = (this.getChild("womanTxt"));
  14508. this.t0 = this.getTransition("t0");
  14509. }
  14510. }
  14511. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14512. class ui_dh_js_shengli extends fgui.GComponent {
  14513. static createInstance() {
  14514. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14515. }
  14516. onConstruct() {
  14517. this.n3 = (this.getChild("n3"));
  14518. this.n4 = (this.getChild("n4"));
  14519. this.n1 = (this.getChild("n1"));
  14520. this.n2 = (this.getChild("n2"));
  14521. this.n5 = (this.getChild("n5"));
  14522. this.n6 = (this.getChild("n6"));
  14523. this.n7 = (this.getChild("n7"));
  14524. this.n8 = (this.getChild("n8"));
  14525. this.attack = this.getTransition("attack");
  14526. this.idle = this.getTransition("idle");
  14527. }
  14528. }
  14529. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14530. class ui_dh_js_shengli_g extends fgui.GComponent {
  14531. static createInstance() {
  14532. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14533. }
  14534. onConstruct() {
  14535. this.n3 = (this.getChild("n3"));
  14536. this.n1 = (this.getChild("n1"));
  14537. this.t0 = this.getTransition("t0");
  14538. }
  14539. }
  14540. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14541. class ui_dh_js_shibai extends fgui.GComponent {
  14542. static createInstance() {
  14543. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14544. }
  14545. onConstruct() {
  14546. this.n0 = (this.getChild("n0"));
  14547. this.n1 = (this.getChild("n1"));
  14548. this.n2 = (this.getChild("n2"));
  14549. this.n3 = (this.getChild("n3"));
  14550. this.idle = this.getTransition("idle");
  14551. this.attack = this.getTransition("attack");
  14552. }
  14553. }
  14554. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14555. class ui_dh_zy_ganfa extends fgui.GButton {
  14556. static createInstance() {
  14557. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14558. }
  14559. onConstruct() {
  14560. this.n0 = (this.getChild("n0"));
  14561. }
  14562. }
  14563. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14564. class ui_dh_zy_sc_guang extends fgui.GButton {
  14565. static createInstance() {
  14566. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14567. }
  14568. onConstruct() {
  14569. this.n0 = (this.getChild("n0"));
  14570. this.n2 = (this.getChild("n2"));
  14571. }
  14572. }
  14573. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14574. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14575. static createInstance() {
  14576. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14577. }
  14578. onConstruct() {
  14579. this.n0 = (this.getChild("n0"));
  14580. this.n3 = (this.getChild("n3"));
  14581. this.t0 = this.getTransition("t0");
  14582. }
  14583. }
  14584. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14585. class ui_dh_zy_wanfa extends fgui.GButton {
  14586. static createInstance() {
  14587. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14588. }
  14589. onConstruct() {
  14590. this.n0 = (this.getChild("n0"));
  14591. }
  14592. }
  14593. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14594. class ui_Button_login extends fgui.GButton {
  14595. static createInstance() {
  14596. return (fgui.UIPackage.createObject("game", "Button_login"));
  14597. }
  14598. onConstruct() {
  14599. this.button = this.getController("button");
  14600. this.n5 = (this.getChild("n5"));
  14601. this.n3 = (this.getChild("n3"));
  14602. }
  14603. }
  14604. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14605. class ui_Component53_1 extends fgui.GComponent {
  14606. static createInstance() {
  14607. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14608. }
  14609. onConstruct() {
  14610. this.n0 = (this.getChild("n0"));
  14611. this.n1 = (this.getChild("n1"));
  14612. this.n2 = (this.getChild("n2"));
  14613. this.n3 = (this.getChild("n3"));
  14614. this.n4 = (this.getChild("n4"));
  14615. this.n5 = (this.getChild("n5"));
  14616. this.n6 = (this.getChild("n6"));
  14617. this.n7 = (this.getChild("n7"));
  14618. this.n8 = (this.getChild("n8"));
  14619. this.n9 = (this.getChild("n9"));
  14620. this.n10 = (this.getChild("n10"));
  14621. this.n11 = (this.getChild("n11"));
  14622. this.n12 = (this.getChild("n12"));
  14623. this.n13 = (this.getChild("n13"));
  14624. this.n14 = (this.getChild("n14"));
  14625. this.n15 = (this.getChild("n15"));
  14626. this.n16 = (this.getChild("n16"));
  14627. this.n19 = (this.getChild("n19"));
  14628. this.n20 = (this.getChild("n20"));
  14629. this.n21 = (this.getChild("n21"));
  14630. this.n22 = (this.getChild("n22"));
  14631. this.n23 = (this.getChild("n23"));
  14632. this.n24 = (this.getChild("n24"));
  14633. this.n25 = (this.getChild("n25"));
  14634. this.n26 = (this.getChild("n26"));
  14635. this.n27 = (this.getChild("n27"));
  14636. this.n28 = (this.getChild("n28"));
  14637. this.n29 = (this.getChild("n29"));
  14638. this.n30 = (this.getChild("n30"));
  14639. this.n31 = (this.getChild("n31"));
  14640. this.n32 = (this.getChild("n32"));
  14641. this.n33 = (this.getChild("n33"));
  14642. this.n34 = (this.getChild("n34"));
  14643. this.n35 = (this.getChild("n35"));
  14644. this.t0 = this.getTransition("t0");
  14645. }
  14646. }
  14647. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14648. class ui_Component30 extends fgui.GComponent {
  14649. static createInstance() {
  14650. return (fgui.UIPackage.createObject("game", "Component30"));
  14651. }
  14652. onConstruct() {
  14653. this.c1 = this.getController("c1");
  14654. this.n46 = (this.getChild("n46"));
  14655. this.n47 = (this.getChild("n47"));
  14656. this.numTxt = (this.getChild("numTxt"));
  14657. this.n50 = (this.getChild("n50"));
  14658. this.n53 = (this.getChild("n53"));
  14659. this.n54 = (this.getChild("n54"));
  14660. this.n55 = (this.getChild("n55"));
  14661. this.n56 = (this.getChild("n56"));
  14662. }
  14663. }
  14664. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14665. class ui_Component30_1 extends fgui.GComponent {
  14666. static createInstance() {
  14667. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14668. }
  14669. onConstruct() {
  14670. this.c1 = this.getController("c1");
  14671. this.n46 = (this.getChild("n46"));
  14672. this.n47 = (this.getChild("n47"));
  14673. this.numTxt = (this.getChild("numTxt"));
  14674. this.n50 = (this.getChild("n50"));
  14675. this.n51 = (this.getChild("n51"));
  14676. this.n52 = (this.getChild("n52"));
  14677. this.n53 = (this.getChild("n53"));
  14678. this.n54 = (this.getChild("n54"));
  14679. }
  14680. }
  14681. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14682. class ui_Component31 extends fgui.GComponent {
  14683. static createInstance() {
  14684. return (fgui.UIPackage.createObject("game", "Component31"));
  14685. }
  14686. onConstruct() {
  14687. this.n55 = (this.getChild("n55"));
  14688. this.n54 = (this.getChild("n54"));
  14689. this.conditionTxt = (this.getChild("conditionTxt"));
  14690. this.n57 = (this.getChild("n57"));
  14691. this.t0 = this.getTransition("t0");
  14692. }
  14693. }
  14694. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14695. class ui_Component32 extends fgui.GComponent {
  14696. static createInstance() {
  14697. return (fgui.UIPackage.createObject("game", "Component32"));
  14698. }
  14699. onConstruct() {
  14700. this.n5 = (this.getChild("n5"));
  14701. this.n6 = (this.getChild("n6"));
  14702. this.n7 = (this.getChild("n7"));
  14703. this.t0 = this.getTransition("t0");
  14704. }
  14705. }
  14706. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14707. class ui_AwardItem extends fgui.GComponent {
  14708. static createInstance() {
  14709. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14710. }
  14711. onConstruct() {
  14712. this.n9 = (this.getChild("n9"));
  14713. this.myIcon = (this.getChild("myIcon"));
  14714. this.numTxt = (this.getChild("numTxt"));
  14715. this.nameTxt = (this.getChild("nameTxt"));
  14716. this.n16 = (this.getChild("n16"));
  14717. this.n17 = (this.getChild("n17"));
  14718. }
  14719. }
  14720. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14721. class ui_ranking_com1 extends fgui.GButton {
  14722. static createInstance() {
  14723. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14724. }
  14725. onConstruct() {
  14726. this.c1 = this.getController("c1");
  14727. this.n49 = (this.getChild("n49"));
  14728. this.n18 = (this.getChild("n18"));
  14729. this.n46 = (this.getChild("n46"));
  14730. this.n48 = (this.getChild("n48"));
  14731. this.n50 = (this.getChild("n50"));
  14732. }
  14733. }
  14734. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14735. class ui_ranking_com2 extends fgui.GButton {
  14736. static createInstance() {
  14737. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14738. }
  14739. onConstruct() {
  14740. this.c1 = this.getController("c1");
  14741. this.n49 = (this.getChild("n49"));
  14742. this.n18 = (this.getChild("n18"));
  14743. this.n46 = (this.getChild("n46"));
  14744. this.n48 = (this.getChild("n48"));
  14745. this.n50 = (this.getChild("n50"));
  14746. }
  14747. }
  14748. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14749. class ui_ranking_com3 extends fgui.GComponent {
  14750. static createInstance() {
  14751. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14752. }
  14753. onConstruct() {
  14754. this.n17 = (this.getChild("n17"));
  14755. this.myIcon = (this.getChild("myIcon"));
  14756. }
  14757. }
  14758. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14759. class ui_ranking_com4 extends fgui.GComponent {
  14760. static createInstance() {
  14761. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14762. }
  14763. onConstruct() {
  14764. this.n16 = (this.getChild("n16"));
  14765. this.head = (this.getChild("head"));
  14766. }
  14767. }
  14768. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14769. class ui_ranking_com5 extends fgui.GComponent {
  14770. static createInstance() {
  14771. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14772. }
  14773. onConstruct() {
  14774. this.c1 = this.getController("c1");
  14775. this.c2 = this.getController("c2");
  14776. this.n2 = (this.getChild("n2"));
  14777. this.n3 = (this.getChild("n3"));
  14778. this.levelBtn = (this.getChild("levelBtn"));
  14779. this.starBtn = (this.getChild("starBtn"));
  14780. this.n23 = (this.getChild("n23"));
  14781. this.n24 = (this.getChild("n24"));
  14782. this.n25 = (this.getChild("n25"));
  14783. this.myList = (this.getChild("myList"));
  14784. this.selfNode = (this.getChild("selfNode"));
  14785. this.n9 = (this.getChild("n9"));
  14786. this.n12 = (this.getChild("n12"));
  14787. this.n13 = (this.getChild("n13"));
  14788. this.n14 = (this.getChild("n14"));
  14789. this.n39 = (this.getChild("n39"));
  14790. this.n41 = (this.getChild("n41"));
  14791. this.n42 = (this.getChild("n42"));
  14792. this.n45 = (this.getChild("n45"));
  14793. this.changeBtn = (this.getChild("changeBtn"));
  14794. this.closeBtn = (this.getChild("closeBtn"));
  14795. this.t0 = this.getTransition("t0");
  14796. }
  14797. }
  14798. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14799. class ui_RankItem extends fgui.GComponent {
  14800. static createInstance() {
  14801. return (fgui.UIPackage.createObject("game", "RankItem"));
  14802. }
  14803. onConstruct() {
  14804. this.n10 = (this.getChild("n10"));
  14805. this.n11 = (this.getChild("n11"));
  14806. this.rankTxt = (this.getChild("rankTxt"));
  14807. this.headNode = (this.getChild("headNode"));
  14808. this.nameTxt = (this.getChild("nameTxt"));
  14809. this.n19 = (this.getChild("n19"));
  14810. this.valueTxt = (this.getChild("valueTxt"));
  14811. this.img1 = (this.getChild("img1"));
  14812. this.img2 = (this.getChild("img2"));
  14813. this.img3 = (this.getChild("img3"));
  14814. }
  14815. }
  14816. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14817. class ui_ranking_com9 extends fgui.GComponent {
  14818. static createInstance() {
  14819. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14820. }
  14821. onConstruct() {
  14822. this.c1 = this.getController("c1");
  14823. this.n27 = (this.getChild("n27"));
  14824. this.n28 = (this.getChild("n28"));
  14825. this.headNode = (this.getChild("headNode"));
  14826. this.rankTxt = (this.getChild("rankTxt"));
  14827. this.nameTxt = (this.getChild("nameTxt"));
  14828. this.n34 = (this.getChild("n34"));
  14829. this.valueTxt = (this.getChild("valueTxt"));
  14830. this.n36 = (this.getChild("n36"));
  14831. this.n37 = (this.getChild("n37"));
  14832. this.n38 = (this.getChild("n38"));
  14833. this.n39 = (this.getChild("n39"));
  14834. this.n40 = (this.getChild("n40"));
  14835. }
  14836. }
  14837. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14838. class ui_ranking_com10 extends fgui.GComponent {
  14839. static createInstance() {
  14840. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14841. }
  14842. onConstruct() {
  14843. this.n23 = (this.getChild("n23"));
  14844. this.n24 = (this.getChild("n24"));
  14845. }
  14846. }
  14847. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14848. class ui_ranking_com11 extends fgui.GComponent {
  14849. static createInstance() {
  14850. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14851. }
  14852. onConstruct() {
  14853. this.n24 = (this.getChild("n24"));
  14854. this.n25 = (this.getChild("n25"));
  14855. this.t0 = this.getTransition("t0");
  14856. }
  14857. }
  14858. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14859. class ui_ranking_com13 extends fgui.GButton {
  14860. static createInstance() {
  14861. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14862. }
  14863. onConstruct() {
  14864. this.c1 = this.getController("c1");
  14865. this.n44 = (this.getChild("n44"));
  14866. this.n45 = (this.getChild("n45"));
  14867. this.n46 = (this.getChild("n46"));
  14868. }
  14869. }
  14870. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14871. class ui_Component_dl_zc extends fgui.GButton {
  14872. static createInstance() {
  14873. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  14874. }
  14875. onConstruct() {
  14876. this.c1 = this.getController("c1");
  14877. this.n0 = (this.getChild("n0"));
  14878. }
  14879. }
  14880. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  14881. class ui_Component122 extends fgui.GComponent {
  14882. static createInstance() {
  14883. return (fgui.UIPackage.createObject("game", "Component122"));
  14884. }
  14885. onConstruct() {
  14886. this.gameNode3 = (this.getChild("gameNode3"));
  14887. }
  14888. }
  14889. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14890. class ui_skillItem extends fgui.GComponent {
  14891. static createInstance() {
  14892. return (fgui.UIPackage.createObject("game", "skillItem"));
  14893. }
  14894. onConstruct() {
  14895. this.c1 = this.getController("c1");
  14896. this.n31 = (this.getChild("n31"));
  14897. this.n6 = (this.getChild("n6"));
  14898. this.skillImg = (this.getChild("skillImg"));
  14899. this.nameTxt = (this.getChild("nameTxt"));
  14900. this.levelTxt = (this.getChild("levelTxt"));
  14901. this.n28 = (this.getChild("n28"));
  14902. this.describeTxt = (this.getChild("describeTxt"));
  14903. this.n32 = (this.getChild("n32"));
  14904. this.mutiBtn = (this.getChild("mutiBtn"));
  14905. this.tryNode = (this.getChild("tryNode"));
  14906. this.normalBtn = (this.getChild("normalBtn"));
  14907. this.startBtn = (this.getChild("startBtn"));
  14908. this.n42 = (this.getChild("n42"));
  14909. this.n43 = (this.getChild("n43"));
  14910. this.n44 = (this.getChild("n44"));
  14911. }
  14912. }
  14913. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14914. class ui_Component26 extends fgui.GButton {
  14915. static createInstance() {
  14916. return (fgui.UIPackage.createObject("game", "Component26"));
  14917. }
  14918. onConstruct() {
  14919. this.n11 = (this.getChild("n11"));
  14920. this.n30 = (this.getChild("n30"));
  14921. this.n34 = (this.getChild("n34"));
  14922. }
  14923. }
  14924. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14925. class ui_Component28 extends fgui.GButton {
  14926. static createInstance() {
  14927. return (fgui.UIPackage.createObject("game", "Component28"));
  14928. }
  14929. onConstruct() {
  14930. this.n12 = (this.getChild("n12"));
  14931. this.n31 = (this.getChild("n31"));
  14932. this.curTxt = (this.getChild("curTxt"));
  14933. this.n33 = (this.getChild("n33"));
  14934. }
  14935. }
  14936. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  14937. class ui_Component1302 extends fgui.GComponent {
  14938. static createInstance() {
  14939. return (fgui.UIPackage.createObject("game", "Component1302"));
  14940. }
  14941. onConstruct() {
  14942. this.n2 = (this.getChild("n2"));
  14943. this.n3 = (this.getChild("n3"));
  14944. }
  14945. }
  14946. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  14947. class ui_Component113 extends fgui.GComponent {
  14948. static createInstance() {
  14949. return (fgui.UIPackage.createObject("game", "Component113"));
  14950. }
  14951. onConstruct() {
  14952. this.n85 = (this.getChild("n85"));
  14953. this.n86 = (this.getChild("n86"));
  14954. this.n77 = (this.getChild("n77"));
  14955. this.n79 = (this.getChild("n79"));
  14956. this.n80 = (this.getChild("n80"));
  14957. this.n81 = (this.getChild("n81"));
  14958. this.n82 = (this.getChild("n82"));
  14959. this.n84 = (this.getChild("n84"));
  14960. this.n87 = (this.getChild("n87"));
  14961. this.t0 = this.getTransition("t0");
  14962. }
  14963. }
  14964. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  14965. class ui_Component114 extends fgui.GComponent {
  14966. static createInstance() {
  14967. return (fgui.UIPackage.createObject("game", "Component114"));
  14968. }
  14969. onConstruct() {
  14970. this.n77 = (this.getChild("n77"));
  14971. this.t0 = this.getTransition("t0");
  14972. }
  14973. }
  14974. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  14975. class ui_Component115 extends fgui.GComponent {
  14976. static createInstance() {
  14977. return (fgui.UIPackage.createObject("game", "Component115"));
  14978. }
  14979. onConstruct() {
  14980. this.n83 = (this.getChild("n83"));
  14981. this.fingerNode = (this.getChild("fingerNode"));
  14982. this.n84 = (this.getChild("n84"));
  14983. }
  14984. }
  14985. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  14986. class ui_Component117 extends fgui.GComponent {
  14987. static createInstance() {
  14988. return (fgui.UIPackage.createObject("game", "Component117"));
  14989. }
  14990. onConstruct() {
  14991. this.n87 = (this.getChild("n87"));
  14992. this.n88 = (this.getChild("n88"));
  14993. this.n84 = (this.getChild("n84"));
  14994. this.n85 = (this.getChild("n85"));
  14995. this.n86 = (this.getChild("n86"));
  14996. this.t0 = this.getTransition("t0");
  14997. }
  14998. }
  14999. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15000. class ui_Component98_1 extends fgui.GButton {
  15001. static createInstance() {
  15002. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15003. }
  15004. onConstruct() {
  15005. this.c1 = this.getController("c1");
  15006. this.n8 = (this.getChild("n8"));
  15007. this.n41 = (this.getChild("n41"));
  15008. this.n40 = (this.getChild("n40"));
  15009. }
  15010. }
  15011. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15012. class ui_Component61 extends fgui.GComponent {
  15013. static createInstance() {
  15014. return (fgui.UIPackage.createObject("game", "Component61"));
  15015. }
  15016. onConstruct() {
  15017. this.n14 = (this.getChild("n14"));
  15018. this.n6 = (this.getChild("n6"));
  15019. this.t0 = this.getTransition("t0");
  15020. }
  15021. }
  15022. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15023. class ui_Component62 extends fgui.GComponent {
  15024. static createInstance() {
  15025. return (fgui.UIPackage.createObject("game", "Component62"));
  15026. }
  15027. onConstruct() {
  15028. this.n66 = (this.getChild("n66"));
  15029. this.n56 = (this.getChild("n56"));
  15030. this.n63 = (this.getChild("n63"));
  15031. this.n65 = (this.getChild("n65"));
  15032. this.t0 = this.getTransition("t0");
  15033. }
  15034. }
  15035. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15036. class ui_d3Root extends fgui.GComponent {
  15037. static createInstance() {
  15038. return (fgui.UIPackage.createObject("game", "d3Root"));
  15039. }
  15040. onConstruct() {
  15041. }
  15042. }
  15043. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15044. class ui_d2Root extends fgui.GComponent {
  15045. static createInstance() {
  15046. return (fgui.UIPackage.createObject("game", "d2Root"));
  15047. }
  15048. onConstruct() {
  15049. }
  15050. }
  15051. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15052. class ui_ballNode extends fgui.GComponent {
  15053. static createInstance() {
  15054. return (fgui.UIPackage.createObject("game", "ballNode"));
  15055. }
  15056. onConstruct() {
  15057. }
  15058. }
  15059. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15060. class ui_border extends fgui.GComponent {
  15061. static createInstance() {
  15062. return (fgui.UIPackage.createObject("game", "border"));
  15063. }
  15064. onConstruct() {
  15065. this.bar1 = (this.getChild("bar1"));
  15066. this.bar2 = (this.getChild("bar2"));
  15067. this.bar3 = (this.getChild("bar3"));
  15068. this.bar4 = (this.getChild("bar4"));
  15069. this.bar5 = (this.getChild("bar5"));
  15070. this.bar6 = (this.getChild("bar6"));
  15071. this.circle1 = (this.getChild("circle1"));
  15072. this.circle2 = (this.getChild("circle2"));
  15073. this.circle3 = (this.getChild("circle3"));
  15074. this.circle4 = (this.getChild("circle4"));
  15075. this.circle5 = (this.getChild("circle5"));
  15076. this.circle6 = (this.getChild("circle6"));
  15077. this.n28 = (this.getChild("n28"));
  15078. }
  15079. }
  15080. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15081. class ui_btn_buy extends fgui.GButton {
  15082. static createInstance() {
  15083. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15084. }
  15085. onConstruct() {
  15086. this.button = this.getController("button");
  15087. this.n0 = (this.getChild("n0"));
  15088. this.n1 = (this.getChild("n1"));
  15089. this.n2 = (this.getChild("n2"));
  15090. }
  15091. }
  15092. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15093. class ui_Component41_2 extends fgui.GComponent {
  15094. static createInstance() {
  15095. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15096. }
  15097. onConstruct() {
  15098. this.c1 = this.getController("c1");
  15099. this.n0 = (this.getChild("n0"));
  15100. this.n2 = (this.getChild("n2"));
  15101. this.n19 = (this.getChild("n19"));
  15102. this.cancelBtn = (this.getChild("cancelBtn"));
  15103. this.videoBtn = (this.getChild("videoBtn"));
  15104. this.n9 = (this.getChild("n9"));
  15105. this.n22 = (this.getChild("n22"));
  15106. this.tipsTxt = (this.getChild("tipsTxt"));
  15107. this.n23 = (this.getChild("n23"));
  15108. this.n24 = (this.getChild("n24"));
  15109. this.n26 = (this.getChild("n26"));
  15110. this.n27 = (this.getChild("n27"));
  15111. this.titleTxt = (this.getChild("titleTxt"));
  15112. }
  15113. }
  15114. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15115. class ui_Component41_1 extends fgui.GComponent {
  15116. static createInstance() {
  15117. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15118. }
  15119. onConstruct() {
  15120. this.c1 = this.getController("c1");
  15121. this.n0 = (this.getChild("n0"));
  15122. this.n2 = (this.getChild("n2"));
  15123. this.cancelBtn = (this.getChild("cancelBtn"));
  15124. this.videoBtn = (this.getChild("videoBtn"));
  15125. this.n27 = (this.getChild("n27"));
  15126. this.n30 = (this.getChild("n30"));
  15127. this.n31 = (this.getChild("n31"));
  15128. this.n32 = (this.getChild("n32"));
  15129. this.n33 = (this.getChild("n33"));
  15130. this.n34 = (this.getChild("n34"));
  15131. this.n35 = (this.getChild("n35"));
  15132. this.n36 = (this.getChild("n36"));
  15133. this.n1 = (this.getChild("n1"));
  15134. this.n37 = (this.getChild("n37"));
  15135. this.t0 = this.getTransition("t0");
  15136. this.t1 = this.getTransition("t1");
  15137. this.t2 = this.getTransition("t2");
  15138. this.t3 = this.getTransition("t3");
  15139. }
  15140. }
  15141. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15142. class ui_againBtn extends fgui.GButton {
  15143. static createInstance() {
  15144. return (fgui.UIPackage.createObject("game", "againBtn"));
  15145. }
  15146. onConstruct() {
  15147. this.n2 = (this.getChild("n2"));
  15148. this.n1 = (this.getChild("n1"));
  15149. this.n5 = (this.getChild("n5"));
  15150. }
  15151. }
  15152. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15153. class ui_Component118 extends fgui.GButton {
  15154. static createInstance() {
  15155. return (fgui.UIPackage.createObject("game", "Component118"));
  15156. }
  15157. onConstruct() {
  15158. this.c1 = this.getController("c1");
  15159. this.n14 = (this.getChild("n14"));
  15160. this.n9 = (this.getChild("n9"));
  15161. this.n10 = (this.getChild("n10"));
  15162. this.diamondTxt = (this.getChild("diamondTxt"));
  15163. this.n13 = (this.getChild("n13"));
  15164. this.n15 = (this.getChild("n15"));
  15165. }
  15166. }
  15167. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15168. class ui_Component119 extends fgui.GComponent {
  15169. static createInstance() {
  15170. return (fgui.UIPackage.createObject("game", "Component119"));
  15171. }
  15172. onConstruct() {
  15173. this.n1 = (this.getChild("n1"));
  15174. this.n2 = (this.getChild("n2"));
  15175. this.n13 = (this.getChild("n13"));
  15176. this.n6 = (this.getChild("n6"));
  15177. this.screenNode = (this.getChild("screenNode"));
  15178. this.n15 = (this.getChild("n15"));
  15179. this.closeBtn = (this.getChild("closeBtn"));
  15180. this.share2Btn = (this.getChild("share2Btn"));
  15181. this.shareBtn = (this.getChild("shareBtn"));
  15182. this.tipsNode = (this.getChild("tipsNode"));
  15183. this.awardNode = (this.getChild("awardNode"));
  15184. }
  15185. }
  15186. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15187. class ui_daoJuDisplay extends fgui.GComponent {
  15188. static createInstance() {
  15189. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15190. }
  15191. onConstruct() {
  15192. this.n6 = (this.getChild("n6"));
  15193. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15194. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15195. this.btn_buy = (this.getChild("btn_buy"));
  15196. this.nameTxt = (this.getChild("nameTxt"));
  15197. this.zsImg = (this.getChild("zsImg"));
  15198. }
  15199. }
  15200. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15201. class ui_Component132_1 extends fgui.GComponent {
  15202. static createInstance() {
  15203. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15204. }
  15205. onConstruct() {
  15206. this.n25 = (this.getChild("n25"));
  15207. this.n26 = (this.getChild("n26"));
  15208. this.n27 = (this.getChild("n27"));
  15209. this.t0 = this.getTransition("t0");
  15210. }
  15211. }
  15212. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15213. class ui_SecretaryDisplay extends fgui.GComponent {
  15214. static createInstance() {
  15215. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15216. }
  15217. onConstruct() {
  15218. this.n2 = (this.getChild("n2"));
  15219. this.levelTxt = (this.getChild("levelTxt"));
  15220. this.n4 = (this.getChild("n4"));
  15221. this.secretary = (this.getChild("secretary"));
  15222. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15223. this.n16 = (this.getChild("n16"));
  15224. this.n37 = (this.getChild("n37"));
  15225. this.n41 = (this.getChild("n41"));
  15226. this.n14 = (this.getChild("n14"));
  15227. this.n17 = (this.getChild("n17"));
  15228. this.heightTxt = (this.getChild("heightTxt"));
  15229. this.n46 = (this.getChild("n46"));
  15230. this.n36 = (this.getChild("n36"));
  15231. this.n38 = (this.getChild("n38"));
  15232. this.foodTxt = (this.getChild("foodTxt"));
  15233. this.n47 = (this.getChild("n47"));
  15234. this.n40 = (this.getChild("n40"));
  15235. this.n42 = (this.getChild("n42"));
  15236. this.historyTxt = (this.getChild("historyTxt"));
  15237. this.n48 = (this.getChild("n48"));
  15238. this.nameImg = (this.getChild("nameImg"));
  15239. this.n12 = (this.getChild("n12"));
  15240. this.n49 = (this.getChild("n49"));
  15241. this.t0 = this.getTransition("t0");
  15242. }
  15243. }
  15244. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15245. class ui_BallRodDisplay extends fgui.GComponent {
  15246. static createInstance() {
  15247. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15248. }
  15249. onConstruct() {
  15250. this.c1 = this.getController("c1");
  15251. this.n31 = (this.getChild("n31"));
  15252. this.n6 = (this.getChild("n6"));
  15253. this.nameTxt = (this.getChild("nameTxt"));
  15254. this.rodImg = (this.getChild("rodImg"));
  15255. this.eftRod = (this.getChild("eftRod"));
  15256. this.levelNode = (this.getChild("levelNode"));
  15257. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15258. }
  15259. }
  15260. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15261. class ui_Component111_11 extends fgui.GComponent {
  15262. static createInstance() {
  15263. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15264. }
  15265. onConstruct() {
  15266. this.n68 = (this.getChild("n68"));
  15267. this.n69 = (this.getChild("n69"));
  15268. }
  15269. }
  15270. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15271. class ui_Component112 extends fgui.GComponent {
  15272. static createInstance() {
  15273. return (fgui.UIPackage.createObject("game", "Component112"));
  15274. }
  15275. onConstruct() {
  15276. this.n68 = (this.getChild("n68"));
  15277. this.n70 = (this.getChild("n70"));
  15278. this.myMask = (this.getChild("myMask"));
  15279. }
  15280. }
  15281. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15282. class ui_Component111 extends fgui.GComponent {
  15283. static createInstance() {
  15284. return (fgui.UIPackage.createObject("game", "Component111"));
  15285. }
  15286. onConstruct() {
  15287. this.n68 = (this.getChild("n68"));
  15288. this.myMask = (this.getChild("myMask"));
  15289. }
  15290. }
  15291. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15292. class ui_Component144 extends fgui.GButton {
  15293. static createInstance() {
  15294. return (fgui.UIPackage.createObject("game", "Component144"));
  15295. }
  15296. onConstruct() {
  15297. this.n8 = (this.getChild("n8"));
  15298. }
  15299. }
  15300. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15301. class ui_Sign_com2 extends fgui.GComponent {
  15302. static createInstance() {
  15303. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15304. }
  15305. onConstruct() {
  15306. this.n0 = (this.getChild("n0"));
  15307. this.n1 = (this.getChild("n1"));
  15308. this.t0 = this.getTransition("t0");
  15309. }
  15310. }
  15311. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15312. class ui_Sign_guang extends fgui.GComponent {
  15313. static createInstance() {
  15314. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15315. }
  15316. onConstruct() {
  15317. this.n1 = (this.getChild("n1"));
  15318. this.n2 = (this.getChild("n2"));
  15319. this.n3 = (this.getChild("n3"));
  15320. this.n4 = (this.getChild("n4"));
  15321. this.n5 = (this.getChild("n5"));
  15322. this.n6 = (this.getChild("n6"));
  15323. this.n8 = (this.getChild("n8"));
  15324. }
  15325. }
  15326. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15327. class ui_SignMax extends fgui.GComponent {
  15328. static createInstance() {
  15329. return (fgui.UIPackage.createObject("game", "SignMax"));
  15330. }
  15331. onConstruct() {
  15332. this.c1 = this.getController("c1");
  15333. this.n7 = (this.getChild("n7"));
  15334. this.n15 = (this.getChild("n15"));
  15335. this.n8 = (this.getChild("n8"));
  15336. this.titleTxt = (this.getChild("titleTxt"));
  15337. this.myIcon1 = (this.getChild("myIcon1"));
  15338. this.numTxt1 = (this.getChild("numTxt1"));
  15339. this.myIcon2 = (this.getChild("myIcon2"));
  15340. this.n20 = (this.getChild("n20"));
  15341. this.n17 = (this.getChild("n17"));
  15342. this.numTxt2 = (this.getChild("numTxt2"));
  15343. this.n12 = (this.getChild("n12"));
  15344. this.n13 = (this.getChild("n13"));
  15345. this.n21 = (this.getChild("n21"));
  15346. this.n14 = (this.getChild("n14"));
  15347. }
  15348. }
  15349. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15350. class ui_Sign_com2_1 extends fgui.GComponent {
  15351. static createInstance() {
  15352. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15353. }
  15354. onConstruct() {
  15355. this.n0 = (this.getChild("n0"));
  15356. this.n1 = (this.getChild("n1"));
  15357. this.t0 = this.getTransition("t0");
  15358. }
  15359. }
  15360. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15361. class ui_Sign_com5 extends fgui.GComponent {
  15362. static createInstance() {
  15363. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15364. }
  15365. onConstruct() {
  15366. this.n3 = (this.getChild("n3"));
  15367. this.n29 = (this.getChild("n29"));
  15368. this.n4 = (this.getChild("n4"));
  15369. this.day1 = (this.getChild("day1"));
  15370. this.day2 = (this.getChild("day2"));
  15371. this.day3 = (this.getChild("day3"));
  15372. this.day4 = (this.getChild("day4"));
  15373. this.day5 = (this.getChild("day5"));
  15374. this.day6 = (this.getChild("day6"));
  15375. this.day7 = (this.getChild("day7"));
  15376. this.t0 = this.getTransition("t0");
  15377. }
  15378. }
  15379. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15380. class ui_Sign_com8 extends fgui.GComponent {
  15381. static createInstance() {
  15382. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15383. }
  15384. onConstruct() {
  15385. this.n48 = (this.getChild("n48"));
  15386. this.womanTxt = (this.getChild("womanTxt"));
  15387. this.t0 = this.getTransition("t0");
  15388. }
  15389. }
  15390. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15391. class ui_Sign_com6 extends fgui.GComponent {
  15392. static createInstance() {
  15393. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15394. }
  15395. onConstruct() {
  15396. this.n2 = (this.getChild("n2"));
  15397. this.n3 = (this.getChild("n3"));
  15398. this.t0 = this.getTransition("t0");
  15399. }
  15400. }
  15401. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15402. class ui_Sign_com7 extends fgui.GComponent {
  15403. static createInstance() {
  15404. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15405. }
  15406. onConstruct() {
  15407. this.n29 = (this.getChild("n29"));
  15408. this.n2 = (this.getChild("n2"));
  15409. }
  15410. }
  15411. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15412. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15413. static createInstance() {
  15414. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15415. }
  15416. onConstruct() {
  15417. this.n5 = (this.getChild("n5"));
  15418. this.n4 = (this.getChild("n4"));
  15419. this.t0 = this.getTransition("t0");
  15420. }
  15421. }
  15422. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15423. class ui_UITurntable_com2 extends fgui.GComponent {
  15424. static createInstance() {
  15425. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15426. }
  15427. onConstruct() {
  15428. this.c1 = this.getController("c1");
  15429. this.n4 = (this.getChild("n4"));
  15430. this.n6 = (this.getChild("n6"));
  15431. this.n10 = (this.getChild("n10"));
  15432. this.n11 = (this.getChild("n11"));
  15433. this.n12 = (this.getChild("n12"));
  15434. this.n13 = (this.getChild("n13"));
  15435. this.n14 = (this.getChild("n14"));
  15436. this.n15 = (this.getChild("n15"));
  15437. this.n16 = (this.getChild("n16"));
  15438. this.n17 = (this.getChild("n17"));
  15439. this.n18 = (this.getChild("n18"));
  15440. this.n19 = (this.getChild("n19"));
  15441. this.n20 = (this.getChild("n20"));
  15442. this.n21 = (this.getChild("n21"));
  15443. this.n22 = (this.getChild("n22"));
  15444. this.n23 = (this.getChild("n23"));
  15445. this.n24 = (this.getChild("n24"));
  15446. this.n25 = (this.getChild("n25"));
  15447. this.n26 = (this.getChild("n26"));
  15448. this.n27 = (this.getChild("n27"));
  15449. this.n28 = (this.getChild("n28"));
  15450. this.n29 = (this.getChild("n29"));
  15451. this.n30 = (this.getChild("n30"));
  15452. this.n31 = (this.getChild("n31"));
  15453. this.n32 = (this.getChild("n32"));
  15454. this.n33 = (this.getChild("n33"));
  15455. }
  15456. }
  15457. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15458. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15459. static createInstance() {
  15460. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15461. }
  15462. onConstruct() {
  15463. this.n5 = (this.getChild("n5"));
  15464. this.n4 = (this.getChild("n4"));
  15465. this.t0 = this.getTransition("t0");
  15466. }
  15467. }
  15468. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15469. class ui_UITurntable_com5 extends fgui.GComponent {
  15470. static createInstance() {
  15471. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15472. }
  15473. onConstruct() {
  15474. this.flashNode = (this.getChild("flashNode"));
  15475. this.rotNode = (this.getChild("rotNode"));
  15476. this.n3 = (this.getChild("n3"));
  15477. this.n21 = (this.getChild("n21"));
  15478. this.t0 = this.getTransition("t0");
  15479. }
  15480. }
  15481. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15482. class ui_UITurntable_com7 extends fgui.GComponent {
  15483. static createInstance() {
  15484. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15485. }
  15486. onConstruct() {
  15487. this.n2 = (this.getChild("n2"));
  15488. this.n35 = (this.getChild("n35"));
  15489. this.img1 = (this.getChild("img1"));
  15490. this.img2 = (this.getChild("img2"));
  15491. this.img3 = (this.getChild("img3"));
  15492. this.img4 = (this.getChild("img4"));
  15493. this.img6 = (this.getChild("img6"));
  15494. this.img5 = (this.getChild("img5"));
  15495. this.txt1 = (this.getChild("txt1"));
  15496. this.txt2 = (this.getChild("txt2"));
  15497. this.txt3 = (this.getChild("txt3"));
  15498. this.txt4 = (this.getChild("txt4"));
  15499. this.txt5 = (this.getChild("txt5"));
  15500. this.txt6 = (this.getChild("txt6"));
  15501. }
  15502. }
  15503. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15504. class ui_UITurntable_com9 extends fgui.GComponent {
  15505. static createInstance() {
  15506. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15507. }
  15508. onConstruct() {
  15509. this.n38 = (this.getChild("n38"));
  15510. this.n39 = (this.getChild("n39"));
  15511. }
  15512. }
  15513. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15514. class ui_UITurntable_com10 extends fgui.GComponent {
  15515. static createInstance() {
  15516. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15517. }
  15518. onConstruct() {
  15519. this.n39 = (this.getChild("n39"));
  15520. this.n40 = (this.getChild("n40"));
  15521. this.t0 = this.getTransition("t0");
  15522. }
  15523. }
  15524. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15525. class ui_UITurntable_com11 extends fgui.GComponent {
  15526. static createInstance() {
  15527. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15528. }
  15529. onConstruct() {
  15530. this.n38 = (this.getChild("n38"));
  15531. this.n39 = (this.getChild("n39"));
  15532. this.n40 = (this.getChild("n40"));
  15533. this.t0 = this.getTransition("t0");
  15534. }
  15535. }
  15536. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15537. class ui_UITurntable_com12 extends fgui.GComponent {
  15538. static createInstance() {
  15539. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15540. }
  15541. onConstruct() {
  15542. this.n43 = (this.getChild("n43"));
  15543. this.barNode = (this.getChild("barNode"));
  15544. this.tipsTxt = (this.getChild("tipsTxt"));
  15545. this.n45 = (this.getChild("n45"));
  15546. this.boxBtn = (this.getChild("boxBtn"));
  15547. }
  15548. }
  15549. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15550. class ui_UITurntable_com1 extends fgui.GButton {
  15551. static createInstance() {
  15552. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15553. }
  15554. onConstruct() {
  15555. this.n41 = (this.getChild("n41"));
  15556. this.n42 = (this.getChild("n42"));
  15557. this.t0 = this.getTransition("t0");
  15558. }
  15559. }
  15560. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15561. class ui_UITurntable_com3 extends fgui.GComponent {
  15562. static createInstance() {
  15563. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15564. }
  15565. onConstruct() {
  15566. this.n48 = (this.getChild("n48"));
  15567. this.womanTxt = (this.getChild("womanTxt"));
  15568. this.t0 = this.getTransition("t0");
  15569. }
  15570. }
  15571. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15572. class ui_cancelBtn2 extends fgui.GButton {
  15573. static createInstance() {
  15574. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15575. }
  15576. onConstruct() {
  15577. this.c1 = this.getController("c1");
  15578. this.n0 = (this.getChild("n0"));
  15579. this.n1 = (this.getChild("n1"));
  15580. this.n2 = (this.getChild("n2"));
  15581. this.n3 = (this.getChild("n3"));
  15582. this.n4 = (this.getChild("n4"));
  15583. this.n5 = (this.getChild("n5"));
  15584. this.n6 = (this.getChild("n6"));
  15585. this.n7 = (this.getChild("n7"));
  15586. this.n8 = (this.getChild("n8"));
  15587. this.powerEft = (this.getChild("powerEft"));
  15588. }
  15589. }
  15590. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15591. class ui_shareBtn2 extends fgui.GButton {
  15592. static createInstance() {
  15593. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15594. }
  15595. onConstruct() {
  15596. this.c1 = this.getController("c1");
  15597. this.n2 = (this.getChild("n2"));
  15598. this.n24 = (this.getChild("n24"));
  15599. this.n1 = (this.getChild("n1"));
  15600. this.n3 = (this.getChild("n3"));
  15601. this.n23 = (this.getChild("n23"));
  15602. this.n4 = (this.getChild("n4"));
  15603. this.n5 = (this.getChild("n5"));
  15604. this.n6 = (this.getChild("n6"));
  15605. this.n20 = (this.getChild("n20"));
  15606. this.n21 = (this.getChild("n21"));
  15607. this.n22 = (this.getChild("n22"));
  15608. this.powerEft = (this.getChild("powerEft"));
  15609. }
  15610. }
  15611. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15612. class ui_UIMoney extends fgui.GComponent {
  15613. static createInstance() {
  15614. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15615. }
  15616. onConstruct() {
  15617. this.c1 = this.getController("c1");
  15618. this.n4 = (this.getChild("n4"));
  15619. this.coinImg = (this.getChild("coinImg"));
  15620. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15621. this.coinTxt = (this.getChild("coinTxt"));
  15622. this.n7 = (this.getChild("n7"));
  15623. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15624. this.diamondTxt = (this.getChild("diamondTxt"));
  15625. this.diamondImg = (this.getChild("diamondImg"));
  15626. this.n12 = (this.getChild("n12"));
  15627. this.powerImg = (this.getChild("powerImg"));
  15628. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15629. this.powerTxt = (this.getChild("powerTxt"));
  15630. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15631. }
  15632. }
  15633. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15634. class ui_backBtn extends fgui.GButton {
  15635. static createInstance() {
  15636. return (fgui.UIPackage.createObject("game", "backBtn"));
  15637. }
  15638. onConstruct() {
  15639. this.n0 = (this.getChild("n0"));
  15640. this.t0 = this.getTransition("t0");
  15641. this.t1 = this.getTransition("t1");
  15642. }
  15643. }
  15644. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15645. class ui_MoneyBtn extends fgui.GButton {
  15646. static createInstance() {
  15647. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15648. }
  15649. onConstruct() {
  15650. this.button = this.getController("button");
  15651. this.n0 = (this.getChild("n0"));
  15652. }
  15653. }
  15654. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15655. class ui_UIMoneyBtn extends fgui.GComponent {
  15656. static createInstance() {
  15657. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15658. }
  15659. onConstruct() {
  15660. this.n1 = (this.getChild("n1"));
  15661. this.closeBtn = (this.getChild("closeBtn"));
  15662. }
  15663. }
  15664. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15665. class ui_Component64 extends fgui.GComponent {
  15666. static createInstance() {
  15667. return (fgui.UIPackage.createObject("game", "Component64"));
  15668. }
  15669. onConstruct() {
  15670. this.n57 = (this.getChild("n57"));
  15671. this.n54 = (this.getChild("n54"));
  15672. this.n55 = (this.getChild("n55"));
  15673. this.n56 = (this.getChild("n56"));
  15674. this.t1 = this.getTransition("t1");
  15675. }
  15676. }
  15677. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15678. class ui_Component41_3 extends fgui.GComponent {
  15679. static createInstance() {
  15680. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15681. }
  15682. onConstruct() {
  15683. this.c1 = this.getController("c1");
  15684. this.n0 = (this.getChild("n0"));
  15685. this.n2 = (this.getChild("n2"));
  15686. this.cancelBtn = (this.getChild("cancelBtn"));
  15687. this.videoBtn = (this.getChild("videoBtn"));
  15688. this.n9 = (this.getChild("n9"));
  15689. this.n24 = (this.getChild("n24"));
  15690. this.n27 = (this.getChild("n27"));
  15691. this.titleTxt = (this.getChild("titleTxt"));
  15692. this.n28 = (this.getChild("n28"));
  15693. this.t0 = this.getTransition("t0");
  15694. }
  15695. }
  15696. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15697. class ui_dh_zs_4 extends fgui.GComponent {
  15698. static createInstance() {
  15699. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15700. }
  15701. onConstruct() {
  15702. this.n1 = (this.getChild("n1"));
  15703. this.n2 = (this.getChild("n2"));
  15704. this.n3 = (this.getChild("n3"));
  15705. this.n4 = (this.getChild("n4"));
  15706. this.n5 = (this.getChild("n5"));
  15707. this.n6 = (this.getChild("n6"));
  15708. this.n8 = (this.getChild("n8"));
  15709. this.t0 = this.getTransition("t0");
  15710. }
  15711. }
  15712. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15713. class ui_Component71_1 extends fgui.GButton {
  15714. static createInstance() {
  15715. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15716. }
  15717. onConstruct() {
  15718. this.n17 = (this.getChild("n17"));
  15719. this.t0 = this.getTransition("t0");
  15720. }
  15721. }
  15722. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15723. class ui_Component83 extends fgui.GComponent {
  15724. static createInstance() {
  15725. return (fgui.UIPackage.createObject("game", "Component83"));
  15726. }
  15727. onConstruct() {
  15728. this.c1 = this.getController("c1");
  15729. this.n17 = (this.getChild("n17"));
  15730. this.n19 = (this.getChild("n19"));
  15731. this.n20 = (this.getChild("n20"));
  15732. }
  15733. }
  15734. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15735. class ui_Component84 extends fgui.GComponent {
  15736. static createInstance() {
  15737. return (fgui.UIPackage.createObject("game", "Component84"));
  15738. }
  15739. onConstruct() {
  15740. this.c1 = this.getController("c1");
  15741. this.n4 = (this.getChild("n4"));
  15742. this.n22 = (this.getChild("n22"));
  15743. this.n23 = (this.getChild("n23"));
  15744. this.numTxt = (this.getChild("numTxt"));
  15745. this.n25 = (this.getChild("n25"));
  15746. this.n26 = (this.getChild("n26"));
  15747. }
  15748. }
  15749. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15750. class ui_Component84_1 extends fgui.GComponent {
  15751. static createInstance() {
  15752. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15753. }
  15754. onConstruct() {
  15755. this.c1 = this.getController("c1");
  15756. this.n4 = (this.getChild("n4"));
  15757. this.n22 = (this.getChild("n22"));
  15758. this.n23 = (this.getChild("n23"));
  15759. this.numTxt = (this.getChild("numTxt"));
  15760. this.n25 = (this.getChild("n25"));
  15761. this.n26 = (this.getChild("n26"));
  15762. }
  15763. }
  15764. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15765. class ui_Component85 extends fgui.GComponent {
  15766. static createInstance() {
  15767. return (fgui.UIPackage.createObject("game", "Component85"));
  15768. }
  15769. onConstruct() {
  15770. this.n1 = (this.getChild("n1"));
  15771. this.n6 = (this.getChild("n6"));
  15772. this.n2 = (this.getChild("n2"));
  15773. this.n3 = (this.getChild("n3"));
  15774. this.levelTxt = (this.getChild("levelTxt"));
  15775. this.n10 = (this.getChild("n10"));
  15776. this.n11 = (this.getChild("n11"));
  15777. this.n12 = (this.getChild("n12"));
  15778. this.n13 = (this.getChild("n13"));
  15779. this.n14 = (this.getChild("n14"));
  15780. this.modeNode = (this.getChild("modeNode"));
  15781. this.n18 = (this.getChild("n18"));
  15782. this.conditionTxt = (this.getChild("conditionTxt"));
  15783. this.diamondNode = (this.getChild("diamondNode"));
  15784. this.coinNode = (this.getChild("coinNode"));
  15785. this.startBtn = (this.getChild("startBtn"));
  15786. this.n28 = (this.getChild("n28"));
  15787. this.displayRoot = (this.getChild("displayRoot"));
  15788. this.t0 = this.getTransition("t0");
  15789. }
  15790. }
  15791. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15792. class ui_Component86 extends fgui.GButton {
  15793. static createInstance() {
  15794. return (fgui.UIPackage.createObject("game", "Component86"));
  15795. }
  15796. onConstruct() {
  15797. this.n15 = (this.getChild("n15"));
  15798. this.t0 = this.getTransition("t0");
  15799. }
  15800. }
  15801. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15802. class ui_Component87 extends fgui.GComponent {
  15803. static createInstance() {
  15804. return (fgui.UIPackage.createObject("game", "Component87"));
  15805. }
  15806. onConstruct() {
  15807. this.n66 = (this.getChild("n66"));
  15808. this.myProgress = (this.getChild("myProgress"));
  15809. this.starAni = (this.getChild("starAni"));
  15810. this.hpTxt = (this.getChild("hpTxt"));
  15811. this.n74 = (this.getChild("n74"));
  15812. this.n73 = (this.getChild("n73"));
  15813. this.ballTxt = (this.getChild("ballTxt"));
  15814. this.n76 = (this.getChild("n76"));
  15815. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15816. this.levelTxt = (this.getChild("levelTxt"));
  15817. this.star1 = (this.getChild("star1"));
  15818. this.star2 = (this.getChild("star2"));
  15819. this.star3 = (this.getChild("star3"));
  15820. }
  15821. }
  15822. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15823. class ui_Component88 extends fgui.GProgressBar {
  15824. static createInstance() {
  15825. return (fgui.UIPackage.createObject("game", "Component88"));
  15826. }
  15827. onConstruct() {
  15828. this.n68 = (this.getChild("n68"));
  15829. this.bar = (this.getChild("bar"));
  15830. }
  15831. }
  15832. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15833. class ui_Component89 extends fgui.GComponent {
  15834. static createInstance() {
  15835. return (fgui.UIPackage.createObject("game", "Component89"));
  15836. }
  15837. onConstruct() {
  15838. this.c1 = this.getController("c1");
  15839. this.n71 = (this.getChild("n71"));
  15840. this.n72 = (this.getChild("n72"));
  15841. }
  15842. }
  15843. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15844. class ui_Component90 extends fgui.GComponent {
  15845. static createInstance() {
  15846. return (fgui.UIPackage.createObject("game", "Component90"));
  15847. }
  15848. onConstruct() {
  15849. this.c1 = this.getController("c1");
  15850. this.n64 = (this.getChild("n64"));
  15851. this.n65 = (this.getChild("n65"));
  15852. this.n66 = (this.getChild("n66"));
  15853. this.t0 = this.getTransition("t0");
  15854. }
  15855. }
  15856. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15857. class ui_Component127 extends fgui.GButton {
  15858. static createInstance() {
  15859. return (fgui.UIPackage.createObject("game", "Component127"));
  15860. }
  15861. onConstruct() {
  15862. this.n5 = (this.getChild("n5"));
  15863. }
  15864. }
  15865. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15866. class gameBinder {
  15867. static bindAll() {
  15868. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15869. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15870. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15871. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15872. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15873. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15874. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15875. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15876. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15877. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15878. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15879. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  15880. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  15881. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  15882. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15883. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15884. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15885. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15886. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15887. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15888. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15889. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15890. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15891. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15892. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15893. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15894. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15895. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15896. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15897. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15898. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15899. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15900. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15901. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15902. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15903. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15904. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15905. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15906. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15907. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15908. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15909. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15910. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15911. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15912. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15913. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15914. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15915. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15916. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15917. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15918. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15919. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15920. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15921. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15922. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15923. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15924. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15925. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15926. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15927. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15928. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15929. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15930. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15931. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15932. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15933. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15934. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15935. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  15936. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  15937. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  15938. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  15939. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  15940. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  15941. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  15942. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  15943. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  15944. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  15945. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  15946. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  15947. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  15948. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  15949. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  15950. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  15951. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  15952. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  15953. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  15954. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  15955. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  15956. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  15957. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  15958. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  15959. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  15960. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  15961. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  15962. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  15963. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  15964. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  15965. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  15966. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  15967. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  15968. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  15969. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  15970. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  15971. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  15972. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  15973. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  15974. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  15975. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  15976. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  15977. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  15978. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  15979. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  15980. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  15981. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  15982. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  15983. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  15984. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  15985. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  15986. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  15987. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  15988. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  15989. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  15990. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  15991. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  15992. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  15993. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  15994. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  15995. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  15996. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  15997. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  15998. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  15999. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16000. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16001. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16002. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16003. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16004. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16005. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16006. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16007. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16008. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16009. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16010. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16011. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16012. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16013. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16014. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16015. fgui.UIObjectFactory.setExtension(ui_Component_fuli1.URL, ui_Component_fuli1);
  16016. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16017. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16018. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16019. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16020. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16021. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16022. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16023. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16024. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16025. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16026. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16027. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16028. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16029. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16030. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16031. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16032. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16033. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16034. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16035. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16036. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16037. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16038. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16039. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16040. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16041. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16042. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16043. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16044. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16045. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16046. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16047. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16048. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16049. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16050. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16051. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16052. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16053. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16054. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16055. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16056. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16057. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16058. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16059. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16060. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16061. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16062. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16063. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16064. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16065. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  16066. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16067. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16068. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16069. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16070. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16071. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16072. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16073. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16074. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16075. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16076. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16077. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16078. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16079. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16080. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16081. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16082. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16083. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16084. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16085. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16086. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16087. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16088. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16089. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16090. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16091. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16092. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16093. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16094. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16095. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16096. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16097. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16098. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16099. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16100. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16101. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16102. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16103. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16104. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16105. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16106. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16107. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16108. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16109. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16110. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16111. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16112. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16113. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16114. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16115. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16116. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16117. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16118. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16119. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16120. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16121. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16122. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16123. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16124. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16125. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16126. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16127. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16128. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16129. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16130. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16131. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16132. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16133. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16134. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16135. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16136. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16137. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16138. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16139. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16140. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16141. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16142. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16143. }
  16144. }
  16145. class ui_btn6 extends fgui.GButton {
  16146. static createInstance() {
  16147. return (fgui.UIPackage.createObject("loading", "btn6"));
  16148. }
  16149. onConstruct() {
  16150. this.n6 = (this.getChild("n6"));
  16151. this.n1 = (this.getChild("n1"));
  16152. }
  16153. }
  16154. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16155. class ui_xyItem extends fgui.GComponent {
  16156. static createInstance() {
  16157. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16158. }
  16159. onConstruct() {
  16160. this.xyItem = (this.getChild("xyItem"));
  16161. }
  16162. }
  16163. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16164. class ui_loadinfo extends fgui.GProgressBar {
  16165. static createInstance() {
  16166. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16167. }
  16168. onConstruct() {
  16169. this.bg = (this.getChild("bg"));
  16170. this.bar = (this.getChild("bar"));
  16171. this.title = (this.getChild("title"));
  16172. this.ani = (this.getChild("ani"));
  16173. }
  16174. }
  16175. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16176. class ui_xyNode extends fgui.GComponent {
  16177. static createInstance() {
  16178. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16179. }
  16180. onConstruct() {
  16181. this.n0 = (this.getChild("n0"));
  16182. this.btnYes = (this.getChild("btnYes"));
  16183. this.btnNo = (this.getChild("btnNo"));
  16184. this.btnKnown = (this.getChild("btnKnown"));
  16185. this.btnSure = (this.getChild("btnSure"));
  16186. this.txtWelcom = (this.getChild("txtWelcom"));
  16187. this.txtXy = (this.getChild("txtXy"));
  16188. this.n75 = (this.getChild("n75"));
  16189. this.btnXy1 = (this.getChild("btnXy1"));
  16190. this.btnXy3 = (this.getChild("btnXy3"));
  16191. this.btnXy2 = (this.getChild("btnXy2"));
  16192. this.n74 = (this.getChild("n74"));
  16193. this.xy1 = (this.getChild("xy1"));
  16194. this.txtTitle = (this.getChild("txtTitle"));
  16195. this.btnBack = (this.getChild("btnBack"));
  16196. this.xyList = (this.getChild("xyList"));
  16197. this.xy2 = (this.getChild("xy2"));
  16198. this.xyNode = (this.getChild("xyNode"));
  16199. }
  16200. }
  16201. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16202. class ui_ageNode extends fgui.GComponent {
  16203. static createInstance() {
  16204. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16205. }
  16206. onConstruct() {
  16207. this.n3 = (this.getChild("n3"));
  16208. this.n7 = (this.getChild("n7"));
  16209. this.n4 = (this.getChild("n4"));
  16210. this.btnAge = (this.getChild("btnAge"));
  16211. this.ageNode = (this.getChild("ageNode"));
  16212. }
  16213. }
  16214. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16215. class ui_rnNode extends fgui.GComponent {
  16216. static createInstance() {
  16217. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16218. }
  16219. onConstruct() {
  16220. this.n28 = (this.getChild("n28"));
  16221. this.n30 = (this.getChild("n30"));
  16222. this.n33 = (this.getChild("n33"));
  16223. this.rn1 = (this.getChild("rn1"));
  16224. this.n40 = (this.getChild("n40"));
  16225. this.n41 = (this.getChild("n41"));
  16226. this.rn3 = (this.getChild("rn3"));
  16227. this.n37 = (this.getChild("n37"));
  16228. this.n39 = (this.getChild("n39"));
  16229. this.rn2 = (this.getChild("rn2"));
  16230. this.n47 = (this.getChild("n47"));
  16231. this.n49 = (this.getChild("n49"));
  16232. this.n44 = (this.getChild("n44"));
  16233. this.inputCode = (this.getChild("inputCode"));
  16234. this.inputName = (this.getChild("inputName"));
  16235. this.n48 = (this.getChild("n48"));
  16236. this.n50 = (this.getChild("n50"));
  16237. this.rn4 = (this.getChild("rn4"));
  16238. this.btnCheck = (this.getChild("btnCheck"));
  16239. this.btnExit = (this.getChild("btnExit"));
  16240. this.btnDone = (this.getChild("btnDone"));
  16241. this.rnNode = (this.getChild("rnNode"));
  16242. }
  16243. }
  16244. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16245. class ui_tipNode extends fgui.GComponent {
  16246. static createInstance() {
  16247. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16248. }
  16249. onConstruct() {
  16250. this.bg = (this.getChild("bg"));
  16251. this.n55 = (this.getChild("n55"));
  16252. this.n56 = (this.getChild("n56"));
  16253. this.tipNode = (this.getChild("tipNode"));
  16254. }
  16255. }
  16256. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16257. class ui_fcmNode extends fgui.GComponent {
  16258. static createInstance() {
  16259. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16260. }
  16261. onConstruct() {
  16262. this.n63 = (this.getChild("n63"));
  16263. this.n62 = (this.getChild("n62"));
  16264. this.btnRn = (this.getChild("btnRn"));
  16265. this.n61 = (this.getChild("n61"));
  16266. this.n58 = (this.getChild("n58"));
  16267. this.fcmNode = (this.getChild("fcmNode"));
  16268. }
  16269. }
  16270. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16271. class ui_msgNode extends fgui.GComponent {
  16272. static createInstance() {
  16273. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16274. }
  16275. onConstruct() {
  16276. this.n69 = (this.getChild("n69"));
  16277. this.txtMsg = (this.getChild("txtMsg"));
  16278. this.msgNode = (this.getChild("msgNode"));
  16279. }
  16280. }
  16281. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16282. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16283. static createInstance() {
  16284. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16285. }
  16286. onConstruct() {
  16287. this.n1 = (this.getChild("n1"));
  16288. this.n13 = (this.getChild("n13"));
  16289. this.n14 = (this.getChild("n14"));
  16290. this.n15 = (this.getChild("n15"));
  16291. this.n3 = (this.getChild("n3"));
  16292. this.n4 = (this.getChild("n4"));
  16293. this.n5 = (this.getChild("n5"));
  16294. this.n6 = (this.getChild("n6"));
  16295. this.n7 = (this.getChild("n7"));
  16296. this.n8 = (this.getChild("n8"));
  16297. this.n9 = (this.getChild("n9"));
  16298. this.n10 = (this.getChild("n10"));
  16299. this.n12 = (this.getChild("n12"));
  16300. this.n11 = (this.getChild("n11"));
  16301. this.n16 = (this.getChild("n16"));
  16302. this.n17 = (this.getChild("n17"));
  16303. this.n18 = (this.getChild("n18"));
  16304. this.n20 = (this.getChild("n20"));
  16305. this.n21 = (this.getChild("n21"));
  16306. this.t0 = this.getTransition("t0");
  16307. }
  16308. }
  16309. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16310. class ui_btn5 extends fgui.GButton {
  16311. static createInstance() {
  16312. return (fgui.UIPackage.createObject("loading", "btn5"));
  16313. }
  16314. onConstruct() {
  16315. this.n9 = (this.getChild("n9"));
  16316. this.n1 = (this.getChild("n1"));
  16317. }
  16318. }
  16319. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16320. class ui_UILoading extends fgui.GComponent {
  16321. static createInstance() {
  16322. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16323. }
  16324. onConstruct() {
  16325. this.n12 = (this.getChild("n12"));
  16326. this.loadinfo = (this.getChild("loadinfo"));
  16327. this.n13 = (this.getChild("n13"));
  16328. this.txtLoad = (this.getChild("txtLoad"));
  16329. this.n18 = (this.getChild("n18"));
  16330. }
  16331. }
  16332. ui_UILoading.URL = "ui://37nctnhwphc33";
  16333. class ui_AgeItem extends fgui.GComponent {
  16334. static createInstance() {
  16335. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16336. }
  16337. onConstruct() {
  16338. this.txtAge = (this.getChild("txtAge"));
  16339. }
  16340. }
  16341. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16342. class ui_btn1 extends fgui.GButton {
  16343. static createInstance() {
  16344. return (fgui.UIPackage.createObject("loading", "btn1"));
  16345. }
  16346. onConstruct() {
  16347. this.n6 = (this.getChild("n6"));
  16348. this.n1 = (this.getChild("n1"));
  16349. }
  16350. }
  16351. ui_btn1.URL = "ui://37nctnhwxe622p";
  16352. class ui_btn3 extends fgui.GButton {
  16353. static createInstance() {
  16354. return (fgui.UIPackage.createObject("loading", "btn3"));
  16355. }
  16356. onConstruct() {
  16357. this.n9 = (this.getChild("n9"));
  16358. this.n1 = (this.getChild("n1"));
  16359. }
  16360. }
  16361. ui_btn3.URL = "ui://37nctnhwxe622s";
  16362. class ui_btn2 extends fgui.GButton {
  16363. static createInstance() {
  16364. return (fgui.UIPackage.createObject("loading", "btn2"));
  16365. }
  16366. onConstruct() {
  16367. this.n6 = (this.getChild("n6"));
  16368. this.n1 = (this.getChild("n1"));
  16369. }
  16370. }
  16371. ui_btn2.URL = "ui://37nctnhwxe622t";
  16372. class ui_btnBack extends fgui.GButton {
  16373. static createInstance() {
  16374. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16375. }
  16376. onConstruct() {
  16377. this.n6 = (this.getChild("n6"));
  16378. this.n7 = (this.getChild("n7"));
  16379. }
  16380. }
  16381. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16382. class ui_btnXy1 extends fgui.GButton {
  16383. static createInstance() {
  16384. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16385. }
  16386. onConstruct() {
  16387. this.n1 = (this.getChild("n1"));
  16388. }
  16389. }
  16390. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16391. class ui_btnXy2 extends fgui.GButton {
  16392. static createInstance() {
  16393. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16394. }
  16395. onConstruct() {
  16396. this.n1 = (this.getChild("n1"));
  16397. }
  16398. }
  16399. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16400. class ui_btnXy3 extends fgui.GButton {
  16401. static createInstance() {
  16402. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16403. }
  16404. onConstruct() {
  16405. this.n1 = (this.getChild("n1"));
  16406. }
  16407. }
  16408. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16409. class ui_btn4 extends fgui.GButton {
  16410. static createInstance() {
  16411. return (fgui.UIPackage.createObject("loading", "btn4"));
  16412. }
  16413. onConstruct() {
  16414. this.n9 = (this.getChild("n9"));
  16415. this.n1 = (this.getChild("n1"));
  16416. }
  16417. }
  16418. ui_btn4.URL = "ui://37nctnhwxe622z";
  16419. class loadingBinder {
  16420. static bindAll() {
  16421. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16422. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16423. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16424. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16425. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16426. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16427. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16428. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16429. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16430. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16431. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16432. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16433. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16434. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16435. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16436. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16437. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16438. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16439. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16440. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16441. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16442. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16443. }
  16444. }
  16445. class UIMgr {
  16446. constructor() {
  16447. this._stage = null;
  16448. this._uiList = [];
  16449. this._showList = [];
  16450. this._bindPkgList = [];
  16451. this.uiIndex = 0;
  16452. }
  16453. static get inst() {
  16454. if (UIMgr._inst == null) {
  16455. UIMgr._inst = new UIMgr();
  16456. }
  16457. return UIMgr._inst;
  16458. }
  16459. setStage(s) {
  16460. if (this._stage) {
  16461. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16462. return;
  16463. }
  16464. this._stage = s;
  16465. }
  16466. clearTempData() {
  16467. console.log('zh:clearTempData start');
  16468. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16469. console.log('zh:clearTempData end');
  16470. }
  16471. init() {
  16472. this.setStage(Laya.stage);
  16473. fairygui.UIConfig.defaultFont = "微软雅黑";
  16474. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16475. fairygui.UIConfig.packageFileExtension = "obj";
  16476. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16477. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16478. fairygui.GRoot.inst.width = Laya.stage.width;
  16479. fairygui.GRoot.inst.height = Laya.stage.height;
  16480. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16481. }
  16482. addAllUpdate() {
  16483. this.uiIndex = 0;
  16484. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16485. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16486. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16487. }
  16488. }
  16489. }
  16490. bindFUI(pkgname) {
  16491. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16492. return;
  16493. }
  16494. switch (pkgname) {
  16495. case fguiRes.loading:
  16496. fairygui.UIPackage.addPackage(pkgname);
  16497. loadingBinder.bindAll();
  16498. this._bindPkgList.push(pkgname);
  16499. break;
  16500. case fguiRes.game:
  16501. fairygui.UIPackage.addPackage(pkgname);
  16502. gameBinder.bindAll();
  16503. this._bindPkgList.push(pkgname);
  16504. break;
  16505. default:
  16506. break;
  16507. }
  16508. }
  16509. Show(cls, ...param) {
  16510. let nameStr = cls.uiName;
  16511. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16512. let temp = this._uiList[i];
  16513. let str = temp.className;
  16514. if (str == nameStr) {
  16515. if (temp.isMuti) {
  16516. if (temp.isHide) {
  16517. temp.show(...param);
  16518. this._uiList.splice(i, 1);
  16519. this._uiList.push(temp);
  16520. return temp;
  16521. }
  16522. }
  16523. else {
  16524. temp.show(...param);
  16525. this._uiList.splice(i, 1);
  16526. this._uiList.push(temp);
  16527. return temp;
  16528. }
  16529. }
  16530. }
  16531. let ui = new cls();
  16532. ui.className = nameStr;
  16533. this._showUI(ui, param);
  16534. return ui;
  16535. }
  16536. destroyUI(ui) {
  16537. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16538. let temp = this._uiList[i].className;
  16539. if (temp == ui.className) {
  16540. this._uiList.splice(i, 1);
  16541. break;
  16542. }
  16543. }
  16544. this.checkUIState();
  16545. }
  16546. _showUI(ui, param) {
  16547. this._uiList.push(ui);
  16548. ui.show(...param);
  16549. }
  16550. Hide(uiClass) {
  16551. let ui = this.getUI(uiClass);
  16552. if (ui && !ui.isHide) {
  16553. ui.hide();
  16554. }
  16555. }
  16556. getUI(ui) {
  16557. let nameStr = ui.uiName;
  16558. for (let index = 0; index < this._uiList.length; index++) {
  16559. let temp = this._uiList[index];
  16560. if (temp.className == nameStr) {
  16561. return temp;
  16562. }
  16563. }
  16564. return null;
  16565. }
  16566. isShow(cls) {
  16567. for (var i of this._uiList) {
  16568. if (i instanceof cls) {
  16569. return i.isShowing;
  16570. }
  16571. }
  16572. return false;
  16573. }
  16574. showUINum() {
  16575. let num = 0;
  16576. for (var i of this._uiList) {
  16577. if (i.isShowing) {
  16578. num++;
  16579. }
  16580. }
  16581. return num;
  16582. }
  16583. checkUIState() {
  16584. Laya.timer.clear(this, this._uiCheck);
  16585. Laya.timer.once(400, this, this._uiCheck);
  16586. }
  16587. _uiCheck() {
  16588. let showList = [];
  16589. for (var i of this._uiList) {
  16590. if (!i.isHide) {
  16591. showList.push(i);
  16592. }
  16593. }
  16594. for (let index = 0; index < showList.length; index++) {
  16595. if (index == showList.length - 1) {
  16596. showList[index].checkActive(true);
  16597. }
  16598. else {
  16599. showList[index].checkActive(false);
  16600. }
  16601. }
  16602. }
  16603. showTip(msg, time = 600, size = 30) {
  16604. }
  16605. }
  16606. class UIShowList {
  16607. }
  16608. class SoundMgr {
  16609. constructor() {
  16610. this.soundMax = 4;
  16611. this.isLoad = false;
  16612. this.soundMap = {};
  16613. this.isSound = true;
  16614. this.openShake = true;
  16615. SoundMgr._instance = this;
  16616. }
  16617. static getInstance() {
  16618. if (!this._instance) {
  16619. this._instance = new SoundMgr();
  16620. }
  16621. return this._instance;
  16622. }
  16623. init() {
  16624. console.log('zh:sm init 1');
  16625. Laya.SoundManager.autoReleaseSound = true;
  16626. Laya.SoundManager.autoStopMusic = true;
  16627. Laya.SoundManager.musicVolume = 0.3;
  16628. Laya.SoundManager.soundVolume = 0.5;
  16629. this.musicPlayed = false;
  16630. this.audioUrl = "asset/sound/ogg/";
  16631. console.log('zh:sm init 2');
  16632. console.log('zh:dev type ');
  16633. if (Laya.Browser.onAndroid) {
  16634. console.log('zh:dev type android');
  16635. this.audioUrl = "asset/sound/ogg/";
  16636. this.isLoad = true;
  16637. }
  16638. else {
  16639. console.log('zh:dev type not android');
  16640. this.audioUrl = "asset/sound/mp3/";
  16641. this.isLoad = true;
  16642. }
  16643. }
  16644. onSetting(isS) {
  16645. this.isSound = isS;
  16646. this.mute(!this.isSound);
  16647. }
  16648. clearCount() {
  16649. for (var key in this.soundMap) {
  16650. delete this.soundMap[key];
  16651. }
  16652. }
  16653. playMusic(path, loop = 0) {
  16654. console.log('zh:playMusic 1 PATH=' + path);
  16655. this.musicPath = path;
  16656. if (!this.isLoad) {
  16657. return;
  16658. }
  16659. if (!path || path == "") {
  16660. return;
  16661. }
  16662. if (!this.isSound) {
  16663. return;
  16664. }
  16665. this.musicPlayed = true;
  16666. let url = this.getUrl(path);
  16667. if (!Laya.Browser.onAndroid) {
  16668. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16669. this.play(url, loop);
  16670. }));
  16671. }
  16672. else {
  16673. this.play(url, loop);
  16674. }
  16675. }
  16676. play(url, loop) {
  16677. Laya.SoundManager.playMusic(url, loop);
  16678. }
  16679. getUrl(path) {
  16680. let url = this.audioUrl + path;
  16681. if (Laya.Browser.onAndroid) {
  16682. url += ".ogg";
  16683. }
  16684. else {
  16685. url += ".mp3";
  16686. }
  16687. return url;
  16688. }
  16689. pauseMusic(pause) {
  16690. if (pause) {
  16691. this.mute(true);
  16692. }
  16693. else if (this.isSound)
  16694. this.mute(false);
  16695. }
  16696. stopMusic() {
  16697. Laya.SoundManager.stopMusic();
  16698. if (Moyu.isNeedPlatAudio) {
  16699. Moyu.stopMusic();
  16700. }
  16701. }
  16702. mute(mute) {
  16703. if (Moyu.isNeedPlatAudio) {
  16704. Moyu.pauseMusic(mute);
  16705. }
  16706. else {
  16707. Laya.SoundManager.musicMuted = mute;
  16708. if (!mute && !this.musicPlayed && this.musicPath) {
  16709. this.playMusic(this.musicPath);
  16710. }
  16711. }
  16712. }
  16713. stopSound(path) {
  16714. let url = this.getUrl(path);
  16715. Laya.SoundManager.stopSound(url);
  16716. }
  16717. playSound(path, loop = 1, soundMax = this.soundMax) {
  16718. if (!this.isLoad)
  16719. return;
  16720. if (!this.isSound)
  16721. return;
  16722. if (!path || path == "")
  16723. return;
  16724. let url = this.getUrl(path);
  16725. if (Moyu.isNeedPlatAudio) {
  16726. Moyu.playSound(path, loop == 0);
  16727. }
  16728. else {
  16729. let count = 1;
  16730. if (this.soundMap[path])
  16731. count = this.soundMap[path] + 1;
  16732. if (count > soundMax)
  16733. return;
  16734. this.soundMap[path] = count;
  16735. Laya.SoundManager.playSound(url, loop);
  16736. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16737. }
  16738. }
  16739. removePath(path) {
  16740. if (this.soundMap[path]) {
  16741. let count = this.soundMap[path];
  16742. count--;
  16743. if (count < 1)
  16744. delete this.soundMap[path];
  16745. else
  16746. this.soundMap[path] = count;
  16747. }
  16748. }
  16749. playBtnSound() {
  16750. this.playSound("btn");
  16751. }
  16752. playGetSound() {
  16753. }
  16754. playCloseUISound() {
  16755. }
  16756. }
  16757. SoundMgr._instance = null;
  16758. var Handler$1 = Laya.Handler;
  16759. var EResType;
  16760. (function (EResType) {
  16761. EResType[EResType["none"] = 0] = "none";
  16762. EResType[EResType["nromal"] = 1] = "nromal";
  16763. EResType[EResType["td"] = 2] = "td";
  16764. EResType[EResType["sk"] = 3] = "sk";
  16765. })(EResType || (EResType = {}));
  16766. class CResLoader {
  16767. constructor(doneCall, proCall) {
  16768. this.completrCall = doneCall;
  16769. this.progressCall = proCall;
  16770. this.progressHander = new Handler$1(this, this.onProgress);
  16771. this.tdResMap = {};
  16772. }
  16773. load(resList) {
  16774. this.resCount = 0;
  16775. this.loadCount = 0;
  16776. for (let i = 0; i < resList.length; i++) {
  16777. let path = resList[i];
  16778. if (!path)
  16779. continue;
  16780. this.resCount++;
  16781. let type = this.getResType(path);
  16782. if (type == EResType.nromal)
  16783. this.loadNromal(path);
  16784. else if (type == EResType.td)
  16785. this.loadTd(path);
  16786. }
  16787. }
  16788. getRes(path) {
  16789. let type = this.getResType(path);
  16790. if (type == EResType.nromal)
  16791. return Laya.loader.getRes(path);
  16792. else if (type == EResType.td) {
  16793. let res = this.tdResMap[path];
  16794. if (res)
  16795. return res.clone();
  16796. return null;
  16797. }
  16798. }
  16799. destroy() {
  16800. this.progressHander.clear();
  16801. this.progressHander = null;
  16802. }
  16803. clearRes(path) {
  16804. let type = this.getResType(path);
  16805. if (type == EResType.nromal)
  16806. Laya.loader.clearRes(path);
  16807. else if (type == EResType.td) {
  16808. let obj = this.tdResMap[path];
  16809. if (obj)
  16810. obj.destroy();
  16811. delete this.tdResMap[path];
  16812. }
  16813. }
  16814. getResType(path) {
  16815. let exs = this.getExtension(path);
  16816. if (exs == "sk")
  16817. return EResType.sk;
  16818. if (exs == "ls" || exs == "lh" || exs == "lm")
  16819. return EResType.td;
  16820. else
  16821. return EResType.nromal;
  16822. }
  16823. getExtension(res) {
  16824. var index = res.lastIndexOf(".");
  16825. return res.substr(index + 1);
  16826. }
  16827. loadNromal(path) {
  16828. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16829. if (res) {
  16830. this.onLoad();
  16831. }
  16832. else
  16833. console.log("load res fail:" + path);
  16834. }), this.progressHander);
  16835. }
  16836. loadSk() {
  16837. }
  16838. loadTd(path) {
  16839. if (this.tdResMap[path]) {
  16840. this.onLoad();
  16841. return;
  16842. }
  16843. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16844. if (res) {
  16845. this.tdResMap[path] = res;
  16846. this.onLoad();
  16847. }
  16848. else
  16849. console.log("load res fail:" + path);
  16850. }));
  16851. }
  16852. onLoad() {
  16853. this.loadCount++;
  16854. this.onProgress(1);
  16855. if (this.loadCount >= this.resCount) {
  16856. this.completrCall.run();
  16857. }
  16858. }
  16859. onProgress(pro) {
  16860. let progress = (this.loadCount + pro) / this.resCount;
  16861. this.progressCall.runWith(progress);
  16862. }
  16863. }
  16864. var Handler$2 = Laya.Handler;
  16865. class ResInfo {
  16866. constructor() {
  16867. this.index = 0;
  16868. }
  16869. }
  16870. class ResMgr {
  16871. constructor() {
  16872. this.resList = [];
  16873. this.doneList = [];
  16874. this.resMap = {};
  16875. this.currentLoad = null;
  16876. this.completeHandler = new Handler$2(this, this.onComplete);
  16877. this.progressHandler = new Handler$2(this, this.onProgress);
  16878. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16879. }
  16880. static getInstance() {
  16881. if (ResMgr._instance == null) {
  16882. ResMgr._instance = new ResMgr();
  16883. }
  16884. return ResMgr._instance;
  16885. }
  16886. loadList(list, completeHandler, progressHandler) {
  16887. if (list.length < 1) {
  16888. completeHandler.run();
  16889. return;
  16890. }
  16891. let info = this.getResInfo();
  16892. info.resList = list;
  16893. info.completeHandler = completeHandler;
  16894. info.progressHandler = progressHandler;
  16895. this.resList.push(info);
  16896. this.startLoad();
  16897. }
  16898. loadFguiRes(list, completeHandler, progressHandler) {
  16899. Laya.loader.load(list, completeHandler, progressHandler);
  16900. }
  16901. loadAny(list, completeHandler, progressHandler) {
  16902. Laya.loader.load(list, completeHandler, progressHandler);
  16903. }
  16904. load(path, completeHandler, progressHandler) {
  16905. let count = this.resMap[path];
  16906. if (count && count > 0) {
  16907. if (completeHandler)
  16908. completeHandler.run();
  16909. }
  16910. else
  16911. this.loadList([path], completeHandler, progressHandler);
  16912. }
  16913. getRes(path) {
  16914. let res = this.resMap[path];
  16915. if (!res)
  16916. this.showLog("资源不存在:" + path);
  16917. else
  16918. return this.loader.getRes(path);
  16919. }
  16920. clearList(list, force = false) {
  16921. if (!list || list.length < 1)
  16922. return;
  16923. let cr = () => {
  16924. for (const k in list) {
  16925. let v = list[k];
  16926. if (!v)
  16927. continue;
  16928. if (force) {
  16929. this.loader.clearRes(v);
  16930. delete this.resMap[v];
  16931. }
  16932. else {
  16933. let count = this.resMap[v];
  16934. if (count && count > 1) {
  16935. count--;
  16936. this.resMap[v] = count;
  16937. }
  16938. else {
  16939. this.loader.clearRes(v);
  16940. delete this.resMap[v];
  16941. }
  16942. }
  16943. }
  16944. if (!window.hasOwnProperty("ks"))
  16945. Laya.Resource.destroyUnusedResources();
  16946. };
  16947. Laya.timer.clearAll(this);
  16948. Laya.timer.once(2000, this, cr);
  16949. }
  16950. clear3D() {
  16951. for (const k in this.loader.tdResMap) {
  16952. this.loader.clearRes(k);
  16953. if (this.resMap[k])
  16954. delete this.resMap[k];
  16955. }
  16956. if (!window.hasOwnProperty("ks"))
  16957. Laya.Resource.destroyUnusedResources();
  16958. }
  16959. clear(path, force = false) {
  16960. this.clearList([path], force);
  16961. }
  16962. getResInfo() {
  16963. if (this.doneList.length > 0)
  16964. return this.doneList.pop();
  16965. else
  16966. return new ResInfo();
  16967. }
  16968. startLoad() {
  16969. if (this.currentLoad)
  16970. return;
  16971. this.currentLoad = this.resList.pop();
  16972. if (this.currentLoad) {
  16973. this.loader.load(this.currentLoad.resList);
  16974. }
  16975. }
  16976. onComplete() {
  16977. if (!this.currentLoad)
  16978. return;
  16979. for (const k in this.currentLoad.resList) {
  16980. let v = this.currentLoad.resList[k];
  16981. let count = this.resMap[v];
  16982. if (count)
  16983. count++;
  16984. else
  16985. count = 1;
  16986. this.resMap[v] = count;
  16987. }
  16988. if (this.currentLoad.completeHandler)
  16989. this.currentLoad.completeHandler.run();
  16990. this.doneList.push(this.currentLoad);
  16991. this.currentLoad = null;
  16992. this.startLoad();
  16993. }
  16994. onProgress(pro) {
  16995. if (!this.currentLoad)
  16996. return;
  16997. if (this.currentLoad.progressHandler)
  16998. this.currentLoad.progressHandler.runWith(pro);
  16999. }
  17000. showLog(str, ...args) {
  17001. console.log("[ResLoader] " + str);
  17002. }
  17003. }
  17004. ResMgr._instance = null;
  17005. class EventMgr extends Laya.EventDispatcher {
  17006. }
  17007. let eventMgr = new EventMgr();
  17008. /*! *****************************************************************************
  17009. Copyright (c) Microsoft Corporation. All rights reserved.
  17010. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17011. this file except in compliance with the License. You may obtain a copy of the
  17012. License at http://www.apache.org/licenses/LICENSE-2.0
  17013. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17014. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17015. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17016. MERCHANTABLITY OR NON-INFRINGEMENT.
  17017. See the Apache Version 2.0 License for specific language governing permissions
  17018. and limitations under the License.
  17019. ***************************************************************************** */
  17020. /* global Reflect, Promise */
  17021. var extendStatics = function(d, b) {
  17022. extendStatics = Object.setPrototypeOf ||
  17023. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17024. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17025. return extendStatics(d, b);
  17026. };
  17027. function __extends(d, b) {
  17028. extendStatics(d, b);
  17029. function __() { this.constructor = d; }
  17030. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17031. }
  17032. var __assign = function() {
  17033. __assign = Object.assign || function __assign(t) {
  17034. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17035. s = arguments[i];
  17036. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17037. }
  17038. return t;
  17039. };
  17040. return __assign.apply(this, arguments);
  17041. };
  17042. function __rest(s, e) {
  17043. var t = {};
  17044. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17045. t[p] = s[p];
  17046. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17047. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17048. t[p[i]] = s[p[i]];
  17049. return t;
  17050. }
  17051. function __decorate(decorators, target, key, desc) {
  17052. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17053. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17054. 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;
  17055. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17056. }
  17057. function __param(paramIndex, decorator) {
  17058. return function (target, key) { decorator(target, key, paramIndex); }
  17059. }
  17060. function __metadata(metadataKey, metadataValue) {
  17061. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17062. }
  17063. function __awaiter(thisArg, _arguments, P, generator) {
  17064. return new (P || (P = Promise))(function (resolve, reject) {
  17065. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17066. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17067. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17068. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17069. });
  17070. }
  17071. function __generator(thisArg, body) {
  17072. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17073. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17074. function verb(n) { return function (v) { return step([n, v]); }; }
  17075. function step(op) {
  17076. if (f) throw new TypeError("Generator is already executing.");
  17077. while (_) try {
  17078. 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;
  17079. if (y = 0, t) op = [op[0] & 2, t.value];
  17080. switch (op[0]) {
  17081. case 0: case 1: t = op; break;
  17082. case 4: _.label++; return { value: op[1], done: false };
  17083. case 5: _.label++; y = op[1]; op = [0]; continue;
  17084. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17085. default:
  17086. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17087. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17088. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17089. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17090. if (t[2]) _.ops.pop();
  17091. _.trys.pop(); continue;
  17092. }
  17093. op = body.call(thisArg, _);
  17094. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17095. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17096. }
  17097. }
  17098. function __exportStar(m, exports) {
  17099. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17100. }
  17101. function __values(o) {
  17102. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17103. if (m) return m.call(o);
  17104. return {
  17105. next: function () {
  17106. if (o && i >= o.length) o = void 0;
  17107. return { value: o && o[i++], done: !o };
  17108. }
  17109. };
  17110. }
  17111. function __read(o, n) {
  17112. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17113. if (!m) return o;
  17114. var i = m.call(o), r, ar = [], e;
  17115. try {
  17116. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17117. }
  17118. catch (error) { e = { error: error }; }
  17119. finally {
  17120. try {
  17121. if (r && !r.done && (m = i["return"])) m.call(i);
  17122. }
  17123. finally { if (e) throw e.error; }
  17124. }
  17125. return ar;
  17126. }
  17127. function __spread() {
  17128. for (var ar = [], i = 0; i < arguments.length; i++)
  17129. ar = ar.concat(__read(arguments[i]));
  17130. return ar;
  17131. }
  17132. function __await(v) {
  17133. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17134. }
  17135. function __asyncGenerator(thisArg, _arguments, generator) {
  17136. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17137. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17138. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17139. 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); }); }; }
  17140. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17141. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17142. function fulfill(value) { resume("next", value); }
  17143. function reject(value) { resume("throw", value); }
  17144. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17145. }
  17146. function __asyncDelegator(o) {
  17147. var i, p;
  17148. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17149. 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; }
  17150. }
  17151. function __asyncValues(o) {
  17152. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17153. var m = o[Symbol.asyncIterator], i;
  17154. 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);
  17155. 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); }); }; }
  17156. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17157. }
  17158. function __makeTemplateObject(cooked, raw) {
  17159. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17160. return cooked;
  17161. };
  17162. function __importStar(mod) {
  17163. if (mod && mod.__esModule) return mod;
  17164. var result = {};
  17165. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17166. result.default = mod;
  17167. return result;
  17168. }
  17169. function __importDefault(mod) {
  17170. return (mod && mod.__esModule) ? mod : { default: mod };
  17171. }
  17172. class CustomAlert {
  17173. static show(title, content, buttons) {
  17174. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17175. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17176. return;
  17177. }
  17178. const bg = new Laya.Box();
  17179. bg.alpha = 0;
  17180. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17181. Laya.stage.addChild(bg);
  17182. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17183. const panel = new Laya.Box();
  17184. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17185. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17186. bg.addChild(panel);
  17187. const titleText = new Laya.Text();
  17188. titleText.text = title;
  17189. titleText.fontSize = 32;
  17190. titleText.color = "#333333";
  17191. titleText.bold = true;
  17192. titleText.pos(20, 20);
  17193. titleText.width = 360;
  17194. titleText.align = "center";
  17195. panel.addChild(titleText);
  17196. const contentText = new Laya.Text();
  17197. contentText.text = content;
  17198. contentText.fontSize = 21;
  17199. contentText.color = "#555555";
  17200. contentText.pos(20, 70);
  17201. contentText.width = 360;
  17202. contentText.wordWrap = true;
  17203. contentText.align = "center";
  17204. panel.addChild(contentText);
  17205. const buttonContainer = new Laya.Box();
  17206. buttonContainer.pos(20, 160);
  17207. panel.addChild(buttonContainer);
  17208. const btnWidth = 120;
  17209. const spacing = 30;
  17210. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17211. buttons.forEach((btn, index) => {
  17212. const button = new Laya.Button();
  17213. button.label = btn.label;
  17214. button.size(btnWidth, 40);
  17215. button.labelSize = 22;
  17216. button.pos(index * (btnWidth + spacing), 0);
  17217. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17218. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17219. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17220. button.alpha = 0.9;
  17221. });
  17222. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17223. button.alpha = 1;
  17224. });
  17225. button.on(Laya.Event.CLICK, this, () => {
  17226. btn.handler();
  17227. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17228. bg.removeSelf();
  17229. }));
  17230. });
  17231. buttonContainer.addChild(button);
  17232. });
  17233. buttonContainer.x = (panel.width - totalWidth) / 2;
  17234. }
  17235. }
  17236. class ConfigMgr {
  17237. constructor() {
  17238. this.httpReqCount = 4;
  17239. this.httpReqOkCount = 0;
  17240. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17241. try {
  17242. this.httpReqOkCount = 0;
  17243. let reqData = xGame.httpMgr.getReqData();
  17244. console.log('zh:第1个请求getClassicCfg');
  17245. const classicCfg = yield this.sendPostAsync('getClassicCfg', reqData);
  17246. this.classicCfg = classicCfg;
  17247. this.httpReqOkCount++;
  17248. console.log('zh:第2个请求getLevelCfg');
  17249. const levelCfg = yield this.sendPostAsync('getLevelCfg', reqData);
  17250. this.levelCfg = levelCfg;
  17251. this.httpReqOkCount++;
  17252. console.log('zh:第3个请求 getPlaceBallCfg');
  17253. const placeBallCfg = yield this.sendPostAsync('getPlaceBallCfg', reqData);
  17254. this.placeBallCfg = placeBallCfg;
  17255. this.httpReqOkCount++;
  17256. console.log('zh:第4个请求 npc');
  17257. const npc = yield this.sendPostAsync('getNpc', reqData);
  17258. this.npcJson = npc.Data;
  17259. this.httpReqOkCount++;
  17260. console.log('zh:所有配置加载完成');
  17261. }
  17262. catch (error) {
  17263. console.error('❌请求失败:', error);
  17264. Laya.timer.once(500, this, () => {
  17265. console.log('zh:✅重新尝试加载网络资源');
  17266. xGame.cfgMgr.getConfigFromServer();
  17267. });
  17268. }
  17269. finally {
  17270. if (this.httpReqCount > this.httpReqOkCount) {
  17271. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17272. {
  17273. label: "Okay", handler: () => {
  17274. console.log("zh:好的知道了");
  17275. JSBridgeUtils.instance.exitAndCloseGame();
  17276. }
  17277. }
  17278. ]);
  17279. }
  17280. }
  17281. });
  17282. this.sendPostAsync = (action, reqData) => {
  17283. return new Promise((resolve, reject) => {
  17284. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17285. try {
  17286. let code = res.code;
  17287. if (code == 200) {
  17288. const parsedData = JSON.parse(res.msg);
  17289. resolve(parsedData);
  17290. }
  17291. else {
  17292. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17293. reject(new Error(`Request failed with code: ${code}`));
  17294. }
  17295. }
  17296. catch (error) {
  17297. console.error(`ERROR=${error}`);
  17298. alert("Please check your network connection.");
  17299. reject(error);
  17300. }
  17301. finally {
  17302. console.log(`zh:${action}的请求处理完毕`);
  17303. }
  17304. });
  17305. });
  17306. };
  17307. }
  17308. static getInstance() {
  17309. if (!this._instance) {
  17310. this._instance = new ConfigMgr();
  17311. }
  17312. return this._instance;
  17313. }
  17314. init() {
  17315. this.getConfigFromServer();
  17316. }
  17317. test() {
  17318. let reqData = xGame.httpMgr.getReqData();
  17319. xGame.httpMgr.sendPost2025('getClassicCfg', reqData, (res) => {
  17320. console.log('zh:1s');
  17321. try {
  17322. let code = res.code;
  17323. let data = res.data;
  17324. if (code == 200) {
  17325. const parsedData = JSON.parse(data);
  17326. this.classicCfg = parsedData;
  17327. }
  17328. else {
  17329. console.log('zh:res = ' + JSON.stringify(res));
  17330. }
  17331. }
  17332. catch (error) {
  17333. console.log('error=' + error);
  17334. alert("Please check your network connection.");
  17335. }
  17336. finally {
  17337. console.log('zh:1');
  17338. }
  17339. });
  17340. }
  17341. getUserInfoByIndex(index) {
  17342. return this.npcJson[index];
  17343. }
  17344. getRandomUserInfo() {
  17345. let index = xGame.tools.random(0, this.npcJson.length);
  17346. let rs = this.npcJson[index];
  17347. return rs;
  17348. }
  17349. getMaxBigMoveLength() {
  17350. return Object.keys(this.levelCfg).length;
  17351. }
  17352. getBigMoveLevelByIndex(index) {
  17353. let cfg = this.levelCfg;
  17354. cfg = cfg[index];
  17355. return cfg;
  17356. }
  17357. getRandomClassicLevel() {
  17358. let cfg = this.classicCfg;
  17359. let num = Object.keys(cfg).length;
  17360. let rand = xGame.common.randomNum(1, num);
  17361. return cfg[rand];
  17362. }
  17363. getPlaceBallByLevel(level) {
  17364. return this.placeBallCfg[level];
  17365. }
  17366. getMaxPlaceBall() {
  17367. return Object.keys(this.placeBallCfg).length;
  17368. }
  17369. }
  17370. class PoolD3Mgr {
  17371. constructor() {
  17372. this.pool = {};
  17373. }
  17374. static get ins() {
  17375. return this._ins || (this._ins = new PoolD3Mgr);
  17376. }
  17377. createList(key, prefab, parent) {
  17378. if (!this.pool[key]) {
  17379. this.pool[key] = {};
  17380. this.pool[key].prefab = prefab;
  17381. this.pool[key].list = [];
  17382. this.pool[key].parent = parent;
  17383. }
  17384. }
  17385. getItem(key) {
  17386. if (!this.pool[key]) {
  17387. return;
  17388. }
  17389. let temp;
  17390. if (this.pool[key].list.length > 0) {
  17391. temp = this.pool[key].list.pop();
  17392. }
  17393. else {
  17394. temp = this.pool[key].prefab.clone();
  17395. if (this.pool[key].parent) {
  17396. this.pool[key].parent.addChild(temp);
  17397. }
  17398. }
  17399. temp.active = true;
  17400. return temp;
  17401. }
  17402. putItem(key, obj) {
  17403. if (!this.pool[key]) {
  17404. return;
  17405. }
  17406. obj.active = false;
  17407. this.pool[key].list.push(obj);
  17408. }
  17409. }
  17410. let context$1 = context;
  17411. let uiMgr = UIMgr.inst;
  17412. let soundMgr = SoundMgr.getInstance();
  17413. let resMgr = ResMgr.getInstance();
  17414. let httpMgr = HttpMgr.getInstance();
  17415. let common = Common.getInstance();
  17416. let cfgMgr = ConfigMgr.getInstance();
  17417. let poolD3Mgr = PoolD3Mgr.ins;
  17418. let d3TexUrl = "res/d3Res/";
  17419. let d3ModeUrl = "res/unityRes/";
  17420. function setStageSize(view) {
  17421. if (view.width) {
  17422. view.width = Laya.stage.width;
  17423. view.height = Laya.stage.height;
  17424. }
  17425. }
  17426. function filledBg(view) {
  17427. let wh = Laya.stage.height / Laya.stage.width;
  17428. if (wh > 16 / 9) {
  17429. view.height = Laya.stage.height;
  17430. view.width = Laya.stage.height / 1334 * 750;
  17431. }
  17432. else {
  17433. view.width = Laya.stage.width;
  17434. view.height = Laya.stage.width / 750 * 1334;
  17435. }
  17436. }
  17437. function setNotch(view) {
  17438. if (view.height) {
  17439. view.y += context$1.notchHeight;
  17440. }
  17441. }
  17442. function showTip(str) {
  17443. uiMgr.Show(UIMsg, str);
  17444. }
  17445. function log(...args) {
  17446. console.log(args);
  17447. }
  17448. let xGame = {
  17449. context: context$1,
  17450. eventMgr,
  17451. resMgr,
  17452. uiMgr,
  17453. soundMgr,
  17454. define,
  17455. tools,
  17456. httpMgr,
  17457. d3TexUrl,
  17458. d3ModeUrl,
  17459. common,
  17460. cfgMgr,
  17461. poolD3Mgr,
  17462. setStageSize,
  17463. filledBg,
  17464. setNotch,
  17465. showTip,
  17466. log,
  17467. };
  17468. window["xGame"] = xGame;
  17469. let dataName = 'tBall_';
  17470. class UserData {
  17471. constructor() {
  17472. this.userId = "";
  17473. this.isAgree = false;
  17474. this.coinNum = 0;
  17475. this.gemNum = 0;
  17476. this.sound = true;
  17477. this.vibration = true;
  17478. this.currentDate = 0;
  17479. this.createTime = 0;
  17480. this.awardTime = 0;
  17481. this.roleId = 1;
  17482. this.roleList = [];
  17483. this.roleAds = [];
  17484. this.dressId = 101;
  17485. this.itemId = 201;
  17486. this.bigSkills = [1, 1, 1, 1, 1];
  17487. this.coin = 4000;
  17488. this.diamond = 0;
  17489. this.skillSuccessTimes = 0;
  17490. this.skillGuide = 0;
  17491. this.skillAccTimes = 0;
  17492. this.placeBallData = [];
  17493. this.shareDiamondTimes = 0;
  17494. this.dailyVideoShareTimes = 0;
  17495. this.secretary = [1, 0];
  17496. this.curSecretary = 0;
  17497. this.ballRod = [1, 0, 0, 0, 0, 1];
  17498. this.curBallRod = 5;
  17499. this.signData = 0;
  17500. this.signTime = 0;
  17501. this.drawTimes = 0;
  17502. this.drawAwardTimes = 0;
  17503. this.dailyfreeDrawTimes = 1;
  17504. this.power = 5;
  17505. this.powerTime = 0;
  17506. this.challengeTimes = 0;
  17507. this.extraSign = 0;
  17508. this.classicTimes = 0;
  17509. this.guideHelpLine = 0;
  17510. this.newUser = true;
  17511. this.rootBallFoul = 0;
  17512. this.timeoutFoul = 0;
  17513. this.roleList = [1];
  17514. }
  17515. saveData() {
  17516. let data = {};
  17517. for (let k in this) {
  17518. data[k.toString()] = this[k];
  17519. }
  17520. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17521. }
  17522. getData() {
  17523. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17524. if (ld) {
  17525. let localData = JSON.parse(ld);
  17526. if (localData) {
  17527. for (let k in this) {
  17528. let key = k.toString();
  17529. let data = localData[key];
  17530. if (data != undefined) {
  17531. this[k] = data;
  17532. }
  17533. }
  17534. }
  17535. }
  17536. }
  17537. }
  17538. class ItemData {
  17539. constructor() {
  17540. this.itemList = {};
  17541. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17542. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17543. }
  17544. saveData() {
  17545. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17546. }
  17547. getData() {
  17548. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17549. if (ld) {
  17550. let localData = JSON.parse(ld);
  17551. if (localData) {
  17552. this.itemList = localData;
  17553. }
  17554. }
  17555. }
  17556. }
  17557. class GameData {
  17558. constructor() {
  17559. this.curLevel = 0;
  17560. this.gameType = 1;
  17561. this.signIdx = 0;
  17562. this.signMax = 0;
  17563. this.rotaryTime = 0;
  17564. this.rotaryCount = 0;
  17565. this.rotaryList = [];
  17566. this.diyCount = 3;
  17567. this.awardIdx = 0;
  17568. this.shareNum = 2;
  17569. this.rankWeek = 0;
  17570. this.rankScore = 0;
  17571. this.gameCount = 0;
  17572. this.trySkill = -1;
  17573. this.tryTime = 0;
  17574. }
  17575. saveData() {
  17576. let data = {};
  17577. for (let k in this) {
  17578. data[k.toString()] = this[k];
  17579. }
  17580. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17581. }
  17582. getData() {
  17583. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17584. if (ld) {
  17585. let localData = JSON.parse(ld);
  17586. if (localData) {
  17587. for (let k in this) {
  17588. let key = k.toString();
  17589. let data = localData[key];
  17590. if (data != undefined) {
  17591. this[k] = data;
  17592. }
  17593. }
  17594. }
  17595. }
  17596. }
  17597. }
  17598. class Diy2025GameData {
  17599. constructor() {
  17600. this.challengeMode_overLev = 0;
  17601. this.xszyForClassic = false;
  17602. this.xszyForChallenge = false;
  17603. }
  17604. saveData() {
  17605. let data = {};
  17606. for (let k in this) {
  17607. data[k.toString()] = this[k];
  17608. }
  17609. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17610. }
  17611. getData() {
  17612. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17613. if (ld) {
  17614. let localData = JSON.parse(ld);
  17615. if (localData) {
  17616. for (let k in this) {
  17617. let key = k.toString();
  17618. let data = localData[key];
  17619. if (data != undefined) {
  17620. this[k] = data;
  17621. }
  17622. }
  17623. }
  17624. }
  17625. }
  17626. }
  17627. class DataMgr {
  17628. static Init() {
  17629. this.userData = new UserData();
  17630. this.gameData = new GameData();
  17631. this.itemData = new ItemData();
  17632. this.diyGameData = new Diy2025GameData();
  17633. this.userData.getData();
  17634. this.gameData.getData();
  17635. this.itemData.getData();
  17636. this.diyGameData.getData();
  17637. this.roleId = this.userData.roleId;
  17638. this.resetUse();
  17639. }
  17640. static isNewDay() {
  17641. Moyu.isNewDay(this, (isnew) => {
  17642. xGame.common.isNewDay = isnew;
  17643. if (!isnew)
  17644. return;
  17645. DataMgr.setShareDiamondTimes(0, false);
  17646. DataMgr.setDailyVideoShareTimes(0, false);
  17647. DataMgr.setDailyfreeDrawTimes(1);
  17648. DataMgr.setExtraSign(0);
  17649. });
  17650. }
  17651. static deletData() {
  17652. Laya.LocalStorage.clear();
  17653. }
  17654. static upRankData() {
  17655. let num = xGame.common.getAllStarNum();
  17656. if (num > 0)
  17657. Moyu.upRankData(xGame.common.curRankID, num);
  17658. }
  17659. static addItem(id, count = 1) {
  17660. let v = this.itemData.itemList[id];
  17661. if (!v)
  17662. v = { id: id, count: count, adnum: 0, active: true };
  17663. else {
  17664. if (v.active) {
  17665. v.count += count;
  17666. }
  17667. else {
  17668. v.count = count;
  17669. v.active = true;
  17670. }
  17671. }
  17672. this.itemData.itemList[id] = v;
  17673. xGame.soundMgr.playGetSound();
  17674. this.saveItemData();
  17675. }
  17676. static hasItem(id) {
  17677. let v = this.itemData.itemList[id];
  17678. if (v && v.active)
  17679. return true;
  17680. return false;
  17681. }
  17682. static getItem(id) {
  17683. let v = this.itemData.itemList[id];
  17684. return v;
  17685. }
  17686. static getItemCount(id) {
  17687. let v = this.itemData.itemList[id];
  17688. if (v && v.active)
  17689. return v.count;
  17690. return 0;
  17691. }
  17692. static getItemAd(id) {
  17693. let v = this.itemData.itemList[id];
  17694. if (v) {
  17695. return v.adnum;
  17696. }
  17697. return 0;
  17698. }
  17699. static onItemAd(id, num = 1) {
  17700. let v = this.itemData.itemList[id];
  17701. if (!v)
  17702. v = { id: id, count: 1, adnum: num, active: false };
  17703. else
  17704. v.adnum += num;
  17705. this.itemData.itemList[id] = v;
  17706. this.saveItemData();
  17707. }
  17708. static costItem(id, count) {
  17709. let v = this.itemData.itemList[id];
  17710. if (v && v.active) {
  17711. if (v.count < count)
  17712. return false;
  17713. else {
  17714. v.count -= count;
  17715. this.itemData.itemList[id] = v;
  17716. return true;
  17717. }
  17718. }
  17719. return false;
  17720. }
  17721. static resetUse() {
  17722. this.dressId = this.userData.dressId;
  17723. this.itemId = this.userData.itemId;
  17724. }
  17725. static passLevel() {
  17726. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17727. this.gameData.curLevel++;
  17728. this.curLevel = this.gameData.curLevel;
  17729. this.saveGameData();
  17730. }
  17731. static useRole(id) {
  17732. this.roleId = id;
  17733. if (this.hasRole(id)) {
  17734. this.userData.roleId = id;
  17735. this.saveUserData();
  17736. }
  17737. }
  17738. static addRole(id) {
  17739. if (this.hasRole(id))
  17740. return;
  17741. this.userData.roleList.push(id);
  17742. this.saveUserData();
  17743. }
  17744. static hasRole(id) {
  17745. return this.userData.roleList.indexOf(id) >= 0;
  17746. }
  17747. static gemEnough(num) {
  17748. return this.userData.gemNum >= num;
  17749. }
  17750. static roleHasAd(id) {
  17751. let count = this.userData.roleAds[id];
  17752. if (count != undefined && count >= 0)
  17753. return true;
  17754. else
  17755. return false;
  17756. }
  17757. static saveUserData(time = 500, event, arg) {
  17758. if (this.userSaving)
  17759. return;
  17760. this.userSaving = true;
  17761. Laya.timer.once(time, this, () => {
  17762. this.userSaving = false;
  17763. this.userData.saveData();
  17764. if (event)
  17765. xGame.eventMgr.event(event, arg);
  17766. });
  17767. }
  17768. static saveGameData() {
  17769. if (this.gameSaving)
  17770. return;
  17771. this.gameSaving = true;
  17772. Laya.timer.once(1000, this, () => {
  17773. this.gameSaving = false;
  17774. this.gameData.saveData();
  17775. });
  17776. }
  17777. static saveItemData() {
  17778. let fun = () => {
  17779. this.itemData.saveData();
  17780. };
  17781. Laya.timer.clear(this, fun);
  17782. Laya.timer.once(500, this, fun);
  17783. }
  17784. static saveData() {
  17785. this.saveUserData();
  17786. this.saveGameData();
  17787. }
  17788. static getBigSkillList() {
  17789. return this.userData.bigSkills;
  17790. }
  17791. static getBigSkillByIndex(index) {
  17792. return this.userData.bigSkills[index];
  17793. }
  17794. static setBigSkill(index, val, addUp = true) {
  17795. if (addUp) {
  17796. this.userData.bigSkills[index] += val;
  17797. }
  17798. else {
  17799. this.userData.bigSkills[index] = val;
  17800. }
  17801. this.saveUserData();
  17802. }
  17803. static coinEnough(need) {
  17804. if (typeof need != "number") {
  17805. console.error("金币格式错误");
  17806. return;
  17807. }
  17808. return this.userData.coin >= need;
  17809. }
  17810. static setCoin(val) {
  17811. if (typeof val != "number") {
  17812. return;
  17813. }
  17814. this.userData.coin += val;
  17815. this.saveUserData();
  17816. xGame.eventMgr.event(COIN_CHANGE);
  17817. }
  17818. static getCoin() {
  17819. return this.userData.coin;
  17820. }
  17821. static diamondEnough(need) {
  17822. if (typeof need != "number") {
  17823. console.error("金币格式错误");
  17824. return;
  17825. }
  17826. return this.userData.diamond >= need;
  17827. }
  17828. static setDiamond(val) {
  17829. if (typeof val != "number") {
  17830. return;
  17831. }
  17832. this.userData.diamond += val;
  17833. this.saveUserData();
  17834. xGame.eventMgr.event(DIAMOND_CHANGE);
  17835. }
  17836. static getDiamond() {
  17837. return this.userData.diamond;
  17838. }
  17839. static getSkillSuccessTimes() {
  17840. return this.userData.skillSuccessTimes;
  17841. }
  17842. static setSkillSuccessTimes(val, addUp = true) {
  17843. if (addUp)
  17844. this.userData.skillSuccessTimes += val;
  17845. else
  17846. this.userData.skillSuccessTimes = val;
  17847. this.saveUserData();
  17848. }
  17849. static getSkillAccTimes() {
  17850. return this.userData.skillAccTimes;
  17851. }
  17852. static setSkillAccTimes(val) {
  17853. this.userData.skillAccTimes += val;
  17854. this.saveUserData();
  17855. }
  17856. static getSkillGuide() {
  17857. if (!xGame.common.openGuide) {
  17858. return 1;
  17859. }
  17860. return this.userData.skillGuide;
  17861. }
  17862. static setSkillGuide(val) {
  17863. this.userData.skillGuide = val;
  17864. this.saveUserData();
  17865. }
  17866. static getPlaceBallLevelList() {
  17867. return this.userData.placeBallData;
  17868. }
  17869. static getPlaceBallLevel(level) {
  17870. let arr = this.userData.placeBallData;
  17871. let index = level - 1;
  17872. let out;
  17873. if (arr[index]) {
  17874. out = arr[index];
  17875. }
  17876. else {
  17877. let max = arr.length;
  17878. if (max == index) {
  17879. out = {
  17880. star: 0,
  17881. play: true,
  17882. isCur: true,
  17883. getAward: false
  17884. };
  17885. }
  17886. else {
  17887. out = {
  17888. star: 0,
  17889. play: false,
  17890. getAward: false
  17891. };
  17892. }
  17893. }
  17894. return out;
  17895. }
  17896. static setPlaceBallLevel(level, star) {
  17897. let arr = this.userData.placeBallData;
  17898. let index = level - 1;
  17899. if (arr[index]) {
  17900. arr[index].star = Math.max(arr[index].star, star);
  17901. }
  17902. else {
  17903. let max = arr.length;
  17904. if (max == index) {
  17905. arr.push({
  17906. star: star,
  17907. play: true,
  17908. getAward: false
  17909. });
  17910. }
  17911. else {
  17912. console.error("关卡存储出错");
  17913. }
  17914. }
  17915. this.saveUserData();
  17916. }
  17917. static setPlaceBallAward(level) {
  17918. let arr = this.userData.placeBallData;
  17919. let index = level - 1;
  17920. if (arr[index]) {
  17921. arr[index].getAward = true;
  17922. }
  17923. this.saveUserData();
  17924. }
  17925. static getShareDiamondTimes() {
  17926. return this.userData.shareDiamondTimes;
  17927. }
  17928. static setShareDiamondTimes(val, addUp = true) {
  17929. if (addUp) {
  17930. this.userData.shareDiamondTimes += val;
  17931. }
  17932. else {
  17933. this.userData.shareDiamondTimes = val;
  17934. }
  17935. this.saveUserData();
  17936. }
  17937. static getDailyVideoShareTimes() {
  17938. return this.userData.dailyVideoShareTimes;
  17939. }
  17940. static setDailyVideoShareTimes(val, addUp = true) {
  17941. if (addUp) {
  17942. this.userData.dailyVideoShareTimes += val;
  17943. }
  17944. else {
  17945. this.userData.dailyVideoShareTimes = val;
  17946. }
  17947. this.saveUserData();
  17948. }
  17949. static getSecretary(index) {
  17950. return this.userData.secretary[index];
  17951. }
  17952. static setSecretary(index, val) {
  17953. this.userData.secretary[index] = val;
  17954. this.saveUserData();
  17955. }
  17956. static getCurSecretary() {
  17957. return this.userData.curSecretary;
  17958. }
  17959. static setCurSecretary(index) {
  17960. this.userData.curSecretary = index;
  17961. this.saveUserData();
  17962. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  17963. }
  17964. static getBallRod(index) {
  17965. return this.userData.ballRod[index];
  17966. }
  17967. static setBallRod(index, val) {
  17968. this.userData.ballRod[index] = val;
  17969. this.saveUserData();
  17970. }
  17971. static getCurBallRod() {
  17972. return this.userData.curBallRod;
  17973. }
  17974. static setCurBallRod(index) {
  17975. this.userData.curBallRod = index;
  17976. this.saveUserData();
  17977. }
  17978. static setSignData(val) {
  17979. this.userData.signData = val;
  17980. this.saveUserData();
  17981. }
  17982. static getSignData() {
  17983. return this.userData.signData;
  17984. }
  17985. static setSignTime(val) {
  17986. this.userData.signTime = val;
  17987. this.saveUserData();
  17988. }
  17989. static getSignTime() {
  17990. return this.userData.signTime;
  17991. }
  17992. static getDrawTimes() {
  17993. return this.userData.drawTimes;
  17994. }
  17995. static setDrawTimes(val, addUp = true) {
  17996. if (addUp) {
  17997. this.userData.drawTimes += val;
  17998. }
  17999. else {
  18000. this.userData.drawTimes = val;
  18001. }
  18002. this.saveUserData();
  18003. }
  18004. static getDrawAwardTimes() {
  18005. return this.userData.drawAwardTimes;
  18006. }
  18007. static setDrawAwardTimes(val) {
  18008. this.userData.drawAwardTimes = val;
  18009. this.saveUserData();
  18010. }
  18011. static getDailyfreeDrawTimes() {
  18012. return this.userData.dailyfreeDrawTimes;
  18013. }
  18014. static setDailyfreeDrawTimes(val) {
  18015. this.userData.dailyfreeDrawTimes = val;
  18016. this.saveUserData();
  18017. }
  18018. static setPower(val, addUp = true) {
  18019. if (addUp)
  18020. this.userData.power += val;
  18021. else
  18022. this.userData.power = val;
  18023. if (this.userData.power >= xGame.common.maxPower) {
  18024. this.userData.power = xGame.common.maxPower;
  18025. }
  18026. xGame.eventMgr.event(POWER_CHANGE, val);
  18027. this.saveUserData();
  18028. }
  18029. static getPower() {
  18030. return this.userData.power;
  18031. }
  18032. static setPowerTime(val) {
  18033. this.userData.powerTime = val;
  18034. this.saveUserData();
  18035. }
  18036. static getPowerTime() {
  18037. return this.userData.powerTime;
  18038. }
  18039. static powerEnough() {
  18040. return this.getPower() > 0;
  18041. }
  18042. static getChallengeTimes() {
  18043. return this.userData.challengeTimes;
  18044. }
  18045. static setChallengeTimes(val) {
  18046. this.userData.challengeTimes += val;
  18047. this.saveUserData();
  18048. }
  18049. static getExtraSign() {
  18050. return this.userData.extraSign;
  18051. }
  18052. static setExtraSign(val) {
  18053. this.userData.extraSign = val;
  18054. this.saveUserData();
  18055. }
  18056. static getClassicTimes() {
  18057. return this.userData.classicTimes;
  18058. }
  18059. static setClassicTimes() {
  18060. this.userData.classicTimes += 1;
  18061. this.saveUserData();
  18062. }
  18063. static getGuideHelpLine() {
  18064. return this.userData.guideHelpLine;
  18065. }
  18066. static setGuideHelpLine() {
  18067. this.userData.guideHelpLine = 1;
  18068. this.saveUserData();
  18069. }
  18070. static getNewUser() {
  18071. return this.userData.newUser;
  18072. }
  18073. static setNewUser() {
  18074. this.userData.newUser = false;
  18075. this.saveUserData();
  18076. }
  18077. static getRootBallFoul() {
  18078. return this.userData.rootBallFoul;
  18079. }
  18080. static setRootBallFoul() {
  18081. this.userData.rootBallFoul = 1;
  18082. this.saveUserData();
  18083. }
  18084. static getTimeoutFoul() {
  18085. return this.userData.timeoutFoul;
  18086. }
  18087. static setTimeoutFoul() {
  18088. this.userData.timeoutFoul = 1;
  18089. this.saveUserData();
  18090. }
  18091. static saveDiyGameData() {
  18092. if (this.diyGameSaving)
  18093. return;
  18094. this.diyGameSaving = true;
  18095. Laya.timer.once(500, this, () => {
  18096. this.diyGameSaving = false;
  18097. this.diyGameData.saveData();
  18098. });
  18099. }
  18100. static getChallengeMode_overLev() {
  18101. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18102. return this.challengeMode_overLev;
  18103. }
  18104. static setChallengeMode_overLev(levNum) {
  18105. this.diyGameData.challengeMode_overLev = levNum;
  18106. this.saveDiyGameData();
  18107. }
  18108. }
  18109. DataMgr.isNewUser = false;
  18110. DataMgr.fristEnter = true;
  18111. DataMgr.levelType = 0;
  18112. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18113. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18114. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18115. DataMgr.challengeMode_overLev = 0;
  18116. DataMgr.xszyForClassic = false;
  18117. DataMgr.xszyForChallenge = false;
  18118. DataMgr.awardId = 0;
  18119. DataMgr.awardCoin = 0;
  18120. DataMgr.sceneId = -1;
  18121. DataMgr.tryId = 0;
  18122. DataMgr.curLevel = 1;
  18123. DataMgr.vipLevel = 0;
  18124. DataMgr.maxLevel = 0;
  18125. DataMgr.awardRatio = 1;
  18126. DataMgr.gameList = [];
  18127. DataMgr.rankList = [];
  18128. DataMgr.recoverTime = 480000;
  18129. DataMgr.minScore = 0;
  18130. DataMgr.rankDis = 0;
  18131. DataMgr.userSaving = false;
  18132. DataMgr.gameSaving = false;
  18133. DataMgr.diyGameSaving = false;
  18134. class D3Tween extends Laya.Script3D {
  18135. constructor() {
  18136. super();
  18137. this.isInited = false;
  18138. }
  18139. ;
  18140. init() {
  18141. if (this.isInited)
  18142. return;
  18143. this.isInited = true;
  18144. this.gameObj = this.owner;
  18145. this.transform = this.gameObj.transform;
  18146. }
  18147. get rotX() {
  18148. return this.transform.localRotationEulerX;
  18149. }
  18150. set rotX(v) {
  18151. this.transform.localRotationEulerX = v;
  18152. }
  18153. get rotY() {
  18154. return this.transform.localRotationEulerY;
  18155. }
  18156. set rotY(v) {
  18157. this.transform.localRotationEulerY = v;
  18158. }
  18159. get rotZ() {
  18160. return this.transform.localRotationEulerZ;
  18161. }
  18162. set rotZ(v) {
  18163. this.transform.localRotationEulerZ = v;
  18164. }
  18165. get posX() {
  18166. return this.transform.localPositionX;
  18167. }
  18168. set posX(v) {
  18169. this.transform.localPositionX = v;
  18170. }
  18171. get posY() {
  18172. return this.transform.localPositionY;
  18173. }
  18174. set posY(v) {
  18175. this.transform.localPositionY = v;
  18176. }
  18177. get posZ() {
  18178. return this.transform.localPositionZ;
  18179. }
  18180. set posZ(v) {
  18181. this.transform.localPositionZ = v;
  18182. }
  18183. get rotation() {
  18184. return this.transform.localRotation;
  18185. }
  18186. set rotation(v) {
  18187. this.transform.localRotation = v;
  18188. }
  18189. }
  18190. class D2Hole extends Laya.Script {
  18191. constructor() { super(); }
  18192. onTriggerEnter(collider) {
  18193. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18194. return;
  18195. }
  18196. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18197. if (collider.owner["mySrc"].isRunSkillAni) {
  18198. return;
  18199. }
  18200. if (collider.owner["mySrc"].number != 0) {
  18201. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18202. }
  18203. xGame.common.ballColliHole(collider);
  18204. xGame.common.recoverCameraView();
  18205. }
  18206. }
  18207. }
  18208. class Table extends Laya.Script3D {
  18209. constructor() {
  18210. super();
  18211. this.isSetBorder = false;
  18212. this.inited = false;
  18213. }
  18214. ;
  18215. onAwake() {
  18216. this.init();
  18217. }
  18218. init() {
  18219. if (this.inited)
  18220. return;
  18221. this.inited = true;
  18222. this.gameObj = this.owner;
  18223. this.border = this.gameObj.getChildByName("border");
  18224. }
  18225. setBorderPos() {
  18226. if (this.isSetBorder)
  18227. return;
  18228. this.isSetBorder = true;
  18229. let ui = xGame.common.gameUI.ui;
  18230. let bar1 = this.border.getChildByName("bar1");
  18231. let bar2 = this.border.getChildByName("bar2");
  18232. let bar3 = this.border.getChildByName("bar3");
  18233. let bar4 = this.border.getChildByName("bar4");
  18234. let bar5 = this.border.getChildByName("bar5");
  18235. let bar6 = this.border.getChildByName("bar6");
  18236. this.setInfo(bar1, ui.border.bar1, "box");
  18237. this.setInfo(bar2, ui.border.bar2, "box");
  18238. this.setInfo(bar3, ui.border.bar3, "box");
  18239. this.setInfo(bar4, ui.border.bar4, "box");
  18240. this.setInfo(bar5, ui.border.bar5, "box");
  18241. this.setInfo(bar6, ui.border.bar6, "box");
  18242. let circle1 = this.border.getChildByName("circle1");
  18243. let circle2 = this.border.getChildByName("circle2");
  18244. let circle3 = this.border.getChildByName("circle3");
  18245. let circle4 = this.border.getChildByName("circle4");
  18246. let circle5 = this.border.getChildByName("circle5");
  18247. let circle6 = this.border.getChildByName("circle6");
  18248. this.setInfo(circle1, ui.border.circle1, "circle");
  18249. this.setInfo(circle2, ui.border.circle2, "circle");
  18250. this.setInfo(circle3, ui.border.circle3, "circle");
  18251. this.setInfo(circle4, ui.border.circle4, "circle");
  18252. this.setInfo(circle5, ui.border.circle5, "circle");
  18253. this.setInfo(circle6, ui.border.circle6, "circle");
  18254. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18255. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18256. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18257. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  18258. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  18259. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  18260. let arr = xGame.common.gameMgr.holePosList;
  18261. xGame.common.gameMgr.posObj = {
  18262. "1": arr[0],
  18263. "3": arr[2],
  18264. "4": arr[3],
  18265. "6": arr[5]
  18266. };
  18267. }
  18268. initHolePos(x, y) {
  18269. if (x < 300)
  18270. x += 25;
  18271. else if (x > 1000)
  18272. x -= 25;
  18273. else if (y > 200)
  18274. y -= 10;
  18275. else
  18276. y += 10;
  18277. if (y < 200)
  18278. y += 30;
  18279. else if (y > 500)
  18280. y -= 30;
  18281. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  18282. }
  18283. setInfo(d3Obj, d2Obj, type) {
  18284. let ui = xGame.common.gameUI.ui;
  18285. let sprite = new Laya.Sprite();
  18286. ui.border.displayObject.addChild(sprite);
  18287. let colli = xGame.common.getCollider(type);
  18288. sprite.addComponentIntance(colli);
  18289. let rigy = xGame.common.getRigbody();
  18290. rigy.type = "static";
  18291. sprite.addComponentIntance(rigy);
  18292. let d3Pos = d3Obj.transform.position;
  18293. xGame.common.pos3to2Convert(d3Pos);
  18294. let scaleX = d3Obj.transform.localScaleX;
  18295. let scaleZ = d3Obj.transform.localScaleZ;
  18296. let width = xGame.common.scale3to2Convert(scaleZ);
  18297. let height = xGame.common.scale3to2Convert(scaleX);
  18298. sprite.pivotX = width / 2;
  18299. sprite.pivotY = height / 2;
  18300. sprite.x = d3Pos.x;
  18301. sprite.y = d3Pos.y;
  18302. sprite.width = width;
  18303. sprite.height = height;
  18304. d2Obj.x = d3Pos.x;
  18305. d2Obj.y = d3Pos.y;
  18306. d2Obj.width = width;
  18307. d2Obj.height = height;
  18308. if (type == "box") {
  18309. colli.width = width;
  18310. colli.height = height;
  18311. colli.isSensor = false;
  18312. colli.label = "border";
  18313. }
  18314. else {
  18315. colli.radius = width / 2;
  18316. colli.isSensor = true;
  18317. colli.label = "hole";
  18318. sprite.addComponent(D2Hole);
  18319. }
  18320. }
  18321. }
  18322. class D3World extends Laya.Script3D {
  18323. constructor() {
  18324. super();
  18325. this.loadNum = 0;
  18326. this.setLoadNum = 7;
  18327. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  18328. }
  18329. onAwake() {
  18330. }
  18331. loadScene() {
  18332. this.scene = this.owner;
  18333. let url = `res/unityRes/root.lh`;
  18334. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  18335. this.scene.addChild(prefab);
  18336. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  18337. this.putCameraInfo();
  18338. this.camera.enableHDR = false;
  18339. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  18340. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  18341. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  18342. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  18343. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  18344. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  18345. this.knife.active = false;
  18346. this.loadD3Obj();
  18347. }));
  18348. }
  18349. putCameraInfo() {
  18350. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  18351. this.cameraObj = new cameraType();
  18352. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  18353. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  18354. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  18355. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  18356. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  18357. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  18358. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  18359. this.visitAngleChild.init();
  18360. this.visitRootObj.posX = this.visitAngleChild.posX;
  18361. this.visitRootObj.posY = this.visitAngleChild.posY;
  18362. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  18363. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  18364. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  18365. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  18366. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18367. xGame.common.showOneCamera("mainCamera");
  18368. }
  18369. loadD3Obj() {
  18370. this.loadTable();
  18371. this.loadRoom();
  18372. this.loadInHoleParticial();
  18373. this.loadIceParticial();
  18374. this.loadHitParticial();
  18375. this.loadFireworksParticial();
  18376. this.loadBall();
  18377. }
  18378. loadInHoleParticial() {
  18379. this.loadD3Res("inHoleEft", "", (prefab) => {
  18380. prefab.addComponent(Partical);
  18381. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  18382. });
  18383. }
  18384. loadIceParticial() {
  18385. this.loadD3Res("iceEft", "", (prefab) => {
  18386. prefab.addComponent(Partical);
  18387. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  18388. });
  18389. }
  18390. loadHitParticial() {
  18391. this.loadD3Res("hitEft", "", (prefab) => {
  18392. prefab.addComponent(Partical);
  18393. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18394. });
  18395. }
  18396. loadFireworksParticial() {
  18397. this.loadD3Res("fireworksEft", "", (prefab) => {
  18398. prefab.addComponent(Partical);
  18399. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18400. });
  18401. }
  18402. loadBall(index = 1) {
  18403. this.loadD3Res("ball", index, (prefab) => {
  18404. this.ballPrefab = prefab;
  18405. this.ballPrefab.addComponent(Ball);
  18406. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18407. });
  18408. }
  18409. loadTable(index = 1) {
  18410. this.loadD3Res("table", index, (prefab) => {
  18411. this.tableSrc = prefab.addComponent(Table);
  18412. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18413. this.d3Hand.init();
  18414. this.tableRoot.addChild(prefab);
  18415. });
  18416. }
  18417. loadRoom(index = 1) {
  18418. this.loadD3Res("room", index, (prefab) => {
  18419. this.roomRoot.addChild(prefab);
  18420. });
  18421. }
  18422. loadD3Res(type, index, callback) {
  18423. let url = `res/unityRes/${type}${index}.lh`;
  18424. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18425. callback && callback(prefab);
  18426. this.checkResLoad();
  18427. }));
  18428. }
  18429. checkResLoad() {
  18430. this.loadNum++;
  18431. if (this.loadNum >= this.setLoadNum) {
  18432. xGame.eventMgr.event(D3RES_LOADED);
  18433. }
  18434. }
  18435. prePlayEft() {
  18436. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  18437. eft.transform.localPositionX = 0;
  18438. eft.transform.localPositionY = -5;
  18439. eft.transform.localPositionZ = 0;
  18440. eft.active = true;
  18441. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  18442. ice.transform.localPositionX = 0;
  18443. ice.transform.localPositionY = -5;
  18444. ice.transform.localPositionZ = 0;
  18445. ice.active = true;
  18446. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  18447. hit.transform.localPositionX = 0;
  18448. hit.transform.localPositionY = -5;
  18449. hit.transform.localPositionZ = 0;
  18450. hit.active = true;
  18451. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  18452. fireworks.transform.localPositionX = 0;
  18453. fireworks.transform.localPositionY = -5;
  18454. fireworks.transform.localPositionZ = 0;
  18455. fireworks.active = true;
  18456. }
  18457. }
  18458. class cameraType {
  18459. }
  18460. class MoyuMgr$1 {
  18461. static initMoyu() {
  18462. this.moyuView = new MoyuView$1();
  18463. Laya.stage.addChild(this.moyuView.ui.displayObject);
  18464. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  18465. this.moyuView.ui.displayObject.zOrder = 1000;
  18466. this.moyuView.init();
  18467. this.moyuView.showTip(true);
  18468. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  18469. window['XApk'] = this;
  18470. }
  18471. static showAge(show) {
  18472. if (this.moyuView)
  18473. this.moyuView.showAge(show);
  18474. }
  18475. static onPlatMsg(idx) {
  18476. if (!MoyuMgr$1.moyuView)
  18477. return;
  18478. if (idx == '0') {
  18479. MoyuMgr$1.moyuView.showTip(false);
  18480. }
  18481. }
  18482. static showAgree(call) {
  18483. if (this.moyuView)
  18484. this.moyuView.showAgree(call);
  18485. else
  18486. call && call();
  18487. }
  18488. static showXy(type = 1) {
  18489. if (this.moyuView)
  18490. this.moyuView.showXy(type);
  18491. }
  18492. }
  18493. MoyuMgr$1.isAdvise = false;
  18494. class MoyuView$1 {
  18495. constructor() {
  18496. this.ysxyNum = 1;
  18497. this.ysJson = null;
  18498. this.ui = ui_UIMoyu.createInstance();
  18499. }
  18500. init() {
  18501. this.ui.mainBg.visible = false;
  18502. this.ui.xyNode.visible = false;
  18503. this.ui.ageNode.visible = false;
  18504. this.ui.tipNode.visible = false;
  18505. this.ui.rnNode.visible = false;
  18506. this.ui.fcmNode.visible = false;
  18507. this.ui.ageTip.visible = false;
  18508. this.ui.msgNode.visible = false;
  18509. this.ui.visible = false;
  18510. this.ui.xyNode.xyList.setVirtual();
  18511. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  18512. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  18513. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  18514. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  18515. this.ui.xyNode.btnKnown.visible = false;
  18516. this.ui.xyNode.xy1.visible = false;
  18517. this.ui.xyNode.xy2.visible = false;
  18518. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  18519. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  18520. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  18521. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  18522. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  18523. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  18524. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  18525. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  18526. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  18527. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  18528. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  18529. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  18530. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  18531. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  18532. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  18533. this.ysxyNum = 2;
  18534. }
  18535. }
  18536. onClick(obj) {
  18537. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18538. switch (obj) {
  18539. case this.ui.ageTip:
  18540. if (Moyu.isTTApk) {
  18541. this.ui.ageNode.visible = true;
  18542. this.ui.mainBg.visible = true;
  18543. }
  18544. break;
  18545. case this.ui.tipNode:
  18546. this.showTip(false);
  18547. break;
  18548. case this.ui.ageNode.btnAge:
  18549. this.ui.ageNode.visible = false;
  18550. this.ui.mainBg.visible = false;
  18551. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  18552. this.ui.visible = false;
  18553. break;
  18554. case this.ui.xyNode.btnXy3:
  18555. case this.ui.xyNode.btnXy1:
  18556. this.loadXy(1);
  18557. break;
  18558. case this.ui.xyNode.btnXy2:
  18559. this.loadXy(2);
  18560. break;
  18561. case this.ui.xyNode.btnBack:
  18562. this.ui.xyNode.xy1.visible = true;
  18563. this.ui.xyNode.xy2.visible = false;
  18564. break;
  18565. case this.ui.xyNode.btnKnown:
  18566. this.ui.xyNode.visible = false;
  18567. this.ui.mainBg.visible = false;
  18568. this.ui.visible = false;
  18569. break;
  18570. case this.ui.rnNode.btnCheck:
  18571. this.check();
  18572. break;
  18573. case this.ui.rnNode.btnExit:
  18574. case this.ui.xyNode.btnNo:
  18575. this.ysxyNum--;
  18576. if (this.ysxyNum > 0)
  18577. this.showMsg("Refuse to quit the game once again");
  18578. else {
  18579. Moyu.userAgree(false);
  18580. Moyu.exit();
  18581. }
  18582. break;
  18583. case this.ui.xyNode.btnSure:
  18584. case this.ui.xyNode.btnYes:
  18585. DataMgr.userData.isAgree = true;
  18586. DataMgr.saveUserData();
  18587. this.onAgree();
  18588. break;
  18589. case this.ui.rnNode.btnDone:
  18590. this.ui.rnNode.visible = false;
  18591. this.ui.visible = false;
  18592. break;
  18593. case this.ui.fcmNode.btnRn:
  18594. this.showRn();
  18595. break;
  18596. }
  18597. }
  18598. showTip(show) {
  18599. if (!Moyu.isVVApk && !Moyu.isOPApk)
  18600. return;
  18601. if (show) {
  18602. MoyuMgr$1.isAdvise = true;
  18603. this.ui.visible = true;
  18604. this.ui.tipNode.visible = true;
  18605. this.ui.tipNode.alpha = 1;
  18606. Laya.timer.once(1000, this, this.showTip, [false]);
  18607. }
  18608. else {
  18609. this.ui.tipNode.alpha = 1;
  18610. this.ui.tipNode.visible = true;
  18611. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  18612. this.ui.tipNode.visible = false;
  18613. MoyuMgr$1.isAdvise = false;
  18614. }), 1000);
  18615. }
  18616. }
  18617. showAge(show, px = 0, py = 0) {
  18618. if (Moyu.platType > 10 && !Moyu.isIos) {
  18619. this.ui.ageTip.x = px;
  18620. this.ui.ageTip.y = py;
  18621. this.ui.ageTip.visible = show;
  18622. if (show)
  18623. this.ui.visible = true;
  18624. }
  18625. }
  18626. showAgree(call) {
  18627. this.agreeCall = call;
  18628. this.onAgree();
  18629. return;
  18630. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  18631. this.showXy(0);
  18632. }
  18633. else
  18634. this.onAgree();
  18635. }
  18636. onAgree() {
  18637. if (!this.ui.ageNode.visible)
  18638. this.ui.visible = false;
  18639. this.ui.xyNode.visible = false;
  18640. Moyu.userAgree(true);
  18641. this.showAge(false);
  18642. this.agreeCall && this.agreeCall();
  18643. this.showRn();
  18644. }
  18645. showMsg(txt) {
  18646. this.ui.msgNode.txtMsg.text = txt;
  18647. this.ui.msgNode.visible = true;
  18648. this.ui.msgNode.alpha = 1;
  18649. this.ui.visible = true;
  18650. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  18651. this.ui.msgNode.visible = false;
  18652. }), 2500, true);
  18653. }
  18654. showRn() {
  18655. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18656. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  18657. this.ui.rnNode.rn1.visible = true;
  18658. this.ui.rnNode.rn2.visible = false;
  18659. this.ui.rnNode.rn3.visible = false;
  18660. this.ui.rnNode.rn4.visible = false;
  18661. this.ui.rnNode.visible = true;
  18662. this.ui.mainBg.visible = true;
  18663. this.ui.rnNode.btnDone.visible = false;
  18664. this.ui.rnNode.btnExit.visible = true;
  18665. this.ui.rnNode.btnCheck.visible = true;
  18666. this.ui.fcmNode.visible = false;
  18667. this.ui.visible = true;
  18668. return;
  18669. }
  18670. }
  18671. this.showFcm();
  18672. }
  18673. showFcm() {
  18674. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18675. Moyu.initFCM(true);
  18676. if (Moyu.gameTime < 1)
  18677. this.fcmLoop();
  18678. else if (Moyu.gameTime < 999)
  18679. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  18680. }
  18681. }
  18682. fcmLoop() {
  18683. if (Moyu.gameTime < 1) {
  18684. this.ui.rnNode.visible = false;
  18685. this.ui.fcmNode.visible = true;
  18686. this.ui.mainBg.visible = true;
  18687. this.ui.visible = true;
  18688. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  18689. Laya.timer.clear(this.ui, this.fcmLoop);
  18690. }
  18691. }
  18692. check() {
  18693. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  18694. this.ui.rnNode.rn1.visible = false;
  18695. this.ui.rnNode.rn2.visible = false;
  18696. this.ui.rnNode.rn4.visible = true;
  18697. }
  18698. else if (this.ui.rnNode.rn4.visible) {
  18699. let name = this.ui.rnNode.inputName.text;
  18700. let code = this.ui.rnNode.inputCode.text;
  18701. if (code && code.length == 18) {
  18702. this.ui.rnNode.rn1.visible = false;
  18703. this.ui.rnNode.rn4.visible = false;
  18704. Moyu.authenticate(name, code, (res) => {
  18705. this.ui.rnNode.rn2.visible = !res;
  18706. this.ui.rnNode.rn3.visible = res;
  18707. this.ui.rnNode.btnDone.visible = res;
  18708. this.ui.rnNode.btnExit.visible = !res;
  18709. this.ui.rnNode.btnCheck.visible = !res;
  18710. if (res)
  18711. this.showFcm();
  18712. });
  18713. }
  18714. else
  18715. this.showMsg("信息填写不完整");
  18716. }
  18717. }
  18718. loadXy(type = 0) {
  18719. this.ui.xyNode.xy1.visible = false;
  18720. this.ui.xyNode.xy2.visible = true;
  18721. this.ui.xyNode.xyList.scrollToView(0);
  18722. if (type == 1) {
  18723. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  18724. }
  18725. else if (type == 2) {
  18726. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  18727. }
  18728. }
  18729. showXy(type = 0) {
  18730. this.xyBtn();
  18731. if (type == 0) {
  18732. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  18733. this.ui.xyNode.btnSure.visible = true;
  18734. }
  18735. else {
  18736. this.ui.xyNode.btnYes.visible = true;
  18737. this.ui.xyNode.btnNo.visible = true;
  18738. }
  18739. }
  18740. else {
  18741. this.ui.xyNode.btnKnown.visible = true;
  18742. this.ui.mainBg.visible = true;
  18743. }
  18744. this.ui.xyNode.xy1.visible = true;
  18745. this.ui.xyNode.xy2.visible = false;
  18746. this.ui.xyNode.visible = true;
  18747. this.ui.visible = true;
  18748. }
  18749. xyBtn() {
  18750. this.ui.xyNode.btnSure.visible = false;
  18751. this.ui.xyNode.btnYes.visible = false;
  18752. this.ui.xyNode.btnNo.visible = false;
  18753. this.ui.xyNode.btnKnown.visible = false;
  18754. {
  18755. this.ui.xyNode.btnXy3.visible = false;
  18756. this.ui.xyNode.btnXy2.visible = true;
  18757. this.ui.xyNode.btnXy1.visible = true;
  18758. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  18759. }
  18760. }
  18761. createXY(json) {
  18762. this.ysJson = json.content;
  18763. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  18764. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  18765. this.ui.xyNode.xy2.visible = true;
  18766. }
  18767. renderListItem(idx, cell) {
  18768. let xy = this.ysJson[idx];
  18769. cell.height = xy.line * 30;
  18770. cell.xyItem.text = xy.text;
  18771. }
  18772. onDestroy() {
  18773. this.agreeCall = null;
  18774. }
  18775. }
  18776. class UILoading extends UIBase {
  18777. constructor() {
  18778. super();
  18779. this.accTime = 0;
  18780. this.curNum = 0;
  18781. this.rate = 1;
  18782. this.loadSubOk = false;
  18783. this.loadResOK = false;
  18784. this.openLoading = true;
  18785. this.beginLoadRes = false;
  18786. this.finishD2 = false;
  18787. this.finishD3 = false;
  18788. }
  18789. onConstructor() {
  18790. this.ui = ui_UILoading.createInstance();
  18791. this.contentPane = this.ui;
  18792. this.isEject = false;
  18793. this._initUI();
  18794. this._addEvent();
  18795. }
  18796. _initUI() {
  18797. MoyuMgr$1.initMoyu();
  18798. }
  18799. _addEvent() {
  18800. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  18801. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  18802. }
  18803. show() {
  18804. super.show();
  18805. console.log('zh:加载分包资源');
  18806. loadSubRes(this.subResProgress.bind(this));
  18807. this.ui.txtLoad.text = "Loading...";
  18808. }
  18809. subResProgress(pro, finish) {
  18810. this.curNum = pro;
  18811. if (finish) {
  18812. this.curNum = 1;
  18813. this.loadSubOk = true;
  18814. }
  18815. }
  18816. laodD3Res() {
  18817. let scene3D = new Laya.Scene3D();
  18818. xGame.common.d3Scene = scene3D;
  18819. xGame.common.d3World = scene3D.addComponent(D3World);
  18820. xGame.common.d3World.loadScene();
  18821. }
  18822. loadD2Res() {
  18823. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  18824. this.finishD2 = true;
  18825. this.checkLoadAll();
  18826. this.curNum = 1;
  18827. }), Laya.Handler.create(this, (pro) => {
  18828. this.curNum = pro;
  18829. }, null, false));
  18830. }
  18831. d3ResFinish() {
  18832. this.finishD3 = true;
  18833. this.checkLoadAll();
  18834. }
  18835. checkLoadAll() {
  18836. if (this.finishD2 && this.finishD3) {
  18837. this.loadResOK = true;
  18838. }
  18839. }
  18840. loadRes() {
  18841. this.laodD3Res();
  18842. this.loadD2Res();
  18843. }
  18844. myUpdate(dt) {
  18845. if (!this.openLoading)
  18846. return;
  18847. this.accTime += dt * this.rate;
  18848. if (this.accTime >= this.curNum)
  18849. this.accTime = this.curNum;
  18850. this.ui.loadinfo.value = this.accTime * 100;
  18851. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  18852. if (!this.beginLoadRes) {
  18853. this.beginLoadRes = true;
  18854. this.ui.txtLoad.text = "Loading...";
  18855. this.curNum = 0;
  18856. this.accTime = 0;
  18857. this.loadRes();
  18858. }
  18859. if (this.loadResOK) {
  18860. this.openLoading = false;
  18861. Laya.timer.once(300, this, () => {
  18862. xGame.common.d3Scene.active = false;
  18863. MoyuMgr$1.showAgree(enterGame);
  18864. });
  18865. }
  18866. }
  18867. }
  18868. release() {
  18869. }
  18870. hide() {
  18871. super.hide();
  18872. this.release();
  18873. }
  18874. onClose() {
  18875. this.hide();
  18876. }
  18877. }
  18878. UILoading.uiName = "UILoading";
  18879. class UIRepentProp$1 extends UIBase {
  18880. constructor() {
  18881. super();
  18882. this.viewType = 0;
  18883. this.regretType = 0;
  18884. }
  18885. onConstructor() {
  18886. this.ui = ui_UIRepentProp.createInstance();
  18887. this.contentPane = this.ui;
  18888. this.isEject = false;
  18889. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  18890. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  18891. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  18892. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  18893. }
  18894. show(viewType, regretType, callback) {
  18895. PlatMgr.showInsert(true);
  18896. this.viewType = viewType;
  18897. this.regretType = regretType;
  18898. this.callback = callback;
  18899. super.show();
  18900. this.ui.t0.play();
  18901. this.ui.c1.selectedIndex = this.viewType;
  18902. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  18903. if (this.viewType == 0) {
  18904. let guide = DataMgr.getGuideHelpLine();
  18905. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  18906. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  18907. }
  18908. xGame.common.gameMgr.gamePause = true;
  18909. }
  18910. hideSelf() {
  18911. xGame.common.gameMgr.gamePause = false;
  18912. this.callback && this.callback(false);
  18913. this.hide();
  18914. }
  18915. videoRegret() {
  18916. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  18917. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  18918. }
  18919. else {
  18920. console.log('zh:AD 失败,直接发放奖励');
  18921. this.qjff_AD_for_UIrepentProp_videoRegret();
  18922. }
  18923. }
  18924. qjff_AD_for_UIrepentProp_videoRegret() {
  18925. this.callback && this.callback(true);
  18926. this.hideSelf();
  18927. }
  18928. videoAddHelpLine() {
  18929. let guide = DataMgr.getGuideHelpLine();
  18930. if (guide == 0) {
  18931. this.callback && this.callback(true);
  18932. this.hideSelf();
  18933. DataMgr.setGuideHelpLine();
  18934. xGame.common.gameUI.ui.guideNode.visible = false;
  18935. }
  18936. else {
  18937. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  18938. if (Laya.Browser.onAndroid) {
  18939. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  18940. if (!boo) {
  18941. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  18942. return;
  18943. }
  18944. }
  18945. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  18946. }
  18947. else {
  18948. console.log('zh:AD 失败,直接发放奖励');
  18949. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  18950. }
  18951. }
  18952. }
  18953. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  18954. this.callback && this.callback(true);
  18955. this.hideSelf();
  18956. }
  18957. }
  18958. UIRepentProp$1.uiName = "UIRepentProp";
  18959. class UIRodMethod$1 extends UIBase {
  18960. constructor() {
  18961. super();
  18962. this.isPressd = false;
  18963. }
  18964. onConstructor() {
  18965. this.ui = ui_UIRodMethod.createInstance();
  18966. this.contentPane = this.ui;
  18967. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  18968. this.moveDir = new Laya.Vector2();
  18969. this.moveDest = new Laya.Vector2();
  18970. this.centerPos = new Laya.Vector2();
  18971. xGame.common.uiRodMethod = this;
  18972. }
  18973. show() {
  18974. super.show();
  18975. xGame.common.gameMgr.gamePause = true;
  18976. this.openPressDotEvent();
  18977. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  18978. this.centerPos.x = this.ui.white.x;
  18979. this.centerPos.y = this.ui.white.y;
  18980. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  18981. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  18982. this.setDot();
  18983. }
  18984. setDot() {
  18985. this.ui.dot.x = this.moveDest.x;
  18986. this.ui.dot.y = this.moveDest.y;
  18987. }
  18988. closeSelf() {
  18989. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  18990. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  18991. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  18992. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  18993. xGame.common.gameMgr.gamePause = false;
  18994. this.hide();
  18995. }
  18996. openPressDotEvent() {
  18997. this.closePressDotEvent();
  18998. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18999. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19000. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19001. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19002. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19003. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19004. }
  19005. closePressDotEvent() {
  19006. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19007. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19008. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19009. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19010. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19011. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19012. }
  19013. onDown(e) {
  19014. if (e.type == Laya.Event.MOUSE_DOWN)
  19015. this.isPressd = true;
  19016. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19017. this.isPressd = false;
  19018. if (!this.isPressd)
  19019. return;
  19020. this.moveDest.x = e.stageX;
  19021. this.moveDest.y = e.stageY;
  19022. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19023. if (dis > 6724) {
  19024. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19025. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19026. }
  19027. this.setDot();
  19028. }
  19029. resetRod() {
  19030. this.ui.dot.x = this.ui.white.x;
  19031. this.ui.dot.y = this.ui.white.y;
  19032. this.gameRod.dot.x = this.gameRod.bg.x;
  19033. this.gameRod.dot.y = this.gameRod.bg.y;
  19034. xGame.common.rodOffest.x = 0;
  19035. xGame.common.rodOffest.y = 0;
  19036. }
  19037. }
  19038. UIRodMethod$1.uiName = "UIRodMethod";
  19039. class UIMsg$1 extends UIBase {
  19040. constructor() {
  19041. super();
  19042. }
  19043. onConstructor() {
  19044. this.ui = ui_UIMsg.createInstance();
  19045. this.contentPane = this.ui;
  19046. this.isEject = false;
  19047. this.isMuti = true;
  19048. }
  19049. show(msg, callback) {
  19050. super.show();
  19051. this.ui.tipsNode.msgTxt.text = msg;
  19052. this.ui.alpha = 1;
  19053. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19054. this.hide();
  19055. callback && callback();
  19056. }), 1000);
  19057. }
  19058. }
  19059. UIMsg$1.uiName = "UIMsg";
  19060. class UITips$1 extends UIBase {
  19061. constructor() {
  19062. super();
  19063. this.type = 0;
  19064. }
  19065. onConstructor() {
  19066. this.ui = ui_UITips.createInstance();
  19067. this.contentPane = this.ui;
  19068. this.isEject = false;
  19069. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19070. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19071. }
  19072. show(tipsTxt, womanTxt, type) {
  19073. super.show();
  19074. this.ui.t0.play();
  19075. this.ui.myNode.tipsTxt.text = tipsTxt;
  19076. this.ui.myNode.womanTxt.text = womanTxt;
  19077. PlatMgr.showInsert(true);
  19078. this.ui.myNode.c1.selectedIndex = type;
  19079. this.type = type;
  19080. switch (this.type) {
  19081. case TipsType.exitGame:
  19082. xGame.common.gameMgr.gamePause = true;
  19083. break;
  19084. case TipsType.foul:
  19085. Laya.timer.once(200, this, () => {
  19086. xGame.common.gameMgr.gamePause = true;
  19087. });
  19088. break;
  19089. default:
  19090. break;
  19091. }
  19092. }
  19093. clickLeftBtn() {
  19094. this.hide();
  19095. xGame.common.gameMgr.gamePause = false;
  19096. switch (this.type) {
  19097. case TipsType.exitGame:
  19098. break;
  19099. case TipsType.foul:
  19100. break;
  19101. default:
  19102. break;
  19103. }
  19104. }
  19105. clickRightBtn() {
  19106. this.hide();
  19107. switch (this.type) {
  19108. case TipsType.exitGame:
  19109. xGame.eventMgr.event(RESET_GAME);
  19110. xGame.uiMgr.Show(UIMain$1);
  19111. Moyu.recordEnd(this, null);
  19112. xGame.common.longHelpLine = false;
  19113. break;
  19114. case TipsType.foul:
  19115. xGame.common.gameMgr.gamePause = false;
  19116. Laya.timer.clearAll(this);
  19117. break;
  19118. default:
  19119. break;
  19120. }
  19121. }
  19122. }
  19123. UITips$1.uiName = "UITips";
  19124. class UIGame$1 extends UIBase {
  19125. constructor() {
  19126. super();
  19127. this.powerNum = 0;
  19128. this.isD3Inited = false;
  19129. this.isPrePlay = false;
  19130. this.isMoveRod = false;
  19131. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19132. this.rulerDis = 20;
  19133. this.rulerOffset = 0;
  19134. }
  19135. onConstructor() {
  19136. this.ui = ui_UIGame.createInstance();
  19137. this.contentPane = this.ui;
  19138. this.ui.x += xGame.common.sysOffestNum;
  19139. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19140. this.isEject = false;
  19141. xGame.common.gameUI = this;
  19142. this.initSelf();
  19143. }
  19144. isTurnSelf() {
  19145. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19146. return true;
  19147. }
  19148. }
  19149. initSelf() {
  19150. let topUI = this.ui.topNode;
  19151. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19152. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19153. this.barInfo = {};
  19154. this.barInfo.curY = 0;
  19155. this.barInfo.height = this.ui.powerNode.height;
  19156. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19157. this.barInfo.powerStartY = this.ui.powerNode.y;
  19158. xGame.common.aiPlayer = new AIPlayer();
  19159. xGame.common.gameMgr = new GameMgr();
  19160. xGame.common.skillMgr = new SkillMgr();
  19161. xGame.common.wordsMgr = new WordsMgr();
  19162. xGame.common.talkMgr = new TalkMgr();
  19163. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19164. console.log("加载经典模式表情文件chenggon !");
  19165. });
  19166. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19167. console.log("挑战模式奖励模式spine加载成功!");
  19168. });
  19169. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19170. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19171. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19172. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19173. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19174. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19175. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19176. }
  19177. getGanZiImg() {
  19178. let index = DataMgr.getCurBallRod();
  19179. let data = cfgTable.ballrodData[index + 1];
  19180. let gan_url = xGame.common.getGameIconUrl(data.img);
  19181. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19182. this.ui.powerNode.showImg.url = gan_url;
  19183. console.log('zh:修改杆子图标O K');
  19184. }
  19185. returnHome() {
  19186. let tips = "Are you sure to exit the game?";
  19187. let woman = "Boss, why don't you play for a while longer?";
  19188. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19189. }
  19190. addRodMethodClick() {
  19191. if (this.isTurnSelf()) {
  19192. xGame.uiMgr.Show(UIRodMethod$1);
  19193. }
  19194. }
  19195. clickHelpLineBtn(force = false) {
  19196. if (!this.isTurnSelf())
  19197. return;
  19198. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19199. if (success) {
  19200. xGame.common.longHelpLine = true;
  19201. xGame.common.d2World.getHelpLine();
  19202. Moyu.sendDataEvent("guideNum");
  19203. }
  19204. else {
  19205. }
  19206. });
  19207. }
  19208. renderSelfDisplayBalls(index, target) {
  19209. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19210. target.myImg.url = xGame.common.getGameIconUrl(str);
  19211. }
  19212. renderAIDisplayBalls(index, target) {
  19213. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19214. target.myImg.url = xGame.common.getGameIconUrl(str);
  19215. ;
  19216. }
  19217. updateMode() {
  19218. if (xGame.common.gameMode == GameMode.classic) {
  19219. this.ui.topNode.scoreNode.visible = false;
  19220. }
  19221. else if (xGame.common.gameMode == GameMode.bigMove) {
  19222. this.ui.topNode.scoreNode.visible = true;
  19223. }
  19224. }
  19225. show() {
  19226. super.show();
  19227. console.log("zh:uigame show AADD");
  19228. this.ui.alpha = 0;
  19229. this.updateSelf();
  19230. xGame.common.gameMgr.gamePause = false;
  19231. xGame.common.gameUI.ui.blackAni.visible = false;
  19232. xGame.common.gameUI.ui.whiteAni.visible = false;
  19233. this.ui.powerEft.visible = false;
  19234. this.ui.colorNode.visible = false;
  19235. this.updateHead();
  19236. let curUse = DataMgr.getCurBallRod();
  19237. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19238. this.getGanZiImg();
  19239. }
  19240. updateSelf() {
  19241. if (xGame.common.gameMode == GameMode.classic) {
  19242. this.ui.c1.selectedIndex = 0;
  19243. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19244. this.ui.topNode.middleNode.visible = true;
  19245. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19246. }
  19247. else if (xGame.common.gameMode == GameMode.bigMove) {
  19248. this.ui.c1.selectedIndex = 0;
  19249. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19250. this.ui.topNode.middleNode.visible = false;
  19251. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19252. let rand = xGame.common.randomNum(1, max);
  19253. let guide = DataMgr.getSkillGuide();
  19254. if (guide == 0)
  19255. rand = 1;
  19256. xGame.common.bigMoveLevelIndex = rand;
  19257. }
  19258. else if (xGame.common.gameMode == GameMode.placeBall) {
  19259. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19260. this.ui.c1.selectedIndex = 1 + data.type;
  19261. this.ui.alpha = 1;
  19262. this.startGame();
  19263. }
  19264. this.updateMode();
  19265. this.initD3world();
  19266. this.initD2world();
  19267. }
  19268. startGame() {
  19269. this.ui.snowNode.visible = Math.random() <= 0.1;
  19270. this.ui.d2Node.visible = false;
  19271. xGame.common.d3World.d3Hand.gameObj.active = false;
  19272. xGame.common.d3World.tableSrc.init();
  19273. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19274. this.cameraViewChange(() => {
  19275. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  19276. switch (xGame.common.gameMode) {
  19277. case GameMode.classic:
  19278. xGame.common.d3World.d3Hand.gameObj.active = true;
  19279. this.playPutBallD3Ani();
  19280. break;
  19281. case GameMode.bigMove:
  19282. this.enterGame();
  19283. Laya.timer.once(500, this, () => {
  19284. this.ui.topNode.middleNode.visible = true;
  19285. this.ui.topNode.middleNode.t0.play();
  19286. });
  19287. break;
  19288. case GameMode.placeBall:
  19289. this.enterGame();
  19290. break;
  19291. default:
  19292. break;
  19293. }
  19294. });
  19295. PlatMgr.showBanner(false);
  19296. }
  19297. enterGame() {
  19298. this.ui.d2Node.visible = true;
  19299. xGame.common.d3World.d3Hand.gameObj.active = false;
  19300. xGame.common.showOneCamera("mainCamera");
  19301. Moyu.recordGame(30, true);
  19302. if (!this.isPrePlay) {
  19303. this.isPrePlay = true;
  19304. xGame.common.d3World.prePlayEft();
  19305. }
  19306. xGame.common.gameMgr.gameReady();
  19307. this.openAllEvent();
  19308. this.ui.snowNode.visible = false;
  19309. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  19310. this.ui.helpBtn.visible = condition;
  19311. }
  19312. showHelpLineGuide() {
  19313. let longGuide = DataMgr.getGuideHelpLine();
  19314. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  19315. this.ui.helpBtn.visible = true;
  19316. this.ui.guideNode.visible = true;
  19317. }
  19318. }
  19319. setTurnAlpha(alpha) {
  19320. this.ui.keduNode.alpha = alpha;
  19321. this.ui.ganNode.alpha = alpha;
  19322. this.ui.rodMethodNode.alpha = alpha;
  19323. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  19324. }
  19325. cameraViewChange(callback) {
  19326. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19327. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  19328. xGame.common.showOneCamera("visitAngle");
  19329. cameraSrc.localRotationEulerY = 180;
  19330. cameraSrc.localRotationEulerZ = 0;
  19331. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  19332. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  19333. callback && callback();
  19334. }));
  19335. }));
  19336. }
  19337. playPutBallD3Ani() {
  19338. xGame.common.showOneCamera("mainCamera");
  19339. let handSrc = xGame.common.d3World.d3Hand;
  19340. handSrc.gameObj.active = true;
  19341. handSrc.transform.localPositionZ = 3;
  19342. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  19343. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  19344. handSrc.gameObj.active = false;
  19345. this.enterGame();
  19346. }), 400);
  19347. }));
  19348. }
  19349. updateHead() {
  19350. let user = Moyu.getUserInfo();
  19351. this.ui.topNode.selfNameTxt.text = user.nickName;
  19352. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  19353. let aiData = xGame.cfgMgr.getRandomUserInfo();
  19354. if (DataMgr.getSkillGuide() < 1) {
  19355. this.ui.topNode.aiNameTxt.text = 'billiards';
  19356. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  19357. }
  19358. else {
  19359. this.ui.topNode.aiNameTxt.text = aiData.name;
  19360. let randNo = Math.floor(Math.random() * 10) + 1;
  19361. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  19362. }
  19363. }
  19364. initD2world() {
  19365. let node = this.ui.d2Root.displayObject;
  19366. let src = node.getComponent(D2World);
  19367. if (!src) {
  19368. xGame.common.d2World = node.addComponent(D2World);
  19369. }
  19370. xGame.common.d2World.initSelf();
  19371. }
  19372. initD3world() {
  19373. if (this.isD3Inited)
  19374. return;
  19375. this.isD3Inited = true;
  19376. let scene3D = xGame.common.d3Scene;
  19377. this.ui.d3Root.displayObject.addChild(scene3D);
  19378. scene3D.active = true;
  19379. xGame.common.d3World.tableSrc.setBorderPos();
  19380. }
  19381. onRootMove(e) {
  19382. let rootBall = xGame.common.d2World.rootBall;
  19383. this.ui.moveNode.x = e.x;
  19384. this.ui.moveNode.y = e.y;
  19385. rootBall.gameObj.x = e.x;
  19386. rootBall.gameObj.y = e.y;
  19387. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  19388. }
  19389. aiRootMove(move) {
  19390. if (move)
  19391. this.hideBallUI();
  19392. else {
  19393. this.showBallUI();
  19394. xGame.common.d2World.getHelpLine();
  19395. }
  19396. }
  19397. aiForce(type, force = 0) {
  19398. this.pressTarget = PressType.powerNode;
  19399. if (type == 1)
  19400. this.onEventUp({ force: true });
  19401. else if (type == 2)
  19402. this.onEventMove({ stageY: force, force: true });
  19403. }
  19404. onEventPress(e) {
  19405. if (e.stopPropagation)
  19406. e.stopPropagation();
  19407. if (!this.isTurnSelf())
  19408. return;
  19409. let target = e.target;
  19410. switch (target) {
  19411. case this.ui.myPowerNode.displayObject:
  19412. this.pressTarget = PressType.powerNode;
  19413. this.barInfo.curY = e.stageY;
  19414. this.updateBarInfo();
  19415. break;
  19416. case this.ui.moveNode.displayObject:
  19417. this.pressTarget = PressType.moveNode;
  19418. this.hideBallUI();
  19419. this.eventObj.curX = this.ui.moveNode.x;
  19420. this.eventObj.curY = this.ui.moveNode.y;
  19421. this.ui.moveNode.finger.visible = false;
  19422. this.eventObj.lastX = e.stageX;
  19423. this.eventObj.lastY = e.stageY;
  19424. break;
  19425. case this.ui.rulerClickNode.displayObject:
  19426. this.pressTarget = PressType.rulerNode;
  19427. this.eventObj.lastY = e.stageY;
  19428. break;
  19429. case this.ui.d2Root.displayObject:
  19430. this.pressTarget = PressType.d2Root;
  19431. this.eventObj.lastX = e.stageX;
  19432. this.eventObj.lastY = e.stageY;
  19433. this.eventObj.starX = e.stageX;
  19434. this.eventObj.starY = e.stageY;
  19435. this.eventObj.curX = 0;
  19436. this.eventObj.curY = 0;
  19437. xGame.common.d2World.d2Gan.setGanLastInfo();
  19438. this.rulerOffset = 0;
  19439. break;
  19440. default:
  19441. break;
  19442. }
  19443. }
  19444. onEventMove(e) {
  19445. if (e.stopPropagation)
  19446. e.stopPropagation();
  19447. if (e && e.force) {
  19448. }
  19449. else {
  19450. if (!this.isTurnSelf())
  19451. return;
  19452. }
  19453. switch (this.pressTarget) {
  19454. case PressType.powerNode:
  19455. this.barInfo.curY = e.stageY;
  19456. this.updateBarInfo();
  19457. this.isMoveRod = true;
  19458. break;
  19459. case PressType.moveNode:
  19460. let rootBall = xGame.common.d2World.rootBall;
  19461. let radius = rootBall.gameObj.width / 2;
  19462. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  19463. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  19464. let border = xGame.common.d2World.borderRect;
  19465. if (curX <= border.x + radius)
  19466. curX = border.x + radius;
  19467. else if (curX >= border.x + border.width - radius)
  19468. curX = border.x + border.width - radius;
  19469. if (curY <= border.y + radius)
  19470. curY = border.y + radius;
  19471. else if (curY >= border.y + border.height - radius)
  19472. curY = border.y + border.height - radius;
  19473. if (xGame.common.gameMgr.isOpenBall) {
  19474. if (curX >= border.x + border.openBallW - radius)
  19475. curX = border.x + border.openBallW - radius;
  19476. }
  19477. this.ui.moveNode.x = curX;
  19478. this.ui.moveNode.y = curY;
  19479. rootBall.gameObj.x = curX;
  19480. rootBall.gameObj.y = curY;
  19481. rootBall.d3BallSrc.setTransPos(curX, curY);
  19482. this.isMoveRod = true;
  19483. break;
  19484. case PressType.rulerNode:
  19485. let yy = e.stageY - this.eventObj.lastY;
  19486. this.eventObj.lastY = e.stageY;
  19487. let ruler1 = this.ui.rulerNode.img1;
  19488. let ruler2 = this.ui.rulerNode.img2;
  19489. ruler1.y += yy;
  19490. ruler2.y += yy;
  19491. this.rulerOffset += yy;
  19492. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  19493. this.rulerOffset = 0;
  19494. xGame.soundMgr.playSound("inch", 1, 10);
  19495. }
  19496. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  19497. let h = ruler1.height;
  19498. this.checkGuide();
  19499. this.isMoveRod = true;
  19500. if (ruler1.y >= h) {
  19501. ruler1.y = -h;
  19502. ruler2.y = 0;
  19503. return;
  19504. }
  19505. else if (ruler1.y <= -h) {
  19506. ruler1.y = h;
  19507. ruler2.y = 0;
  19508. return;
  19509. }
  19510. if (ruler2.y >= h) {
  19511. ruler2.y = -h;
  19512. ruler1.y = 0;
  19513. return;
  19514. }
  19515. else if (ruler2.y <= -h) {
  19516. ruler2.y = h;
  19517. ruler1.y = 0;
  19518. return;
  19519. }
  19520. break;
  19521. case PressType.d2Root:
  19522. this.eventObj.curX = e.stageX;
  19523. this.eventObj.curY = e.stageY;
  19524. let offset = this.checkRodMoveDir();
  19525. xGame.common.d2World.d2Gan.rotateSelf(offset);
  19526. this.eventObj.lastX = e.stageX;
  19527. this.eventObj.lastY = e.stageY;
  19528. break;
  19529. default:
  19530. break;
  19531. }
  19532. }
  19533. onEventUp(e) {
  19534. if (e.stopPropagation)
  19535. e.stopPropagation();
  19536. if (e && e.force) {
  19537. }
  19538. else {
  19539. if (!this.isTurnSelf())
  19540. return;
  19541. }
  19542. switch (this.pressTarget) {
  19543. case PressType.powerNode:
  19544. this.ui.powerNode.value = 0;
  19545. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19546. this.ui.powerTxt.text = "";
  19547. if (this.powerNum > 0) {
  19548. xGame.eventMgr.event(BALL_SHOOT);
  19549. xGame.common.d2World.shoot(this.powerNum);
  19550. xGame.common.d2World.d2Gan.shoot();
  19551. xGame.common.d2World.d2HelpLine.shoot();
  19552. this.finishGuide();
  19553. this.ui.powerEft.visible = false;
  19554. this.ui.colorNode.visible = false;
  19555. let ganStr = "";
  19556. if (this.powerNum <= 30) {
  19557. ganStr = "gan_30";
  19558. }
  19559. else if (this.powerNum <= 60) {
  19560. ganStr = "gan_50";
  19561. }
  19562. else {
  19563. ganStr = "gan_80";
  19564. }
  19565. xGame.soundMgr.playSound(ganStr);
  19566. }
  19567. break;
  19568. case PressType.moveNode:
  19569. let rootBall = xGame.common.d2World.rootBall;
  19570. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  19571. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  19572. let isIntersect = this.judgeBallIntersect();
  19573. if (isIntersect) {
  19574. this.ui.moveNode.x = lastX;
  19575. this.ui.moveNode.y = lastY;
  19576. rootBall.gameObj.x = lastX;
  19577. rootBall.gameObj.y = lastY;
  19578. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  19579. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  19580. }
  19581. else {
  19582. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  19583. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  19584. }
  19585. this.showBallUI();
  19586. this.ui.moveNode.finger.visible = true;
  19587. xGame.common.d2World.getHelpLine();
  19588. break;
  19589. case PressType.rulerNode:
  19590. break;
  19591. case PressType.d2Root:
  19592. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  19593. if (dis <= 25) {
  19594. this.moveToClickDot(e);
  19595. }
  19596. break;
  19597. default:
  19598. break;
  19599. }
  19600. this.pressTarget = -1;
  19601. }
  19602. checkGuide() {
  19603. let guide = DataMgr.getSkillGuide();
  19604. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  19605. xGame.common.guideStep++;
  19606. xGame.common.gameUI.ui.guide2.visible = false;
  19607. xGame.common.gameUI.ui.guide3.visible = true;
  19608. }
  19609. }
  19610. finishGuide() {
  19611. let guide = DataMgr.getSkillGuide();
  19612. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  19613. xGame.common.guideStep = 10;
  19614. this.closeAllGuide();
  19615. console.log('zh: 新手引导完毕');
  19616. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  19617. }
  19618. }
  19619. closeAllGuide() {
  19620. xGame.common.gameUI.ui.guide1.visible = false;
  19621. xGame.common.gameUI.ui.guide2.visible = false;
  19622. xGame.common.gameUI.ui.guide3.visible = false;
  19623. }
  19624. updateBarInfo() {
  19625. let star = this.ui.powerNode.y;
  19626. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  19627. if (rate >= 1)
  19628. rate = 1;
  19629. if (rate <= 0)
  19630. rate = 0;
  19631. this.powerNum = Math.ceil(rate * 100);
  19632. this.ui.powerNode.value = this.powerNum;
  19633. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  19634. this.ui.colorNode.value = this.powerNum;
  19635. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  19636. this.ui.powerEft.visible = this.powerNum != 0;
  19637. this.ui.colorNode.visible = this.powerNum != 0;
  19638. this.ui.powerTxt.text = this.powerNum + "";
  19639. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  19640. }
  19641. forceCancel() {
  19642. this.ui.powerNode.value = 0;
  19643. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19644. this.ui.powerTxt.text = "";
  19645. }
  19646. checkRodMoveDir() {
  19647. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  19648. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  19649. if (tempX >= 0 && tempY <= 0) {
  19650. return this.checkDir();
  19651. }
  19652. else if (tempX < 0 && tempY < 0) {
  19653. return this.checkDir(1, -1);
  19654. }
  19655. else if (tempX < 0 && tempY > 0) {
  19656. return this.checkDir(-1, -1);
  19657. }
  19658. else {
  19659. return this.checkDir(-1, 1);
  19660. }
  19661. }
  19662. checkDir(flagX = 1, flagY = 1) {
  19663. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  19664. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  19665. if (offsetY == 0) {
  19666. return offsetX * flagX;
  19667. }
  19668. if (offsetX == 0) {
  19669. return offsetY * flagY;
  19670. }
  19671. let angle = offsetY / offsetX;
  19672. if (Math.abs(angle) >= 1) {
  19673. return offsetY * flagY;
  19674. }
  19675. else {
  19676. return offsetX * flagX;
  19677. }
  19678. }
  19679. judgeBallIntersect() {
  19680. let rootBall = xGame.common.d2World.rootBall;
  19681. let ballArr = xGame.common.d2World.ballArr;
  19682. let radius = rootBall.gameObj.width / 2;
  19683. let temp;
  19684. let isIntersect = false;
  19685. for (let index = 0; index < ballArr.length; index++) {
  19686. temp = ballArr[index];
  19687. if (temp.number == rootBall.number)
  19688. continue;
  19689. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  19690. if (isIntersect) {
  19691. break;
  19692. }
  19693. }
  19694. return isIntersect;
  19695. }
  19696. hideBallUI() {
  19697. let d2Gan = xGame.common.d2World.d2Gan;
  19698. if (!d2Gan.ui.isDisposed)
  19699. d2Gan.ui.visible = false;
  19700. let d2Help = xGame.common.d2World.d2HelpLine;
  19701. if (!d2Help.ui.isDisposed)
  19702. d2Help.ui.visible = false;
  19703. let rootBall = xGame.common.d2World.rootBall;
  19704. if (!rootBall.destroyed) {
  19705. rootBall.gameObj.active = false;
  19706. }
  19707. }
  19708. showBallUI() {
  19709. let d2Gan = xGame.common.d2World.d2Gan;
  19710. if (!d2Gan.ui.isDisposed)
  19711. d2Gan.ui.visible = true;
  19712. let d2Help = xGame.common.d2World.d2HelpLine;
  19713. if (!d2Help.ui.isDisposed)
  19714. d2Help.ui.visible = true;
  19715. let rootBall = xGame.common.d2World.rootBall;
  19716. if (!rootBall.destroyed) {
  19717. rootBall.gameObj.active = true;
  19718. }
  19719. }
  19720. moveToClickDot(e) {
  19721. if (!this.isMoveRod && !xGame.common.clickedBall) {
  19722. let root = xGame.common.d2World.rootBall.gameObj;
  19723. let xx = e.stageX - xGame.common.sysOffestNum;
  19724. let yy = e.stageY;
  19725. let x = xx - root.x;
  19726. let y = yy - root.y;
  19727. let angle = xGame.common.getfguiRotation(x, y);
  19728. xGame.common.d2World.d2Gan.ui.rotation = angle;
  19729. xGame.common.d2World.getHelpLine();
  19730. }
  19731. this.isMoveRod = false;
  19732. xGame.common.clickedBall = false;
  19733. }
  19734. openAllEvent() {
  19735. this.closeAllEvent();
  19736. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19737. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19738. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19739. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19740. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19741. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19742. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19743. }
  19744. closeAllEvent() {
  19745. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19746. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19747. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19748. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19749. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19750. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19751. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19752. }
  19753. resetGame() {
  19754. this.closeAllEvent();
  19755. this.hideBallUI();
  19756. xGame.common.gameMgr.gamePause = true;
  19757. }
  19758. }
  19759. UIGame$1.uiName = "UIGame";
  19760. class UIAddCoin$1 extends UIBase {
  19761. constructor() {
  19762. super();
  19763. this.coinNum = 2000;
  19764. }
  19765. onConstructor() {
  19766. this.ui = ui_UIAddCoin.createInstance();
  19767. this.contentPane = this.ui;
  19768. this.isEject = false;
  19769. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19770. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  19771. }
  19772. show() {
  19773. super.show();
  19774. this.ui.t0.play();
  19775. }
  19776. videoAddCoin() {
  19777. console.log('zh:qjff_AD_for_UIAddCoin');
  19778. if (Laya.Browser.onAndroid) {
  19779. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19780. if (!boo) {
  19781. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19782. return;
  19783. }
  19784. }
  19785. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  19786. }
  19787. else {
  19788. console.log('zh:AD 失败,直接发放奖励');
  19789. this.qjff_AD_for_UIAddCoin();
  19790. }
  19791. }
  19792. qjff_AD_for_UIAddCoin() {
  19793. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  19794. this.hide();
  19795. }
  19796. }
  19797. UIAddCoin$1.uiName = "UIAddCoin";
  19798. class UIInvitation$1 extends UIBase {
  19799. constructor() {
  19800. super();
  19801. }
  19802. onConstructor() {
  19803. this.ui = ui_UIInvitation.createInstance();
  19804. this.contentPane = this.ui;
  19805. this.isEject = false;
  19806. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  19807. }
  19808. show() {
  19809. super.show();
  19810. }
  19811. enterGame() {
  19812. xGame.common.gameMode = GameMode.classic;
  19813. DataMgr.setChallengeTimes(1);
  19814. xGame.common.passAwardCoin = 2000;
  19815. let need = xGame.common.classicNiceNeddCoin;
  19816. if (DataMgr.coinEnough(need)) {
  19817. DataMgr.setCoin(-need);
  19818. xGame.eventMgr.event(RESTART_GAME, true);
  19819. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  19820. }
  19821. else {
  19822. xGame.eventMgr.event(RESTART_GAME, true);
  19823. }
  19824. this.hide();
  19825. }
  19826. hide() {
  19827. super.hide();
  19828. }
  19829. }
  19830. UIInvitation$1.uiName = "UIInvitation";
  19831. class UIPower$1 extends UIBase {
  19832. constructor() {
  19833. super();
  19834. }
  19835. onConstructor() {
  19836. this.ui = ui_UIPower.createInstance();
  19837. this.contentPane = this.ui;
  19838. this.isEject = false;
  19839. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19840. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  19841. }
  19842. show() {
  19843. super.show();
  19844. this.ui.t0.play();
  19845. }
  19846. videoGetPower() {
  19847. console.log('zh:qjff_AD_for_uipower');
  19848. if (Laya.Browser.onAndroid) {
  19849. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19850. if (!boo) {
  19851. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19852. return;
  19853. }
  19854. }
  19855. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  19856. }
  19857. else {
  19858. console.log('zh:AD 失败,直接发放奖励');
  19859. this.qjff_AD_for_uipower();
  19860. }
  19861. }
  19862. qjff_AD_for_uipower() {
  19863. DataMgr.setPower(xGame.common.videoPower, true);
  19864. xGame.eventMgr.event(POWER_TIME);
  19865. this.hide();
  19866. }
  19867. }
  19868. UIPower$1.uiName = "UIPower";
  19869. class UIGameEnd$1 extends UIBase {
  19870. constructor() {
  19871. super();
  19872. this.success = false;
  19873. this.awardCoinNum = 1000;
  19874. this.awardDiamondNum = 10;
  19875. }
  19876. onConstructor() {
  19877. this.ui = ui_UIGameEnd.createInstance();
  19878. this.contentPane = this.ui;
  19879. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  19880. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  19881. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  19882. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19883. this.ui.talkNode.visible = false;
  19884. if (Moyu.isKs)
  19885. this.ui.closeNode.closeBtn.x += 100;
  19886. }
  19887. updateType() {
  19888. switch (xGame.common.gameMode) {
  19889. case GameMode.classic:
  19890. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19891. this.ui.coinNode.visible = this.success;
  19892. if (!this.success) {
  19893. Laya.timer.once(500, this, () => {
  19894. xGame.uiMgr.Show(UIAddCoin$1);
  19895. });
  19896. }
  19897. else {
  19898. this.logEventForClassic_win();
  19899. }
  19900. this.logEventForClassic_complete();
  19901. this.ui.isGetAward.visible = false;
  19902. this.ui.leftBtn.c1.selectedIndex = 3;
  19903. this.ui.rightBtn.c1.selectedIndex = 0;
  19904. this.moneyNode.ui.c1.selectedIndex = 1;
  19905. break;
  19906. case GameMode.bigMove:
  19907. console.log('zh:招法模式 aaaaaa bigMove');
  19908. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19909. this.ui.coinNode.visible = this.success;
  19910. if (xGame.common.gameMode == GameMode.bigMove) {
  19911. if (this.success) {
  19912. DataMgr.setSkillSuccessTimes(1, true);
  19913. DataMgr.setSkillAccTimes(1);
  19914. }
  19915. else {
  19916. DataMgr.setSkillSuccessTimes(0, false);
  19917. }
  19918. }
  19919. this.logEventForRod_complete_N();
  19920. if (!this.success) {
  19921. Laya.timer.once(500, this, () => {
  19922. xGame.uiMgr.Show(UIAddCoin$1);
  19923. });
  19924. }
  19925. else {
  19926. this.logEventForRod_win();
  19927. }
  19928. this.ui.isGetAward.visible = false;
  19929. this.ui.leftBtn.c1.selectedIndex = 3;
  19930. this.ui.rightBtn.c1.selectedIndex = 0;
  19931. this.moneyNode.ui.c1.selectedIndex = 1;
  19932. break;
  19933. case GameMode.placeBall:
  19934. this.ui.coinNode.visible = false;
  19935. if (this.success) {
  19936. if (xGame.common.placeBallStarNum == 3) {
  19937. this.ui.c1.selectedIndex = 2;
  19938. }
  19939. else {
  19940. this.ui.c1.selectedIndex = 3;
  19941. }
  19942. let level = xGame.common.placeBallCurLevel;
  19943. if (level > 59) {
  19944. this.logEventForChallenge_level_complete(level);
  19945. }
  19946. else {
  19947. this.logEventForChallenge_level_N(level);
  19948. }
  19949. }
  19950. else {
  19951. this.ui.c1.selectedIndex = 4;
  19952. }
  19953. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19954. if (cfg.type == PlaceBallType.challenge) {
  19955. this.ui.c1.selectedIndex = 2;
  19956. }
  19957. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  19958. this.updatePlaceBallBtn();
  19959. this.updatePlaceBallStarNum();
  19960. this.updatePlaceBallAwardState();
  19961. this.moneyNode.ui.c1.selectedIndex = 2;
  19962. this.moneyNode.checkPowerTime();
  19963. this.moneyNode.powerChange();
  19964. DataMgr.upRankData();
  19965. break;
  19966. default:
  19967. break;
  19968. }
  19969. }
  19970. logEventForRod_complete_N() {
  19971. let gfmsIdx = xGame.common.curPlayerSkillType;
  19972. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  19973. let gfmc = 'Skyfall Shot';
  19974. if (gfmsIdx == 0) {
  19975. gfmc = 'Skyfall Shot';
  19976. }
  19977. if (gfmsIdx == 1) {
  19978. gfmc = 'Surging break';
  19979. }
  19980. if (gfmsIdx == 2) {
  19981. gfmc = 'Frost Lock';
  19982. }
  19983. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19984. console.log('zh:logEventForRod_complete_N level = ' + level);
  19985. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  19986. let jsonStr = {
  19987. "count": 0,
  19988. "name": gfmc
  19989. };
  19990. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19991. const d = LocalStorageManager.getItem(keyStr);
  19992. jsonStr.count = d.count + 1;
  19993. LocalStorageManager.setItem(keyStr, jsonStr);
  19994. }
  19995. else {
  19996. LocalStorageManager.setItem(keyStr, jsonStr);
  19997. }
  19998. const d2 = LocalStorageManager.getItem(keyStr);
  19999. let count = d2.count;
  20000. console.log('zh:logEventForRod_complete_N count = ' + count);
  20001. if (count % 5 == 0) {
  20002. const reqStr = JSON.stringify(jsonStr);
  20003. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20004. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20005. }
  20006. }
  20007. logEventForRod_win() {
  20008. console.log('zh:logEventForRod_win,胜利');
  20009. let gfmsIdx = xGame.common.curPlayerSkillType;
  20010. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20011. let gfmc = 'Skyfall Shot';
  20012. if (gfmsIdx == 0) {
  20013. gfmc = 'Skyfall Shot';
  20014. }
  20015. if (gfmsIdx == 1) {
  20016. gfmc = 'Surging break';
  20017. }
  20018. if (gfmsIdx == 2) {
  20019. gfmc = 'Frost Lock';
  20020. }
  20021. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20022. console.log('zh:logEventForRod_win level = ' + level);
  20023. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20024. let jsonStr = {
  20025. "count": 1,
  20026. "name": gfmc + ' Lev' + level
  20027. };
  20028. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20029. const d = LocalStorageManager.getItem(keyStr);
  20030. jsonStr.count = d.count + 1;
  20031. LocalStorageManager.setItem(keyStr, jsonStr);
  20032. }
  20033. else {
  20034. LocalStorageManager.setItem(keyStr, jsonStr);
  20035. }
  20036. const reqStr = JSON.stringify(jsonStr);
  20037. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20038. }
  20039. logEventForClassic_win() {
  20040. console.log('zh:logEventForClassic_win,胜利');
  20041. let rtype = xGame.common.classicRoomType;
  20042. let msmc = '';
  20043. if (rtype == 1) {
  20044. msmc = 'beginner';
  20045. }
  20046. if (rtype == 2) {
  20047. msmc = 'expert';
  20048. }
  20049. if (rtype == 3) {
  20050. msmc = 'master';
  20051. }
  20052. let keyStr = 'sjmd_classic_win_' + rtype;
  20053. let jsonStr = {
  20054. "difficulty": msmc,
  20055. "classic_count": 1,
  20056. "difficulty_count": 1
  20057. };
  20058. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20059. const d = LocalStorageManager.getItem(keyStr);
  20060. jsonStr.classic_count = d.classic_count + 1;
  20061. jsonStr.difficulty_count = d.difficulty_count + 1;
  20062. LocalStorageManager.setItem(keyStr, jsonStr);
  20063. }
  20064. else {
  20065. LocalStorageManager.setItem(keyStr, jsonStr);
  20066. }
  20067. const reqStr = JSON.stringify(jsonStr);
  20068. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20069. }
  20070. logEventForClassic_complete() {
  20071. console.log('zh:logEventForClassic_complete,胜利');
  20072. let rtype = xGame.common.classicRoomType;
  20073. let msmc = '';
  20074. if (rtype == 1) {
  20075. msmc = 'beginner';
  20076. }
  20077. if (rtype == 2) {
  20078. msmc = 'expert';
  20079. }
  20080. if (rtype == 3) {
  20081. msmc = 'master';
  20082. }
  20083. let keyStr = 'sjmd_classic_complete_' + rtype;
  20084. let jsonStr = {
  20085. "msmc": msmc,
  20086. "count": 0
  20087. };
  20088. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20089. const d = LocalStorageManager.getItem(keyStr);
  20090. jsonStr.count = d.count + 1;
  20091. LocalStorageManager.setItem(keyStr, jsonStr);
  20092. }
  20093. else {
  20094. LocalStorageManager.setItem(keyStr, jsonStr);
  20095. }
  20096. if (jsonStr.count % 5 == 0) {
  20097. const reqStr = JSON.stringify(jsonStr);
  20098. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20099. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20100. }
  20101. }
  20102. updatePlaceBallBtn() {
  20103. this.ui.leftBtn.c1.selectedIndex = 5;
  20104. if (this.success) {
  20105. this.ui.rightBtn.c1.selectedIndex = 14;
  20106. }
  20107. else {
  20108. if (xGame.common.placeBallStarNum == 3) {
  20109. this.ui.rightBtn.c1.selectedIndex = 14;
  20110. }
  20111. else {
  20112. this.ui.rightBtn.c1.selectedIndex = 1;
  20113. }
  20114. }
  20115. }
  20116. updatePlaceBallStarNum() {
  20117. let starNum = xGame.common.placeBallStarNum;
  20118. if (starNum == 0)
  20119. this.ui.starNumNode.c1.selectedIndex = 3;
  20120. else {
  20121. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20122. }
  20123. }
  20124. updatePlaceBallAwardState() {
  20125. let level = xGame.common.placeBallCurLevel;
  20126. let starNum = xGame.common.placeBallStarNum;
  20127. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20128. let data = cfgTable.placeballData[level].award;
  20129. let cfg = cfgTable.placeballData[level];
  20130. this.awardDiamondNum = data[1];
  20131. this.awardCoinNum = data[0];
  20132. if (cfg.type == PlaceBallType.challenge) {
  20133. this.awardDiamondNum = 0;
  20134. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20135. }
  20136. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20137. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20138. if (cfg.type == PlaceBallType.challenge) {
  20139. this.ui.awardNode.coinNode.visible = true;
  20140. }
  20141. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20142. this.ui.awardNode.diamondNode.x = 265;
  20143. this.ui.awardNode.coinNode.x = 354;
  20144. }
  20145. else {
  20146. this.ui.awardNode.diamondNode.x = 291;
  20147. this.ui.awardNode.coinNode.x = 291;
  20148. }
  20149. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20150. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20151. if (this.awardCoinNum == 0) {
  20152. this.ui.awardNode.coinNode.numTxt.text = "";
  20153. }
  20154. if (getAward) {
  20155. this.ui.isGetAward.visible = true;
  20156. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20157. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20158. }
  20159. else {
  20160. this.ui.isGetAward.visible = false;
  20161. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20162. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20163. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20164. }
  20165. else {
  20166. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20167. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20168. }
  20169. }
  20170. }
  20171. show(success) {
  20172. super.show();
  20173. xGame.eventMgr.event(RESET_GAME);
  20174. this.success = success;
  20175. Laya.timer.clearAll(this);
  20176. this.playSecretaryAni();
  20177. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20178. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20179. offsetTime = Math.floor(offsetTime / 1000);
  20180. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20181. this.updateType();
  20182. Laya.timer.once(200, this, () => {
  20183. this.addAward(() => {
  20184. this.updateType();
  20185. Laya.timer.once(500, this, () => {
  20186. this.showChallengeLevel();
  20187. });
  20188. });
  20189. });
  20190. if (this.success) {
  20191. JSBridgeUtils.instance.showInternAd('gameend_success');
  20192. console.log('zh:game end 成功');
  20193. xGame.soundMgr.playSound('slots_roll01');
  20194. xGame.soundMgr.playSound("s_win");
  20195. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20196. this.diyGameDataUtilForGameWin();
  20197. }
  20198. else {
  20199. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20200. console.log('zh:game end失败');
  20201. xGame.soundMgr.playSound('matchwin01');
  20202. xGame.soundMgr.playSound("s_lose");
  20203. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20204. }
  20205. let challengeNum = DataMgr.getChallengeTimes();
  20206. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20207. DataMgr.setChallengeTimes(1);
  20208. }
  20209. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20210. DataMgr.setClassicTimes();
  20211. }
  20212. }
  20213. diyGameDataUtilForGameWin() {
  20214. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20215. switch (xGame.common.gameMode) {
  20216. case GameMode.classic:
  20217. console.log('zh:DiyGameDataUtilForGameWin 111');
  20218. case GameMode.bigMove:
  20219. console.log('zh:DiyGameDataUtilForGameWin 222');
  20220. this.restartGame();
  20221. break;
  20222. case GameMode.placeBall:
  20223. console.log('zh:DiyGameDataUtilForGameWin 333');
  20224. var level = xGame.common.placeBallCurLevel;
  20225. console.log('zh:练习模式 联系了多少LEV=' + level);
  20226. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20227. if (level > db_over_lev) {
  20228. DataMgr.setChallengeMode_overLev(level);
  20229. }
  20230. break;
  20231. default:
  20232. console.log('zh:DiyGameDataUtilForGameWin 444');
  20233. break;
  20234. }
  20235. }
  20236. showChallengeLevel() {
  20237. if (DataMgr.getChallengeTimes() != 0)
  20238. return;
  20239. let skill = DataMgr.getSkillAccTimes();
  20240. let put = DataMgr.getPlaceBallLevelList().length;
  20241. if (skill >= 3 || put >= 5) {
  20242. xGame.uiMgr.Show(UIInvitation$1);
  20243. this.hide();
  20244. }
  20245. }
  20246. addAward(callback) {
  20247. if (!this.success) {
  20248. callback && callback();
  20249. return;
  20250. }
  20251. switch (xGame.common.gameMode) {
  20252. case GameMode.classic:
  20253. this.awardCoinNum = xGame.common.passAwardCoin;
  20254. this.awardDiamondNum = 0;
  20255. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20256. break;
  20257. case GameMode.bigMove:
  20258. this.awardCoinNum = xGame.common.passAwardCoin;
  20259. this.awardDiamondNum = 0;
  20260. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20261. callback && callback();
  20262. break;
  20263. case GameMode.placeBall:
  20264. let level = xGame.common.placeBallCurLevel;
  20265. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  20266. if (xGame.common.placeBallStarNum != 3) {
  20267. callback && callback();
  20268. return;
  20269. }
  20270. else {
  20271. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20272. if (getAward) {
  20273. callback && callback();
  20274. return;
  20275. }
  20276. }
  20277. let cfg = cfgTable.placeballData[level];
  20278. let data = cfgTable.placeballData[level].award;
  20279. this.awardCoinNum = data[0];
  20280. this.awardDiamondNum = data[1];
  20281. if (cfg.type == PlaceBallType.challenge) {
  20282. this.awardDiamondNum = 0;
  20283. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20284. }
  20285. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  20286. let diamondAward;
  20287. if (this.awardDiamondNum > 0) {
  20288. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  20289. xGame.common.getAward([diamondAward, coinAward], callback);
  20290. }
  20291. else {
  20292. xGame.common.getAward([coinAward], callback);
  20293. }
  20294. if (cfg.type == PlaceBallType.normal) {
  20295. DataMgr.setPlaceBallAward(level);
  20296. }
  20297. break;
  20298. default:
  20299. break;
  20300. }
  20301. }
  20302. playSecretaryAni_old() {
  20303. let parent = this.ui.secretary.displayObject;
  20304. parent.destroyChildren();
  20305. let xx = this.ui.secretary.width / 2;
  20306. let yy = this.ui.secretary.height;
  20307. let scale = xGame.common.getSecretaryScale();
  20308. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20309. if (this.success) {
  20310. let rand = Math.random() <= 0.5 ? 2 : 3;
  20311. xGame.common.secretary.play(data, rand, false, parent, () => {
  20312. xGame.common.secretary.play(data, 1, true, parent);
  20313. });
  20314. }
  20315. else {
  20316. xGame.common.secretary.play(data, 0, true, parent);
  20317. }
  20318. }
  20319. playSecretaryAni() {
  20320. let parent = this.ui.secretary.displayObject;
  20321. parent.destroyChildren();
  20322. let xx = this.ui.secretary.width / 2;
  20323. let yy = this.ui.secretary.height;
  20324. let scale = xGame.common.getSecretaryScale();
  20325. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20326. if (this.success) {
  20327. let rand = 0;
  20328. xGame.common.secretary.play(data, 0, true, parent);
  20329. }
  20330. else {
  20331. xGame.common.secretary.play(data, 0, true, parent);
  20332. }
  20333. }
  20334. restartGame() {
  20335. switch (xGame.common.gameMode) {
  20336. case GameMode.classic:
  20337. xGame.eventMgr.event(RESTART_GAME);
  20338. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20339. break;
  20340. case GameMode.bigMove:
  20341. this.hide();
  20342. xGame.eventMgr.event(RESTART_GAME);
  20343. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20344. break;
  20345. default:
  20346. break;
  20347. }
  20348. }
  20349. hide() {
  20350. super.hide();
  20351. xGame.common.stopGirlPop(this.ui.talkNode);
  20352. PlatMgr.showBanner(false);
  20353. }
  20354. returnHome() {
  20355. this.hide();
  20356. let showFailWords = !this.success;
  20357. xGame.uiMgr.Show(UIMain$1, showFailWords);
  20358. }
  20359. clickLeftBtn() {
  20360. switch (xGame.common.gameMode) {
  20361. case GameMode.classic:
  20362. case GameMode.bigMove:
  20363. this.returnHome();
  20364. break;
  20365. case GameMode.placeBall:
  20366. let level = xGame.common.placeBallCurLevel;
  20367. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  20368. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20369. break;
  20370. default:
  20371. break;
  20372. }
  20373. }
  20374. powerStartPlaceBallLevel(level, btn) {
  20375. if (DataMgr.powerEnough()) {
  20376. btn.touchable = false;
  20377. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20378. btn.touchable = true;
  20379. DataMgr.setPower(-1);
  20380. xGame.eventMgr.event(POWER_TIME);
  20381. this.startPlaceBallLevel(level);
  20382. this.logEventForChallenge_level_start(level);
  20383. }));
  20384. }
  20385. else {
  20386. xGame.uiMgr.Show(UIPower$1, 0);
  20387. }
  20388. }
  20389. clickRightBtn() {
  20390. switch (xGame.common.gameMode) {
  20391. case GameMode.classic:
  20392. console.log('zh:clickRightBtn 111');
  20393. case GameMode.bigMove:
  20394. console.log('zh:clickRightBtn 222');
  20395. this.restartGame();
  20396. break;
  20397. case GameMode.placeBall:
  20398. console.log('zh:clickRightBtn 333');
  20399. let level = xGame.common.placeBallCurLevel;
  20400. let data = DataMgr.getPlaceBallLevel(level);
  20401. let curPss = data.play && !data.isCur;
  20402. if (curPss) {
  20403. console.log('zh:clickRightBtn 333-111');
  20404. console.log('zh:当前LV=' + level);
  20405. if (level == 60) {
  20406. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  20407. Laya.timer.once(3000, this, () => {
  20408. this.returnHome();
  20409. });
  20410. }
  20411. else {
  20412. let lev = level + 1;
  20413. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20414. }
  20415. }
  20416. else {
  20417. console.log('zh:clickRightBtn 333-000');
  20418. Moyu.sendDataEvent("placeBallNextLevel");
  20419. console.log('zh:qjff_AD_for_uiGameEnd');
  20420. if (Laya.Browser.onAndroid) {
  20421. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20422. if (!boo) {
  20423. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20424. return;
  20425. }
  20426. }
  20427. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  20428. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  20429. }
  20430. else {
  20431. console.log('zh:AD 失败,直接发放奖励');
  20432. this.qjff_AD_for_uiGameEnd(level);
  20433. }
  20434. }
  20435. break;
  20436. default:
  20437. console.log('zh:clickRightBtn 444');
  20438. break;
  20439. }
  20440. }
  20441. logEventForChallenge_level_start(level) {
  20442. let keyStr = 'sjmd_challenge_level_start';
  20443. let jsonStr = {
  20444. "count": 0,
  20445. "gold_balance ": DataMgr.getCoin(),
  20446. "level": level,
  20447. "diamond_balance ": DataMgr.getDiamond()
  20448. };
  20449. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20450. const d = LocalStorageManager.getItem(keyStr);
  20451. if (level > d.level) {
  20452. jsonStr.count = d.count + 1;
  20453. LocalStorageManager.setItem(keyStr, jsonStr);
  20454. }
  20455. else {
  20456. }
  20457. }
  20458. else {
  20459. LocalStorageManager.setItem(keyStr, jsonStr);
  20460. }
  20461. const reqStr = JSON.stringify(jsonStr);
  20462. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20463. }
  20464. qjff_AD_for_uiGameEnd(level) {
  20465. DataMgr.setPlaceBallLevel(level, 1);
  20466. this.startPlaceBallLevel(level + 1);
  20467. }
  20468. startPlaceBallLevel(level) {
  20469. xGame.common.gameMode = GameMode.placeBall;
  20470. xGame.common.placeBallCurLevel = level;
  20471. xGame.uiMgr.Show(UIGame$1);
  20472. this.hide();
  20473. }
  20474. logEventForChallenge_level_complete(level) {
  20475. let keyStr = 'sjmd_challenge_level_complete';
  20476. let jsonStr = {
  20477. "count": 1,
  20478. "gold_balance ": DataMgr.getCoin(),
  20479. "level": level,
  20480. "diamond_balance ": DataMgr.getDiamond()
  20481. };
  20482. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20483. const d = LocalStorageManager.getItem(keyStr);
  20484. jsonStr.count = d.count + 1;
  20485. LocalStorageManager.setItem(keyStr, jsonStr);
  20486. }
  20487. else {
  20488. LocalStorageManager.setItem(keyStr, jsonStr);
  20489. }
  20490. const reqStr = JSON.stringify(jsonStr);
  20491. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  20492. }
  20493. logEventForChallenge_level_N(level) {
  20494. console.log('zh:logEventForChallenge_level_N ' + level);
  20495. let keyStr = 'sjmd_challenge_level_N';
  20496. if (LocalStorageManager.hasKey(keyStr)) {
  20497. let lev = LocalStorageManager.getItem(keyStr);
  20498. if (level > lev) {
  20499. LocalStorageManager.setItem(keyStr, level);
  20500. }
  20501. if ((level) % 5 == 0) {
  20502. console.log('zh:每5关上报1次');
  20503. let sjmc = 'challenge_level_' + level;
  20504. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  20505. let sjmcForFirebase = 'challenge_level_' + level;
  20506. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  20507. }
  20508. else {
  20509. console.log('zh:5 no 上报');
  20510. }
  20511. }
  20512. else {
  20513. LocalStorageManager.setItem(keyStr, level);
  20514. }
  20515. }
  20516. }
  20517. UIGameEnd$1.uiName = "UIGameEnd";
  20518. class ShowItem$1 {
  20519. constructor() {
  20520. this.ui = ui_ShowItem.createInstance();
  20521. }
  20522. destroySelf() {
  20523. if (!this.ui.isDisposed) {
  20524. this.ui.removeFromParent();
  20525. this.ui.dispose();
  20526. }
  20527. }
  20528. setParent(parent) {
  20529. parent.addChild(this.ui);
  20530. }
  20531. setPos(x, y) {
  20532. this.ui.x = x;
  20533. this.ui.y = y;
  20534. }
  20535. setUrl(index) {
  20536. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  20537. }
  20538. }
  20539. class UILevelProp$1 extends UIBase {
  20540. constructor() {
  20541. super();
  20542. this.firstPos = 385;
  20543. this.secondPos = 467;
  20544. this.showItemArr = [];
  20545. }
  20546. onFontLoaded() {
  20547. try {
  20548. this.ui.myNode.conditionTxt.font = "arial";
  20549. console.log("zh: onFontLoaded 设置arial字体成功");
  20550. }
  20551. catch (error) {
  20552. console.log("zh: constructor onFontLoaded加载arial字体失败");
  20553. }
  20554. }
  20555. onConstructor() {
  20556. this.ui = ui_UILevelProp.createInstance();
  20557. this.contentPane = this.ui;
  20558. this.isEject = false;
  20559. this.addUIClick(this.ui.closeBtn, this.hide);
  20560. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20561. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  20562. }
  20563. show(level) {
  20564. super.show();
  20565. this.ui.t1.play();
  20566. this.level = level;
  20567. this.data = cfgTable.placeballData[this.level];
  20568. this.updateSelf();
  20569. this.showPreView();
  20570. this.moneyNode.ui.c1.selectedIndex = 2;
  20571. this.moneyNode.checkPowerTime();
  20572. this.moneyNode.powerChange();
  20573. }
  20574. showPreView() {
  20575. let item;
  20576. let data;
  20577. for (let index = 0; index < this.showItemArr.length; index++) {
  20578. item = this.showItemArr[index];
  20579. item.destroySelf();
  20580. }
  20581. this.showItemArr = [];
  20582. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  20583. for (const key in cfgData) {
  20584. data = cfgData[key];
  20585. item = new ShowItem$1();
  20586. item.setParent(this.ui.myNode.displayRoot);
  20587. item.setPos(data.x, data.y);
  20588. item.setUrl(data.value);
  20589. this.showItemArr.push(item);
  20590. }
  20591. }
  20592. updateSelf() {
  20593. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  20594. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  20595. if (this.data.ball == -1) {
  20596. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  20597. }
  20598. else {
  20599. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  20600. }
  20601. let localData = DataMgr.getPlaceBallLevel(this.level);
  20602. let getAward = localData.getAward;
  20603. let cfg = cfgTable.placeballData[this.level];
  20604. let coin = this.data.award[0];
  20605. let diamond = this.data.award[1];
  20606. if (cfg.type == PlaceBallType.challenge) {
  20607. diamond = 0;
  20608. coin = 100;
  20609. }
  20610. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  20611. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  20612. this.ui.myNode.coinNode.numTxt.text = coin + "";
  20613. if (cfg.type == PlaceBallType.challenge) {
  20614. this.ui.myNode.coinNode.numTxt.text = "";
  20615. }
  20616. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  20617. if (coin > 0 && diamond > 0) {
  20618. this.ui.myNode.diamondNode.x = 385;
  20619. this.ui.myNode.coinNode.x = 467;
  20620. }
  20621. else {
  20622. this.ui.myNode.diamondNode.x = 385;
  20623. this.ui.myNode.coinNode.x = 385;
  20624. }
  20625. if (!getAward) {
  20626. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  20627. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  20628. }
  20629. else {
  20630. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  20631. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  20632. }
  20633. }
  20634. startGame() {
  20635. if (DataMgr.powerEnough()) {
  20636. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  20637. this.ui.myNode.startBtn.touchable = false;
  20638. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20639. console.log('zh:startGame ');
  20640. this.ui.myNode.startBtn.touchable = true;
  20641. DataMgr.setPower(-1);
  20642. xGame.eventMgr.event(POWER_TIME);
  20643. xGame.common.gameMode = GameMode.placeBall;
  20644. xGame.common.placeBallCurLevel = this.level;
  20645. xGame.uiMgr.Show(UIGame$1);
  20646. this.logEventForChallenge_level_start(this.level);
  20647. xGame.uiMgr.Hide(UILevelDisplay$1);
  20648. xGame.uiMgr.Hide(UIMain$1);
  20649. this.hide();
  20650. }));
  20651. }
  20652. else {
  20653. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  20654. xGame.uiMgr.Show(UIPower$1);
  20655. }
  20656. }
  20657. logEventForChallenge_level_start(level) {
  20658. let keyStr = 'sjmd_challenge_level_start';
  20659. let jsonStr = {
  20660. "count": 1,
  20661. "gold_balance ": DataMgr.getCoin(),
  20662. "level": level,
  20663. "diamond_balance ": DataMgr.getDiamond()
  20664. };
  20665. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20666. const d = LocalStorageManager.getItem(keyStr);
  20667. if (level > d.level) {
  20668. jsonStr.count = d.count + 1;
  20669. LocalStorageManager.setItem(keyStr, jsonStr);
  20670. }
  20671. else {
  20672. }
  20673. }
  20674. else {
  20675. LocalStorageManager.setItem(keyStr, jsonStr);
  20676. }
  20677. const reqStr = JSON.stringify(jsonStr);
  20678. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20679. }
  20680. hide() {
  20681. super.hide();
  20682. }
  20683. }
  20684. UILevelProp$1.uiName = "UILevelProp";
  20685. class PutBallLevelDisplay$1 {
  20686. constructor(ui, index) {
  20687. this.index = 0;
  20688. this.ui = ui;
  20689. this.index = index;
  20690. this.ui.onClick(this, this.clickSelf);
  20691. this.updateSelf();
  20692. this.ui.levelTxt.text = (this.index + 1) + "";
  20693. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  20694. this.ui.special.levelTxt.text = (this.index + 1) + "";
  20695. }
  20696. updateSelf() {
  20697. let level = this.index + 1;
  20698. this.data = DataMgr.getPlaceBallLevel(level);
  20699. this.ui.starNode.c1.selectedIndex = this.data.star;
  20700. let isChallenge = cfgTable.placeballData[level].type;
  20701. if (this.data.isCur) {
  20702. if (isChallenge) {
  20703. this.ui.c1.selectedIndex = 5;
  20704. }
  20705. else {
  20706. this.ui.c1.selectedIndex = 2;
  20707. }
  20708. }
  20709. else {
  20710. if (this.data.play) {
  20711. if (this.data.star == 3) {
  20712. this.ui.c1.selectedIndex = 0;
  20713. }
  20714. else {
  20715. this.ui.c1.selectedIndex = 1;
  20716. }
  20717. }
  20718. else {
  20719. if (isChallenge) {
  20720. this.ui.c1.selectedIndex = 4;
  20721. }
  20722. else {
  20723. this.ui.c1.selectedIndex = 3;
  20724. }
  20725. }
  20726. }
  20727. }
  20728. clickSelf() {
  20729. if (!this.data.play)
  20730. return;
  20731. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20732. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  20733. }
  20734. }
  20735. class UILevelDisplay$1 extends UIBase {
  20736. constructor() {
  20737. super();
  20738. }
  20739. onConstructor() {
  20740. this.ui = ui_UILevelDisplay.createInstance();
  20741. this.contentPane = this.ui;
  20742. this.isEject = false;
  20743. this.myList = this.ui.myNode.myList;
  20744. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  20745. this.levelItemArr = [];
  20746. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  20747. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  20748. this.myList.numItems = levelNum;
  20749. if (Moyu.isKs)
  20750. this.ui.closeNode.closeBtn.x += 100;
  20751. }
  20752. levelItemRender(index, target) {
  20753. let item = new PutBallLevelDisplay$1(target, index);
  20754. this.levelItemArr.push(item);
  20755. }
  20756. show() {
  20757. super.show();
  20758. this.updateLevel();
  20759. this.scrollToPlace();
  20760. }
  20761. updateLevel() {
  20762. let temp;
  20763. for (let index = 0; index < this.levelItemArr.length; index++) {
  20764. temp = this.levelItemArr[index];
  20765. temp.updateSelf();
  20766. }
  20767. }
  20768. scrollToPlace() {
  20769. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  20770. let passArr = DataMgr.getPlaceBallLevelList();
  20771. let offest = passArr.length;
  20772. if (offest >= maxNum - 1)
  20773. offest = maxNum - 1;
  20774. this.myList.scrollToView(offest, true, true);
  20775. }
  20776. hide() {
  20777. super.hide();
  20778. }
  20779. }
  20780. UILevelDisplay$1.uiName = "UILevelDisplay";
  20781. class UIMatching$1 extends UIBase {
  20782. constructor() {
  20783. super();
  20784. }
  20785. onConstructor() {
  20786. this.ui = ui_UIMatching.createInstance();
  20787. this.contentPane = this.ui;
  20788. this.isEject = false;
  20789. }
  20790. show(callback) {
  20791. super.show();
  20792. PlatMgr.showBanner(true);
  20793. this.callback = callback;
  20794. let user = Moyu.getUserInfo();
  20795. if (!this.selfPot) {
  20796. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  20797. }
  20798. if (!this.aiPot) {
  20799. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  20800. }
  20801. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  20802. this.ui.selfHead.nameTxt.text = user.nickName;
  20803. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  20804. this.ui.aiHead.nameTxt.text = "???";
  20805. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  20806. this.ui.selfHead.c1.selectedIndex = 0;
  20807. this.ui.aiHead.c1.selectedIndex = 0;
  20808. this.ui.selfHead.x = this.selfPot.x;
  20809. this.ui.selfHead.y = this.selfPot.y;
  20810. this.ui.aiHead.x = this.aiPot.x;
  20811. this.ui.aiHead.y = this.aiPot.y;
  20812. switch (xGame.common.gameMode) {
  20813. case GameMode.classic:
  20814. break;
  20815. case GameMode.bigMove:
  20816. this.initSkillData();
  20817. break;
  20818. default:
  20819. break;
  20820. }
  20821. this.ui.t1.play(Laya.Handler.create(this, () => {
  20822. this.ui.t2.play(Laya.Handler.create(this, () => {
  20823. switch (xGame.common.gameMode) {
  20824. case GameMode.classic:
  20825. this.waitingPeople();
  20826. break;
  20827. case GameMode.bigMove:
  20828. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  20829. break;
  20830. default:
  20831. break;
  20832. }
  20833. }));
  20834. }));
  20835. }
  20836. initSkillData() {
  20837. this.skillSelectData = [];
  20838. let skillUrl = xGame.common.skillIconList;
  20839. let skillName = xGame.common.skillNameList;
  20840. let skillLevel = DataMgr.getBigSkillList();
  20841. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  20842. for (let index = 0; index < 5; index++) {
  20843. let obj = {};
  20844. obj.skillImg = skillUrl[index];
  20845. obj.skillName = skillName[index];
  20846. obj.skillType = skillType[index];
  20847. obj.skillLevel = skillLevel[index];
  20848. this.skillSelectData.push(obj);
  20849. }
  20850. }
  20851. getAISkillLevel(myLevel) {
  20852. let video = xGame.common.upSkillLevel;
  20853. let aiLevel;
  20854. let temp;
  20855. if (video) {
  20856. temp = xGame.common.randomNum(-2, -1);
  20857. }
  20858. else {
  20859. if (myLevel <= 5) {
  20860. temp = xGame.common.randomNum(1, 3);
  20861. }
  20862. else if (myLevel <= 9) {
  20863. temp = xGame.common.randomNum(-2, 1);
  20864. }
  20865. else {
  20866. temp = xGame.common.randomNum(-4, 0);
  20867. }
  20868. }
  20869. aiLevel = temp + myLevel;
  20870. if (aiLevel <= 1)
  20871. aiLevel = 1;
  20872. if (aiLevel >= 10)
  20873. aiLevel = 10;
  20874. return aiLevel;
  20875. }
  20876. getAISkillType() {
  20877. return xGame.common.randomNum(1, 4);
  20878. let successTimes = DataMgr.getSkillSuccessTimes();
  20879. let info = cfgTable.aiskillData[successTimes];
  20880. if (!info) {
  20881. let max = Object.keys(cfgTable.aiskillData).length - 1;
  20882. info = cfgTable.aiskillData[max];
  20883. }
  20884. let dataArr = info.skillselect;
  20885. let myCfg = {};
  20886. for (let index = 0; index < dataArr.length; index++) {
  20887. let temp = dataArr[index].split('-');
  20888. myCfg[temp[0]] = {};
  20889. myCfg[temp[0]].id = parseInt(temp[0]);
  20890. myCfg[temp[0]].weight = parseInt(temp[1]);
  20891. }
  20892. let aiCfg = xGame.common.initWeight(myCfg);
  20893. let curData = xGame.common.getRandomWeightData(aiCfg);
  20894. return parseInt(curData.id);
  20895. }
  20896. getAISkillData(index) {
  20897. let myLevel = this.skillSelectData[index].skillLevel;
  20898. let aiLevel = this.getAISkillLevel(myLevel);
  20899. let aiType = this.getAISkillType() - 1;
  20900. return { aiLevel, aiType } = { aiLevel, aiType };
  20901. }
  20902. skillSelectFinish(index) {
  20903. let aiInfo = this.getAISkillData(index);
  20904. xGame.common.gameMgr.selfCurSkill = index;
  20905. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  20906. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  20907. this.ui.selfHead.c1.selectedIndex = 1;
  20908. this.ui.aiHead.c1.selectedIndex = 1;
  20909. let myData = this.skillSelectData[index];
  20910. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  20911. let guide = DataMgr.getSkillGuide();
  20912. if (guide == 0) {
  20913. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  20914. }
  20915. else {
  20916. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  20917. }
  20918. let aiData = this.skillSelectData[aiInfo.aiType];
  20919. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  20920. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  20921. this.waitingPeople();
  20922. }
  20923. waitingPeople() {
  20924. let time = xGame.common.randomNum(1000, 3000);
  20925. time += 1000;
  20926. Laya.timer.once(time, this, () => {
  20927. this.matchingSuccess();
  20928. });
  20929. }
  20930. matchingSuccess() {
  20931. let gameUI = xGame.common.gameUI;
  20932. let name = gameUI.ui.topNode.aiNameTxt.text;
  20933. let url = gameUI.ui.topNode.aiHeadLoader.url;
  20934. this.ui.aiHead.nameTxt.text = name;
  20935. this.ui.aiHead.headImg.url = url;
  20936. name = gameUI.ui.topNode.selfNameTxt.text;
  20937. url = gameUI.ui.topNode.selfHeadLoader.url;
  20938. this.ui.selfHead.nameTxt.text = name;
  20939. this.ui.selfHead.headImg.url = url;
  20940. this.ui.t3.play(Laya.Handler.create(this, () => {
  20941. this.callback && this.callback();
  20942. this.ui.t4.play(Laya.Handler.create(this, () => {
  20943. this.destroySelf();
  20944. }));
  20945. }));
  20946. }
  20947. destroySelf() {
  20948. this.callback = null;
  20949. this.skillSelectData = null;
  20950. this.selfPot = null;
  20951. this.aiPot = null;
  20952. if (!this.ui.isDisposed) {
  20953. this.ui.removeFromParent();
  20954. this.ui.dispose();
  20955. }
  20956. xGame.uiMgr.destroyUI(this);
  20957. }
  20958. }
  20959. UIMatching$1.uiName = "UIMatching";
  20960. class SkillDisplay$1 {
  20961. constructor(ui, data, uiIndex) {
  20962. this.starX = 0;
  20963. this.starY = 0;
  20964. this.index = 0;
  20965. this.ui = ui;
  20966. this.data = data;
  20967. this.index = uiIndex;
  20968. this.initSelf();
  20969. console.log('zh:SkillDisplay constructor this.skillData=', data);
  20970. }
  20971. initSelf() {
  20972. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  20973. this.ui.nameTxt.text = this.data.name;
  20974. this.ui.describeTxt.text = this.data.describe;
  20975. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  20976. this.ui.startBtn.onClick(this, this.startGame);
  20977. this.updateSelf();
  20978. }
  20979. updateSelf() {
  20980. this.checkTry();
  20981. let level = DataMgr.getBigSkillByIndex(this.index);
  20982. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  20983. }
  20984. checkTry() {
  20985. let index = this.index;
  20986. let level = DataMgr.getBigSkillByIndex(index);
  20987. if (level == null) {
  20988. DataMgr.setBigSkill(index, 1, false);
  20989. level = 1;
  20990. }
  20991. this.ui.levelTxt.text = "LV." + level;
  20992. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  20993. this.ui.tryNode.visible = true;
  20994. else
  20995. this.ui.tryNode.visible = false;
  20996. }
  20997. clickAddLevel() {
  20998. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20999. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21000. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21001. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21002. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21003. }
  21004. else {
  21005. console.log('zh:AD 失败,直接发放奖励');
  21006. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21007. }
  21008. }
  21009. qjff_AD_for_skilldisplay_clickAddLevel() {
  21010. DataMgr.setBigSkill(this.data.index, 1);
  21011. this.updateSelf();
  21012. xGame.common.upSkillLevel = true;
  21013. }
  21014. startGame() {
  21015. console.log('zh:rod skill startgame');
  21016. if (this.data.index == 3) {
  21017. alert('Coming soon!');
  21018. return;
  21019. }
  21020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21021. let needCoin = xGame.common.bigMoveNeedCoin;
  21022. xGame.common.passAwardCoin = 2000;
  21023. let guide = DataMgr.getSkillGuide();
  21024. console.log('zh:startGame guide=' + guide);
  21025. xGame.common.temSelfLevel = 0;
  21026. if (guide == 0) {
  21027. needCoin = 0;
  21028. xGame.common.temSelfLevel = 100;
  21029. }
  21030. if (DataMgr.coinEnough(needCoin)) {
  21031. DataMgr.setCoin(-needCoin);
  21032. xGame.common.curPlayerSkillType = this.index;
  21033. if (guide == 0)
  21034. xGame.common.curPlayerSkillType = 0;
  21035. console.log('zh: skilldisplay 1');
  21036. xGame.uiMgr.Show(UIGame$1);
  21037. xGame.uiMgr.Hide(UIMain$1);
  21038. xGame.uiMgr.Show(UIMatching$1, () => {
  21039. xGame.common.gameUI.ui.alpha = 1;
  21040. xGame.common.gameUI.startGame();
  21041. xGame.uiMgr.Hide(UISkill$1);
  21042. });
  21043. this.logEventForRod_start();
  21044. }
  21045. else {
  21046. console.log('zh: skilldisplay 2');
  21047. xGame.uiMgr.Show(UIAddProp$1, 0);
  21048. Moyu.sendDataEvent("AddCoinVideo");
  21049. }
  21050. }
  21051. logEventForRod_start() {
  21052. let gfmsIdx = xGame.common.curPlayerSkillType;
  21053. console.log('zh:选择的技能=' + gfmsIdx);
  21054. let gfmc = 'Skyfall Shot';
  21055. if (gfmsIdx == 0) {
  21056. gfmc = 'Skyfall Shot';
  21057. }
  21058. if (gfmsIdx == 1) {
  21059. gfmc = 'Surging break';
  21060. }
  21061. if (gfmsIdx == 2) {
  21062. gfmc = 'Frost Lock';
  21063. }
  21064. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21065. let jsonStr = {
  21066. "count": 0,
  21067. "name": gfmc
  21068. };
  21069. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21070. const d = LocalStorageManager.getItem(keyStr);
  21071. jsonStr.count = d.count + 1;
  21072. LocalStorageManager.setItem(keyStr, jsonStr);
  21073. }
  21074. else {
  21075. LocalStorageManager.setItem(keyStr, jsonStr);
  21076. }
  21077. const reqStr = JSON.stringify(jsonStr);
  21078. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21079. }
  21080. }
  21081. class UISkill$1 extends UIBase {
  21082. constructor() {
  21083. super();
  21084. this.skillData = [];
  21085. }
  21086. onConstructor() {
  21087. this.ui = ui_UISkill.createInstance();
  21088. this.contentPane = this.ui;
  21089. this.isEject = false;
  21090. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21091. this.initSkillData();
  21092. console.log('zh:aaaaaa1111111111');
  21093. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21094. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21095. console.log('zh:aaaaaa22222222');
  21096. this.displayList = [];
  21097. this.ui.skillNode.skillList.numItems = 3;
  21098. this.addUIClick(this.ui, this.interuptSecretary);
  21099. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21100. this.ui.talkNode.visible = false;
  21101. if (Moyu.isKs)
  21102. this.ui.closeNode.closeBtn.x += 100;
  21103. }
  21104. show() {
  21105. super.show();
  21106. this.playSecretaryIdle();
  21107. this.moneyNode.ui.c1.selectedIndex = 1;
  21108. Laya.timer.clearAll(this);
  21109. xGame.soundMgr.playSound("s_start");
  21110. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21111. let guide = DataMgr.getSkillGuide();
  21112. this.ui.guideNode.visible = guide == 0;
  21113. let item = this.getSkillItemByUIIndex(0);
  21114. if (guide == 0) {
  21115. item.ui.c1.selectedIndex = 1;
  21116. }
  21117. else {
  21118. item.ui.c1.selectedIndex = 0;
  21119. }
  21120. this.ui.guideNode.guideBtn.visible = guide == 0;
  21121. for (let index = 0; index < this.displayList.length; index++) {
  21122. this.displayList[index].checkTry();
  21123. }
  21124. }
  21125. getSkillItemByUIIndex(cur) {
  21126. for (let index = 0; index < this.displayList.length; index++) {
  21127. if (this.displayList[index].index == cur) {
  21128. return this.displayList[index];
  21129. }
  21130. }
  21131. }
  21132. enterGuideLevel() {
  21133. let item = this.getSkillItemByUIIndex(0);
  21134. item.startGame();
  21135. if (DataMgr.getNewUser())
  21136. Moyu.sendDataEvent("gameStart1");
  21137. }
  21138. initSkillData() {
  21139. this.skillData = [];
  21140. let nameList = xGame.common.skillNameList;
  21141. let iconList = xGame.common.skillIconList;
  21142. let describeList = [
  21143. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21144. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21145. "The power of frost descends—freezing the flow and taking full control of the game!"
  21146. ];
  21147. console.log('zh:initSkillData 111111111');
  21148. let data;
  21149. for (let index = 0; index < nameList.length; index++) {
  21150. data = {};
  21151. data.name = nameList[index];
  21152. data.icon = iconList[index];
  21153. data.describe = describeList[index];
  21154. data.index = index;
  21155. this.skillData.push(data);
  21156. }
  21157. }
  21158. updateSkillItem(index, target) {
  21159. if (this.displayList[index] == null) {
  21160. let uiIndex;
  21161. switch (index) {
  21162. case 0:
  21163. uiIndex = 1;
  21164. break;
  21165. case 1:
  21166. uiIndex = 0;
  21167. break;
  21168. case 2:
  21169. uiIndex = 2;
  21170. break;
  21171. case 3:
  21172. uiIndex = 3;
  21173. break;
  21174. default:
  21175. break;
  21176. }
  21177. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21178. this.displayList.push(temp);
  21179. }
  21180. }
  21181. playSecretaryIdle() {
  21182. let parent = this.ui.secretary.displayObject;
  21183. parent.destroyChildren();
  21184. let xx = this.ui.secretary.width / 2;
  21185. let yy = this.ui.secretary.height;
  21186. let scale = xGame.common.getSecretaryScale();
  21187. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21188. xGame.common.secretary.play(data, 0, true, parent);
  21189. }
  21190. returnUIMain() {
  21191. this.hide();
  21192. xGame.common.stopGirlPop(this.ui.talkNode);
  21193. xGame.uiMgr.Show(UIMain$1);
  21194. }
  21195. interuptSecretary() {
  21196. Laya.timer.clearAll(this);
  21197. this.playSecretaryRandomSound();
  21198. }
  21199. playSecretaryRandomSound() {
  21200. if (this.isHide)
  21201. return;
  21202. let time = xGame.common.randomNum(45000, 60000);
  21203. Laya.timer.once(time, this, () => {
  21204. if (this.isHide)
  21205. return;
  21206. let index = xGame.common.randomNum(4, 7);
  21207. xGame.soundMgr.playSound("s_main0" + index);
  21208. let words = 1;
  21209. switch (index) {
  21210. case 4:
  21211. words = 5;
  21212. break;
  21213. case 5:
  21214. words = 3;
  21215. break;
  21216. case 6:
  21217. words = 6;
  21218. break;
  21219. case 7:
  21220. words = 7;
  21221. break;
  21222. default:
  21223. break;
  21224. }
  21225. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21226. this.playSecretaryRandomSound();
  21227. });
  21228. }
  21229. }
  21230. UISkill$1.uiName = "UISkill";
  21231. class UIAddProp$1 extends UIBase {
  21232. constructor() {
  21233. super();
  21234. this.curType = "";
  21235. }
  21236. onConstructor() {
  21237. this.ui = ui_UIAddProp.createInstance();
  21238. this.contentPane = this.ui;
  21239. this.isEject = false;
  21240. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21241. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  21242. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  21243. this.updateUI();
  21244. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  21245. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  21246. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  21247. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  21248. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  21249. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  21250. }
  21251. show(type) {
  21252. super.show();
  21253. this.curType = type == 0 ? "coin" : "diamond";
  21254. this.switchBtn("");
  21255. this.ui.t0.play();
  21256. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  21257. PlatMgr.showInsert(true);
  21258. }
  21259. closeSelf() {
  21260. this.hide();
  21261. }
  21262. updateUI() {
  21263. let data = cfgTable.moneyData;
  21264. let temp;
  21265. let obj;
  21266. for (const key in data) {
  21267. temp = data[key];
  21268. obj = this.ui.myNode["node" + key];
  21269. if (parseInt(key) <= 2) {
  21270. obj.diamondTxt.text = "+" + temp.num;
  21271. }
  21272. else {
  21273. obj.coinTxt.text = temp.num;
  21274. obj.diamondTxt.text = temp.get.split('_')[1];
  21275. }
  21276. }
  21277. this.updateDiamondShare();
  21278. }
  21279. updateDiamondShare() {
  21280. let data = DataMgr.getShareDiamondTimes();
  21281. if (data >= xGame.common.maxShareDiamondTimes) {
  21282. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  21283. this.ui.myNode.node1.touchable = false;
  21284. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21285. }
  21286. else {
  21287. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  21288. this.ui.myNode.node1.touchable = true;
  21289. }
  21290. }
  21291. switchBtn(type) {
  21292. if (type == "")
  21293. type = this.curType;
  21294. else {
  21295. if (this.curType == type) {
  21296. return;
  21297. }
  21298. else {
  21299. this.curType = type;
  21300. }
  21301. }
  21302. if (type == "coin") {
  21303. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  21304. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  21305. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  21306. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  21307. this.ui.myNode.c1.selectedIndex = 0;
  21308. }
  21309. else {
  21310. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  21311. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  21312. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  21313. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  21314. this.ui.myNode.c1.selectedIndex = 1;
  21315. }
  21316. }
  21317. convertCoin(index) {
  21318. let data = cfgTable.moneyData[index];
  21319. let coinNum = data.num;
  21320. let str = data.get.split('_')[1];
  21321. let needDiamond = parseInt(str);
  21322. if (DataMgr.diamondEnough(needDiamond)) {
  21323. DataMgr.setDiamond(-needDiamond);
  21324. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  21325. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  21326. }
  21327. else {
  21328. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  21329. this.switchBtn("diamond");
  21330. }
  21331. }
  21332. videoGetDiamond() {
  21333. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  21334. if (Laya.Browser.onAndroid) {
  21335. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21336. if (!boo) {
  21337. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21338. return;
  21339. }
  21340. }
  21341. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  21342. }
  21343. else {
  21344. console.log('zh:AD 失败,直接发放奖励');
  21345. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  21346. }
  21347. }
  21348. qjff_AD_for_uiAddProp_videoGetDiamond() {
  21349. let num = cfgTable.moneyData[2].num;
  21350. xGame.common.playObjFlyAnim(num, Prop.diamond);
  21351. this.closeSelf();
  21352. }
  21353. videoGetCoin() {
  21354. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  21355. if (Laya.Browser.onAndroid) {
  21356. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21357. if (!boo) {
  21358. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21359. return;
  21360. }
  21361. }
  21362. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  21363. }
  21364. else {
  21365. console.log('zh:AD 失败,直接发放奖励');
  21366. this.qjff_AD_for_uiAddProp_videoGetCoin();
  21367. }
  21368. }
  21369. qjff_AD_for_uiAddProp_videoGetCoin() {
  21370. xGame.common.playObjFlyAnim(2000, Prop.coin);
  21371. this.closeSelf();
  21372. }
  21373. shareGetDiamond() {
  21374. let times = DataMgr.getShareDiamondTimes();
  21375. if (times >= xGame.common.maxShareDiamondTimes) {
  21376. console.log('zh: 233333333333 maxShareDiamondTimes');
  21377. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21378. }
  21379. else {
  21380. console.log('zh:33333333333333ad');
  21381. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  21382. if (Laya.Browser.onAndroid) {
  21383. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21384. if (!boo) {
  21385. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21386. return;
  21387. }
  21388. }
  21389. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  21390. }
  21391. else {
  21392. console.log('zh:AD 失败,直接发放奖励');
  21393. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  21394. }
  21395. }
  21396. }
  21397. qjff_AD_for_uiAddProp_shareGetDiamond() {
  21398. let diamond = xGame.common.randomNum(50, 100);
  21399. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  21400. DataMgr.setShareDiamondTimes(1);
  21401. this.updateDiamondShare();
  21402. }
  21403. openPutBallView() {
  21404. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  21405. let skill = xGame.uiMgr.getUI(UISkill$1);
  21406. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  21407. let uigame = xGame.uiMgr.getUI(UIGame$1);
  21408. if (end && !end.isHide) {
  21409. xGame.uiMgr.Hide(UIGameEnd$1);
  21410. xGame.uiMgr.Show(UIMain$1);
  21411. }
  21412. if (skill && !skill.isHide)
  21413. xGame.uiMgr.Hide(UISkill$1);
  21414. if (uigame && !uigame.isHide)
  21415. xGame.uiMgr.Hide(UIGame$1);
  21416. if (level && !level.isHide) {
  21417. }
  21418. else {
  21419. xGame.uiMgr.Show(UILevelDisplay$1);
  21420. }
  21421. this.closeSelf();
  21422. }
  21423. }
  21424. UIAddProp$1.uiName = "UIAddProp";
  21425. class MoneyNode$1 {
  21426. constructor(ui) {
  21427. this.leftTime = 0;
  21428. this.ui = ui;
  21429. this.ui.addCoinBtn.onClick(this, this.addCoin);
  21430. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  21431. this.ui.addPowerBtn.onClick(this, this.addPower);
  21432. this.ui.c1.selectedIndex = 1;
  21433. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  21434. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  21435. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  21436. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  21437. this.coinChange();
  21438. this.diamondChange();
  21439. this.powerChange();
  21440. }
  21441. addPower() {
  21442. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21443. xGame.uiMgr.Show(UIPower$1);
  21444. }
  21445. powerChange() {
  21446. let powerNum = DataMgr.getPower();
  21447. this.ui.powerTxt.text = powerNum + "";
  21448. }
  21449. checkPowerTime() {
  21450. let cur = new Date().getTime();
  21451. let last = DataMgr.getPowerTime();
  21452. if (last == 0) {
  21453. last = cur;
  21454. DataMgr.setPowerTime(cur);
  21455. }
  21456. let power = DataMgr.getPower();
  21457. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  21458. Laya.timer.clearAll(this);
  21459. if (power >= xGame.common.natureMaxPower) {
  21460. this.ui.powerTimeTxt.text = "";
  21461. DataMgr.setPowerTime(cur);
  21462. return;
  21463. }
  21464. if (power + offset >= xGame.common.natureMaxPower) {
  21465. DataMgr.setPower(xGame.common.natureMaxPower, false);
  21466. this.ui.powerTimeTxt.text = "";
  21467. DataMgr.setPowerTime(cur);
  21468. }
  21469. else {
  21470. if (offset > 0) {
  21471. DataMgr.setPower(offset);
  21472. DataMgr.setPowerTime(cur);
  21473. }
  21474. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  21475. this.leftTime = xGame.common.powerRecoverNum - time;
  21476. if (this.leftTime <= 0)
  21477. this.leftTime = 0;
  21478. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21479. Laya.timer.loop(1000, this, this.updatePowerTime);
  21480. }
  21481. }
  21482. updatePowerTime() {
  21483. this.leftTime -= 1;
  21484. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21485. if (this.leftTime <= 0) {
  21486. this.checkPowerTime();
  21487. }
  21488. }
  21489. coinChange() {
  21490. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  21491. }
  21492. diamondChange() {
  21493. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  21494. }
  21495. addCoin() {
  21496. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21497. Moyu.sendDataEvent("AddCoinBtn");
  21498. xGame.uiMgr.Show(UIAddProp$1, 0);
  21499. }
  21500. addDiamond() {
  21501. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21502. Moyu.sendDataEvent("AddDiamondBtn");
  21503. xGame.uiMgr.Show(UIAddProp$1, 1);
  21504. }
  21505. }
  21506. class SettingNode$1 {
  21507. constructor(ui) {
  21508. this.showSetting = false;
  21509. this.openSound = true;
  21510. this.openShake = true;
  21511. this.ui = ui;
  21512. this.ui.soundBtn.onClick(this, this.switchSound);
  21513. this.ui.shakeBtn.onClick(this, this.switchShake);
  21514. this.ui.xyBtn.onClick(this, this.onXy);
  21515. this.ui.clickNode.onClick(this, this.changeSetting);
  21516. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  21517. this.ui.xyBtn.visible = false;
  21518. this.ui.shakeBtn.visible = false;
  21519. }
  21520. changeSetting() {
  21521. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21522. this.showSetting = !this.showSetting;
  21523. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  21524. }
  21525. switchSound() {
  21526. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21527. this.openSound = !this.openSound;
  21528. Moyu.onSetting(this.openSound, this.openShake);
  21529. xGame.soundMgr.onSetting(this.openSound);
  21530. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  21531. }
  21532. switchShake() {
  21533. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21534. this.openShake = !this.openShake;
  21535. Moyu.onSetting(this.openSound, this.openShake);
  21536. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  21537. }
  21538. onXy() {
  21539. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21540. MoyuMgr$1.showXy(1);
  21541. }
  21542. }
  21543. class UIDraw$1 extends UIBase {
  21544. constructor() {
  21545. super();
  21546. this.curKey = 0;
  21547. }
  21548. onConstructor() {
  21549. this.ui = ui_UIDraw.createInstance();
  21550. this.contentPane = this.ui;
  21551. this.isEject = false;
  21552. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21553. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21554. this.addUIClick(this.ui.drawBtn, this.startDraw);
  21555. this.initDraw();
  21556. this.initUI();
  21557. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21558. if (Moyu.isKs)
  21559. this.ui.closeNode.closeBtn.x += 100;
  21560. }
  21561. show() {
  21562. super.show();
  21563. this.ui.t0.play();
  21564. this.playSecretaryIdle();
  21565. this.updateDraw();
  21566. this.checkFree();
  21567. if (PlatMgr.bannerDelay > 0) {
  21568. this.ui.closeNode.closeBtn.visible = false;
  21569. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  21570. this.ui.closeNode.closeBtn.visible = true;
  21571. });
  21572. }
  21573. PlatMgr.showRateBanner();
  21574. }
  21575. hide() {
  21576. Laya.timer.clearAll(this);
  21577. super.hide();
  21578. }
  21579. checkFree() {
  21580. let isFree = DataMgr.getDailyfreeDrawTimes();
  21581. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  21582. }
  21583. initDraw() {
  21584. this.drawObj = [];
  21585. let data = cfgTable.drawData;
  21586. let temp;
  21587. let weight = 0;
  21588. for (const key in data) {
  21589. temp = data[key];
  21590. weight += temp.weight;
  21591. this.drawObj.push(weight);
  21592. }
  21593. this.allWeight = weight;
  21594. }
  21595. initUI() {
  21596. let data = cfgTable.drawData;
  21597. let temp;
  21598. let img;
  21599. let txt;
  21600. for (const key in data) {
  21601. temp = data[key];
  21602. img = this.ui.myNode.rotNode["img" + key];
  21603. txt = this.ui.myNode.rotNode["txt" + key];
  21604. img.url = xGame.common.getGameIconUrl(temp.icon);
  21605. txt.visible = true;
  21606. if (temp.award > 2) {
  21607. img.rotation = 0;
  21608. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  21609. }
  21610. else {
  21611. img.rotation = temp.rotation;
  21612. txt.text = temp.num;
  21613. }
  21614. }
  21615. }
  21616. getCurkey() {
  21617. let rand = Math.random() * this.allWeight;
  21618. let temp;
  21619. for (let index = 0; index < this.drawObj.length - 1; index++) {
  21620. temp = this.drawObj[index];
  21621. if (index == 0) {
  21622. if (rand < temp) {
  21623. return index + 1;
  21624. }
  21625. }
  21626. else {
  21627. if (rand >= temp && rand < this.drawObj[index + 1]) {
  21628. return index + 1;
  21629. }
  21630. }
  21631. }
  21632. return 2;
  21633. }
  21634. startDraw() {
  21635. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  21636. if (freeTimes > 0) {
  21637. this.beginDraw();
  21638. DataMgr.setDailyfreeDrawTimes(0);
  21639. this.checkFree();
  21640. }
  21641. else {
  21642. if (Laya.Browser.onAndroid) {
  21643. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21644. if (!boo) {
  21645. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21646. return;
  21647. }
  21648. }
  21649. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  21650. }
  21651. else {
  21652. console.log('zh:AD 失败,直接发放奖励');
  21653. this.qjff_chouJiang();
  21654. }
  21655. }
  21656. }
  21657. qjff_chouJiang() {
  21658. this.beginDraw();
  21659. }
  21660. beginDraw() {
  21661. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  21662. this.ui.drawBtn.touchable = false;
  21663. this.curKey = this.getCurkey();
  21664. console.log("当前key", this.curKey);
  21665. let cell = 60;
  21666. let lap = 3;
  21667. let angle = cell * (this.curKey - 1) + lap * 360;
  21668. let target = this.ui.myNode.rotNode;
  21669. target.rotation = 0;
  21670. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  21671. console.log("旋转完成");
  21672. this.ui.drawBtn.touchable = true;
  21673. this.getAward();
  21674. }));
  21675. }
  21676. getAward() {
  21677. let data = cfgTable.drawData[this.curKey];
  21678. let temp = new AwardType();
  21679. temp.type = data.award;
  21680. temp.num = data.num;
  21681. xGame.common.getAward([temp], () => {
  21682. DataMgr.setDrawTimes(1);
  21683. this.updateDraw();
  21684. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21685. });
  21686. }
  21687. updateDraw() {
  21688. let drawTimes = DataMgr.getDrawTimes();
  21689. let awardTimes = DataMgr.getDrawAwardTimes();
  21690. if (Math.floor(drawTimes / 3) > awardTimes) {
  21691. this.ui.extraNode.boxBtn.t0.play(null, -1);
  21692. this.ui.extraNode.boxBtn.touchable = true;
  21693. this.ui.extraNode.tipsTxt.text = "3/3";
  21694. this.ui.extraNode.barNode.width = 265;
  21695. this.getExtraAward();
  21696. }
  21697. else {
  21698. this.ui.extraNode.boxBtn.t0.stop();
  21699. this.ui.extraNode.boxBtn.touchable = false;
  21700. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  21701. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  21702. }
  21703. let data = cfgTable.drawData[1];
  21704. if (awardTimes == 0) {
  21705. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  21706. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  21707. this.ui.myNode.rotNode.img1.rotation = 0;
  21708. }
  21709. else {
  21710. let award = data.nextid;
  21711. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  21712. this.ui.myNode.rotNode.txt1.text = award[1];
  21713. this.ui.myNode.rotNode.img1.rotation = 0;
  21714. }
  21715. }
  21716. getExtraAward() {
  21717. let drawTimes = DataMgr.getDrawTimes();
  21718. let awardTimes = DataMgr.getDrawAwardTimes();
  21719. let data = cfgTable.drawData[1];
  21720. let award = new AwardType();
  21721. if (awardTimes == 0) {
  21722. award.num = data.num;
  21723. award.type = data.award;
  21724. xGame.common.getAward([award], () => {
  21725. let all = Math.floor(drawTimes / 3);
  21726. DataMgr.setDrawAwardTimes(all);
  21727. this.updateDraw();
  21728. });
  21729. }
  21730. else {
  21731. award.num = parseInt(data.nextid[1]);
  21732. award.type = parseInt(data.nextid[0]);
  21733. xGame.common.getAward([award], () => {
  21734. let all = Math.floor(drawTimes / 3);
  21735. DataMgr.setDrawAwardTimes(all);
  21736. this.updateDraw();
  21737. });
  21738. }
  21739. }
  21740. closeSelf() {
  21741. this.hide();
  21742. }
  21743. playSecretaryIdle() {
  21744. let parent = this.ui.secretary.displayObject;
  21745. parent.destroyChildren();
  21746. let xx = this.ui.secretary.width / 2;
  21747. let yy = this.ui.secretary.height;
  21748. let scale = xGame.common.getSecretaryScale();
  21749. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21750. xGame.common.secretary.play(data, 0, true, parent);
  21751. }
  21752. }
  21753. UIDraw$1.uiName = "UIDraw";
  21754. class UIRanking$1 extends UIBase {
  21755. constructor() {
  21756. super();
  21757. this.showSelf = true;
  21758. this.rankType = 1;
  21759. this.rankList = [];
  21760. this.topX = 10;
  21761. this.myIndex = this.topX + 1;
  21762. this.myStar = 0;
  21763. }
  21764. onConstructor() {
  21765. this.ui = ui_UIRanking.createInstance();
  21766. this.contentPane = this.ui;
  21767. this.isEject = false;
  21768. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  21769. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  21770. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  21771. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  21772. this.ui.myNode.myList.setVirtual();
  21773. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  21774. }
  21775. show() {
  21776. super.show();
  21777. this.getPaiHangBangDataFormJosnFile();
  21778. this.updateSelf();
  21779. let self = Moyu.getUserInfo();
  21780. if (!self.isAuth) {
  21781. Moyu.initUser(this, () => {
  21782. DataMgr.upRankData();
  21783. });
  21784. }
  21785. }
  21786. getPaiHangBangDataFormJosnFile() {
  21787. const rankingList = cfgTable.paiHangBangData.list;
  21788. this.updateItemData(rankingList);
  21789. }
  21790. updateSelfItem() {
  21791. console.log('zh:Moyu.platType =' + Moyu.platType);
  21792. let self = Moyu.getUserInfo();
  21793. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  21794. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  21795. if (this.myIndex > this.topX) {
  21796. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  21797. }
  21798. else {
  21799. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  21800. }
  21801. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  21802. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  21803. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  21804. }
  21805. updateItemData(data) {
  21806. this.myStar = xGame.common.getAllStarNum();
  21807. if (this.rankList.length < 2) {
  21808. this.rankList = data;
  21809. let self = Moyu.getUserInfo();
  21810. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  21811. self.headIcon = self.headIcon;
  21812. for (let i = 0; i < data.length; i++) {
  21813. let data = this.rankList[i];
  21814. if (data.userId == self.userId) {
  21815. this.rankList.splice(i, 1);
  21816. break;
  21817. }
  21818. }
  21819. for (let i = 0; i < data.length; i++) {
  21820. let data = this.rankList[i];
  21821. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  21822. this.myIndex = i + 1;
  21823. let user = { headIcon: self.headIcon, nickName: "myself" };
  21824. let ud = { user: user, data: {} };
  21825. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  21826. console.log('zh:Moyu.platType = ' + Moyu.platType);
  21827. if (Moyu.platType < 11) {
  21828. user.headIcon = self.headIcon;
  21829. user.nickName = self.nickName;
  21830. }
  21831. this.rankList.splice(i, 0, md);
  21832. break;
  21833. }
  21834. }
  21835. }
  21836. this.updateSelfItem();
  21837. this.ui.myNode.myList.numItems = this.rankList.length;
  21838. }
  21839. updateItemUI(index, obj) {
  21840. let data = this.rankList[index];
  21841. let userData = JSON.parse(data.userData).user;
  21842. obj.nameTxt.text = userData.nickName.toString();
  21843. obj.valueTxt.text = data.rankScore;
  21844. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  21845. obj.rankTxt.text = index + 1;
  21846. switch (index) {
  21847. case 0:
  21848. this.setImg(obj, 1, 0, 0);
  21849. obj.rankTxt.color = "#FFC047";
  21850. break;
  21851. case 1:
  21852. this.setImg(obj, 0, 1, 0);
  21853. obj.rankTxt.color = "#ACACAC";
  21854. break;
  21855. case 2:
  21856. this.setImg(obj, 0, 0, 1);
  21857. obj.rankTxt.color = "#D09672";
  21858. break;
  21859. default:
  21860. this.setImg(obj, 0, 0, 0);
  21861. obj.rankTxt.color = "#496FAB";
  21862. break;
  21863. }
  21864. }
  21865. setImg(obj, a, b, c) {
  21866. obj.img1.visible = a ? true : false;
  21867. obj.img2.visible = b ? true : false;
  21868. obj.img3.visible = c ? true : false;
  21869. }
  21870. changeList(type) {
  21871. this.rankType = type;
  21872. this.updateSelf();
  21873. }
  21874. changeSelfNode() {
  21875. this.showSelf = !this.showSelf;
  21876. this.updateSelf();
  21877. }
  21878. updateSelf() {
  21879. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  21880. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  21881. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21882. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  21883. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21884. }
  21885. }
  21886. UIRanking$1.uiName = "UIRanking";
  21887. class UISecretary$1 extends UIBase {
  21888. constructor() {
  21889. super();
  21890. this.curIndex = 1;
  21891. }
  21892. onConstructor() {
  21893. this.ui = ui_UISecretary.createInstance();
  21894. this.contentPane = this.ui;
  21895. this.isEject = false;
  21896. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21897. this.nodeObj = { left: null, right: null, cur: null };
  21898. this.nodeObj.cur = this.ui.myNode.gameNode3;
  21899. }
  21900. show() {
  21901. super.show();
  21902. this.ui.t0.play();
  21903. this.updateData();
  21904. }
  21905. addSecretarySpine(node, spineName) {
  21906. if (spineName == "mishu") {
  21907. if (this.secretarySpine1) {
  21908. node.displayObject.destroyChildren();
  21909. this.playWoman(this.secretarySpine1, node.displayObject);
  21910. }
  21911. else {
  21912. let spine1 = new SpineMgr("mishu", () => {
  21913. this.secretarySpine1 = spine1;
  21914. this.playWoman(this.secretarySpine1, node.displayObject);
  21915. });
  21916. }
  21917. }
  21918. else {
  21919. if (this.secretarySpine2) {
  21920. node.displayObject.destroyChildren();
  21921. this.playWoman(this.secretarySpine2, node.displayObject);
  21922. }
  21923. else {
  21924. let spine2 = new SpineMgr("xiaomishu2", () => {
  21925. this.secretarySpine2 = spine2;
  21926. this.playWoman(this.secretarySpine2, node.displayObject);
  21927. });
  21928. }
  21929. }
  21930. }
  21931. playWoman(node, parent) {
  21932. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  21933. let yy = this.ui.myNode.gameNode3.secretary.height;
  21934. let scale = 1.5;
  21935. if (node == this.secretarySpine2) {
  21936. scale = 1.2;
  21937. }
  21938. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21939. node.play(data, 0, true, parent);
  21940. }
  21941. turnLeft() {
  21942. this.curIndex--;
  21943. if (this.curIndex < 1) {
  21944. this.curIndex = 2;
  21945. }
  21946. let left = this.nodeObj.left;
  21947. let right = this.nodeObj.right;
  21948. let cur = this.nodeObj.cur;
  21949. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21950. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21951. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21952. this.updateData();
  21953. }));
  21954. this.ui.myNode.setChildIndex(right, 2);
  21955. this.nodeObj.left = cur;
  21956. this.nodeObj.right = left;
  21957. this.nodeObj.cur = right;
  21958. }
  21959. turnRight() {
  21960. this.curIndex++;
  21961. if (this.curIndex > 2) {
  21962. this.curIndex = 1;
  21963. }
  21964. let left = this.nodeObj.left;
  21965. let right = this.nodeObj.right;
  21966. let cur = this.nodeObj.cur;
  21967. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21968. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21969. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21970. this.updateData();
  21971. }));
  21972. this.ui.myNode.setChildIndex(left, 2);
  21973. this.nodeObj.left = right;
  21974. this.nodeObj.right = cur;
  21975. this.nodeObj.cur = left;
  21976. }
  21977. updateData() {
  21978. console.log('zh: updateData FFFFFFFFFF');
  21979. let data = cfgTable.secretaryshopData;
  21980. let children = this.ui.myNode._children;
  21981. let temp;
  21982. let curData;
  21983. for (let index = 0; index < children.length; index++) {
  21984. temp = children[index];
  21985. curData = data[1];
  21986. temp.heightTxt.text = curData.height;
  21987. temp.foodTxt.text = curData.food;
  21988. temp.historyTxt.text = curData.history;
  21989. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  21990. this.addSecretarySpine(temp.secretary, curData.spine);
  21991. let womanIndex = curData.id - 1;
  21992. let getWoman = DataMgr.getSecretary(womanIndex);
  21993. let curUse = DataMgr.getCurSecretary();
  21994. if (getWoman) {
  21995. if (curUse == womanIndex) {
  21996. temp.purchaseBtn.c1.selectedIndex = 1;
  21997. }
  21998. else {
  21999. temp.purchaseBtn.c1.selectedIndex = 2;
  22000. }
  22001. }
  22002. else {
  22003. temp.purchaseBtn.c1.selectedIndex = 0;
  22004. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22005. }
  22006. temp.purchaseBtn.visible = false;
  22007. }
  22008. }
  22009. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22010. console.log('zh: 点击了clickSecretary ');
  22011. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22012. if (getWoman) {
  22013. if (curUse != womanIndex) {
  22014. console.log();
  22015. DataMgr.setCurSecretary(womanIndex);
  22016. this.updateData();
  22017. }
  22018. }
  22019. else {
  22020. console.log('zh:点击购买了');
  22021. let need = needDiamond;
  22022. if (DataMgr.diamondEnough(need)) {
  22023. DataMgr.setDiamond(-need);
  22024. DataMgr.setSecretary(womanIndex, 1);
  22025. DataMgr.setCurSecretary(womanIndex);
  22026. this.updateData();
  22027. }
  22028. else {
  22029. xGame.uiMgr.Show(UIAddProp$1, 1);
  22030. }
  22031. }
  22032. }
  22033. closeSelf() {
  22034. this.hide();
  22035. }
  22036. }
  22037. UISecretary$1.uiName = "UISecretary";
  22038. class BallRodDisplay$1 {
  22039. constructor(ui, index) {
  22040. this.index = 0;
  22041. this.uiIndex = 0;
  22042. this.ui = ui;
  22043. this.index = index;
  22044. this.initData();
  22045. }
  22046. initData() {
  22047. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22048. let data = cfgTable.ballrodData[this.index + 1];
  22049. this.ui.nameTxt.text = data.name;
  22050. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22051. this.ui.levelNode.c1.selectedIndex = data.quality;
  22052. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22053. if (data.spine) {
  22054. this.mySpine = new SpineMgr(data.spine, () => {
  22055. let xx = 150;
  22056. let yy = 70;
  22057. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22058. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22059. });
  22060. }
  22061. }
  22062. updateSelf() {
  22063. console.log('zh:updateSelf -------------- ');
  22064. let get = DataMgr.getBallRod(this.index);
  22065. if (get == null)
  22066. get = 1;
  22067. let curUse = DataMgr.getCurBallRod();
  22068. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22069. if (get) {
  22070. if (curUse == this.index) {
  22071. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22072. }
  22073. else {
  22074. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22075. }
  22076. }
  22077. else {
  22078. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22079. }
  22080. }
  22081. buyBallRod() {
  22082. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22083. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22084. switch (selectedIndex) {
  22085. case 0:
  22086. break;
  22087. case 1:
  22088. console.log('zh:点击了 USE THIS');
  22089. DataMgr.setCurBallRod(this.index);
  22090. let curUse = DataMgr.getCurBallRod();
  22091. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22092. let ui = xGame.uiMgr.getUI(UIShop$1);
  22093. ui.updateBallRod();
  22094. break;
  22095. case 2:
  22096. let data = cfgTable.ballrodData[this.index + 1];
  22097. let need = data.price;
  22098. if (DataMgr.diamondEnough(need)) {
  22099. DataMgr.setDiamond(-need);
  22100. DataMgr.setBallRod(this.index, 1);
  22101. DataMgr.setCurBallRod(this.index);
  22102. let ui = xGame.uiMgr.getUI(UIShop$1);
  22103. ui.updateBallRod();
  22104. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22105. }
  22106. else {
  22107. xGame.uiMgr.Show(UIAddProp$1, 1);
  22108. }
  22109. break;
  22110. default:
  22111. break;
  22112. }
  22113. }
  22114. logEventForGouMaiGan(qiuGanName) {
  22115. const ev = {
  22116. value: qiuGanName
  22117. };
  22118. const jsonStr = JSON.stringify(ev);
  22119. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22120. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22121. }
  22122. }
  22123. class DaoJuDisplay$1 {
  22124. constructor(ui, index) {
  22125. this.index = 0;
  22126. this.uiIndex = 0;
  22127. this.ui = ui;
  22128. this.index = index;
  22129. this.initData();
  22130. }
  22131. initData() {
  22132. this.ui.btn_buy.onClick(this, this.buySp);
  22133. this.ui.btn_buy.onClick(this, this.buyDj);
  22134. let data = cfgTable.daoJuData[this.index + 1];
  22135. console.log('zh:' + JSON.stringify(data));
  22136. this.ui.nameTxt.text = data.spbt;
  22137. this.ui.n_jiaGe.text = data.spjg + "";
  22138. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22139. let baseUrl = "asset/sound/ogg/";
  22140. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  22141. }
  22142. buyDj() {
  22143. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22144. }
  22145. buySp() {
  22146. let data = cfgTable.daoJuData[this.index + 1];
  22147. console.log('zh:点击购买 data =' + JSON.stringify(data));
  22148. }
  22149. }
  22150. class UIShop$1 extends UIBase {
  22151. constructor() {
  22152. super();
  22153. this.itemNums = 0;
  22154. this.itemNumsForDj = 0;
  22155. this.curType = "";
  22156. }
  22157. onConstructor() {
  22158. this.ui = ui_UIShop.createInstance();
  22159. this.contentPane = this.ui;
  22160. this.isEject = false;
  22161. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22162. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22163. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  22164. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  22165. this.addUIClick(this.ui, this.interuptSecretary);
  22166. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  22167. this.ballRodArr = [];
  22168. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  22169. this.ui.myNode.myList.numItems = this.itemNums;
  22170. this.loadDjdata_old();
  22171. }
  22172. loadDjdata_old() {
  22173. let fff = cfgTable.daoJuData;
  22174. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  22175. this.daoJuArr = [];
  22176. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  22177. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  22178. }
  22179. getProductList() {
  22180. let reqData = xGame.httpMgr.getReqData();
  22181. let pd = JSON.parse(reqData);
  22182. pd.splx = "Consumable";
  22183. reqData = JSON.stringify(pd);
  22184. xGame.httpMgr.sendPost2025('getProductList', reqData, (res) => {
  22185. try {
  22186. let code = res.code;
  22187. let msg = res.msg;
  22188. if (code == 200) {
  22189. let data = res.data;
  22190. for (let index = 0; index < data.length; index++) {
  22191. let element = data[index];
  22192. cfgTable.daoJuData[element.spid] = element;
  22193. }
  22194. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  22195. }
  22196. else {
  22197. xGame.uiMgr.Show(UIMsg, msg);
  22198. }
  22199. }
  22200. catch (error) {
  22201. console.log('error=' + error);
  22202. alert(error);
  22203. }
  22204. finally {
  22205. }
  22206. });
  22207. }
  22208. show(type) {
  22209. super.show();
  22210. this.curType = type == 0 ? "qiugan" : "daoju";
  22211. this.switchBtn("qiugan");
  22212. this.playSecretaryIdle();
  22213. this.updateBallRod();
  22214. }
  22215. test123() {
  22216. console.log('zh:test123 ');
  22217. }
  22218. switchBtn(type) {
  22219. console.log('zh:1111切換 sel type=' + type);
  22220. if (type == "") {
  22221. type = this.curType;
  22222. }
  22223. else {
  22224. if (this.curType == type) {
  22225. return;
  22226. }
  22227. else {
  22228. this.curType = type;
  22229. }
  22230. }
  22231. if (type == "qiugan") {
  22232. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  22233. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  22234. this.ui.myNode.c1.selectedIndex = 0;
  22235. this.ui.myNode.myList.visible = true;
  22236. this.ui.myNode.djList.visible = false;
  22237. }
  22238. else {
  22239. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  22240. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  22241. this.ui.myNode.c1.selectedIndex = 1;
  22242. this.ui.myNode.myList.visible = false;
  22243. this.ui.myNode.djList.visible = true;
  22244. }
  22245. }
  22246. updateBallRod() {
  22247. for (let index = 0; index < this.ballRodArr.length; index++) {
  22248. this.ballRodArr[index].updateSelf();
  22249. }
  22250. }
  22251. renderBallRod(sort, obj) {
  22252. let index = this.getIndexBySort(sort + 1) - 1;
  22253. let ballRod = new BallRodDisplay$1(obj, index);
  22254. this.ballRodArr.push(ballRod);
  22255. }
  22256. renderDaoJu(idx, obj) {
  22257. let index = this.getIndexBySortForDj(idx + 1) - 1;
  22258. let b = new DaoJuDisplay$1(obj, index);
  22259. this.daoJuArr.push(b);
  22260. }
  22261. getIndexBySort(sort) {
  22262. let object = cfgTable.ballrodData;
  22263. for (const key in object) {
  22264. if (object[key].sort == sort) {
  22265. return parseInt(key);
  22266. }
  22267. }
  22268. }
  22269. getIndexBySortForDj(idx) {
  22270. let object = cfgTable.daoJuData;
  22271. for (const key in object) {
  22272. if (object[key].idx == idx) {
  22273. return parseInt(key);
  22274. }
  22275. }
  22276. }
  22277. playSecretaryIdle() {
  22278. let parent = this.ui.secretary.displayObject;
  22279. parent.destroyChildren();
  22280. let xx = this.ui.secretary.width / 2;
  22281. let yy = this.ui.secretary.height;
  22282. let scale = xGame.common.getSecretaryScale();
  22283. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22284. xGame.common.secretary.play(data, 0, true, parent);
  22285. }
  22286. interuptSecretary() {
  22287. Laya.timer.clearAll(this);
  22288. this.playSecretaryRandomSound();
  22289. }
  22290. playSecretaryRandomSound() {
  22291. if (this.isHide)
  22292. return;
  22293. let time = xGame.common.randomNum(45000, 60000);
  22294. Laya.timer.once(time, this, () => {
  22295. if (this.isHide)
  22296. return;
  22297. let index = xGame.common.randomNum(4, 7);
  22298. xGame.soundMgr.playSound("s_main0" + index);
  22299. let words = 1;
  22300. switch (index) {
  22301. case 4:
  22302. words = 5;
  22303. break;
  22304. case 5:
  22305. words = 3;
  22306. break;
  22307. case 6:
  22308. words = 6;
  22309. break;
  22310. case 7:
  22311. words = 7;
  22312. break;
  22313. default:
  22314. break;
  22315. }
  22316. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22317. this.playSecretaryRandomSound();
  22318. });
  22319. }
  22320. closeSelf() {
  22321. this.hide();
  22322. }
  22323. }
  22324. UIShop$1.uiName = "UIShop";
  22325. class SignMax$1 {
  22326. constructor(ui) {
  22327. this.ui = ui;
  22328. }
  22329. updateSelf(index, sameDay, curDayIndex) {
  22330. let data = cfgTable.signData[index + 1];
  22331. this.ui.titleTxt.text = data.title;
  22332. let arr1 = data.award[0].split('-');
  22333. let arr2 = data.award[1].split('-');
  22334. let num1 = parseInt(arr1[1]);
  22335. let num2 = parseInt(arr2[1]);
  22336. this.ui.numTxt1.text = num1 + "";
  22337. this.ui.numTxt2.text = num2 + "";
  22338. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  22339. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  22340. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  22341. this.ui.numTxt1.visible = false;
  22342. }
  22343. else {
  22344. this.ui.numTxt1.visible = true;
  22345. }
  22346. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  22347. this.ui.numTxt2.visible = false;
  22348. }
  22349. else {
  22350. this.ui.numTxt2.visible = true;
  22351. }
  22352. if (index < curDayIndex) {
  22353. this.ui.c1.selectedIndex = 1;
  22354. }
  22355. else if (index == curDayIndex) {
  22356. if (sameDay) {
  22357. this.ui.c1.selectedIndex = 2;
  22358. }
  22359. else {
  22360. this.ui.c1.selectedIndex = 2;
  22361. }
  22362. }
  22363. else {
  22364. this.ui.c1.selectedIndex = 0;
  22365. }
  22366. }
  22367. }
  22368. class SignNormal$1 {
  22369. constructor(ui) {
  22370. this.ui = ui;
  22371. }
  22372. updateSelf(index, sameDay, curDayIndex) {
  22373. let data = cfgTable.signData[index + 1];
  22374. this.ui.titleTxt.text = data.title;
  22375. let arr = data.award[0].split('-');
  22376. let type = parseInt(arr[0]);
  22377. let num = parseInt(arr[1]);
  22378. this.ui.numTxt.text = num + "";
  22379. if (type > 2) {
  22380. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  22381. this.ui.myIcon.rotation = 0;
  22382. }
  22383. else {
  22384. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  22385. this.ui.myIcon.rotation = 0;
  22386. }
  22387. if (xGame.common.signAwardContainsRod(data.award)) {
  22388. this.ui.numTxt.visible = false;
  22389. }
  22390. else {
  22391. this.ui.numTxt.visible = true;
  22392. }
  22393. if (index < curDayIndex) {
  22394. this.ui.c1.selectedIndex = 1;
  22395. }
  22396. else if (index == curDayIndex) {
  22397. if (sameDay) {
  22398. this.ui.c1.selectedIndex = 2;
  22399. }
  22400. else {
  22401. this.ui.c1.selectedIndex = 2;
  22402. }
  22403. }
  22404. else {
  22405. this.ui.c1.selectedIndex = 0;
  22406. }
  22407. }
  22408. }
  22409. class UISign$1 extends UIBase {
  22410. constructor() {
  22411. super();
  22412. this.curDayIndex = 0;
  22413. this.starX = 0;
  22414. }
  22415. onConstructor() {
  22416. this.ui = ui_UISign.createInstance();
  22417. this.contentPane = this.ui;
  22418. this.isEject = false;
  22419. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22420. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22421. this.initSignItem();
  22422. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  22423. this.addUIClick(this.ui.againBtn, this.againGetAward);
  22424. }
  22425. show() {
  22426. super.show();
  22427. this.ui.t0.play();
  22428. this.playSecretaryIdle();
  22429. this.updateSign();
  22430. }
  22431. initSignItem() {
  22432. this.signArr = [];
  22433. for (let index = 0; index < 6; index++) {
  22434. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  22435. this.signArr.push(temp);
  22436. }
  22437. this.signMax = new SignMax$1(this.ui.myNode.day7);
  22438. if (Moyu.isKs)
  22439. this.ui.closeNode.closeBtn.x += 100;
  22440. }
  22441. updateSign() {
  22442. let sameDay = xGame.common.judgeSameDay();
  22443. let max = 7;
  22444. this.curDayIndex = DataMgr.getSignData();
  22445. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  22446. this.curDayIndex = 0;
  22447. if (!sameDay) {
  22448. this.ui.normalBtn.visible = true;
  22449. this.ui.tipsNode.visible = false;
  22450. this.ui.againBtn.visible = false;
  22451. }
  22452. else {
  22453. this.ui.normalBtn.visible = false;
  22454. let again = DataMgr.getExtraSign();
  22455. let isCurrency = false;
  22456. let index = this.curDayIndex;
  22457. if (index == 0)
  22458. index = 7;
  22459. let award = cfgTable.signData[index].award;
  22460. let num = award[0].split("-")[0];
  22461. if (num == "1" || num == "2")
  22462. isCurrency = true;
  22463. let showAgain = again == 0 && isCurrency;
  22464. this.ui.againBtn.visible = showAgain;
  22465. this.ui.tipsNode.visible = !showAgain;
  22466. }
  22467. for (let index = 0; index < this.signArr.length; index++) {
  22468. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  22469. }
  22470. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  22471. }
  22472. playSecretaryIdle() {
  22473. let parent = this.ui.secretary.displayObject;
  22474. parent.destroyChildren();
  22475. let xx = this.ui.secretary.width / 2;
  22476. let yy = this.ui.secretary.height;
  22477. let scale = xGame.common.getSecretaryScale();
  22478. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22479. xGame.common.secretary.play(data, 0, true, parent);
  22480. }
  22481. closeSelf() {
  22482. this.hide();
  22483. }
  22484. normalGetAward() {
  22485. let sameDay = xGame.common.judgeSameDay();
  22486. if (!sameDay) {
  22487. let award = cfgTable.signData[this.curDayIndex + 1].award;
  22488. let temp;
  22489. let type;
  22490. let num;
  22491. let arr = [];
  22492. for (let index = 0; index < award.length; index++) {
  22493. temp = award[index].split("-");
  22494. type = parseInt(temp[0]);
  22495. num = parseInt(temp[1]);
  22496. let awardType = new AwardType();
  22497. awardType.num = num;
  22498. awardType.type = type;
  22499. arr.push(awardType);
  22500. }
  22501. xGame.common.getAward(arr, (watchVideo) => {
  22502. this.curDayIndex++;
  22503. if (this.curDayIndex > 7)
  22504. this.curDayIndex = 0;
  22505. DataMgr.setSignData(this.curDayIndex);
  22506. DataMgr.setSignTime(new Date().getTime());
  22507. if (watchVideo) {
  22508. DataMgr.setExtraSign(1);
  22509. Moyu.sendDataEvent("signIn1");
  22510. }
  22511. this.updateSign();
  22512. });
  22513. }
  22514. }
  22515. againGetAward() {
  22516. Moyu.sendDataEvent("signIn2");
  22517. console.log('zh:qjff_AD_for_uisign');
  22518. if (Laya.Browser.onAndroid) {
  22519. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22520. if (!boo) {
  22521. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22522. return;
  22523. }
  22524. }
  22525. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  22526. }
  22527. else {
  22528. console.log('zh:AD 失败,直接发放奖励');
  22529. this.qjff_AD_for_uisign();
  22530. }
  22531. }
  22532. qjff_AD_for_uisign() {
  22533. let index = this.curDayIndex;
  22534. if (index == 0)
  22535. index = 7;
  22536. let award = cfgTable.signData[index].award;
  22537. let temp;
  22538. let type;
  22539. let num;
  22540. for (let index = 0; index < award.length; index++) {
  22541. temp = award[index].split("-");
  22542. type = parseInt(temp[0]);
  22543. num = parseInt(temp[1]) * 3;
  22544. xGame.common.playObjFlyAnim(num, type);
  22545. }
  22546. DataMgr.setExtraSign(1);
  22547. this.updateSign();
  22548. }
  22549. }
  22550. UISign$1.uiName = "UISign";
  22551. class UIModeSelection$1 extends UIBase {
  22552. constructor() {
  22553. super();
  22554. }
  22555. onConstructor() {
  22556. this.ui = ui_UIModeSelection.createInstance();
  22557. this.contentPane = this.ui;
  22558. this.isEject = false;
  22559. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  22560. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  22561. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  22562. this.addUIClick(this.ui.closeBtn, this.hide);
  22563. this.peopleArr = [65, 990, 580];
  22564. this.peopleOffest = [5, 10, 10];
  22565. }
  22566. show(callback) {
  22567. this.updateSelf();
  22568. super.show();
  22569. this.ui.t0.play();
  22570. this.callback = callback;
  22571. }
  22572. updateSelf() {
  22573. let cfg = cfgTable.modeselectData;
  22574. for (let index = 1; index <= 3; index++) {
  22575. let node = this.ui.myNode["type" + index];
  22576. node.need.text = cfg[index].need;
  22577. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  22578. node.peopleTxt.text = this.getRandPeople(index - 1);
  22579. }
  22580. }
  22581. enterGame(type) {
  22582. console.log('zh: 进入经典模式 type: ' + type);
  22583. xGame.common.classicRoomType = type;
  22584. let cfg = cfgTable.modeselectData[type];
  22585. let need = cfg.need;
  22586. xGame.common.passAwardCoin = cfg.award;
  22587. if (DataMgr.coinEnough(need)) {
  22588. DataMgr.setCoin(-need);
  22589. this.ui.myNode["type" + type].t0.play();
  22590. Laya.timer.once(200, this, () => {
  22591. this.callback && this.callback();
  22592. });
  22593. this.logEventForClassic_start();
  22594. }
  22595. else {
  22596. Moyu.sendDataEvent("AddCoinVideo");
  22597. xGame.uiMgr.Show(UIAddProp$1, 0);
  22598. }
  22599. }
  22600. getRandPeople(index) {
  22601. let rand = this.peopleOffest[index];
  22602. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  22603. }
  22604. logEventForClassic_start() {
  22605. let rtype = xGame.common.classicRoomType;
  22606. let msmc = '';
  22607. if (rtype == 1) {
  22608. msmc = 'beginner';
  22609. }
  22610. if (rtype == 2) {
  22611. msmc = 'expert';
  22612. }
  22613. if (rtype == 3) {
  22614. msmc = 'master';
  22615. }
  22616. let keyStr = 'sjmd_classic_start_' + rtype;
  22617. let jsonStr = {
  22618. "difficulty": msmc,
  22619. "classic_count": 1,
  22620. "difficulty_count": 1
  22621. };
  22622. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22623. const d = LocalStorageManager.getItem(keyStr);
  22624. jsonStr.classic_count = d.classic_count + 1;
  22625. jsonStr.difficulty_count = d.difficulty_count + 1;
  22626. LocalStorageManager.setItem(keyStr, jsonStr);
  22627. }
  22628. else {
  22629. LocalStorageManager.setItem(keyStr, jsonStr);
  22630. }
  22631. const reqStr = JSON.stringify(jsonStr);
  22632. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  22633. }
  22634. }
  22635. UIModeSelection$1.uiName = "UIModeSelection";
  22636. class UILogin$1 extends UIBase {
  22637. constructor() {
  22638. super();
  22639. }
  22640. onConstructor() {
  22641. this.ui = ui_UILogin.createInstance();
  22642. this.contentPane = this.ui;
  22643. this.isEject = false;
  22644. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22645. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  22646. this.addUIClick(this.ui.btn_login, this.userLogin);
  22647. }
  22648. show() {
  22649. super.show();
  22650. this.x = (Laya.stage.width - this.width) / 2;
  22651. this.y = (Laya.stage.height - this.height) / 2;
  22652. }
  22653. closeSelf() {
  22654. this.hide();
  22655. }
  22656. userLogin() {
  22657. let ua = this.ui.txt_ua.text;
  22658. let up = this.ui.txt_up.text;
  22659. if (ua && up) {
  22660. let reqData = JSON.stringify({
  22661. username: ua.trim(),
  22662. password: up.trim(),
  22663. fromMark: 'app_game'
  22664. });
  22665. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  22666. try {
  22667. console.log('zh:res = ' + JSON.stringify(res));
  22668. let code = res.code;
  22669. let msg = res.msg;
  22670. if (code == 200) {
  22671. let keyStr = 'userInfo';
  22672. let jsonStr = {
  22673. "username": res.username,
  22674. "token": res.token
  22675. };
  22676. LocalStorageManager.setItem(keyStr, jsonStr);
  22677. xGame.uiMgr.Show(UIMsg$1, msg);
  22678. this.closeSelf();
  22679. }
  22680. else {
  22681. xGame.uiMgr.Show(UIMsg$1, msg);
  22682. }
  22683. }
  22684. catch (error) {
  22685. console.log('error=' + error);
  22686. alert(error);
  22687. }
  22688. finally {
  22689. }
  22690. });
  22691. }
  22692. else {
  22693. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22694. }
  22695. }
  22696. gotoRegPage() {
  22697. this.closeSelf();
  22698. xGame.uiMgr.Show(UIReg$1);
  22699. }
  22700. }
  22701. UILogin$1.uiName = "UILogin";
  22702. class UIReg$1 extends UIBase {
  22703. constructor() {
  22704. super();
  22705. }
  22706. onConstructor() {
  22707. this.ui = ui_UIReg.createInstance();
  22708. this.contentPane = this.ui;
  22709. this.isEject = false;
  22710. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22711. this.addUIClick(this.ui.btn_reg, this.regUser);
  22712. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  22713. }
  22714. show() {
  22715. super.show();
  22716. this.x = (Laya.stage.width - this.width) / 2;
  22717. this.y = (Laya.stage.height - this.height) / 2;
  22718. }
  22719. closeSelf() {
  22720. this.hide();
  22721. }
  22722. regUser() {
  22723. this.ui.lab_tip.visible = false;
  22724. let ua = this.ui.txt_ua.text;
  22725. let up1 = this.ui.txt_up1.text;
  22726. let up2 = this.ui.txt_up2.text;
  22727. if (ua && up1 && up2 && up1 == up2) {
  22728. let reqData = JSON.stringify({
  22729. username: ua.trim(),
  22730. password: up1.trim(),
  22731. fromMark: 'app_game'
  22732. });
  22733. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  22734. try {
  22735. console.log('zh:res = ' + JSON.stringify(res));
  22736. let code = res.code;
  22737. let msg = res.msg;
  22738. xGame.uiMgr.Show(UIMsg$1, msg);
  22739. if (code == 200) {
  22740. this.ui.lab_tip.color = "#FFFFFF";
  22741. xGame.uiMgr.Show(UIMsg$1, msg);
  22742. this.closeSelf();
  22743. }
  22744. else {
  22745. this.ui.lab_tip.color = "#FF0000";
  22746. xGame.uiMgr.Show(UIMsg$1, msg);
  22747. }
  22748. }
  22749. catch (error) {
  22750. console.log('error=' + error);
  22751. alert(error);
  22752. }
  22753. finally {
  22754. }
  22755. });
  22756. }
  22757. else {
  22758. if (up1 != up2) {
  22759. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  22760. }
  22761. else {
  22762. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22763. }
  22764. }
  22765. }
  22766. gotoLogin() {
  22767. this.closeSelf();
  22768. xGame.uiMgr.Show(UILogin$1);
  22769. }
  22770. }
  22771. UIReg$1.uiName = "UIReg";
  22772. class UIFuli1$1 extends UIBase {
  22773. constructor() {
  22774. super();
  22775. }
  22776. onConstructor() {
  22777. this.ui = ui_UIFuli1.createInstance();
  22778. this.contentPane = this.ui;
  22779. this.isEject = false;
  22780. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  22781. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  22782. }
  22783. show() {
  22784. super.show();
  22785. this.x = (Laya.stage.width - this.width) / 2;
  22786. this.y = (Laya.stage.height - this.height) / 2;
  22787. }
  22788. closeSelf() {
  22789. this.hide();
  22790. }
  22791. gotoBuy() {
  22792. this.hide();
  22793. }
  22794. }
  22795. UIFuli1$1.uiName = "UIFuli1";
  22796. class UIFuli2$1 extends UIBase {
  22797. constructor() {
  22798. super();
  22799. }
  22800. onConstructor() {
  22801. this.ui = ui_UIFuli2.createInstance();
  22802. this.contentPane = this.ui;
  22803. this.isEject = false;
  22804. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  22805. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  22806. }
  22807. show() {
  22808. super.show();
  22809. this.x = (Laya.stage.width - this.width) / 2;
  22810. this.y = (Laya.stage.height - this.height) / 2;
  22811. }
  22812. closeSelf() {
  22813. this.hide();
  22814. }
  22815. gotoBuy() {
  22816. this.hide();
  22817. }
  22818. }
  22819. UIFuli2$1.uiName = "UIFuli2";
  22820. class UITry$1 extends UIBase {
  22821. constructor() {
  22822. super();
  22823. this.closeTime = 0;
  22824. this.closeNum = 0;
  22825. this.skillUrl = xGame.common.skillIconList;
  22826. }
  22827. onConstructor() {
  22828. this.ui = ui_UITry.createInstance();
  22829. this.contentPane = this.ui;
  22830. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  22831. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  22832. }
  22833. show() {
  22834. super.show();
  22835. this.closeNum = 0;
  22836. this.closeTime = 15;
  22837. this.ui.t0.play();
  22838. PlatMgr.showRateBanner();
  22839. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22840. Laya.timer.loop(1000, this, this.updateTime);
  22841. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  22842. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  22843. xGame.common.gameMgr.gamePause = true;
  22844. }
  22845. updateTime() {
  22846. if (this.closeTime > 1) {
  22847. this.closeTime--;
  22848. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22849. }
  22850. else
  22851. this.hide();
  22852. }
  22853. hide() {
  22854. Laya.timer.clearAll(this);
  22855. Moyu.showBannerAd(false);
  22856. super.hide();
  22857. xGame.common.gameMgr.gamePause = false;
  22858. }
  22859. onTry() {
  22860. console.log('zh:qjff_AD_for_uitry');
  22861. if (Laya.Browser.onAndroid) {
  22862. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22863. if (!boo) {
  22864. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22865. return;
  22866. }
  22867. }
  22868. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  22869. }
  22870. else {
  22871. console.log('zh:AD 失败,直接发放奖励');
  22872. this.qjff_AD_for_uitry();
  22873. }
  22874. }
  22875. qjff_AD_for_uitry() {
  22876. let select = xGame.common.curPlayerSkillType;
  22877. DataMgr.gameData.trySkill = select;
  22878. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  22879. DataMgr.saveGameData();
  22880. DataMgr.setBigSkill(select, 1);
  22881. xGame.showTip("Trial Successful");
  22882. this.hide();
  22883. }
  22884. onCancel() {
  22885. if (this.closeNum > 0) {
  22886. this.closeNum--;
  22887. if (this.closeNum < 2)
  22888. this.hide();
  22889. return;
  22890. }
  22891. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  22892. this.onTry();
  22893. }
  22894. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  22895. this.closeNum = 3;
  22896. }
  22897. else
  22898. this.hide();
  22899. }
  22900. }
  22901. UITry$1.uiName = "UITry";
  22902. class UIGetAward$1 extends UIBase {
  22903. constructor() {
  22904. super();
  22905. this.showTriple = true;
  22906. }
  22907. onConstructor() {
  22908. this.ui = ui_UIGetAward.createInstance();
  22909. this.contentPane = this.ui;
  22910. this.isEject = false;
  22911. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  22912. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  22913. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  22914. }
  22915. show(arr, showTriple, callback) {
  22916. super.show();
  22917. this.ui.t0.play();
  22918. this.ui.eftNode.visible = true;
  22919. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  22920. this.ui.eftNode.visible = false;
  22921. }), 1, 0, 0, 0.9);
  22922. this.awardArr = arr;
  22923. this.showTriple = showTriple;
  22924. this.callback = callback;
  22925. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  22926. this.ui.myList.numItems = arr.length;
  22927. xGame.soundMgr.playSound("getaward");
  22928. }
  22929. updateSelf(index, obj) {
  22930. let temp = this.awardArr[index];
  22931. let icon = this.getIcon(temp.type);
  22932. let str = icon;
  22933. if (temp.type > 2) {
  22934. str = "s" + icon;
  22935. }
  22936. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  22937. obj.myIcon.rotation = 0;
  22938. obj.numTxt.text = temp.num + "";
  22939. obj.numTxt.visible = temp.type > 2 ? false : true;
  22940. obj.nameTxt.text = this.getNameStr(temp.type);
  22941. }
  22942. renderItem(index, obj) {
  22943. this.updateSelf(index, obj);
  22944. }
  22945. tripleGetAward() {
  22946. console.log('zh:qjff_AD_for_uigetAward');
  22947. if (Laya.Browser.onAndroid) {
  22948. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22949. if (!boo) {
  22950. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22951. return;
  22952. }
  22953. }
  22954. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  22955. }
  22956. else {
  22957. console.log('zh:AD 失败,直接发放奖励');
  22958. this.qjff_AD_for_uigetAward();
  22959. }
  22960. }
  22961. qjff_AD_for_uigetAward() {
  22962. this.getAward(3);
  22963. }
  22964. normalGetAward() {
  22965. if (PlatMgr.isMisVideo())
  22966. this.tripleGetAward();
  22967. else
  22968. this.getAward();
  22969. }
  22970. getAward(times = 1) {
  22971. this.hide();
  22972. for (let index = 0; index < this.awardArr.length; index++) {
  22973. this.awardArr[index].num *= times;
  22974. }
  22975. this.callback && this.callback(times != 1);
  22976. }
  22977. getIcon(type) {
  22978. switch (type) {
  22979. case Prop.diamond:
  22980. return "ty_zs";
  22981. case Prop.coin:
  22982. return "ty_jb";
  22983. case Prop.gan1:
  22984. return "qg1";
  22985. case Prop.gan2:
  22986. return "qg2";
  22987. case Prop.gan3:
  22988. return "qg3";
  22989. case Prop.gan4:
  22990. return "qg4";
  22991. default:
  22992. break;
  22993. }
  22994. }
  22995. getNameStr(type) {
  22996. switch (type) {
  22997. case Prop.diamond:
  22998. return "Diamond";
  22999. case Prop.coin:
  23000. return "Coins";
  23001. case Prop.gan1:
  23002. case Prop.gan2:
  23003. case Prop.gan3:
  23004. case Prop.gan4:
  23005. return cfgTable.ballrodData[type - 1].name;
  23006. default:
  23007. break;
  23008. }
  23009. }
  23010. }
  23011. UIGetAward$1.uiName = "UIGetAward";
  23012. class UIBox$1 extends UIBase {
  23013. constructor() {
  23014. super();
  23015. this.boxNum = 0;
  23016. this.boxMax = 10;
  23017. this.inAd = false;
  23018. this.isClose = false;
  23019. }
  23020. onConstructor() {
  23021. this.ui = ui_UIBox.createInstance();
  23022. this.contentPane = this.ui;
  23023. this.isEject = false;
  23024. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  23025. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  23026. Laya.timer.loop(1000, this, this.update);
  23027. }
  23028. update() {
  23029. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  23030. this.boxNum -= 1;
  23031. this.upBar();
  23032. }
  23033. }
  23034. upBar() {
  23035. if (this.boxNum > this.boxMax)
  23036. this.boxNum = this.boxMax;
  23037. this.ui.bar.value = this.boxNum * 10;
  23038. }
  23039. show() {
  23040. super.show();
  23041. this.isClose = false;
  23042. this.boxNum = 0;
  23043. this.inAd = false;
  23044. this.upBar();
  23045. this.ui.t0.play();
  23046. this.ui.closeBtn.visible = false;
  23047. Laya.timer.once(3000, this, () => {
  23048. this.ui.closeBtn.visible = true;
  23049. this.ui.bar.alpha = 1;
  23050. });
  23051. Laya.timer.once(500, this, () => {
  23052. this.ui.t1.play();
  23053. });
  23054. }
  23055. hide() {
  23056. Laya.timer.clearAll(this);
  23057. Moyu.showBannerAd(false);
  23058. super.hide();
  23059. }
  23060. onOpenBox() {
  23061. this.boxNum++;
  23062. if (this.boxNum < this.boxMax) {
  23063. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  23064. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  23065. }
  23066. }
  23067. else if (this.boxNum == this.boxMax) {
  23068. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  23069. this.ui.openBtn.c1.selectedIndex = 13;
  23070. this.inAd = true;
  23071. }
  23072. else
  23073. this.getAward();
  23074. }
  23075. else if (this.inAd) {
  23076. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  23077. if (Laya.Browser.onAndroid) {
  23078. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23079. if (!boo) {
  23080. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23081. return;
  23082. }
  23083. }
  23084. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  23085. }
  23086. else {
  23087. console.log('zh:AD 失败,直接发放奖励');
  23088. this.qjff_AD_for_UIBOX_onOpenBox();
  23089. }
  23090. }
  23091. this.upBar();
  23092. }
  23093. qjff_AD_for_UIBOX_onOpenBox() {
  23094. this.getAward();
  23095. }
  23096. onCloseBox() {
  23097. if (this.isClose)
  23098. this.hide();
  23099. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  23100. this.isClose = true;
  23101. PlatMgr.showBanner(true, 0, 3000);
  23102. }
  23103. else
  23104. this.hide();
  23105. }
  23106. getAward() {
  23107. let str = "";
  23108. if (Math.random() < 0.5) {
  23109. let max = Moyu.isLegal ? 500 : 2500;
  23110. let num = xGame.tools.random(max, 500 + max);
  23111. DataMgr.setCoin(num);
  23112. str = "金币x" + num;
  23113. }
  23114. else {
  23115. let max = Moyu.isLegal ? 10 : 30;
  23116. let num = xGame.tools.random(max, 30 + max);
  23117. DataMgr.setDiamond(num);
  23118. str = "钻石x" + num;
  23119. }
  23120. xGame.showTip("恭喜获得-" + str);
  23121. this.hide();
  23122. }
  23123. }
  23124. UIBox$1.uiName = "UIBox";
  23125. class UIMain$1 extends UIBase {
  23126. constructor() {
  23127. super();
  23128. this.firstEnter = true;
  23129. }
  23130. nativeCallJs(msg) {
  23131. let t = msg;
  23132. console.log("zh: nativeCallJs 奖励开始发放:", t);
  23133. switch (t) {
  23134. case 'qjff_chouJiang':
  23135. let dui = xGame.uiMgr.getUI(UIDraw$1);
  23136. dui.qjff_chouJiang();
  23137. break;
  23138. case 'qjff_AD_for_uisign':
  23139. let dui2 = xGame.uiMgr.getUI(UISign$1);
  23140. dui2.qjff_AD_for_uisign();
  23141. break;
  23142. case 'qjff_AD_for_uitry':
  23143. let dui3 = xGame.uiMgr.getUI(UITry$1);
  23144. dui3.qjff_AD_for_uitry();
  23145. break;
  23146. case 'qjff_AD_for_uipower':
  23147. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  23148. dui4.qjff_AD_for_uipower();
  23149. break;
  23150. case 'qjff_AD_for_uigetAward':
  23151. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  23152. dui5.qjff_AD_for_uigetAward();
  23153. break;
  23154. case 'qjff_AD_for_uiGameEnd':
  23155. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  23156. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  23157. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  23158. break;
  23159. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  23160. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  23161. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  23162. break;
  23163. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  23164. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  23165. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  23166. break;
  23167. case 'qjff_AD_for_UIrepentProp_videoRegret':
  23168. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  23169. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  23170. break;
  23171. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  23172. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  23173. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  23174. break;
  23175. case 'qjff_AD_for_UIBOX_onOpenBox':
  23176. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  23177. dui11.qjff_AD_for_UIBOX_onOpenBox();
  23178. break;
  23179. case 'qjff_AD_for_UIAddCoin':
  23180. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  23181. dui12.qjff_AD_for_UIAddCoin();
  23182. break;
  23183. case '111a':
  23184. let dui14 = xGame.uiMgr.getUI(UISign$1);
  23185. dui14.qjff_AD_for_uisign();
  23186. break;
  23187. case '222a':
  23188. let dui15 = xGame.uiMgr.getUI(UISign$1);
  23189. dui15.qjff_AD_for_uisign();
  23190. break;
  23191. case '333a':
  23192. let dui16 = xGame.uiMgr.getUI(UISign$1);
  23193. dui16.qjff_AD_for_uisign();
  23194. break;
  23195. default:
  23196. console.log('zh:未知的方法名字' + t);
  23197. break;
  23198. }
  23199. }
  23200. onConstructor() {
  23201. console.log('zh: UIMain onConstructor');
  23202. this.ui = ui_UIMain.createInstance();
  23203. this.contentPane = this.ui;
  23204. this.isEject = false;
  23205. this.addEvent();
  23206. this.addClickSpine();
  23207. this.settingNode = new SettingNode$1(this.ui.settingNode);
  23208. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23209. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  23210. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  23211. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  23212. let curUse = DataMgr.getCurSecretary();
  23213. this.changeSecretary(curUse);
  23214. this.ui.talkNode.visible = false;
  23215. let guide = DataMgr.getSkillGuide();
  23216. if (xGame.common.isNewDay && guide == 1) {
  23217. xGame.common.isNewDay = false;
  23218. xGame.soundMgr.playSound("s_main01");
  23219. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23220. console.log("zh:播放小秘书每天语音");
  23221. }
  23222. this.onGetUserInfo();
  23223. this.ui.n83.visible = false;
  23224. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23225. const d = LocalStorageManager.getItem(keyForLoginInfo);
  23226. let ua = d.username;
  23227. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23228. }
  23229. this.c_btn_for_user();
  23230. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  23231. }
  23232. Logout() {
  23233. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23234. LocalStorageManager.removeItem(keyForLoginInfo);
  23235. this.freshUser();
  23236. }
  23237. }
  23238. gotoLogin() {
  23239. xGame.uiMgr.Show(UILogin$1);
  23240. }
  23241. gotoRegUser() {
  23242. xGame.uiMgr.Show(UIReg$1);
  23243. }
  23244. showFuLi() {
  23245. console.log('zh:福利2');
  23246. xGame.uiMgr.Show(UIFuli1$1);
  23247. xGame.uiMgr.Show(UIFuli2$1);
  23248. console.log('zh:福利2222');
  23249. }
  23250. c_btn_for_user() {
  23251. this.ui.n_Logout.visible = false;
  23252. this.ui.n_dengLu.visible = false;
  23253. this.ui.n_zhuCe.visible = false;
  23254. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23255. this.ui.n_Logout.visible = true;
  23256. }
  23257. else {
  23258. this.ui.n_dengLu.visible = true;
  23259. }
  23260. }
  23261. changeSecretary(curUse) {
  23262. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  23263. xGame.common.secretary && xGame.common.secretary.dispose();
  23264. this.addSecretarySpine(name);
  23265. }
  23266. addSecretarySpine(name) {
  23267. let spine = new SpineMgr(name, () => {
  23268. this.playSecretaryIdle();
  23269. });
  23270. xGame.common.secretary = spine;
  23271. }
  23272. addClickSpine() {
  23273. let clickSpine = new SpineMgr("dianji", () => {
  23274. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  23275. let parent = Laya.stage;
  23276. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  23277. clickSpine.play(data, 0, false, parent, (spine) => {
  23278. spine.destroy(true);
  23279. });
  23280. });
  23281. });
  23282. }
  23283. addEvent() {
  23284. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  23285. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  23286. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  23287. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  23288. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  23289. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  23290. this.addUIClick(this.ui, this.interuptSecretary);
  23291. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  23292. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  23293. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  23294. this.addUIClick(this.ui.shopBtn, this.openShopView);
  23295. this.addUIClick(this.ui.signBtn, this.openSignView);
  23296. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  23297. this.addUIClick(this.ui.rankBtn, this.openRanking);
  23298. this.addUIClick(this.ui.n_Logout, this.Logout);
  23299. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  23300. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  23301. this.addUIClick(this.ui.n_fuli, this.showFuLi);
  23302. }
  23303. show(showFailWords) {
  23304. super.show();
  23305. this.moneyNode.ui.c1.selectedIndex = 1;
  23306. this.playSecretaryIdle();
  23307. xGame.soundMgr.playMusic("caromhall01", 0);
  23308. Laya.timer.clearAll(this);
  23309. this.playSecretaryRandomSound();
  23310. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  23311. if (showFailWords) {
  23312. console.log('zh:uimain.ts ');
  23313. setTimeout(() => {
  23314. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  23315. let words = -1;
  23316. if (str == "s_main02") {
  23317. words = 2;
  23318. }
  23319. else {
  23320. words = 3;
  23321. }
  23322. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23323. xGame.soundMgr.playSound(str);
  23324. }, 300);
  23325. }
  23326. this.showGuide();
  23327. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  23328. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  23329. let guide = DataMgr.getSkillGuide();
  23330. if (guide == 1) {
  23331. let randTime = xGame.common.randomNum(300, 800);
  23332. if (this.firstEnter) {
  23333. console.log("zh: firstEnter");
  23334. this.firstEnter = false;
  23335. randTime += 900;
  23336. }
  23337. else {
  23338. console.log("zh: no firstEnter");
  23339. }
  23340. Laya.timer.once(randTime, this, () => {
  23341. xGame.common.autoPopUIView();
  23342. });
  23343. }
  23344. }
  23345. checkActive(show) {
  23346. }
  23347. showGuide() {
  23348. let guide = DataMgr.getSkillGuide();
  23349. this.ui.guideBtn.visible = guide == 0;
  23350. this.ui.enterGuide.visible = false;
  23351. this.ui.secretaryGuide.visible = guide == 0;
  23352. if (guide == 0) {
  23353. console.log("zh:显示引导");
  23354. xGame.soundMgr.playSound("s_guide");
  23355. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23356. }
  23357. else {
  23358. console.log("zh:不需要显示引导");
  23359. }
  23360. }
  23361. ensureSecretary() {
  23362. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  23363. this.ui.secretaryGuide.visible = false;
  23364. this.ui.enterGuide.visible = true;
  23365. this.ui.wordsNode.t0.play();
  23366. if (DataMgr.getNewUser())
  23367. Moyu.sendDataEvent("gameReady");
  23368. }
  23369. playSecretaryIdle() {
  23370. let parent = this.ui.secretary.displayObject;
  23371. parent.destroyChildren();
  23372. let xx = this.ui.secretary.width / 2;
  23373. let yy = this.ui.secretary.height;
  23374. let scale = xGame.common.getSecretaryScale();
  23375. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23376. xGame.common.secretary.play(data, 0, true, parent);
  23377. }
  23378. startGame(type) {
  23379. if (!this.isReadyForLoadNetSource()) {
  23380. return;
  23381. }
  23382. xGame.common.gameMode = type;
  23383. Moyu.sendDataEvent("PlayGame", { type: type });
  23384. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  23385. switch (xGame.common.gameMode) {
  23386. case GameMode.classic:
  23387. console.log('zh:进入经典模式111111111');
  23388. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  23389. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23390. console.log('zh:classic db_over_lev=', db_over_lev);
  23391. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  23392. console.log('zh:判断是否可以玩该模式classic =NO');
  23393. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  23394. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23395. return;
  23396. }
  23397. else {
  23398. console.log('zh:可以玩该模式classic 66666666666666');
  23399. this.beginGame();
  23400. }
  23401. }
  23402. else {
  23403. console.log('zh:不需要判断是否可以玩该classic');
  23404. let challengeTimes = DataMgr.getChallengeTimes();
  23405. if (challengeTimes == 0) {
  23406. xGame.uiMgr.Show(UIInvitation$1);
  23407. }
  23408. else {
  23409. this.beginGame();
  23410. }
  23411. break;
  23412. }
  23413. case GameMode.bigMove:
  23414. console.error('zh:bigMove check');
  23415. let guide = DataMgr.getSkillGuide();
  23416. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  23417. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23418. console.log('zh:bigMove db_over_lev=', db_over_lev);
  23419. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  23420. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  23421. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23422. return;
  23423. }
  23424. else {
  23425. console.log('zh:可以玩该模式 bigMove');
  23426. this.beginGame();
  23427. if (DataMgr.getNewUser())
  23428. Moyu.sendDataEvent("gameStart0");
  23429. }
  23430. }
  23431. else {
  23432. this.beginGame();
  23433. if (DataMgr.getNewUser())
  23434. Moyu.sendDataEvent("gameStart0");
  23435. }
  23436. break;
  23437. default:
  23438. console.error('zh:未知错误!!!!');
  23439. break;
  23440. }
  23441. }
  23442. beginGame(isNice = false) {
  23443. console.log('zh:beginGame ');
  23444. let guide = DataMgr.getSkillGuide();
  23445. if (guide == 1) {
  23446. console.log('zh:非新手引导,showInternAd ');
  23447. JSBridgeUtils.instance.showInternAd('beginGame');
  23448. }
  23449. else {
  23450. console.log('zh:新手引导,不显示AD ');
  23451. }
  23452. console.log('zh:beginGame 2 go');
  23453. if (xGame.common.gameMode == GameMode.classic) {
  23454. if (isNice) {
  23455. this.enterClassic();
  23456. }
  23457. else {
  23458. xGame.uiMgr.Show(UIModeSelection$1, () => {
  23459. console.log('zh:BBBBBBBBBBBBBBB');
  23460. this.enterClassic();
  23461. });
  23462. }
  23463. }
  23464. else if (xGame.common.gameMode == GameMode.bigMove) {
  23465. this.ui.enterGuide.visible = false;
  23466. xGame.uiMgr.Show(UISkill$1);
  23467. }
  23468. }
  23469. enterClassic() {
  23470. xGame.uiMgr.Show(UIGame$1);
  23471. xGame.uiMgr.Show(UIMatching$1, () => {
  23472. if (!this.isHide)
  23473. this.hide();
  23474. xGame.common.gameUI.ui.alpha = 1;
  23475. xGame.common.gameUI.startGame();
  23476. xGame.uiMgr.Hide(UIGameEnd$1);
  23477. });
  23478. }
  23479. startGlobal() {
  23480. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23481. }
  23482. startWeekly() {
  23483. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23484. }
  23485. zhouSaiMonth() {
  23486. console.log('zh: zhouSaiMonth 被调用');
  23487. }
  23488. isReadyForLoadNetSource() {
  23489. let reqCount = xGame.cfgMgr.httpReqCount;
  23490. let ok = xGame.cfgMgr.httpReqOkCount;
  23491. if (reqCount > ok) {
  23492. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  23493. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  23494. Laya.timer.once(5000, this, () => {
  23495. xGame.cfgMgr.getConfigFromServer();
  23496. });
  23497. return false;
  23498. }
  23499. return true;
  23500. }
  23501. startPlaceBall() {
  23502. if (!this.isReadyForLoadNetSource()) {
  23503. return;
  23504. }
  23505. xGame.uiMgr.Show(UILevelDisplay$1);
  23506. }
  23507. hide() {
  23508. console.log('zh:uimain hide ...');
  23509. super.hide();
  23510. xGame.common.stopGirlPop(this.ui.talkNode);
  23511. }
  23512. onGetUserInfo(force = false) {
  23513. if (Moyu.isWx) {
  23514. let info = Moyu.getSystemInfo();
  23515. if (info)
  23516. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  23517. }
  23518. else {
  23519. Moyu.initUser(this, this.freshUser, force);
  23520. }
  23521. this.freshUser();
  23522. }
  23523. freshUser() {
  23524. let user = Moyu.getUserInfo();
  23525. if (!user.isAuth) {
  23526. user.headIcon = 'res/ty_touxiang.png';
  23527. }
  23528. else {
  23529. DataMgr.upRankData();
  23530. }
  23531. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  23532. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  23533. let keyStr = keyForLoginInfo;
  23534. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23535. const d = LocalStorageManager.getItem(keyStr);
  23536. let ua = d.username;
  23537. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23538. }
  23539. else {
  23540. }
  23541. this.c_btn_for_user();
  23542. }
  23543. interuptSecretary() {
  23544. Laya.timer.clearAll(this);
  23545. this.playSecretaryRandomSound();
  23546. }
  23547. playSecretaryRandomSound() {
  23548. if (this.isHide)
  23549. return;
  23550. let time = xGame.common.randomNum(45000, 60000);
  23551. Laya.timer.once(time, this, () => {
  23552. if (this.isHide)
  23553. return;
  23554. let index = xGame.common.randomNum(4, 7);
  23555. xGame.soundMgr.playSound("s_main0" + index);
  23556. let words = 1;
  23557. switch (index) {
  23558. case 4:
  23559. words = 5;
  23560. break;
  23561. case 5:
  23562. words = 3;
  23563. break;
  23564. case 6:
  23565. words = 6;
  23566. break;
  23567. case 7:
  23568. words = 7;
  23569. break;
  23570. default:
  23571. break;
  23572. }
  23573. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23574. this.playSecretaryRandomSound();
  23575. });
  23576. }
  23577. openSecretaryView() {
  23578. xGame.uiMgr.Show(UISecretary$1);
  23579. Moyu.sendDataEvent("secretary");
  23580. }
  23581. openShopView() {
  23582. xGame.uiMgr.Show(UIShop$1, 0);
  23583. }
  23584. openSignView() {
  23585. xGame.uiMgr.Show(UISign$1);
  23586. }
  23587. openDrawView() {
  23588. xGame.uiMgr.Show(UIDraw$1);
  23589. }
  23590. openRanking() {
  23591. console.log('zh:phb openRanking');
  23592. xGame.uiMgr.Show(UIRanking$1);
  23593. Moyu.sendDataEvent("rankingList");
  23594. }
  23595. }
  23596. UIMain$1.uiName = "UIMain";
  23597. function InitShader() {
  23598. }
  23599. function appInit() {
  23600. xGame.context.init(getLoadingResList(), initCallback);
  23601. }
  23602. function getLoadingResList() {
  23603. return [
  23604. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  23605. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  23606. ];
  23607. }
  23608. function getGameResList() {
  23609. return [
  23610. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  23611. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  23612. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  23613. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  23614. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  23615. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  23616. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  23617. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  23618. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  23619. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  23620. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  23621. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  23622. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  23623. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  23624. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  23625. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  23626. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  23627. ];
  23628. }
  23629. function initCallback() {
  23630. window["DataMgr"] = DataMgr;
  23631. DataMgr.Init();
  23632. Moyu.init(getPlat(), this, () => {
  23633. DataMgr.isNewDay();
  23634. PlatMgr.initConfig();
  23635. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  23636. }, true);
  23637. console.log('zh:开始sm init1 start');
  23638. xGame.soundMgr.init();
  23639. console.log('zh:开始sm init1 end');
  23640. xGame.uiMgr.init();
  23641. xGame.uiMgr.clearTempData();
  23642. xGame.uiMgr.bindFUI(fguiRes.loading);
  23643. xGame.uiMgr.Show(UILoading);
  23644. }
  23645. function loadSubRes(callback) {
  23646. var tab = ["asset", "res", "spine"];
  23647. let subDone = 0;
  23648. for (var i = 0; i < tab.length; i++) {
  23649. let sub = tab[i];
  23650. Moyu.loadSubRes(sub, (pro) => {
  23651. callback && callback(pro, false);
  23652. }).then(() => {
  23653. subDone++;
  23654. if (subDone >= tab.length)
  23655. callback && callback(1, true);
  23656. });
  23657. }
  23658. }
  23659. function enterGame() {
  23660. xGame.cfgMgr.init();
  23661. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  23662. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  23663. xGame.uiMgr.Hide(UILoading);
  23664. fgui.UIPackage.removePackage(fguiRes.loading);
  23665. xGame.uiMgr.bindFUI(fguiRes.game);
  23666. xGame.uiMgr.Show(UIMain$1);
  23667. if (DataMgr.getNewUser())
  23668. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  23669. }
  23670. function getPlat() {
  23671. let cfg = new MoyuCfg();
  23672. cfg.plat = MoyuPlat.web;
  23673. cfg.myId = 180;
  23674. cfg.myKey = '8848a885774230a4';
  23675. cfg.version = 0;
  23676. if (window.hasOwnProperty("gamebox")) {
  23677. cfg.plat = MoyuPlat.f399;
  23678. cfg.version = 0;
  23679. }
  23680. else if (window.hasOwnProperty("ks")) {
  23681. cfg.plat = MoyuPlat.ks;
  23682. cfg.version = 0;
  23683. cfg.ads.ksVideoId = '2300002254_01';
  23684. cfg.ads.ksInsertId = '2300002254_02';
  23685. }
  23686. else if (Laya.Browser.onTTMiniGame) {
  23687. cfg.plat = MoyuPlat.tt;
  23688. cfg.version = 0;
  23689. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  23690. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  23691. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  23692. }
  23693. else if (Laya.Browser.onMiniGame) {
  23694. cfg.plat = MoyuPlat.wx;
  23695. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  23696. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  23697. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  23698. }
  23699. else if (Laya.Browser.onQQMiniGame) {
  23700. cfg.plat = MoyuPlat.qq;
  23701. }
  23702. else if (Laya.Browser.onQGMiniGame) {
  23703. cfg.plat = MoyuPlat.op;
  23704. cfg.ads.opVideoId = '455502';
  23705. cfg.ads.opBannerId = '455507';
  23706. }
  23707. else if (Laya.Browser.onVVMiniGame) {
  23708. cfg.plat = MoyuPlat.vv;
  23709. cfg.version = 0;
  23710. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  23711. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  23712. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  23713. }
  23714. else if (Laya.Browser.onHWMiniGame) {
  23715. cfg.plat = MoyuPlat.hw;
  23716. }
  23717. else if (window["mz"]) {
  23718. cfg.plat = MoyuPlat.mz;
  23719. }
  23720. else {
  23721. let cfg = window['conchConfig'];
  23722. if (cfg) {
  23723. var os = cfg.getOS();
  23724. if (os == "Conch-ios") {
  23725. cfg.plat = MoyuPlat.ios;
  23726. }
  23727. else if (os == "Conch-android") {
  23728. }
  23729. }
  23730. }
  23731. return cfg;
  23732. }
  23733. class Main {
  23734. constructor() {
  23735. if (window["Laya3D"])
  23736. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  23737. else {
  23738. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  23739. this.initMain();
  23740. }
  23741. }
  23742. initMain() {
  23743. Laya["Physics"] && Laya["Physics"].enable();
  23744. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  23745. Laya.stage.scaleMode = GameConfig.scaleMode;
  23746. Laya.stage.screenMode = GameConfig.screenMode;
  23747. Laya.stage.alignV = GameConfig.alignV;
  23748. Laya.stage.alignH = GameConfig.alignH;
  23749. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  23750. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  23751. Laya.enableDebugPanel();
  23752. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  23753. Laya["PhysicsDebugDraw"].enable();
  23754. if (GameConfig.stat)
  23755. Laya.Stat.show();
  23756. Laya.alertGlobalError(true);
  23757. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  23758. }
  23759. onVersionLoaded() {
  23760. appInit();
  23761. }
  23762. }
  23763. new Main();
  23764. }());
  23765. //# sourceMappingURL=bundle.js.map